mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-03-09 15:40:26 +00:00
feat: create game options modal
fix error when getSteamAppDetails fails dont set game as removed when deleting instalation folder fix game not deleting installation folder organize code feat: add open game executable path and installer path
This commit is contained in:
parent
2c26fed478
commit
48b6d1c941
9 changed files with 283 additions and 1 deletions
22
src/main/events/library/open-game-executable-path.ts
Normal file
22
src/main/events/library/open-game-executable-path.ts
Normal file
|
@ -0,0 +1,22 @@
|
|||
import { shell } from "electron";
|
||||
import path from "node:path";
|
||||
import { gameRepository } from "@main/repository";
|
||||
import { registerEvent } from "../register-event";
|
||||
|
||||
const openGameExecutablePath = async (
|
||||
_event: Electron.IpcMainInvokeEvent,
|
||||
gameId: number
|
||||
) => {
|
||||
const game = await gameRepository.findOne({
|
||||
where: { id: gameId, isDeleted: false },
|
||||
});
|
||||
|
||||
if (!game || !game.executablePath) return true;
|
||||
|
||||
const gamePath = path.join(game.executablePath, "../");
|
||||
|
||||
shell.openPath(gamePath);
|
||||
return true;
|
||||
};
|
||||
|
||||
registerEvent("openGameExecutablePath", openGameExecutablePath);
|
Loading…
Add table
Add a link
Reference in a new issue