summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/api/lsfgApi.ts11
-rw-r--r--src/components/ConfigurationSection.tsx26
-rw-r--r--src/config/configSchema.ts23
3 files changed, 25 insertions, 35 deletions
diff --git a/src/api/lsfgApi.ts b/src/api/lsfgApi.ts
index 0b221e9..8d14da6 100644
--- a/src/api/lsfgApi.ts
+++ b/src/api/lsfgApi.ts
@@ -1,5 +1,5 @@
import { callable } from "@decky/api";
-import { ConfigurationData, ConfigurationManager } from "../config/configSchema";
+import { ConfigurationData } from "../config/configSchema";
// Type definitions for API responses
export interface InstallationResult {
@@ -99,16 +99,15 @@ export const getLaunchOption = callable<[], LaunchOptionResult>("get_launch_opti
export const getConfigFileContent = callable<[], FileContentResult>("get_config_file_content");
export const getLaunchScriptContent = callable<[], FileContentResult>("get_launch_script_content");
-// Updated config function using centralized configuration
+// Updated config function using object-based configuration (single source of truth)
export const updateLsfgConfig = callable<
- [string, number, number, boolean, boolean, string, number, boolean, boolean, boolean, boolean],
+ [ConfigurationData],
ConfigUpdateResult
>("update_lsfg_config");
-// Helper function to create config update from configuration object
+// Legacy helper function for backward compatibility
export const updateLsfgConfigFromObject = async (config: ConfigurationData): Promise<ConfigUpdateResult> => {
- const args = ConfigurationManager.createArgsFromConfig(config);
- return updateLsfgConfig(...args as [string, number, number, boolean, boolean, string, number, boolean, boolean, boolean, boolean]);
+ return updateLsfgConfig(config);
};
// Self-updater API functions
diff --git a/src/components/ConfigurationSection.tsx b/src/components/ConfigurationSection.tsx
index 26099e7..1c0d2b2 100644
--- a/src/components/ConfigurationSection.tsx
+++ b/src/components/ConfigurationSection.tsx
@@ -112,16 +112,26 @@ export function ConfigurationSection({
<PanelSectionRow>
<div
style={{
- fontSize: "14px",
- fontWeight: "bold",
- marginTop: "16px",
- marginBottom: "8px",
- borderBottom: "1px solid rgba(255, 255, 255, 0.2)",
- paddingBottom: "4px",
- color: "white"
+ fontSize: "14px",
+ fontWeight: "bold",
+ marginTop: "16px",
+ marginBottom: "2px",
+ borderBottom: "1px solid rgba(255, 255, 255, 0.2)",
+ paddingBottom: "2px",
+ color: "white"
+ }}
+ >
+ Environment Variables
+ </div>
+ <div
+ style={{
+ fontSize: "12px",
+ color: "#cccccc",
+ marginTop: "2px",
+ marginBottom: "8px"
}}
>
- Environment Variables (Requires re-launch)
+ Must be toggled before game start or restart game to take effect
</div>
</PanelSectionRow>
diff --git a/src/config/configSchema.ts b/src/config/configSchema.ts
index 979d3c9..fdf6212 100644
--- a/src/config/configSchema.ts
+++ b/src/config/configSchema.ts
@@ -8,6 +8,7 @@
import { callable } from "@decky/api";
import type { ConfigurationData } from './generatedConfigSchema';
import { getDefaults } from './generatedConfigSchema';
+import { updateLsfgConfig } from "../api/lsfgApi";
// Re-export all auto-generated configuration constants
export {
@@ -30,7 +31,6 @@ export class ConfigurationManager {
// Callable methods for backend communication
private getConfiguration = callable<[], { success: boolean; data?: ConfigurationData; error?: string }>("get_configuration");
- private setConfiguration = callable<[{ config_data: ConfigurationData }], { success: boolean; error?: string }>("set_configuration");
private resetConfiguration = callable<[], { success: boolean; data?: ConfigurationData; error?: string }>("reset_configuration");
private constructor() {}
@@ -50,25 +50,6 @@ export class ConfigurationManager {
}
/**
- * Create args array from config object for lsfg API calls
- */
- static createArgsFromConfig(config: ConfigurationData): [string, number, number, boolean, boolean, string, number, boolean, boolean, boolean, boolean] {
- return [
- config.dll,
- config.multiplier,
- config.flow_scale,
- config.performance_mode,
- config.hdr_mode,
- config.experimental_present_mode,
- config.dxvk_frame_rate,
- config.enable_wow64,
- config.disable_steamdeck_mode,
- config.mangohud_workaround,
- config.disable_vkbasalt
- ];
- }
-
- /**
* Load configuration from backend
*/
async loadConfig(): Promise<ConfigurationData> {
@@ -91,7 +72,7 @@ export class ConfigurationManager {
*/
async saveConfig(config: ConfigurationData): Promise<void> {
try {
- const result = await this.setConfiguration({ config_data: config });
+ const result = await updateLsfgConfig(config);
if (result.success) {
this._config = config;
} else {