mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-03-09 15:40:26 +00:00
feat: block executable 1:N game
This commit is contained in:
parent
fcc24d6b94
commit
939133fcc3
8 changed files with 37 additions and 5 deletions
1
src/renderer/src/declaration.d.ts
vendored
1
src/renderer/src/declaration.d.ts
vendored
|
@ -71,6 +71,7 @@ declare global {
|
|||
) => Promise<void>;
|
||||
createGameShortcut: (id: number) => Promise<boolean>;
|
||||
updateExecutablePath: (id: number, executablePath: string) => Promise<void>;
|
||||
verifyExecutablePathInUse: (executablePath: string) => Promise<Game>;
|
||||
getLibrary: () => Promise<LibraryGame[]>;
|
||||
openGameInstaller: (gameId: number) => Promise<boolean>;
|
||||
openGameInstallerPath: (gameId: number) => Promise<boolean>;
|
||||
|
|
|
@ -57,8 +57,17 @@ export function GameOptionsModal({
|
|||
const path = await selectGameExecutable();
|
||||
|
||||
if (path) {
|
||||
await window.electron.updateExecutablePath(game.id, path);
|
||||
updateGame();
|
||||
const gameUsingPath =
|
||||
await window.electron.verifyExecutablePathInUse(path);
|
||||
|
||||
if (gameUsingPath) {
|
||||
showErrorToast(
|
||||
t("executable_path_in_use", { game: gameUsingPath.title })
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
window.electron.updateExecutablePath(game.id, path).then(updateGame);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue