From 557295ba34d6554ea120355242825567ac88cbcc Mon Sep 17 00:00:00 2001 From: xXJSONDeruloXx Date: Tue, 22 Jul 2025 17:14:52 -0400 Subject: extract plus minus to own component --- src/components/FpsMultiplierControl.tsx | 72 +++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 src/components/FpsMultiplierControl.tsx (limited to 'src/components/FpsMultiplierControl.tsx') diff --git a/src/components/FpsMultiplierControl.tsx b/src/components/FpsMultiplierControl.tsx new file mode 100644 index 0000000..da73fea --- /dev/null +++ b/src/components/FpsMultiplierControl.tsx @@ -0,0 +1,72 @@ +import { PanelSectionRow, DialogButton, Focusable } from "@decky/ui"; +import { ConfigurationData } from "../config/configSchema"; +import { MULTIPLIER } from "../config/generatedConfigSchema"; + +interface FpsMultiplierControlProps { + config: ConfigurationData; + onConfigChange: (fieldName: keyof ConfigurationData, value: boolean | number | string) => Promise; +} + +export function FpsMultiplierControl({ + config, + onConfigChange +}: FpsMultiplierControlProps) { + return ( + + + onConfigChange(MULTIPLIER, Math.max(1, config.multiplier - 1))} + disabled={config.multiplier <= 1} + > + − + +
+ {config.multiplier < 2 ? "OFF" : `${config.multiplier}X`} +
+ onConfigChange(MULTIPLIER, Math.min(6, config.multiplier + 1))} + disabled={config.multiplier >= 6} + > + + + +
+
+ ); +} -- cgit v1.2.3 From d194d4886825027c4edfed1a7af67c1bc4ce3189 Mon Sep 17 00:00:00 2001 From: xXJSONDeruloXx Date: Tue, 22 Jul 2025 20:19:17 -0400 Subject: set max fpx mul to 4 --- src/components/FpsMultiplierControl.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/components/FpsMultiplierControl.tsx') diff --git a/src/components/FpsMultiplierControl.tsx b/src/components/FpsMultiplierControl.tsx index da73fea..456a7b4 100644 --- a/src/components/FpsMultiplierControl.tsx +++ b/src/components/FpsMultiplierControl.tsx @@ -61,8 +61,8 @@ export function FpsMultiplierControl({ padding: "5px 0px 0px 0px", minWidth: "40px", }} - onClick={() => onConfigChange(MULTIPLIER, Math.min(6, config.multiplier + 1))} - disabled={config.multiplier >= 6} + onClick={() => onConfigChange(MULTIPLIER, Math.min(4, config.multiplier + 1))} + disabled={config.multiplier >= 4} > + -- cgit v1.2.3