diff options
| author | Janleyx <242423638+Janleyx@users.noreply.github.com> | 2026-07-18 10:20:20 -0400 |
|---|---|---|
| committer | Janleyx <242423638+Janleyx@users.noreply.github.com> | 2026-07-18 10:20:20 -0400 |
| commit | e205effa83dbbcb9c13f3f11a493a525e989d7b6 (patch) | |
| tree | 9b05626daceb691cdfa2e5306274f0297306d84c /src/components | |
| parent | 722ac0cf338d659e2d0553431285fbfb0cd978b5 (diff) | |
| download | decky-lsfg-vk-e205effa83dbbcb9c13f3f11a493a525e989d7b6.tar.gz decky-lsfg-vk-e205effa83dbbcb9c13f3f11a493a525e989d7b6.zip | |
preserve Armada game launch wrapper
Diffstat (limited to 'src/components')
| -rw-r--r-- | src/components/SmartClipboardButton.tsx | 9 | ||||
| -rw-r--r-- | src/components/UsageInstructions.tsx | 42 |
2 files changed, 44 insertions, 7 deletions
diff --git a/src/components/SmartClipboardButton.tsx b/src/components/SmartClipboardButton.tsx index c90515a..7217e83 100644 --- a/src/components/SmartClipboardButton.tsx +++ b/src/components/SmartClipboardButton.tsx @@ -20,12 +20,11 @@ export function SmartClipboardButton() { }, [showSuccess]); const getLaunchOptionText = async (): Promise<string> => { - try { - const result = await getLaunchOption(); - return result.launch_option || "~/lsfg %command%"; - } catch (error) { - return "~/lsfg %command%"; + const result = await getLaunchOption(); + if (!result.launch_option) { + throw new Error("Launch option is unavailable"); } + return result.launch_option; }; const copyToClipboard = async () => { diff --git a/src/components/UsageInstructions.tsx b/src/components/UsageInstructions.tsx index 5f032b8..02d0eb3 100644 --- a/src/components/UsageInstructions.tsx +++ b/src/components/UsageInstructions.tsx @@ -1,6 +1,31 @@ +import { useEffect, useState } from "react"; import { PanelSectionRow } from "@decky/ui"; +import { getLaunchOption } from "../api/lsfgApi"; export function UsageInstructions() { + const [launchOption, setLaunchOption] = useState("~/lsfg %command%"); + const [launchExplanation, setLaunchExplanation] = useState( + "The LSFG wrapper configures frame generation before launching the game." + ); + + useEffect(() => { + let active = true; + + getLaunchOption() + .then((result) => { + if (!active) return; + if (result.launch_option) setLaunchOption(result.launch_option); + if (result.explanation) setLaunchExplanation(result.explanation); + }) + .catch(() => { + // Keep the standard launch option visible if the backend is unavailable. + }); + + return () => { + active = false; + }; + }, []); + return ( <> <PanelSectionRow> @@ -47,7 +72,20 @@ export function UsageInstructions() { textAlign: "center" }} > - <strong>~/lsfg %command%</strong> + <strong>{launchOption}</strong> + </div> + </PanelSectionRow> + + <PanelSectionRow> + <div + style={{ + fontSize: "11px", + lineHeight: "1.3", + opacity: "0.7", + marginTop: "4px" + }} + > + {launchExplanation} </div> </PanelSectionRow> @@ -60,7 +98,7 @@ export function UsageInstructions() { marginTop: "8px" }} > -The configuration is stored in ~/.config/lsfg-vk/conf.toml and hot-reloads while games are running. + The configuration is stored in ~/.config/lsfg-vk/conf.toml and hot-reloads while games are running. </div> </PanelSectionRow> </> |
