From bc4df58984e27687a3b64e86418e392435e4cb94 Mon Sep 17 00:00:00 2001
From: beerpsi <92439990+beer-psi@users.noreply.github.com>
Date: Wed, 16 Jul 2025 01:30:17 +0700
Subject: [PATCH] fix(client): shorten maimai DX difficulties, display percent
as 4dp (#1329)
* fix(client): shorten maimai DX difficulties, display percent as 4dp
* fix: default percentDp should be 2
---
client/src/components/tables/cells/DifficultyCell.tsx | 3 ++-
client/src/components/tables/cells/ScoreCell.tsx | 4 +++-
client/src/lib/game-implementations.tsx | 1 +
3 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/client/src/components/tables/cells/DifficultyCell.tsx b/client/src/components/tables/cells/DifficultyCell.tsx
index 384714688..80bd736d3 100644
--- a/client/src/components/tables/cells/DifficultyCell.tsx
+++ b/client/src/components/tables/cells/DifficultyCell.tsx
@@ -53,8 +53,9 @@ export default function DifficultyCell({
const gptImpl = GPT_CLIENT_IMPLEMENTATIONS[GetGPTString(game, chart.playtype)];
- if (game === "iidx") {
+ if (game === "iidx" || game === "maimaidx") {
// IIDX stuff should always be in the form SPA/SPL to save space.
+ // For the same reason, maimai DX stuff should be using (DX) EXP/MAS/Re:MAS.
// All players know what this means.
// eslint-disable-next-line no-param-reassign
alwaysShort = true;
diff --git a/client/src/components/tables/cells/ScoreCell.tsx b/client/src/components/tables/cells/ScoreCell.tsx
index 4930076df..926a62672 100644
--- a/client/src/components/tables/cells/ScoreCell.tsx
+++ b/client/src/components/tables/cells/ScoreCell.tsx
@@ -8,10 +8,12 @@ export default function ScoreCell({
colour,
grade,
percent,
+ percentDp = 2,
scoreRenderFn,
}: {
score?: integer;
percent: number;
+ percentDp?: integer;
grade: string;
colour: string;
showScore?: boolean;
@@ -25,7 +27,7 @@ export default function ScoreCell({
>
{grade}
- {`${ToFixedFloor(percent, 2)}%`}
+ {`${ToFixedFloor(percent, percentDp)}%`}
{score !== undefined && (
<>
diff --git a/client/src/lib/game-implementations.tsx b/client/src/lib/game-implementations.tsx
index 5e65d2bba..5f0514413 100644
--- a/client/src/lib/game-implementations.tsx
+++ b/client/src/lib/game-implementations.tsx
@@ -466,6 +466,7 @@ export const GPT_CLIENT_IMPLEMENTATIONS: GPTClientImplementations = {
colour={GetEnumColour(sc, "grade")}
grade={sc.scoreData.grade}
percent={sc.scoreData.percent}
+ percentDp={4}
/>