feat: gitadora frontend

This commit is contained in:
zkldi
2022-12-20 14:36:27 +00:00
parent 4d1714e2c2
commit e63cab2159
22 changed files with 187 additions and 94 deletions
+10 -1
View File
@@ -4,7 +4,7 @@ import type { Grades, integer, PBScoreDocument } from "../types";
import type { PrudenceError } from "prudence";
export function FormatInt(v: number): string {
return v.toString();
return Math.floor(v).toFixed(0);
}
export function FormatDifficulty(chart: ChartDocument, game: Game): string {
@@ -22,6 +22,15 @@ export function FormatDifficulty(chart: ChartDocument, game: Game): string {
return `${itgChart.data.difficultyTag} ${itgChart.level}`;
}
if (game === "gitadora") {
const gptConfig = GetGamePTConfig(game, chart.playtype);
const shortDiff = gptConfig.shortDifficulties[chart.difficulty] ?? chart.difficulty;
// gitadora should always use short diffs. they just look better.
return `${shortDiff} ${chart.level}`;
}
const gameConfig = GetGameConfig(game);
if (gameConfig.validPlaytypes.length > 1) {