Skip to content

Commit

Permalink
feat: Display Flare Rank in DDR scores
Browse files Browse the repository at this point in the history
  • Loading branch information
Gyoo committed Aug 22, 2024
1 parent 6a13aa1 commit 5c47f18
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
13 changes: 13 additions & 0 deletions client/src/components/tables/cells/FlareCell.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React from "react";

export default function FlareCell({ value }: { value: string }) {
return (
<td
style={{
whiteSpace: "nowrap",
}}
>
<strong>{value}</strong>
</td>
);
}
3 changes: 3 additions & 0 deletions client/src/lib/games/ddr.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import RatingCell from "components/tables/cells/RatingCell";
import LampCell from "../../components/tables/cells/LampCell";
import DDRScoreCell from "../../components/tables/cells/DDRScoreCell";
import { bg, bgc } from "./_util";
import FlareCell from "../../components/tables/cells/FlareCell";

Check failure on line 11 in client/src/lib/games/ddr.tsx

View workflow job for this annotation

GitHub Actions / test

`../../components/tables/cells/FlareCell` import should occur before import of `./_util`

const DDR_ENUM_COLOURS: GPTClientImplementation<GPTStrings["ddr"]>["enumColours"] = {
grade: {
Expand Down Expand Up @@ -51,6 +52,7 @@ const DDR_DIFF_COLOURS: GPTClientImplementation<GPTStrings["ddr"]>["difficultyCo
const DDR_HEADERS: GPTClientImplementation<"ddr:SP" | "ddr:DP">["scoreHeaders"] = [
["Score", "Score", NumericSOV((x) => x.scoreData.score)],
["Lamp", "Lamp", NumericSOV((x) => x.scoreData.enumIndexes.lamp)],
["Flare", "Flare", NumericSOV((x) => x.scoreData.optional.enumIndexes.flare ?? 0)],
];

const DDR_COLOURS: GPTClientImplementation<"ddr:SP" | "ddr:DP">["classColours"] = {
Expand Down Expand Up @@ -110,6 +112,7 @@ const DDRCoreCells: GPTClientImplementation<GPTStrings["ddr"]>["scoreCoreCells"]
score={sc.scoreData.score}
/>
<LampCell lamp={sc.scoreData.lamp} colour={GetEnumColour(sc, "lamp")} />
<FlareCell value={sc.scoreData.optional.flare ?? "0"}></FlareCell>
</>
);

Expand Down
4 changes: 0 additions & 4 deletions server/src/game-implementations/games/ddr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ interface PBScoreDocumentWithSong extends PBScoreDocument<"ddr:DP" | "ddr:SP"> {
top?: number;
}

const FLARE_0_POINTS = [
145, 155, 170, 185, 205, 230, 255, 290, 335, 400, 465, 510, 545, 575, 600, 620, 635, 650, 665,
];

const DDR_GOAL_FMT: GPTGoalFormatters<"ddr:DP" | "ddr:SP"> = {
score: GoalFmtScore,
};
Expand Down

0 comments on commit 5c47f18

Please sign in to comment.