Skip to content
This repository has been archived by the owner on Jul 23, 2023. It is now read-only.

Commit

Permalink
Find game path by folder, not by exe
Browse files Browse the repository at this point in the history
  • Loading branch information
Raicuparta committed Jan 6, 2022
1 parent d807978 commit f935ab9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
16 changes: 4 additions & 12 deletions app/components/Settings/PathInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ const useStyles = makeStyles(({ spacing }) => ({
},
}));

const FILE_NAME = 'OuterWilds.exe';

const PathInput: FunctionComponent<Props> = ({
value,
onChange,
Expand All @@ -60,18 +58,12 @@ const PathInput: FunctionComponent<Props> = ({

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);
};
Expand Down
4 changes: 2 additions & 2 deletions app/helpers/static-text.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.',
},
Expand Down Expand Up @@ -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}: `,
Expand Down

0 comments on commit f935ab9

Please sign in to comment.