From 9a679fc4b70dad9c4894b7886d62ad41d0596251 Mon Sep 17 00:00:00 2001 From: xXJSONDeruloXx Date: Mon, 14 Jul 2025 20:57:57 -0400 Subject: dynamic option 2 var display --- src/components/Content.tsx | 2 +- src/components/UsageInstructions.tsx | 58 +++++++++++++++++++++++++----------- 2 files changed, 42 insertions(+), 18 deletions(-) (limited to 'src/components') diff --git a/src/components/Content.tsx b/src/components/Content.tsx index cecb142..0e17f3c 100644 --- a/src/components/Content.tsx +++ b/src/components/Content.tsx @@ -102,7 +102,7 @@ export function Content() { /> )} - + ); } diff --git a/src/components/UsageInstructions.tsx b/src/components/UsageInstructions.tsx index 712d4c1..3df3d78 100644 --- a/src/components/UsageInstructions.tsx +++ b/src/components/UsageInstructions.tsx @@ -1,10 +1,47 @@ import { PanelSectionRow } from "@decky/ui"; -interface UsageInstructionsProps { +interface ConfigType { + enableLsfg: boolean; multiplier: number; + flowScale: number; + hdr: boolean; + perfMode: boolean; + immediateMode: boolean; } -export function UsageInstructions({ multiplier }: UsageInstructionsProps) { +interface UsageInstructionsProps { + config: ConfigType; +} + +export function UsageInstructions({ config }: UsageInstructionsProps) { + // Build manual environment variables string based on current config + const buildManualEnvVars = (): string => { + const envVars: string[] = []; + + if (config.enableLsfg) { + envVars.push("ENABLE_LSFG=1"); + } + + // Always include multiplier and flow_scale if LSFG is enabled, as they have defaults + if (config.enableLsfg) { + envVars.push(`LSFG_MULTIPLIER=${config.multiplier}`); + envVars.push(`LSFG_FLOW_SCALE=${config.flowScale}`); + } + + if (config.hdr) { + envVars.push("LSFG_HDR=1"); + } + + if (config.perfMode) { + envVars.push("LSFG_PERF_MODE=1"); + } + + if (config.immediateMode) { + envVars.push("MESA_VK_WSI_PRESENT_MODE=immediate"); + } + + return envVars.length > 0 ? `${envVars.join(" ")} %command%` : "%command%"; + }; return (
- ~/lsfg %COMMAND% + ~/lsfg %command%
Option 2: Manual environment variables: @@ -47,20 +84,7 @@ export function UsageInstructions({ multiplier }: UsageInstructionsProps) { marginBottom: "6px" }} > - ENABLE_LSFG=1 LSFG_MULTIPLIER={multiplier} %COMMAND% -
-
- The lsfg script uses your current configuration settings. -
- • ENABLE_LSFG=1 - Enables frame generation -
- • LSFG_MULTIPLIER=2-4 - FPS multiplier (start with 2) -
- • LSFG_FLOW_SCALE=0.25-1.0 - Flow scale (for performance) -
- • LSFG_HDR=1 - HDR mode (only if using HDR) -
- • MESA_VK_WSI_PRESENT_MODE=immediate - Disable vsync + {buildManualEnvVars()}
-- cgit v1.2.3 From 885b9a938f9c5193ab0259502d4f63e981fc4a26 Mon Sep 17 00:00:00 2001 From: xXJSONDeruloXx Date: Mon, 14 Jul 2025 22:50:42 -0400 Subject: launch wiki in steam browser button --- src/components/UsageInstructions.tsx | 100 +++++++++++++++++++++-------------- 1 file changed, 60 insertions(+), 40 deletions(-) (limited to 'src/components') diff --git a/src/components/UsageInstructions.tsx b/src/components/UsageInstructions.tsx index 3df3d78..277f685 100644 --- a/src/components/UsageInstructions.tsx +++ b/src/components/UsageInstructions.tsx @@ -1,4 +1,5 @@ -import { PanelSectionRow } from "@decky/ui"; +import { PanelSectionRow, ButtonItem } from "@decky/ui"; +import { FaExternalLinkAlt } from "react-icons/fa"; interface ConfigType { enableLsfg: boolean; @@ -42,51 +43,70 @@ export function UsageInstructions({ config }: UsageInstructionsProps) { return envVars.length > 0 ? `${envVars.join(" ")} %command%` : "%command%"; }; + + const handleWikiClick = () => { + window.open("https://github.com/PancakeTAS/lsfg-vk/wiki", "_blank"); + }; + return ( - -
-
- Usage Instructions: -
-
- Option 1: Use the lsfg script (recommended): -
+ <> +
- ~/lsfg %command% -
-
- Option 2: Manual environment variables: +
+ Usage Instructions: +
+
+ Option 1: Use the lsfg script (recommended): +
+
+ ~/lsfg %command% +
+
+ Option 2: Manual environment variables: +
+
+ {buildManualEnvVars()} +
-
+ + + - {buildManualEnvVars()} -
-
-
+
+ +
LSFG-VK Wiki
+
+ + + ); } -- cgit v1.2.3 From 171959709a49899bdd1555cd07de1ab323a18ddb Mon Sep 17 00:00:00 2001 From: xXJSONDeruloXx Date: Mon, 14 Jul 2025 22:57:38 -0400 Subject: separate wiki button into component --- src/components/UsageInstructions.tsx | 20 +++----------------- src/components/WikiButton.tsx | 22 ++++++++++++++++++++++ src/components/index.ts | 1 + 3 files changed, 26 insertions(+), 17 deletions(-) create mode 100644 src/components/WikiButton.tsx (limited to 'src/components') diff --git a/src/components/UsageInstructions.tsx b/src/components/UsageInstructions.tsx index 277f685..a826d3d 100644 --- a/src/components/UsageInstructions.tsx +++ b/src/components/UsageInstructions.tsx @@ -1,5 +1,5 @@ -import { PanelSectionRow, ButtonItem } from "@decky/ui"; -import { FaExternalLinkAlt } from "react-icons/fa"; +import { PanelSectionRow } from "@decky/ui"; +import { WikiButton } from "./WikiButton"; interface ConfigType { enableLsfg: boolean; @@ -44,10 +44,6 @@ export function UsageInstructions({ config }: UsageInstructionsProps) { return envVars.length > 0 ? `${envVars.join(" ")} %command%` : "%command%"; }; - const handleWikiClick = () => { - window.open("https://github.com/PancakeTAS/lsfg-vk/wiki", "_blank"); - }; - return ( <> @@ -96,17 +92,7 @@ export function UsageInstructions({ config }: UsageInstructionsProps) { - - -
- -
LSFG-VK Wiki
-
-
-
+ ); } diff --git a/src/components/WikiButton.tsx b/src/components/WikiButton.tsx new file mode 100644 index 0000000..80ff1d9 --- /dev/null +++ b/src/components/WikiButton.tsx @@ -0,0 +1,22 @@ +import { PanelSectionRow, ButtonItem } from "@decky/ui"; +import { FaExternalLinkAlt } from "react-icons/fa"; + +export function WikiButton() { + const handleWikiClick = () => { + window.open("https://github.com/PancakeTAS/lsfg-vk/wiki", "_blank"); + }; + + return ( + + +
+ +
LSFG-VK Wiki
+
+
+
+ ); +} diff --git a/src/components/index.ts b/src/components/index.ts index 77f11d4..26eb2fb 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -3,3 +3,4 @@ export { StatusDisplay } from "./StatusDisplay"; export { InstallationButton } from "./InstallationButton"; export { ConfigurationSection } from "./ConfigurationSection"; export { UsageInstructions } from "./UsageInstructions"; +export { WikiButton } from "./WikiButton"; -- cgit v1.2.3 From ec4541dd78f4e2a58b679b20740f323d8ce76698 Mon Sep 17 00:00:00 2001 From: xXJSONDeruloXx Date: Tue, 15 Jul 2025 13:11:06 -0400 Subject: add disable_vkbasalt=1 defaulted, hidden ui to expose to users later if desired --- src/components/ConfigurationSection.tsx | 14 +++++++++++++- src/components/Content.tsx | 18 ++++++++++++------ src/components/UsageInstructions.tsx | 5 +++++ 3 files changed, 30 insertions(+), 7 deletions(-) (limited to 'src/components') diff --git a/src/components/ConfigurationSection.tsx b/src/components/ConfigurationSection.tsx index ee18e5b..34955f8 100644 --- a/src/components/ConfigurationSection.tsx +++ b/src/components/ConfigurationSection.tsx @@ -7,6 +7,7 @@ interface LsfgConfig { hdr: boolean; perfMode: boolean; immediateMode: boolean; + disableVkbasalt: boolean; } interface ConfigurationSectionProps { @@ -17,6 +18,7 @@ interface ConfigurationSectionProps { onHdrChange: (value: boolean) => Promise; onPerfModeChange: (value: boolean) => Promise; onImmediateModeChange: (value: boolean) => Promise; + onDisableVkbasaltChange: (value: boolean) => Promise; } export function ConfigurationSection({ @@ -26,7 +28,8 @@ export function ConfigurationSection({ onFlowScaleChange, onHdrChange, onPerfModeChange, - onImmediateModeChange + onImmediateModeChange, + onDisableVkbasaltChange }: ConfigurationSectionProps) { return ( <> @@ -110,6 +113,15 @@ export function ConfigurationSection({ onChange={onImmediateModeChange} /> + + {/* + + */} ); } diff --git a/src/components/Content.tsx b/src/components/Content.tsx index 0e17f3c..16c8f2f 100644 --- a/src/components/Content.tsx +++ b/src/components/Content.tsx @@ -36,32 +36,37 @@ 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); + await updateConfig(value, config.multiplier, config.flowScale, config.hdr, config.perfMode, config.immediateMode, config.disableVkbasalt); }; const handleMultiplierChange = async (value: number) => { setters.setMultiplier(value); - await updateConfig(config.enableLsfg, value, config.flowScale, config.hdr, config.perfMode, config.immediateMode); + await updateConfig(config.enableLsfg, value, config.flowScale, config.hdr, config.perfMode, config.immediateMode, config.disableVkbasalt); }; const handleFlowScaleChange = async (value: number) => { setters.setFlowScale(value); - await updateConfig(config.enableLsfg, config.multiplier, value, config.hdr, config.perfMode, config.immediateMode); + await updateConfig(config.enableLsfg, config.multiplier, value, config.hdr, config.perfMode, config.immediateMode, config.disableVkbasalt); }; const handleHdrChange = async (value: boolean) => { setters.setHdr(value); - await updateConfig(config.enableLsfg, config.multiplier, config.flowScale, value, config.perfMode, config.immediateMode); + await updateConfig(config.enableLsfg, config.multiplier, config.flowScale, value, config.perfMode, config.immediateMode, config.disableVkbasalt); }; const handlePerfModeChange = async (value: boolean) => { setters.setPerfMode(value); - await updateConfig(config.enableLsfg, config.multiplier, config.flowScale, config.hdr, value, config.immediateMode); + await updateConfig(config.enableLsfg, config.multiplier, config.flowScale, config.hdr, value, config.immediateMode, config.disableVkbasalt); }; const handleImmediateModeChange = async (value: boolean) => { setters.setImmediateMode(value); - await updateConfig(config.enableLsfg, config.multiplier, config.flowScale, config.hdr, config.perfMode, value); + await updateConfig(config.enableLsfg, config.multiplier, config.flowScale, config.hdr, config.perfMode, value, config.disableVkbasalt); + }; + + const handleDisableVkbasaltChange = async (value: boolean) => { + setters.setDisableVkbasalt(value); + await updateConfig(config.enableLsfg, config.multiplier, config.flowScale, config.hdr, config.perfMode, config.immediateMode, value); }; const onInstall = () => { @@ -99,6 +104,7 @@ export function Content() { onHdrChange={handleHdrChange} onPerfModeChange={handlePerfModeChange} onImmediateModeChange={handleImmediateModeChange} + onDisableVkbasaltChange={handleDisableVkbasaltChange} /> )} diff --git a/src/components/UsageInstructions.tsx b/src/components/UsageInstructions.tsx index a826d3d..ca9ddd2 100644 --- a/src/components/UsageInstructions.tsx +++ b/src/components/UsageInstructions.tsx @@ -8,6 +8,7 @@ interface ConfigType { hdr: boolean; perfMode: boolean; immediateMode: boolean; + disableVkbasalt: boolean; } interface UsageInstructionsProps { @@ -41,6 +42,10 @@ export function UsageInstructions({ config }: UsageInstructionsProps) { envVars.push("MESA_VK_WSI_PRESENT_MODE=immediate"); } + if (config.disableVkbasalt) { + envVars.push("DISABLE_VKBASALT=1"); + } + return envVars.length > 0 ? `${envVars.join(" ")} %command%` : "%command%"; }; -- cgit v1.2.3