Skip to content

Commit

Permalink
feat: Display Flare Rank in DDR scores (#1159)
Browse files Browse the repository at this point in the history
* feat: Display Flare Rank in DDR scores

* chore: lint fix in client

* fix: change position of Flare in score columns
  • Loading branch information
Gyoo authored Aug 22, 2024
1 parent 9fd1ba1 commit 7cae91b
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 @@ -7,6 +7,7 @@ import React from "react";
import RatingCell from "components/tables/cells/RatingCell";
import LampCell from "../../components/tables/cells/LampCell";
import DDRScoreCell from "../../components/tables/cells/DDRScoreCell";
import FlareCell from "../../components/tables/cells/FlareCell";
import { bg, bgc } from "./_util";

const DDR_ENUM_COLOURS: GPTClientImplementation<GPTStrings["ddr"]>["enumColours"] = {
Expand Down Expand Up @@ -50,6 +51,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)],
["Flare", "Flare", NumericSOV((x) => x.scoreData.optional.enumIndexes.flare ?? 0)],
["Lamp", "Lamp", NumericSOV((x) => x.scoreData.enumIndexes.lamp)],
];

Expand Down Expand Up @@ -109,6 +111,7 @@ const DDRCoreCells: GPTClientImplementation<GPTStrings["ddr"]>["scoreCoreCells"]
grade={sc.scoreData.grade}
score={sc.scoreData.score}
/>
<FlareCell value={sc.scoreData.optional.flare ?? "0"}></FlareCell>
<LampCell lamp={sc.scoreData.lamp} colour={GetEnumColour(sc, "lamp")} />
</>
);
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 7cae91b

Please sign in to comment.