mirror of
https://github.com/zkldi/Tachi.git
synced 2026-10-11 08:48:15 +03:00
GPTCharts Update
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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 = [
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -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];
|
||||
}
|
||||
Reference in New Issue
Block a user