fix: open game with parameters

This commit is contained in:
Zamitto 2024-12-31 19:38:17 -03:00
parent 0661cbd661
commit 1226483deb
4 changed files with 10 additions and 7 deletions

View File

@ -58,7 +58,7 @@
},
"game_details": {
"launch_options": "Опции за стартиране",
"launch_options_description": "Напредналите потребители могат да въведат модификации на своите опции за стартиране",
"launch_options_description": "Напредналите потребители могат да въведат модификации на своите опции за стартиране (экспериментальный)",
"launch_options_placeholder": "Няма зададен параметър",
"open_download_options": "Варианти за изтегляне",
"download_options_zero": "Няма варианти за изтегляне",

View File

@ -168,7 +168,7 @@
"wine_prefix": "Wine Prefix",
"wine_prefix_description": "The Wine prefix used to run this game",
"launch_options": "Launch Options",
"launch_options_description": "Advanced users may choose to enter modifications to their launch options",
"launch_options_description": "Advanced users may choose to enter modifications to their launch options (experimental feature)",
"launch_options_placeholder": "No parameter specified",
"no_download_option_info": "No information available",
"backup_deletion_failed": "Failed to delete backup",

View File

@ -156,7 +156,7 @@
"wine_prefix": "Prefixo Wine",
"wine_prefix_description": "O prefixo Wine que foi utilizado para instalar o jogo",
"launch_options": "Opções de Inicialização",
"launch_options_description": "Usuários avançados podem adicionar opções de inicialização no jogo",
"launch_options_description": "Usuários avançados podem adicionar opções de inicialização no jogo (experimental)",
"launch_options_placeholder": "Nenhum parâmetro informado",
"no_download_option_info": "Sem informações disponíveis",
"backup_deletion_failed": "Falha ao apagar backup",

View File

@ -20,13 +20,16 @@ const openGame = async (
{ executablePath: parsedPath, launchOptions }
);
if (process.platform === "linux" || process.platform === "darwin") {
if (
process.platform === "linux" ||
process.platform === "darwin" ||
parsedParams.length === 0
) {
shell.openPath(parsedPath);
return;
}
if (process.platform === "win32") {
spawn(parsedPath, parsedParams, { shell: false, detached: true });
}
};
registerEvent("openGame", openGame);