From 948965dda5afcc79c697afcdafebd3361e853f8e Mon Sep 17 00:00:00 2001 From: jarome Date: Sat, 23 Nov 2024 21:39:45 -0300 Subject: [PATCH] QoL allow clearing game executable path and wine prefix --- src/locales/en/translation.json | 1 + .../modals/game-options-modal.tsx | 20 +++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/src/locales/en/translation.json b/src/locales/en/translation.json index fa47e5075..a762d655f 100644 --- a/src/locales/en/translation.json +++ b/src/locales/en/translation.json @@ -105,6 +105,7 @@ "open_folder": "Open folder", "open_download_location": "See downloaded files", "create_shortcut": "Create desktop shortcut", + "clear": "Clear", "remove_files": "Remove files", "remove_from_library_title": "Are you sure?", "remove_from_library_description": "This will remove {{game}} from your library", diff --git a/src/renderer/src/pages/game-details/modals/game-options-modal.tsx b/src/renderer/src/pages/game-details/modals/game-options-modal.tsx index 64346d528..614fa4a07 100644 --- a/src/renderer/src/pages/game-details/modals/game-options-modal.tsx +++ b/src/renderer/src/pages/game-details/modals/game-options-modal.tsx @@ -95,6 +95,11 @@ export function GameOptionsModal({ await window.electron.openGameExecutablePath(game.id); }; + const handleClearExecutablePath = async () => { + await window.electron.updateExecutablePath(game.id, ""); + updateGame(); + }; + const handleChangeWinePrefixPath = async () => { const { filePaths } = await window.electron.showOpenDialog({ properties: ["openDirectory"], @@ -106,6 +111,11 @@ export function GameOptionsModal({ } }; + const handleClearWinePrefixPath = async () => { + await window.electron.selectGameWinePrefix(game.id, ""); + updateGame(); + }; + const shouldShowWinePrefixConfiguration = window.electron.platform === "linux"; @@ -168,6 +178,9 @@ export function GameOptionsModal({ + )} @@ -196,6 +209,13 @@ export function GameOptionsModal({ } /> + {game.winePrefixPath && ( +
+ +
+ )} )}