From 5bed3355d1014fcf874a34695d113275cbebe9d2 Mon Sep 17 00:00:00 2001 From: xXJsonDeruloXx Date: Sat, 21 Mar 2026 08:27:00 -0400 Subject: Parse full OptiScaler config schema --- src/api/index.ts | 2 +- src/types/index.ts | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/api/index.ts b/src/api/index.ts index 2e275d2..ea0d28c 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -18,7 +18,7 @@ export const getGameConfig = callable<[string], GameConfigResponse>("get_game_co export const saveGameConfig = callable< [string, Record, string | null, boolean, string | null], - ApiResponse + GameConfigResponse >("save_game_config"); export const logError = callable<[string], void>("log_error"); diff --git a/src/types/index.ts b/src/types/index.ts index 73e7947..e9424c1 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -21,11 +21,40 @@ export interface GameConfigPaths { live_ini: string; } +export interface GameConfigOption { + value: string; + label: string; +} + +export interface GameConfigSettingSchema { + id: string; + section: string; + key: string; + label: string; + description: string; + default: string; + control: "dropdown" | "range" | "number" | "text"; + options: GameConfigOption[]; + rangeMin?: number | null; + rangeMax?: number | null; + step?: number; + numericType?: "int" | "float"; + isPath?: boolean; + isKeycode?: boolean; +} + +export interface GameConfigSectionSchema { + id: string; + label: string; + settings: GameConfigSettingSchema[]; +} + export interface GameConfigResponse extends ApiResponse { appid?: string; name?: string; proxy?: string; settings?: Record; + schema?: GameConfigSectionSchema[]; raw_ini?: string; managed_exists?: boolean; live_available?: boolean; -- cgit v1.2.3