feat: remove launch options temporarily

This commit is contained in:
Zamitto 2025-01-01 20:19:57 -03:00
parent 720a7aa2a0
commit 16b50fc22b
3 changed files with 3 additions and 24 deletions

View File

@ -1,9 +0,0 @@
export const parseLaunchOptions = (params: string | null): string[] => {
if (params == null || params == "") {
return [];
}
const paramsSplit = params.split(" ");
return paramsSplit;
};

View File

@ -2,9 +2,7 @@ import { gameRepository } from "@main/repository";
import { registerEvent } from "../register-event";
import { shell } from "electron";
import { spawn } from "child_process";
import { parseExecutablePath } from "../helpers/parse-executable-path";
import { parseLaunchOptions } from "../helpers/parse-launch-options";
const openGame = async (
_event: Electron.IpcMainInvokeEvent,
@ -12,24 +10,15 @@ const openGame = async (
executablePath: string,
launchOptions: string | null
) => {
// TODO: revisit this for launchOptions
const parsedPath = parseExecutablePath(executablePath);
const parsedParams = parseLaunchOptions(launchOptions);
await gameRepository.update(
{ id: gameId },
{ executablePath: parsedPath, launchOptions }
);
if (
process.platform === "linux" ||
process.platform === "darwin" ||
parsedParams.length === 0
) {
shell.openPath(parsedPath);
return;
}
spawn(parsedPath, parsedParams, { shell: false, detached: true });
};
registerEvent("openGame", openGame);

View File

@ -141,8 +141,7 @@ export function GameOptionsModal({
const shouldShowWinePrefixConfiguration =
window.electron.platform === "linux";
const shouldShowLaunchOptionsConfiguration =
window.electron.platform === "win32";
const shouldShowLaunchOptionsConfiguration = false;
return (
<>