mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-01-23 13:34:54 +03:00
feat: remove launch options temporarily
This commit is contained in:
parent
720a7aa2a0
commit
16b50fc22b
@ -1,9 +0,0 @@
|
|||||||
export const parseLaunchOptions = (params: string | null): string[] => {
|
|
||||||
if (params == null || params == "") {
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
|
|
||||||
const paramsSplit = params.split(" ");
|
|
||||||
|
|
||||||
return paramsSplit;
|
|
||||||
};
|
|
@ -2,9 +2,7 @@ import { gameRepository } from "@main/repository";
|
|||||||
|
|
||||||
import { registerEvent } from "../register-event";
|
import { registerEvent } from "../register-event";
|
||||||
import { shell } from "electron";
|
import { shell } from "electron";
|
||||||
import { spawn } from "child_process";
|
|
||||||
import { parseExecutablePath } from "../helpers/parse-executable-path";
|
import { parseExecutablePath } from "../helpers/parse-executable-path";
|
||||||
import { parseLaunchOptions } from "../helpers/parse-launch-options";
|
|
||||||
|
|
||||||
const openGame = async (
|
const openGame = async (
|
||||||
_event: Electron.IpcMainInvokeEvent,
|
_event: Electron.IpcMainInvokeEvent,
|
||||||
@ -12,24 +10,15 @@ const openGame = async (
|
|||||||
executablePath: string,
|
executablePath: string,
|
||||||
launchOptions: string | null
|
launchOptions: string | null
|
||||||
) => {
|
) => {
|
||||||
|
// TODO: revisit this for launchOptions
|
||||||
const parsedPath = parseExecutablePath(executablePath);
|
const parsedPath = parseExecutablePath(executablePath);
|
||||||
const parsedParams = parseLaunchOptions(launchOptions);
|
|
||||||
|
|
||||||
await gameRepository.update(
|
await gameRepository.update(
|
||||||
{ id: gameId },
|
{ id: gameId },
|
||||||
{ executablePath: parsedPath, launchOptions }
|
{ executablePath: parsedPath, launchOptions }
|
||||||
);
|
);
|
||||||
|
|
||||||
if (
|
shell.openPath(parsedPath);
|
||||||
process.platform === "linux" ||
|
|
||||||
process.platform === "darwin" ||
|
|
||||||
parsedParams.length === 0
|
|
||||||
) {
|
|
||||||
shell.openPath(parsedPath);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
spawn(parsedPath, parsedParams, { shell: false, detached: true });
|
|
||||||
};
|
};
|
||||||
|
|
||||||
registerEvent("openGame", openGame);
|
registerEvent("openGame", openGame);
|
||||||
|
@ -141,8 +141,7 @@ export function GameOptionsModal({
|
|||||||
const shouldShowWinePrefixConfiguration =
|
const shouldShowWinePrefixConfiguration =
|
||||||
window.electron.platform === "linux";
|
window.electron.platform === "linux";
|
||||||
|
|
||||||
const shouldShowLaunchOptionsConfiguration =
|
const shouldShowLaunchOptionsConfiguration = false;
|
||||||
window.electron.platform === "win32";
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
Loading…
Reference in New Issue
Block a user