From 033e7f28d62103247e93652d512f64300c656a00 Mon Sep 17 00:00:00 2001 From: xXJSONDeruloXx Date: Wed, 12 Feb 2025 19:45:02 -0500 Subject: feat: add warning modal, revise middle ui description text --- src/index.tsx | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/src/index.tsx b/src/index.tsx index 010589e..eeb95ea 100755 --- a/src/index.tsx +++ b/src/index.tsx @@ -3,7 +3,9 @@ import { PanelSection, PanelSectionRow, ButtonItem, - DropdownItem + DropdownItem, + ConfirmModal, + showModal } from "@decky/ui"; import { definePlugin, callable } from "@decky/api"; import { RiAiGenerate } from "react-icons/ri"; @@ -169,7 +171,7 @@ function FGModInstallerSection() { ) : null}
- Install the mod above, then select and patch a game. If a game behaves strangely, be sure to select unpatch then restart the game to remove the mod. + Install the mod above, then select and patch a game below to enable DLSS in the game's menu.
@@ -208,13 +210,26 @@ function InstalledGamesSection() { const handlePatchClick = async () => { if (!selectedGame) return; - try { - await SteamClient.Apps.SetAppLaunchOptions(selectedGame.appid, '~/fgmod/fgmod %COMMAND%'); - setResult(`Launch options set for ${selectedGame.name}. You can now select DLSS in the game's menu.`); - } catch (error) { - logError('handlePatchClick: ' + String(error)); - setResult(error instanceof Error ? `Error setting launch options: ${error.message}` : 'Error setting launch options'); - } + // Show confirmation modal + showModal( + { + try { + await SteamClient.Apps.SetAppLaunchOptions(selectedGame.appid, '~/fgmod/fgmod %COMMAND%'); + setResult(`Launch options set for ${selectedGame.name}. You can now select DLSS in the game's menu.`); + } catch (error) { + logError('handlePatchClick: ' + String(error)); + setResult(error instanceof Error ? `Error setting launch options: ${error.message}` : 'Error setting launch options'); + } + }} + /> + ); }; const handleUnpatchClick = async () => { -- cgit v1.2.3