diff options
Diffstat (limited to 'src/components')
| -rw-r--r-- | src/components/ConfigurationSection.tsx | 27 | ||||
| -rw-r--r-- | src/components/Content.tsx | 20 | ||||
| -rw-r--r-- | src/components/UsageInstructions.tsx | 5 |
3 files changed, 44 insertions, 8 deletions
diff --git a/src/components/ConfigurationSection.tsx b/src/components/ConfigurationSection.tsx index 34955f8..6c6f50a 100644 --- a/src/components/ConfigurationSection.tsx +++ b/src/components/ConfigurationSection.tsx @@ -8,6 +8,7 @@ interface LsfgConfig { perfMode: boolean; immediateMode: boolean; disableVkbasalt: boolean; + frameCap: number; } interface ConfigurationSectionProps { @@ -19,6 +20,7 @@ interface ConfigurationSectionProps { onPerfModeChange: (value: boolean) => Promise<void>; onImmediateModeChange: (value: boolean) => Promise<void>; onDisableVkbasaltChange: (value: boolean) => Promise<void>; + onFrameCapChange: (value: number) => Promise<void>; } export function ConfigurationSection({ @@ -29,7 +31,8 @@ export function ConfigurationSection({ onHdrChange, onPerfModeChange, onImmediateModeChange, - onDisableVkbasaltChange + onDisableVkbasaltChange, + onFrameCapChange }: ConfigurationSectionProps) { return ( <> @@ -114,6 +117,28 @@ export function ConfigurationSection({ /> </PanelSectionRow> + <PanelSectionRow> + <SliderField + label={`Game Frame Cap ${config.frameCap === 0 ? "(Disabled)" : `(${config.frameCap} FPS)`}`} + description="Limit frame rate using DXVK_FRAME_RATE (0 = disabled)" + value={config.frameCap} + min={0} + max={60} + step={5} + notchCount={7} + notchLabels={[ + { notchIndex: 0, label: "Off" }, + { notchIndex: 1, label: "10" }, + { notchIndex: 2, label: "20" }, + { notchIndex: 3, label: "30" }, + { notchIndex: 4, label: "40" }, + { notchIndex: 5, label: "50" }, + { notchIndex: 6, label: "60" } + ]} + onChange={onFrameCapChange} + /> + </PanelSectionRow> + {/* <PanelSectionRow> <ToggleField label="Disable vkbasalt" 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} /> )} diff --git a/src/components/UsageInstructions.tsx b/src/components/UsageInstructions.tsx index bf80630..3589c04 100644 --- a/src/components/UsageInstructions.tsx +++ b/src/components/UsageInstructions.tsx @@ -8,6 +8,7 @@ interface ConfigType { perfMode: boolean; immediateMode: boolean; disableVkbasalt: boolean; + frameCap: number; } interface UsageInstructionsProps { @@ -45,6 +46,10 @@ export function UsageInstructions({ config }: UsageInstructionsProps) { envVars.push("DISABLE_VKBASALT=1"); } + if (config.frameCap > 0) { + envVars.push(`DXVK_FRAME_RATE=${config.frameCap}`); + } + return envVars.length > 0 ? `${envVars.join(" ")} %command%` : "%command%"; }; |
