From 5c47f18730b7b8174b95350a07ab906b1a85f546 Mon Sep 17 00:00:00 2001 From: Gyoo Date: Thu, 22 Aug 2024 12:39:51 +0000 Subject: [PATCH 1/3] feat: Display Flare Rank in DDR scores --- client/src/components/tables/cells/FlareCell.tsx | 13 +++++++++++++ client/src/lib/games/ddr.tsx | 3 +++ server/src/game-implementations/games/ddr.ts | 4 ---- 3 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 client/src/components/tables/cells/FlareCell.tsx diff --git a/client/src/components/tables/cells/FlareCell.tsx b/client/src/components/tables/cells/FlareCell.tsx new file mode 100644 index 000000000..81e19ca1b --- /dev/null +++ b/client/src/components/tables/cells/FlareCell.tsx @@ -0,0 +1,13 @@ +import React from "react"; + +export default function FlareCell({ value }: { value: string }) { + return ( + + {value} + + ); +} diff --git a/client/src/lib/games/ddr.tsx b/client/src/lib/games/ddr.tsx index a336bc93f..040bd25a0 100644 --- a/client/src/lib/games/ddr.tsx +++ b/client/src/lib/games/ddr.tsx @@ -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"; const DDR_ENUM_COLOURS: GPTClientImplementation["enumColours"] = { grade: { @@ -51,6 +52,7 @@ const DDR_DIFF_COLOURS: GPTClientImplementation["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"] = { @@ -110,6 +112,7 @@ const DDRCoreCells: GPTClientImplementation["scoreCoreCells"] score={sc.scoreData.score} /> + ); diff --git a/server/src/game-implementations/games/ddr.ts b/server/src/game-implementations/games/ddr.ts index 9a5b7382e..96b0e3634 100644 --- a/server/src/game-implementations/games/ddr.ts +++ b/server/src/game-implementations/games/ddr.ts @@ -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, }; From d77036d400db317a53ecefff574661924e292f14 Mon Sep 17 00:00:00 2001 From: Gyoo Date: Thu, 22 Aug 2024 12:45:38 +0000 Subject: [PATCH 2/3] chore: lint fix in client --- client/src/lib/games/ddr.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/lib/games/ddr.tsx b/client/src/lib/games/ddr.tsx index 040bd25a0..7130365ed 100644 --- a/client/src/lib/games/ddr.tsx +++ b/client/src/lib/games/ddr.tsx @@ -7,8 +7,8 @@ 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 { bg, bgc } from "./_util"; import FlareCell from "../../components/tables/cells/FlareCell"; +import { bg, bgc } from "./_util"; const DDR_ENUM_COLOURS: GPTClientImplementation["enumColours"] = { grade: { From 3c7af2f2c831ab5ccdd145cb8e95ebc9735c3178 Mon Sep 17 00:00:00 2001 From: Gyoo Date: Thu, 22 Aug 2024 21:47:55 +0200 Subject: [PATCH 3/3] fix: change position of Flare in score columns --- client/src/lib/games/ddr.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/lib/games/ddr.tsx b/client/src/lib/games/ddr.tsx index 7130365ed..2cb1930be 100644 --- a/client/src/lib/games/ddr.tsx +++ b/client/src/lib/games/ddr.tsx @@ -51,8 +51,8 @@ const DDR_DIFF_COLOURS: GPTClientImplementation["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)], + ["Lamp", "Lamp", NumericSOV((x) => x.scoreData.enumIndexes.lamp)], ]; const DDR_COLOURS: GPTClientImplementation<"ddr:SP" | "ddr:DP">["classColours"] = { @@ -111,8 +111,8 @@ const DDRCoreCells: GPTClientImplementation["scoreCoreCells"] grade={sc.scoreData.grade} score={sc.scoreData.score} /> - + );