mirror of
https://github.com/zkldi/Tachi.git
synced 2026-10-06 22:07:58 +03:00
fix: allow midi for bms7k and bms14k
This commit is contained in:
@@ -338,7 +338,7 @@ export const BMS_7K_CONF = {
|
||||
|
||||
scoreMeta: z.strictObject({
|
||||
random: RANDOM_SCHEMA.optional().nullable(),
|
||||
inputDevice: z.enum(["BM_CONTROLLER", "KEYBOARD"]).optional().nullable(),
|
||||
inputDevice: z.enum(["BM_CONTROLLER", "KEYBOARD", "MIDI"]).optional().nullable(),
|
||||
client: z.enum(["lr2oraja", "LR2"]).optional().nullable(),
|
||||
gauge: z.enum(["EASY", "NORMAL", "HARD", "EX-HARD"]).optional().nullable(),
|
||||
}),
|
||||
@@ -356,7 +356,7 @@ export const BMS_14K_CONF = {
|
||||
|
||||
scoreMeta: z.strictObject({
|
||||
random: z.tuple([RANDOM_SCHEMA, RANDOM_SCHEMA]).optional().nullable(),
|
||||
inputDevice: z.enum(["BM_CONTROLLER", "KEYBOARD"]).optional().nullable(),
|
||||
inputDevice: z.enum(["BM_CONTROLLER", "KEYBOARD", "MIDI"]).optional().nullable(),
|
||||
client: z.enum(["lr2oraja", "LR2"]).optional().nullable(),
|
||||
gauge: z.enum(["EASY", "NORMAL", "HARD", "EX-HARD"]).optional().nullable(),
|
||||
}),
|
||||
|
||||
@@ -15,7 +15,7 @@ import type { DryScore } from "../../../framework/common/types";
|
||||
import type { ConverterFunction } from "../../common/types";
|
||||
import type { BeatorajaChart, BeatorajaContext, BeatorajaScore } from "./types";
|
||||
import type { KtLogger } from "lib/logger/logger";
|
||||
import type { ChartDocument, SongDocument, Playtypes } from "tachi-common";
|
||||
import type { ChartDocument, SongDocument, Playtypes, Playtype } from "tachi-common";
|
||||
import type { Mutable } from "utils/types";
|
||||
|
||||
const LAMP_LOOKUP = {
|
||||
@@ -164,8 +164,16 @@ export const ConverterIRBeatoraja: ConverterFunction<BeatorajaScore, BeatorajaCo
|
||||
"bms:7K" | "bms:14K"
|
||||
> | null;
|
||||
} else {
|
||||
let playtype: Playtypes["pms"];
|
||||
|
||||
// It's still called BM_CONTROLLER even though its popn!
|
||||
const playtype = data.deviceType === "BM_CONTROLLER" ? "Controller" : "Keyboard";
|
||||
if (data.deviceType === "BM_CONTROLLER") {
|
||||
playtype = "Controller";
|
||||
} else if (data.deviceType === "KEYBOARD") {
|
||||
playtype = "Keyboard";
|
||||
} else {
|
||||
throw new InvalidScoreFailure("MIDI is not allowed for PMS scores.");
|
||||
}
|
||||
|
||||
chart = (await FindChartOnSHA256Playtype(game, data.sha256, playtype)) as ChartDocument<
|
||||
"pms:Controller" | "pms:Keyboard"
|
||||
|
||||
@@ -13,7 +13,7 @@ const PR_BEATORAJA_SCORE = {
|
||||
exscore: p.isPositiveInteger,
|
||||
passnotes: p.isPositiveInteger,
|
||||
gauge: p.or(p.isBetween(0, 100), p.is(-1)),
|
||||
deviceType: p.isIn("BM_CONTROLLER", "KEYBOARD"),
|
||||
deviceType: p.isIn("BM_CONTROLLER", "KEYBOARD", "MIDI"),
|
||||
minbp: p.or(p.isPositiveInteger, p.is(-1)),
|
||||
option: p.isInteger,
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ export interface BeatorajaScore {
|
||||
exscore: integer;
|
||||
passnotes: integer;
|
||||
gauge: number;
|
||||
deviceType: "BM_CONTROLLER" | "KEYBOARD";
|
||||
deviceType: "BM_CONTROLLER" | "KEYBOARD" | "MIDI";
|
||||
minbp: integer;
|
||||
option: integer;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user