Project: Fix some stuff for non-windows os

This commit is contained in:
themitosan 2024-02-23 22:57:38 -03:00
parent 84e23ca517
commit 140cb016f6
3 changed files with 30 additions and 7 deletions

View file

@ -552,7 +552,7 @@ temp_DESIGN = {
}
// Set game metadata
document.getElementById('IMG_APP_ICON').src = gameData.appIcon;
document.getElementById('IMG_APP_ICON').src = `file://${gameData.appIcon}`;
document.getElementById('DIV_GAME_DETAILS_currentExec').innerHTML = gameMetadata;
document.getElementById('LABEL_GAME_DETAILS_STATUS').innerHTML = gameData.appStatus;
document.getElementById('LABEL_GAME_DETAILS_APP_NAME').innerHTML = gameData.appName;

View file

@ -132,7 +132,13 @@ const APP = {
if (APP.settings.data.debugTestLog === !1){
// Window state
var winMode, pressAnyKey = '';
var winMode,
wineCommand = '',
pressAnyKey = '',
emuExecPath = APP.path.parse(APP.settings.data.emuPath).base,
cmdWinTitle = `"${APP.lang.getVariable('logWindowTitle')} - ${APP.gameList.selectedGame}"`;
// Switch cmd window mode
switch (APP.settings.data.logExternalWindowStartMode){
case 'normal':
@ -154,10 +160,18 @@ const APP = {
pressAnyKey = '^& pause';
}
// Check if needs to append wine command
if (APP.os.platform !== 'win32'){
cmdWinTitle = '',
pressAnyKey = '';
wineCommand = 'wine ';
emuExecPath = `Z:${APP.settings.data.emuPath.replace(RegExp('\\\\', 'gi'), '/')}`;
}
// Transform args into string
var gPath = `"${args[args.indexOf('-e') + 1]}"`,
parseArgs = args.toString().replace(RegExp(',', 'gi'), ' ').replace(args[args.indexOf('-e') + 1], gPath),
execLine = 'start "' + APP.lang.getVariable('logWindowTitle') + ' - ' + APP.gameList.selectedGame + '" ' + winMode + ' cmd /C ' + APP.path.parse(APP.settings.data.emuPath).base + ' ' + parseArgs + ' ' + pressAnyKey;
execLine = `${wineCommand}start ${cmdWinTitle} ${winMode} cmd /C ${emuExecPath} ${parseArgs} ${pressAnyKey}`;
APP.execProcess = APP.childProcess.exec(execLine);
@ -253,10 +267,18 @@ const APP = {
checkCurrentOs: function(){
// Check if needs to display warn
if (APP.os.platform() !== 'win32' && APP.settings.data.nonWindowsOsWarn === !1){
window.alert(APP.lang.getVariable('nonWindowsOsWarn'));
APP.settings.data.nonWindowsOsWarn = !0;
APP.settings.save();
if (APP.os.platform() !== 'win32'){
// Get fpPS4 wine dir
// Check if needs to display warn
if (APP.settings.data.nonWindowsOsWarn === !1){
window.alert(APP.lang.getVariable('nonWindowsOsWarn'));
APP.settings.data.nonWindowsOsWarn = !0;
APP.settings.save();
}
}
},

View file

@ -27,6 +27,7 @@ temp_SETTINGS = {
nwPath: '',
emuPath: '',
gamePath: '',
emuWinePath: '',
// Run fpPS4 on fullscreen
enableEmuFullscreen: !1,