summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxXJSONDeruloXx <danielhimebauch@gmail.com>2025-02-12 19:45:02 -0500
committerxXJSONDeruloXx <danielhimebauch@gmail.com>2025-02-12 19:45:02 -0500
commit033e7f28d62103247e93652d512f64300c656a00 (patch)
tree1f939b89a7626e9de51d971060eff860ec58da76
parent96a63b12b2c53ef9e6c19dc0c790c3708b970596 (diff)
downloadDecky-Framegen-033e7f28d62103247e93652d512f64300c656a00.tar.gz
Decky-Framegen-033e7f28d62103247e93652d512f64300c656a00.zip
feat: add warning modal, revise middle ui description text
-rwxr-xr-xsrc/index.tsx33
1 files 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}
<PanelSectionRow>
<div>
- 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.
</div>
</PanelSectionRow>
</PanelSection>
@@ -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(
+ <ConfirmModal
+ strTitle={`Patch ${selectedGame.name}?`}
+ strDescription={
+ "WARNING: Decky Framegen does not unpatch games when uninstalled. Be sure to unpatch the game or verify the integrity of your game files if you choose to uninstall the plugin or the game has issues."
+ }
+ strOKButtonText="Yeah man, I wanna do it"
+ strCancelButtonText="Cancel"
+ onOK={async () => {
+ 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 () => {