From 1995d12050d407d4cd3e069358d48aa2e933eaf5 Mon Sep 17 00:00:00 2001
From: zkldi <20380519+zkldi@users.noreply.github.com>
Date: Sun, 27 Feb 2022 05:48:39 +0000
Subject: [PATCH 1/2] Fix bug where CHUNITHM tables were uselessly screwed.
---
client/package.json | 2 +-
.../tables/cells/CHUNITHMJudgementCell.tsx | 45 +++++++++++++++++++
.../game-core-cells/CHUNITHMCoreCells.tsx | 35 +++++++++++++++
.../tables/game-core-cells/ScoreCoreCells.tsx | 3 +-
client/src/util/constants/version.ts | 2 +-
5 files changed, 84 insertions(+), 3 deletions(-)
create mode 100644 client/src/components/tables/cells/CHUNITHMJudgementCell.tsx
create mode 100644 client/src/components/tables/game-core-cells/CHUNITHMCoreCells.tsx
diff --git a/client/package.json b/client/package.json
index 29cdbfd93..36be8bab9 100644
--- a/client/package.json
+++ b/client/package.json
@@ -1,6 +1,6 @@
{
"name": "tachi-client",
- "version": "2.1.3",
+ "version": "2.1.4",
"private": true,
"scripts": {
"start": "node scripts/start.js -o",
diff --git a/client/src/components/tables/cells/CHUNITHMJudgementCell.tsx b/client/src/components/tables/cells/CHUNITHMJudgementCell.tsx
new file mode 100644
index 000000000..aa5e6cce7
--- /dev/null
+++ b/client/src/components/tables/cells/CHUNITHMJudgementCell.tsx
@@ -0,0 +1,45 @@
+import React from "react";
+import { COLOUR_SET, PBScoreDocument, ScoreDocument } from "tachi-common";
+import { IsNullish } from "util/misc";
+
+export default function CHUNITHMJudgementCell({
+ score,
+}: {
+ score: ScoreDocument<"chunithm:Single"> | PBScoreDocument<"chunithm:Single">;
+}) {
+ // even if we dont have judgement data, we know what they got.
+ if (score.scoreData.lamp === "ALL JUSTICE CRITICAL") {
+ return (
+
+
+ 0-
+ 0-
+ 0-
+ 0
+
+ |
+ );
+ }
+
+ const judgements = score.scoreData.judgements;
+
+ if (
+ IsNullish(judgements.miss) ||
+ IsNullish(judgements.attack) ||
+ IsNullish(judgements.justice) ||
+ IsNullish(judgements.jcrit)
+ ) {
+ return No Data. | ;
+ }
+
+ return (
+
+
+ {judgements.jcrit}-
+ {judgements.justice}-
+ {judgements.attack}-
+ {judgements.miss}
+
+ |
+ );
+}
diff --git a/client/src/components/tables/game-core-cells/CHUNITHMCoreCells.tsx b/client/src/components/tables/game-core-cells/CHUNITHMCoreCells.tsx
new file mode 100644
index 000000000..0a38cfa56
--- /dev/null
+++ b/client/src/components/tables/game-core-cells/CHUNITHMCoreCells.tsx
@@ -0,0 +1,35 @@
+import React from "react";
+import { GetGamePTConfig, PBScoreDocument, ScoreDocument } from "tachi-common";
+import { ChangeOpacity } from "util/color-opacity";
+import { FormatMillions } from "util/misc";
+import CHUNITHMJudgementCell from "../cells/CHUNITHMJudgementCell";
+import JubeatJudgementCell from "../cells/JubeatJudgementCell";
+import LampCell from "../cells/LampCell";
+import RatingCell from "../cells/RatingCell";
+
+export default function CHUNITHMCoreCells({
+ sc,
+ rating,
+}: {
+ sc: ScoreDocument<"chunithm:Single"> | PBScoreDocument<"chunithm:Single">;
+ rating: keyof ScoreDocument["calculatedData"];
+}) {
+ const gptConfig = GetGamePTConfig(sc.game, sc.playtype);
+
+ return (
+ <>
+
+ {sc.scoreData.grade}
+
+ {FormatMillions(sc.scoreData.score)}
+ |
+
+
+
+ >
+ );
+}
diff --git a/client/src/components/tables/game-core-cells/ScoreCoreCells.tsx b/client/src/components/tables/game-core-cells/ScoreCoreCells.tsx
index 5dd37698b..8cad9ee8c 100644
--- a/client/src/components/tables/game-core-cells/ScoreCoreCells.tsx
+++ b/client/src/components/tables/game-core-cells/ScoreCoreCells.tsx
@@ -8,6 +8,7 @@ import {
ScoreDocument,
} from "tachi-common";
import BMSCoreCells from "./BMSCoreCells";
+import CHUNITHMCoreCells from "./CHUNITHMCoreCells";
import GenericCoreCells from "./GenericCoreCells";
import IIDXCoreCells from "./IIDXCoreCells";
import JubeatCoreCells from "./JubeatCoreCells";
@@ -58,7 +59,7 @@ export default function ScoreCoreCells({
} else if (game === "jubeat") {
return ;
} else if (game === "chunithm") {
- return ;
+ return ;
} else if (game === "ddr") {
return ;
} else if (game === "gitadora") {
diff --git a/client/src/util/constants/version.ts b/client/src/util/constants/version.ts
index 39a86d13a..979fcec74 100644
--- a/client/src/util/constants/version.ts
+++ b/client/src/util/constants/version.ts
@@ -1,6 +1,6 @@
const MAJOR = 2;
const MINOR = 1;
-const PATCH = 3;
+const PATCH = 4;
// As is with all front-facing zkldi projects, the version names for tachi-client
// are from an album I like. In this case, the album is The Cure - Disintegration.
From 355bd1dcfe76719f02cf2fc56d26e84397e2398c Mon Sep 17 00:00:00 2001
From: zkldi <20380519+zkldi@users.noreply.github.com>
Date: Sun, 27 Feb 2022 05:51:10 +0000
Subject: [PATCH 2/2] boring hail mary
---
.../tables/game-core-cells/CHUNITHMCoreCells.tsx | 1 -
client/src/components/tables/headers/GameHeaders.tsx | 7 +++++--
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/client/src/components/tables/game-core-cells/CHUNITHMCoreCells.tsx b/client/src/components/tables/game-core-cells/CHUNITHMCoreCells.tsx
index 0a38cfa56..3ef2139c8 100644
--- a/client/src/components/tables/game-core-cells/CHUNITHMCoreCells.tsx
+++ b/client/src/components/tables/game-core-cells/CHUNITHMCoreCells.tsx
@@ -3,7 +3,6 @@ import { GetGamePTConfig, PBScoreDocument, ScoreDocument } from "tachi-common";
import { ChangeOpacity } from "util/color-opacity";
import { FormatMillions } from "util/misc";
import CHUNITHMJudgementCell from "../cells/CHUNITHMJudgementCell";
-import JubeatJudgementCell from "../cells/JubeatJudgementCell";
import LampCell from "../cells/LampCell";
import RatingCell from "../cells/RatingCell";
diff --git a/client/src/components/tables/headers/GameHeaders.tsx b/client/src/components/tables/headers/GameHeaders.tsx
index d751c8619..0a94c8518 100644
--- a/client/src/components/tables/headers/GameHeaders.tsx
+++ b/client/src/components/tables/headers/GameHeaders.tsx
@@ -1,4 +1,3 @@
-import { nanoid } from "nanoid";
import React from "react";
import {
Game,
@@ -127,10 +126,14 @@ export function GetGPTCoreHeaders
| PBScoreDocument<"popn:9B">;
- if (!aSc || !bSc) {
+ if (!aSc && bSc) {
return -Infinity;
}
+ if (aSc && !bSc) {
+ return Infinity;
+ }
+
if (aSc.scoreData.lampIndex === bSc.scoreData.lampIndex) {
if (
!aSc.scoreData.hitMeta.specificClearType ||