feat: last mmdx touches

This commit is contained in:
zkldi
2022-12-26 16:07:01 +00:00
parent fecb3440a9
commit f287c8d281
12 changed files with 56120 additions and 55738 deletions
@@ -58,7 +58,8 @@ export default function GPTChartPage({
setActiveChart: SetState<ChartDocument | null>;
allCharts: ChartDocument[];
} & GamePT) {
const { difficulty } = useParams<{ difficulty: string }>();
const { difficulty: d } = useParams<{ difficulty: string }>();
const difficulty = decodeURIComponent(d);
const gptConfig = GetGamePTConfig(game, playtype);
@@ -25,6 +25,7 @@ const GPT_UTILS: Record<IDStrings, Array<GPTUtility>> = {
"usc:Controller": [],
"usc:Keyboard": [],
"wacca:Single": [],
"maimaidx:Single": [],
};
export function GetGPTUtils(game: Game, playtype: Playtype) {
@@ -0,0 +1,35 @@
import { IsNullish } from "util/misc";
import React from "react";
import { COLOUR_SET, PBScoreDocument, ScoreDocument } from "tachi-common";
export default function GitadoraJudgementCell({
score,
}: {
score:
| ScoreDocument<"gitadora:Dora" | "gitadora:Gita">
| PBScoreDocument<"gitadora:Dora" | "gitadora:Gita">;
}) {
const judgements = score.scoreData.judgements;
if (
IsNullish(judgements.perfect) ||
IsNullish(judgements.great) ||
IsNullish(judgements.good) ||
IsNullish(judgements.ok) ||
IsNullish(judgements.miss)
) {
return <td>No Data.</td>;
}
return (
<td>
<strong>
<span style={{ color: COLOUR_SET.gold }}>{judgements.perfect}</span>-
<span style={{ color: COLOUR_SET.green }}>{judgements.great}</span>-
<span style={{ color: COLOUR_SET.blue }}>{judgements.good}</span>-
<span style={{ color: COLOUR_SET.purple }}>{judgements.ok}</span>-
<span style={{ color: COLOUR_SET.red }}>{judgements.miss}</span>
</strong>
</td>
);
}
@@ -1,23 +0,0 @@
import React from "react";
import { IDStrings, ScoreCalculatedDataLookup, ScoreDocument } from "tachi-common";
import LampCell from "../cells/LampCell";
import RatingCell from "../cells/RatingCell";
import ScoreCell from "../cells/ScoreCell";
export default function GenericCoreCells({
sc,
showScore,
rating,
}: {
sc: ScoreDocument;
showScore?: boolean;
rating: ScoreCalculatedDataLookup[IDStrings];
}) {
return (
<>
<ScoreCell score={sc} showScore={showScore} />
<LampCell score={sc} />
<RatingCell score={sc} rating={rating} />
</>
);
}
@@ -0,0 +1,23 @@
import React from "react";
import { PBScoreDocument, ScoreDocument } from "tachi-common";
import LampCell from "../cells/LampCell";
import RatingCell from "../cells/RatingCell";
import ScoreCell from "../cells/ScoreCell";
import MaimaiDXJudgementCell from "../cells/MaimaiDXJudgementCell";
export default function MaimaiDXCoreCells({
sc,
rating,
}: {
sc: ScoreDocument<"maimaidx:Single"> | PBScoreDocument<"maimaidx:Single">;
rating: keyof ScoreDocument["calculatedData"];
}) {
return (
<>
<ScoreCell showScore={false} score={sc} />
<MaimaiDXJudgementCell score={sc} />
<LampCell score={sc} />
<RatingCell score={sc} rating={rating} />
</>
);
}
@@ -9,7 +9,6 @@ import {
} from "tachi-common";
import BMSCoreCells from "./BMSCoreCells";
import CHUNITHMCoreCells from "./CHUNITHMCoreCells";
import GenericCoreCells from "./GenericCoreCells";
import IIDXCoreCells from "./IIDXCoreCells";
import ITGCoreCells from "./ITGCoreCells";
import JubeatCoreCells from "./JubeatCoreCells";
@@ -19,6 +18,7 @@ import PopnCoreCells from "./PopnCoreCells";
import SDVXScoreCoreCells from "./SDVXCoreCells";
import WACCACoreCells from "./WACCACoreCells";
import GitadoraCoreCells from "./GitadoraCoreCells";
import MaimaiDXCoreCells from "./MaimaiDXCoreCells";
export default function ScoreCoreCells({
game,
@@ -30,7 +30,7 @@ export default function ScoreCoreCells({
chart: ChartDocument;
rating: ScoreCalculatedDataLookup[IDStrings];
game: Game;
}) {
}): React.ReactChild {
const sc = score as any; // lazy hack
switch (game) {
@@ -70,5 +70,7 @@ export default function ScoreCoreCells({
return <PMSCoreCells sc={sc} rating={rating} />;
case "itg":
return <ITGCoreCells sc={sc} rating={rating} />;
case "maimaidx":
return <MaimaiDXCoreCells sc={sc} rating={rating} />;
}
}