summaryrefslogtreecommitdiff
path: root/main.py
diff options
context:
space:
mode:
authorxXJSONDeruloXx <danielhimebauch@gmail.com>2026-04-03 09:52:39 -0400
committerxXJSONDeruloXx <danielhimebauch@gmail.com>2026-04-03 09:52:39 -0400
commita6955e828b1dee7b14f8021a8a470dd51d77e33e (patch)
tree32824be9f9a76966f1d6fc38c50284bb5ec98e09 /main.py
parentd1ce48eba2a38909f33df965ab672249156dc47d (diff)
downloadDecky-Framegen-a6955e828b1dee7b14f8021a8a470dd51d77e33e.tar.gz
Decky-Framegen-a6955e828b1dee7b14f8021a8a470dd51d77e33e.zip
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.
Diffstat (limited to 'main.py')
-rw-r--r--main.py19
1 files changed, 15 insertions, 4 deletions
diff --git a/main.py b/main.py
index 4092ab0..ea80561 100644
--- a/main.py
+++ b/main.py
@@ -10,6 +10,16 @@ from pathlib import Path
# Set to False or comment out this constant to skip the overwrite by default.
UPSCALER_OVERWRITE_ENABLED = True
+VALID_DLL_NAMES = {
+ "dxgi.dll",
+ "winmm.dll",
+ "dbghelp.dll",
+ "version.dll",
+ "wininet.dll",
+ "winhttp.dll",
+ "OptiScaler.asi",
+}
+
INJECTOR_FILENAMES = [
"dxgi.dll",
"winmm.dll",
@@ -523,7 +533,7 @@ class Plugin:
decky.logger.info(f"Resolved directory {directory} to absolute path {target}")
return target
- def _manual_patch_directory_impl(self, directory: Path) -> dict:
+ def _manual_patch_directory_impl(self, directory: Path, dll_name: str = "dxgi.dll") -> dict:
fgmod_path = Path(decky.HOME) / "fgmod"
if not fgmod_path.exists():
return {
@@ -538,7 +548,6 @@ class Plugin:
"message": "OptiScaler.dll not found in ~/fgmod. Reinstall OptiScaler.",
}
- dll_name = "dxgi.dll"
preserve_ini = True
try:
@@ -772,14 +781,16 @@ class Plugin:
async def log_error(self, error: str) -> None:
decky.logger.error(f"FRONTEND: {error}")
- async def manual_patch_directory(self, directory: str) -> dict:
+ async def manual_patch_directory(self, directory: str, dll_name: str = "dxgi.dll") -> dict:
+ if dll_name not in VALID_DLL_NAMES:
+ return {"status": "error", "message": f"Invalid proxy DLL name: {dll_name}"}
try:
target_dir = self._resolve_target_directory(directory)
except (FileNotFoundError, NotADirectoryError, PermissionError) as exc:
decky.logger.error(f"Manual patch validation failed: {exc}")
return {"status": "error", "message": str(exc)}
- return self._manual_patch_directory_impl(target_dir)
+ return self._manual_patch_directory_impl(target_dir, dll_name)
async def manual_unpatch_directory(self, directory: str) -> dict:
try: