GPTCharts Update

This commit is contained in:
zkldi
2021-09-22 12:25:16 +01:00
parent f35b99649c
commit 8b3820f08c
33 changed files with 887 additions and 144 deletions
+2 -2
View File
@@ -48,9 +48,9 @@ export async function APIFetchV1<T = unknown>(
const rj = await res.json();
if (!rj.success) {
console.error(rj);
console.warn(rj);
} else {
console.log(rj.description);
console.debug(rj.description);
}
if (!rj.success && displayFailure) {
-2
View File
@@ -1,5 +1,3 @@
import { IDStrings } from "tachi-common";
export const neutralSplashes = ["A Rhythm Game Score Manager", "The Rhythm Game Score Manager"];
export const loggedInSplashes = [
+1
View File
@@ -47,6 +47,7 @@ export function CreateDefaultPBSearchParams<I extends IDStrings = IDStrings>(
percent: x => x.scoreData.percent,
ranking: x => x.rankingData.rank,
highlight: x => !!x.highlight,
username: x => x.__related.user?.username ?? null,
lamp: {
valueGetter: x => [x.scoreData.lamp, x.scoreData.lampIndex],
strToNum: HumanFriendlyStrToLampIndex(game, playtype),
+24
View File
@@ -0,0 +1,24 @@
import { Header } from "components/tables/components/TachiTable";
import IndicatorHeader from "components/tables/headers/IndicatorHeader";
import { PBDataset } from "types/tables";
import { StrSOV } from "util/sorts";
type PBHeader = Header<PBDataset[0]>;
export function GetPBLeadingHeaders(
showUser: boolean,
showChart: boolean,
chartHeader: PBHeader
): PBHeader[] {
const userHeader: PBHeader = ["User", "User", StrSOV(x => x.__related.user!.username)];
const songHeader: PBHeader = ["Song", "Song", StrSOV(x => x.__related.song.title)];
if (showUser && showChart) {
return [userHeader, chartHeader, IndicatorHeader, songHeader];
}
if (showUser && !showChart) {
return [IndicatorHeader, userHeader];
}
return [chartHeader, IndicatorHeader, songHeader];
}