From 4967dbb4ea19182c982c8107574a85f306266e8f Mon Sep 17 00:00:00 2001
From: Kurt Himebauch <136133082+xXJSONDeruloXx@users.noreply.github.com>
Date: Wed, 6 Aug 2025 21:42:38 -0400
Subject: Pr fixes (#126)

* rm flatpak function, rm legacy script

* feat: add warning modal on copy button
---
 src/components/SmartClipboardButton.tsx | 28 +++++++++++++++++++++++++++-
 1 file changed, 27 insertions(+), 1 deletion(-)

(limited to 'src/components/SmartClipboardButton.tsx')

diff --git a/src/components/SmartClipboardButton.tsx b/src/components/SmartClipboardButton.tsx
index 095da15..d88a58a 100644
--- a/src/components/SmartClipboardButton.tsx
+++ b/src/components/SmartClipboardButton.tsx
@@ -1,5 +1,5 @@
 import { useState, useEffect } from "react";
-import { PanelSectionRow, ButtonItem } from "@decky/ui";
+import { PanelSectionRow, ButtonItem, ConfirmModal, showModal } from "@decky/ui";
 import { FaClipboard, FaCheck } from "react-icons/fa";
 import { toaster } from "@decky/api";
 
@@ -29,6 +29,32 @@ export function SmartClipboardButton({
   const copyToClipboard = async () => {
     if (isLoading || showSuccess) return;
     
+    const isPatchCommand = command.includes("fgmod %command%") && !command.includes("uninstaller");
+    
+    if (isPatchCommand) {
+      showModal(
+        <ConfirmModal 
+          strTitle={`Patch Game with OptiScaler?`}
+          strDescription={
+            "WARNING: Decky Framegen does not unpatch games when uninstalled. Be sure to unpatch the game or run the OptiScaler uninstall script inside the game files if you choose to uninstall the plugin or the game has issues."
+          }
+          strOKButtonText="Copy Patch Command"
+          strCancelButtonText="Cancel"
+          onOK={async () => {
+            await performCopy();
+          }}
+        />
+      );
+      return;
+    }
+    
+    // For non-patch commands, copy directly
+    await performCopy();
+  };
+
+  const performCopy = async () => {
+    if (isLoading || showSuccess) return;
+    
     setIsLoading(true);
     try {
       const text = command;
-- 
cgit v1.2.3

