From 3379a5b72e366fbb74dc5fcef581e20a33108af1 Mon Sep 17 00:00:00 2001 From: zkldi <20380519+zkldi@users.noreply.github.com> Date: Mon, 14 Aug 2023 21:42:41 +0100 Subject: [PATCH] fix: why the HELL is our code able to compile **with errors??** --- .../app/pages/dashboard/utils/QuestEditor.tsx | 31 +++++++++++++++++-- client/src/components/gpt-utils/GPTUtils.tsx | 1 + client/src/context/UserContext.tsx | 1 - client/src/util/scales.ts | 1 + 4 files changed, 30 insertions(+), 4 deletions(-) diff --git a/client/src/app/pages/dashboard/utils/QuestEditor.tsx b/client/src/app/pages/dashboard/utils/QuestEditor.tsx index c070aabca..6b6f49623 100644 --- a/client/src/app/pages/dashboard/utils/QuestEditor.tsx +++ b/client/src/app/pages/dashboard/utils/QuestEditor.tsx @@ -8,7 +8,7 @@ import { TachiConfig } from "lib/config"; import { PrudenceSchema, p } from "prudence"; import React, { useEffect, useMemo, useState } from "react"; import { Alert, Button, Col, Form, Modal, Row } from "react-bootstrap"; -import { FormatPrError, GetGameConfig } from "tachi-common"; +import { FormatPrError, GetGameConfig, GetGamePTConfig, GetScoreMetrics } from "tachi-common"; import { PR_GOAL_SCHEMA } from "tachi-common/lib/schemas"; import { SetState } from "types/react"; import { RawQuestDocument } from "types/tachi"; @@ -38,8 +38,33 @@ const PR_LOCAL_QUESTS_SCHEMA: PrudenceSchema = { { goal: { name: "string", - charts: PR_GOAL_SCHEMA.charts, - criteria: PR_GOAL_SCHEMA.criteria, + charts: p.or( + { + type: p.is("folder"), + data: "string", + }, + { + type: p.is("multi"), + data: ["string"], + }, + { + type: p.is("single"), + data: "string", + } + ), + criteria: p.or( + { + mode: p.is("single"), + key: "string", // temp + value: "number", + }, + { + mode: p.isIn("absolute", "proportion"), + countNum: p.isPositive, + key: "string", // temp + value: "number", + } + ), }, note: p.optional("string"), }, diff --git a/client/src/components/gpt-utils/GPTUtils.tsx b/client/src/components/gpt-utils/GPTUtils.tsx index 5362a9352..38398dd17 100644 --- a/client/src/components/gpt-utils/GPTUtils.tsx +++ b/client/src/components/gpt-utils/GPTUtils.tsx @@ -26,6 +26,7 @@ const GPT_UTILS: Record> = { "usc:Keyboard": [], "wacca:Single": [], "maimaidx:Single": [], + "maimai:Single": [], }; export function GetGPTUtils(game: Game, playtype: Playtype) { diff --git a/client/src/context/UserContext.tsx b/client/src/context/UserContext.tsx index 2ed1be239..ff73cd1cd 100644 --- a/client/src/context/UserContext.tsx +++ b/client/src/context/UserContext.tsx @@ -1,4 +1,3 @@ -import { getUserActions } from "app/actions/user"; import React, { createContext, useState } from "react"; import { UserDocument } from "tachi-common"; import { JustChildren, SetState } from "types/react"; diff --git a/client/src/util/scales.ts b/client/src/util/scales.ts index 5a6e09929..92d7b618c 100644 --- a/client/src/util/scales.ts +++ b/client/src/util/scales.ts @@ -7,6 +7,7 @@ const scales: Record = { chunithm: 5, gitadora: 1, maimaidx: 1, + maimai: 1, museca: 5, sdvx: 5, usc: 5,