From a6955e828b1dee7b14f8021a8a470dd51d77e33e Mon Sep 17 00:00:00 2001
From: xXJSONDeruloXx <danielhimebauch@gmail.com>
Date: Fri, 3 Apr 2026 09:52:39 -0400
Subject: feat: proxy DLL name picker

Expose the proxy DLL rename as a user-selectable option across all
injection paths.  Previously hardcoded to dxgi.dll with no way to
change it short of manually prepending DLL=<name> to the Steam launch
option.

src/utils/constants.ts
- Add PROXY_DLL_OPTIONS (7 entries matching _create_renamed_copies)
  each with a label and one-line hint
- Add DEFAULT_PROXY_DLL constant (dxgi.dll) and ProxyDllValue type

src/api/index.ts
- runManualPatch now takes [directory, dll_name] so the chosen name
  reaches the backend

src/components/OptiScalerControls.tsx
- Own dllName state (default: dxgi.dll)
- Render a DropdownItem (visible when installed) showing the 7 options
  with the selected option's hint as the description
- Pass dllName down to both ClipboardCommands and ManualPatchControls

src/components/ClipboardCommands.tsx
- Accept dllName prop
- Patch command is plain ~/fgmod/fgmod %command% for the default;
  prefixed DLL=<name> ~/fgmod/fgmod %command% for any other choice

src/components/CustomPathOverride.tsx
- Accept dllName prop
- Pass it to runManualPatch
- Manual launch cmd clipboard button builds
  WINEDLLOVERRIDES="<stem>=n,b" dynamically; emits bare
  SteamDeck=0 %command% for OptiScaler.asi (ASI loader path needs no
  Wine DLL override)

main.py
- Add VALID_DLL_NAMES set (whitelist matching the renames dir)
- manual_patch_directory validates dll_name against the whitelist and
  returns an error for unknown values
- _manual_patch_directory_impl accepts dll_name param; removes the
  hardcoded "dxgi.dll" line

defaults/assets/fgmod.sh
- Fix longstanding bug: WINEDLLOVERRIDES was hardcoded to dxgi=n,b
  regardless of the DLL= env var selection.  Now derives the stem from
  $dll_name and skips the override entirely for .asi files.
---
 src/components/CustomPathOverride.tsx | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

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

diff --git a/src/components/CustomPathOverride.tsx b/src/components/CustomPathOverride.tsx
index ffc4b1f..14a0905 100644
--- a/src/components/CustomPathOverride.tsx
+++ b/src/components/CustomPathOverride.tsx
@@ -36,6 +36,7 @@ const ensureDirectory = (value: string) => {
 interface ManualPatchControlsProps {
   isAvailable: boolean;
   onManualModeChange?: (enabled: boolean) => void;
+  dllName: string;
 }
 
 interface PickerState {
@@ -56,7 +57,7 @@ const formatResultMessage = (result: ApiResponse | null) => {
   return result.message || result.output || "Operation failed.";
 };
 
-export const ManualPatchControls = ({ isAvailable, onManualModeChange }: ManualPatchControlsProps) => {
+export const ManualPatchControls = ({ isAvailable, onManualModeChange, dllName }: ManualPatchControlsProps) => {
   const [isEnabled, setEnabled] = useState(false);
   const [defaults, setDefaults] = useState<PathDefaults>(INITIAL_DEFAULTS);
   const [pickerState, setPickerState] = useState<PickerState>(INITIAL_PICKER_STATE);
@@ -165,7 +166,7 @@ export const ManualPatchControls = ({ isAvailable, onManualModeChange }: ManualP
       try {
         const response =
           action === "patch"
-            ? await runManualPatch(selectedPath)
+            ? await runManualPatch(selectedPath, dllName)
             : await runManualUnpatch(selectedPath);
         setOperationResult(response ?? { status: "error", message: "No response from backend." });
       } catch (err) {
@@ -177,7 +178,7 @@ export const ManualPatchControls = ({ isAvailable, onManualModeChange }: ManualP
         setBusy(false);
       }
     },
-    [selectedPath]
+    [selectedPath, dllName]
   );
 
   const handleToggle = (value: boolean) => {
@@ -216,7 +217,11 @@ export const ManualPatchControls = ({ isAvailable, onManualModeChange }: ManualP
       {canInteract && (
         <>
           <SmartClipboardButton
-            command='WINEDLLOVERRIDES="dxgi=n,b" SteamDeck=0 %command%'
+            command={
+              dllName === "OptiScaler.asi"
+                ? "SteamDeck=0 %command%"
+                : `WINEDLLOVERRIDES="${dllName.replace(".dll", "")}=n,b" SteamDeck=0 %command%`
+            }
             buttonText="Manual launch cmd"
           />
           <PanelSectionRow>
-- 
cgit v1.2.3


From d845c74d039fd08449ce723d25958cd96a72ee06 Mon Sep 17 00:00:00 2001
From: xXJSONDeruloXx <danielhimebauch@gmail.com>
Date: Fri, 3 Apr 2026 10:10:36 -0400
Subject: chore: remove all emojis from source files

---
 src/components/CustomPathOverride.tsx | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

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

diff --git a/src/components/CustomPathOverride.tsx b/src/components/CustomPathOverride.tsx
index 14a0905..4effc6c 100644
--- a/src/components/CustomPathOverride.tsx
+++ b/src/components/CustomPathOverride.tsx
@@ -239,9 +239,7 @@ export const ManualPatchControls = ({ isAvailable, onManualModeChange, dllName }
               <Field
                 label="Picker error"
                 description={pickerState.lastError}
-              >
-                ⚠️
-              </Field>
+              />
             </PanelSectionRow>
           )}
 
-- 
cgit v1.2.3

