Fix bug where CHUNITHM tables were uselessly screwed.

This commit is contained in:
zkldi
2022-02-27 05:48:39 +00:00
parent a20ce65132
commit 1995d12050
5 changed files with 84 additions and 3 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "tachi-client",
"version": "2.1.3",
"version": "2.1.4",
"private": true,
"scripts": {
"start": "node scripts/start.js -o",
@@ -0,0 +1,45 @@
import React from "react";
import { COLOUR_SET, PBScoreDocument, ScoreDocument } from "tachi-common";
import { IsNullish } from "util/misc";
export default function CHUNITHMJudgementCell({
score,
}: {
score: ScoreDocument<"chunithm:Single"> | PBScoreDocument<"chunithm:Single">;
}) {
// even if we dont have judgement data, we know what they got.
if (score.scoreData.lamp === "ALL JUSTICE CRITICAL") {
return (
<td>
<strong>
<span style={{ color: COLOUR_SET.gold }}>0</span>-
<span style={{ color: COLOUR_SET.orange }}>0</span>-
<span style={{ color: COLOUR_SET.green }}>0</span>-
<span style={{ color: COLOUR_SET.gray }}>0</span>
</strong>
</td>
);
}
const judgements = score.scoreData.judgements;
if (
IsNullish(judgements.miss) ||
IsNullish(judgements.attack) ||
IsNullish(judgements.justice) ||
IsNullish(judgements.jcrit)
) {
return <td>No Data.</td>;
}
return (
<td>
<strong>
<span style={{ color: COLOUR_SET.gold }}>{judgements.jcrit}</span>-
<span style={{ color: COLOUR_SET.orange }}>{judgements.justice}</span>-
<span style={{ color: COLOUR_SET.green }}>{judgements.attack}</span>-
<span style={{ color: COLOUR_SET.gray }}>{judgements.miss}</span>
</strong>
</td>
);
}
@@ -0,0 +1,35 @@
import React from "react";
import { GetGamePTConfig, PBScoreDocument, ScoreDocument } from "tachi-common";
import { ChangeOpacity } from "util/color-opacity";
import { FormatMillions } from "util/misc";
import CHUNITHMJudgementCell from "../cells/CHUNITHMJudgementCell";
import JubeatJudgementCell from "../cells/JubeatJudgementCell";
import LampCell from "../cells/LampCell";
import RatingCell from "../cells/RatingCell";
export default function CHUNITHMCoreCells({
sc,
rating,
}: {
sc: ScoreDocument<"chunithm:Single"> | PBScoreDocument<"chunithm:Single">;
rating: keyof ScoreDocument["calculatedData"];
}) {
const gptConfig = GetGamePTConfig(sc.game, sc.playtype);
return (
<>
<td
style={{
backgroundColor: ChangeOpacity(gptConfig.gradeColours[sc.scoreData.grade], 0.2),
}}
>
<strong>{sc.scoreData.grade}</strong>
<br />
{FormatMillions(sc.scoreData.score)}
</td>
<CHUNITHMJudgementCell score={sc} />
<LampCell score={sc} />
<RatingCell score={sc} rating={rating} />
</>
);
}
@@ -8,6 +8,7 @@ import {
ScoreDocument,
} from "tachi-common";
import BMSCoreCells from "./BMSCoreCells";
import CHUNITHMCoreCells from "./CHUNITHMCoreCells";
import GenericCoreCells from "./GenericCoreCells";
import IIDXCoreCells from "./IIDXCoreCells";
import JubeatCoreCells from "./JubeatCoreCells";
@@ -58,7 +59,7 @@ export default function ScoreCoreCells({
} else if (game === "jubeat") {
return <JubeatCoreCells sc={sc} rating={rating} />;
} else if (game === "chunithm") {
return <GenericCoreCells sc={sc} rating={rating} />;
return <CHUNITHMCoreCells sc={sc} rating={rating} />;
} else if (game === "ddr") {
return <GenericCoreCells sc={sc} rating={rating} />;
} else if (game === "gitadora") {
+1 -1
View File
@@ -1,6 +1,6 @@
const MAJOR = 2;
const MINOR = 1;
const PATCH = 3;
const PATCH = 4;
// As is with all front-facing zkldi projects, the version names for tachi-client
// are from an album I like. In this case, the album is The Cure - Disintegration.