From f935ab91db835915a4a8fbaf9272406f68692ad3 Mon Sep 17 00:00:00 2001 From: Raicuparta Date: Thu, 6 Jan 2022 19:13:35 +0100 Subject: [PATCH] Find game path by folder, not by exe --- app/components/Settings/PathInput.tsx | 16 ++++------------ app/helpers/static-text.ts | 4 ++-- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/app/components/Settings/PathInput.tsx b/app/components/Settings/PathInput.tsx index 0679e1d..3c89956 100644 --- a/app/components/Settings/PathInput.tsx +++ b/app/components/Settings/PathInput.tsx @@ -33,8 +33,6 @@ const useStyles = makeStyles(({ spacing }) => ({ }, })); -const FILE_NAME = 'OuterWilds.exe'; - const PathInput: FunctionComponent = ({ value, onChange, @@ -60,18 +58,12 @@ const PathInput: FunctionComponent = ({ const handleFindClick = async () => { const openedValue = await remote.dialog.showOpenDialog({ - properties: ['openFile'], - title: settingsText.pathFindTitle(FILE_NAME), - defaultPath: `${value}\\${FILE_NAME}`, - filters: [ - { - name: FILE_NAME, - extensions: ['exe'], - }, - ], + properties: ['openDirectory'], + title: settingsText.pathFindTitle, + defaultPath: value, }); - const pathResult = openedValue.filePaths[0].replace(FILE_NAME, ''); + const pathResult = openedValue.filePaths[0]; onChange(pathResult); setPath(pathResult); }; diff --git a/app/helpers/static-text.ts b/app/helpers/static-text.ts index 8fd23e0..30bbb61 100644 --- a/app/helpers/static-text.ts +++ b/app/helpers/static-text.ts @@ -112,7 +112,7 @@ export const settingsText = { 'If enabled, logs show in "Logs" tab. Otherwise, they will show in a separate console window. Disabling this might improve game performance.', }, gamePath: { - label: 'Game path', + label: 'Game folder (contains game exe)', tooltip: 'Game path will be determined automatically when you launch the game. Leave empty for automatic detection on launch.', }, @@ -156,7 +156,7 @@ export const settingsText = { }, textFieldSave: 'Save', pathFindButton: 'Find...', - pathFindTitle: (fileName: string) => `Find ${fileName}...`, + pathFindTitle: `Find folder that contains game exe...`, resetToDefault: 'Reset all settings to default', getSettingsError: (path: string) => `Error while getting settings file in ${path}: `,