From eb1c32ee61d4d4098feb1441ea5bf3b73f520780 Mon Sep 17 00:00:00 2001
From: xXJSONDeruloXx <danielhimebauch@gmail.com>
Date: Wed, 16 Jul 2025 10:42:54 -0400
Subject: initial add of fps cap ui toggle

---
 src/components/Content.tsx | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

(limited to 'src/components/Content.tsx')

diff --git a/src/components/Content.tsx b/src/components/Content.tsx
index 39de01b..895b2fc 100644
--- a/src/components/Content.tsx
+++ b/src/components/Content.tsx
@@ -38,37 +38,42 @@ export function Content() {
   // Configuration change handlers
   const handleEnableLsfgChange = async (value: boolean) => {
     setters.setEnableLsfg(value);
-    await updateConfig(value, config.multiplier, config.flowScale, config.hdr, config.perfMode, config.immediateMode, config.disableVkbasalt);
+    await updateConfig(value, config.multiplier, config.flowScale, config.hdr, config.perfMode, config.immediateMode, config.disableVkbasalt, config.frameCap);
   };
 
   const handleMultiplierChange = async (value: number) => {
     setters.setMultiplier(value);
-    await updateConfig(config.enableLsfg, value, config.flowScale, config.hdr, config.perfMode, config.immediateMode, config.disableVkbasalt);
+    await updateConfig(config.enableLsfg, value, config.flowScale, config.hdr, config.perfMode, config.immediateMode, config.disableVkbasalt, config.frameCap);
   };
 
   const handleFlowScaleChange = async (value: number) => {
     setters.setFlowScale(value);
-    await updateConfig(config.enableLsfg, config.multiplier, value, config.hdr, config.perfMode, config.immediateMode, config.disableVkbasalt);
+    await updateConfig(config.enableLsfg, config.multiplier, value, config.hdr, config.perfMode, config.immediateMode, config.disableVkbasalt, config.frameCap);
   };
 
   const handleHdrChange = async (value: boolean) => {
     setters.setHdr(value);
-    await updateConfig(config.enableLsfg, config.multiplier, config.flowScale, value, config.perfMode, config.immediateMode, config.disableVkbasalt);
+    await updateConfig(config.enableLsfg, config.multiplier, config.flowScale, value, config.perfMode, config.immediateMode, config.disableVkbasalt, config.frameCap);
   };
 
   const handlePerfModeChange = async (value: boolean) => {
     setters.setPerfMode(value);
-    await updateConfig(config.enableLsfg, config.multiplier, config.flowScale, config.hdr, value, config.immediateMode, config.disableVkbasalt);
+    await updateConfig(config.enableLsfg, config.multiplier, config.flowScale, config.hdr, value, config.immediateMode, config.disableVkbasalt, config.frameCap);
   };
 
   const handleImmediateModeChange = async (value: boolean) => {
     setters.setImmediateMode(value);
-    await updateConfig(config.enableLsfg, config.multiplier, config.flowScale, config.hdr, config.perfMode, value, config.disableVkbasalt);
+    await updateConfig(config.enableLsfg, config.multiplier, config.flowScale, config.hdr, config.perfMode, value, config.disableVkbasalt, config.frameCap);
   };
 
   const handleDisableVkbasaltChange = async (value: boolean) => {
     setters.setDisableVkbasalt(value);
-    await updateConfig(config.enableLsfg, config.multiplier, config.flowScale, config.hdr, config.perfMode, config.immediateMode, value);
+    await updateConfig(config.enableLsfg, config.multiplier, config.flowScale, config.hdr, config.perfMode, config.immediateMode, value, config.frameCap);
+  };
+
+  const handleFrameCapChange = async (value: number) => {
+    setters.setFrameCap(value);
+    await updateConfig(config.enableLsfg, config.multiplier, config.flowScale, config.hdr, config.perfMode, config.immediateMode, config.disableVkbasalt, value);
   };
 
   const onInstall = () => {
@@ -107,6 +112,7 @@ export function Content() {
           onPerfModeChange={handlePerfModeChange}
           onImmediateModeChange={handleImmediateModeChange}
           onDisableVkbasaltChange={handleDisableVkbasaltChange}
+          onFrameCapChange={handleFrameCapChange}
         />
       )}
 
-- 
cgit v1.2.3


From 7868396718b13443209e7c5d83a2c96cd7eee31e Mon Sep 17 00:00:00 2001
From: xXJSONDeruloXx <danielhimebauch@gmail.com>
Date: Wed, 16 Jul 2025 13:54:09 -0400
Subject:  centralized configuration system for lsfg-vk params

---
 src/components/Content.tsx | 55 +++++-----------------------------------------
 1 file changed, 6 insertions(+), 49 deletions(-)

(limited to 'src/components/Content.tsx')

diff --git a/src/components/Content.tsx b/src/components/Content.tsx
index 895b2fc..ba651d4 100644
--- a/src/components/Content.tsx
+++ b/src/components/Content.tsx
@@ -8,6 +8,7 @@ import { ConfigurationSection } from "./ConfigurationSection";
 import { UsageInstructions } from "./UsageInstructions";
 import { WikiButton } from "./WikiButton";
 import { ClipboardButton } from "./ClipboardButton";
+import { ConfigurationData } from "../config/configSchema";
 
 export function Content() {
   const {
@@ -21,9 +22,8 @@ export function Content() {
 
   const {
     config,
-    setters,
     loadLsfgConfig,
-    updateConfig
+    updateField
   } = useLsfgConfig();
 
   const { isInstalling, isUninstalling, handleInstall, handleUninstall } = useInstallationActions();
@@ -35,45 +35,9 @@ export function Content() {
     }
   }, [isInstalled, loadLsfgConfig]);
 
-  // Configuration change handlers
-  const handleEnableLsfgChange = async (value: boolean) => {
-    setters.setEnableLsfg(value);
-    await updateConfig(value, config.multiplier, config.flowScale, config.hdr, config.perfMode, config.immediateMode, config.disableVkbasalt, config.frameCap);
-  };
-
-  const handleMultiplierChange = async (value: number) => {
-    setters.setMultiplier(value);
-    await updateConfig(config.enableLsfg, value, config.flowScale, config.hdr, config.perfMode, config.immediateMode, config.disableVkbasalt, config.frameCap);
-  };
-
-  const handleFlowScaleChange = async (value: number) => {
-    setters.setFlowScale(value);
-    await updateConfig(config.enableLsfg, config.multiplier, value, config.hdr, config.perfMode, config.immediateMode, config.disableVkbasalt, config.frameCap);
-  };
-
-  const handleHdrChange = async (value: boolean) => {
-    setters.setHdr(value);
-    await updateConfig(config.enableLsfg, config.multiplier, config.flowScale, value, config.perfMode, config.immediateMode, config.disableVkbasalt, config.frameCap);
-  };
-
-  const handlePerfModeChange = async (value: boolean) => {
-    setters.setPerfMode(value);
-    await updateConfig(config.enableLsfg, config.multiplier, config.flowScale, config.hdr, value, config.immediateMode, config.disableVkbasalt, config.frameCap);
-  };
-
-  const handleImmediateModeChange = async (value: boolean) => {
-    setters.setImmediateMode(value);
-    await updateConfig(config.enableLsfg, config.multiplier, config.flowScale, config.hdr, config.perfMode, value, config.disableVkbasalt, config.frameCap);
-  };
-
-  const handleDisableVkbasaltChange = async (value: boolean) => {
-    setters.setDisableVkbasalt(value);
-    await updateConfig(config.enableLsfg, config.multiplier, config.flowScale, config.hdr, config.perfMode, config.immediateMode, value, config.frameCap);
-  };
-
-  const handleFrameCapChange = async (value: number) => {
-    setters.setFrameCap(value);
-    await updateConfig(config.enableLsfg, config.multiplier, config.flowScale, config.hdr, config.perfMode, config.immediateMode, config.disableVkbasalt, value);
+  // Generic configuration change handler
+  const handleConfigChange = async (fieldName: keyof ConfigurationData, value: boolean | number) => {
+    await updateField(fieldName, value);
   };
 
   const onInstall = () => {
@@ -105,14 +69,7 @@ export function Content() {
       {isInstalled && (
         <ConfigurationSection
           config={config}
-          onEnableLsfgChange={handleEnableLsfgChange}
-          onMultiplierChange={handleMultiplierChange}
-          onFlowScaleChange={handleFlowScaleChange}
-          onHdrChange={handleHdrChange}
-          onPerfModeChange={handlePerfModeChange}
-          onImmediateModeChange={handleImmediateModeChange}
-          onDisableVkbasaltChange={handleDisableVkbasaltChange}
-          onFrameCapChange={handleFrameCapChange}
+          onConfigChange={handleConfigChange}
         />
       )}
 
-- 
cgit v1.2.3

