Slight improvements to wacca and pop'ns UIs

This commit is contained in:
zkldi
2022-02-09 02:56:01 +00:00
parent 731b902a52
commit a366095e6f
7 changed files with 135 additions and 1 deletions
@@ -2,7 +2,7 @@ import React from "react";
import { COLOUR_SET, PBScoreDocument, ScoreDocument } from "tachi-common";
import { IsNullish } from "util/misc";
export default function SDVXJudgementCell({
export default function MusecaJudgementCell({
score,
}: {
score: ScoreDocument<"museca:Single"> | PBScoreDocument<"museca:Single">;
@@ -0,0 +1,25 @@
import React from "react";
import { COLOUR_SET, PBScoreDocument, ScoreDocument } from "tachi-common";
import { IsNullish } from "util/misc";
export default function PopnJudgementCell({
score,
}: {
score: ScoreDocument<"popn:9B"> | PBScoreDocument<"popn:9B">;
}) {
const judgements = score.scoreData.judgements;
if (IsNullish(judgements.bad) || IsNullish(judgements.great) || IsNullish(judgements.good)) {
return <td>No Data.</td>;
}
return (
<td>
<strong>
<span style={{ color: COLOUR_SET.vibrantYellow }}>{judgements.great}</span>-
<span style={{ color: COLOUR_SET.red }}>{judgements.good}</span>
<span style={{ color: COLOUR_SET.blue }}>{judgements.bad}</span>
</strong>
</td>
);
}
@@ -1,4 +1,5 @@
import GentleLink from "components/util/GentleLink";
import Muted from "components/util/Muted";
import React from "react";
import { ChartDocument, Game, SongDocument } from "tachi-common";
import { CreateChartLink } from "util/data";
@@ -18,6 +19,16 @@ export default function TitleCell({
}) {
return (
<td style={{ textAlign: "left", minWidth: "140px", maxWidth: "300px" }}>
{game === "popn" && (
<>
{(song as SongDocument<"popn">).data.genre === song.title ? (
<Muted>Unknown Genre</Muted>
) : (
(song as SongDocument<"popn">).data.genre
)}
<br />
</>
)}
<GentleLink to={CreateChartLink(chart, game)}>
{song.title}
{!noArtist && (
@@ -0,0 +1,43 @@
import React from "react";
import { COLOUR_SET, PBScoreDocument, ScoreDocument } from "tachi-common";
import { IsNullish } from "util/misc";
export default function WaccaJudgementCell({
score,
}: {
score: ScoreDocument<"wacca:Single"> | PBScoreDocument<"wacca:Single">;
}) {
// even if we dont have judgement data, we know what they got.
if (score.scoreData.lamp === "ALL MARVELOUS") {
return (
<td>
<strong>
<span style={{ color: COLOUR_SET.vibrantYellow }}>0</span>-
<span style={{ color: COLOUR_SET.blue }}>0</span>-
<span style={{ color: COLOUR_SET.red }}>0</span>
</strong>
</td>
);
}
// safety
if (score.scoreData.lamp === "FULL COMBO") {
score.scoreData.judgements.miss = 0;
}
const judgements = score.scoreData.judgements;
if (IsNullish(judgements.miss) || IsNullish(judgements.great) || IsNullish(judgements.good)) {
return <td>No Data.</td>;
}
return (
<td>
<strong>
<span style={{ color: COLOUR_SET.vibrantYellow }}>{judgements.great}</span>-
<span style={{ color: COLOUR_SET.blue }}>{judgements.good}</span>
<span style={{ color: COLOUR_SET.red }}>{judgements.miss}</span>
</strong>
</td>
);
}
@@ -0,0 +1,26 @@
import React from "react";
import { PBScoreDocument, ScoreDocument } from "tachi-common";
import { IsNullish } from "util/misc";
import LampCell from "../cells/LampCell";
import MillionsScoreCell from "../cells/MillionsScoreCell";
import PopnJudgementCell from "../cells/PopnJudgementCell";
import WaccaJudgementCell from "../cells/WACCAJudgementCell";
export default function PopnCoreCells({
sc,
}: {
sc: ScoreDocument<"popn:9B"> | PBScoreDocument<"popn:9B">;
}) {
return (
<div>
<MillionsScoreCell score={sc} />
<PopnJudgementCell score={sc} />
<LampCell score={sc} />
<td>
{!IsNullish(sc.calculatedData.classPoints)
? sc.calculatedData.classPoints!.toFixed(3)
: "N/A"}
</td>
</div>
);
}
@@ -10,7 +10,9 @@ import BMSScoreCoreCells from "./BMSScoreCoreCells";
import GenericScoreCoreCells from "./GenericScoreCoreCells";
import IIDXScoreCoreCells from "./IIDXScoreCoreCells";
import MusecaScoreCoreCells from "./MusecaScoreCoreCells";
import PopnCoreCells from "./PopnCoreCells";
import SDVXScoreCoreCells from "./SDVXCoreCells";
import WACCACoreCells from "./WACCACoreCells";
export default function ScoreCoreCells({
game,
@@ -38,6 +40,10 @@ export default function ScoreCoreCells({
return <GenericScoreCoreCells showScore={false} sc={sc} />;
} else if (game === "museca") {
return <MusecaScoreCoreCells sc={sc} />;
} else if (game === "wacca") {
return <WACCACoreCells sc={sc} />;
} else if (game === "popn") {
return <PopnCoreCells sc={sc} />;
}
return <GenericScoreCoreCells sc={sc} />;
@@ -0,0 +1,23 @@
import React from "react";
import { PBScoreDocument, ScoreDocument } from "tachi-common";
import { IsNullish } from "util/misc";
import LampCell from "../cells/LampCell";
import MillionsScoreCell from "../cells/MillionsScoreCell";
import WaccaJudgementCell from "../cells/WACCAJudgementCell";
export default function WACCACoreCells({
sc,
}: {
sc: ScoreDocument<"wacca:Single"> | PBScoreDocument<"wacca:Single">;
}) {
return (
<div>
<MillionsScoreCell score={sc} />
<WaccaJudgementCell score={sc} />
<LampCell score={sc} />
<td>
{!IsNullish(sc.calculatedData.rate) ? sc.calculatedData.rate!.toFixed(3) : "N/A"}
</td>
</div>
);
}