';
});
// Call quicksettings menu
APP.design.quickSettings.show({
showTitle: !1,
content: htmlTemp,
width: data.menuWidth,
// Execute action after closing quicksettings
onClose: function(){
// Reset cursor index
APP.design.input.currentIndex = APP.design.settingsMenu.selectedMenu;
// Return to previous location
APP.design.settingsMenu.renderMenu(data.menu, function(){
APP.design.input.currentIndex = prevIndex;
});
// Callback after closing quicksettings
if (typeof data.onCloseQs === 'function'){
data.onCloseQs();
}
}
});
// Set default actions for quicksettings
APP.design.settingsMenu.qSettingsInputDefault(selectedIndex, parseInt(optionList.length - 1));
// Release input
APP.input.releaseInput();
}
},
// Interface
gui: {
// Select language
selectLanguage: function(){
// WIP
}
},
// Video options
graphics: {
// Change screen resolution
changeScreenRes: function(){
// Lock input
APP.input.lockInput();
// Variables
var htmlTemp = '',
selectedIndex = 0,
screenResList = APP.settings.screenResList,
currentMenu = APP.design.settingsMenu.selectedMenuName;
// Process res. list
screenResList.forEach(function(cEntry, cIndex){
// Variables
var cW = cEntry.w,
cH = cEntry.h,
cL = cEntry.flag,
selectedFlag = '',
selectedLabel = '',
selectedClass = '';
// Check if there's labels for current res.
if (cL !== void 0 && cL !== ''){
selectedLabel = '';
});
// Call quicksettings menu
APP.design.quickSettings.show({
width: 26,
showTitle: !1,
content: htmlTemp,
onClose: function(){
APP.design.settingsMenu.graphics.returnScreenResTest();
}
});
// Set default actions for quicksettings
APP.design.settingsMenu.qSettingsInputDefault(selectedIndex, screenResList.length - 1);
// Release input
APP.input.releaseInput();
},
// Test screen res
testScreenRes: function(newRes){
// Variables
var settingsData = APP.settings.data,
newResData = APP.settings.screenResList[newRes];
// Check if current screen res. changed
if (settingsData.cScreenRes !== newRes){
// Lock input
APP.input.lockInput();
// Reset quicksettings onclose action and close it
APP.design.quickSettings.onClose = null;
APP.design.quickSettings.close();
// Set current screen res. on temp data
APP.design.settingsMenu.tempData['resId'] = newRes;
APP.design.settingsMenu.tempData['resW'] = newResData.w;
APP.design.settingsMenu.tempData['resH'] = newResData.h;
APP.design.settingsMenu.tempData['prevZoom'] = settingsData.guiZoomScale;
APP.design.settingsMenu.tempData['newRes'] = newResData.w + 'x' + newResData.h;
// Reset interface scale if res is lower than 1600x900
if (newResData.w < 1600 && newResData.h < 900){
APP.settings.data.guiZoomScale = 1;
}
// Update screen res for testing
APP.design.updateCanvasRes(newResData.w, newResData.h);
// Call msgsys preview message
APP.design.msgsys.displayMsg({
showAboutIcon: !0,
msgName: 'launcherSettings_testScreenRes'
});
// Set timeout to revert screen res.
APP.design.settingsMenu.tempData['screenTimeout'] = setTimeout(function(){
APP.input.commandActions.ACTION_1();
}, 10000);
} else {
// Close quicksettings menu
APP.design.quickSettings.close();
}
},
// Return from screen res. test
returnScreenResTest: function(saveSettings){
// Lock input
APP.input.lockInput();
// Clear timeout
clearTimeout(APP.design.settingsMenu.tempData.screenTimeout);
// Get temp data
const tData = APP.design.settingsMenu.tempData;
// Check if need to update settings
if (saveSettings === !0){
// Update res. id
APP.settings.data.cScreenRes = tData.resId;
// Update screen res.
APP.settings.data.screenWidth = tData.resW;
APP.settings.data.screenHeight = tData.resH;
// Save settings
APP.settings.save();
} else {
// Get previous screen res.
const prevRes = APP.settings.screenResList[APP.settings.data.cScreenRes];
// Reset zoom scale
APP.settings.data.guiZoomScale = tData.prevZoom;
// Reset screen res.
APP.design.updateCanvasRes(prevRes.w, prevRes.h);
}
// Reset cursor index
APP.design.input.currentIndex = 1;
// Return to previous location
APP.design.settingsMenu.renderMenu('graphics', function(){
APP.design.input.currentIndex = 0;
});
// Reset temp data
APP.design.settingsMenu.tempData = {};
}
},
// Paths
paths: {
// Select fpPS4 path [WIP]
selectEmuPath: function(){
// Open file select path
APP.fileManager.selectFile('.exe', function(newPath){
// Set new path location on temp
APP.temp.newPath = newPath;
// Execute script
APP.scriptInterpreter.run('path_selectEmuPath');
});
},
// Add App / Games path
addPath: function(){
// Open select path prompt
APP.fileManager.selectPath(function(newPath){
// Append new game folder
APP.settings.data.gamePaths.push(newPath);
// Execute addGamePath script
APP.scriptInterpreter.run('paths_addGamePath');
});
},
// Remove selected index
removeEntry: function(){
APP.scriptInterpreter.run('path_removeGamePath');
},
// Update input label and set selected index on templist
updateInputPath: function(cIndex, pathIndex){
// Set selected index on tempData
APP.temp['cursorIndex'] = cIndex;
APP.temp['selectedPath'] = pathIndex;
// Reset error button class
APP.design.removeErrorClass();
// Update inpput label
APP.design.input.updateButtonLabels({
resetInput: !0,
target: 'LAUNCHER_SETTINGS',
displayButtons: ['ACTION_3', 'ACTION_1'],
buttonLabels: {'ACTION_3': 'removePath', 'ACTION_1': 'back'},
// Bind input actions
callback: function(){
// Delete entry
APP.input.setActionFn('ACTION_3', function(){
APP.design.settingsMenu.paths.removeEntry();
});
// Go back
APP.input.setActionFn('ACTION_1', function(){
APP.design.settingsMenu.renderLeft();
});
APP.input.setActionFn('ARROW_LEFT', function(){
APP.design.settingsMenu.renderLeft();
});
// Next / Prev buttons
APP.input.setActionFn('ARROW_UP', function(){
// Move cursor
APP.design.input.moveCursor('prev');
// Reset error button class
APP.design.removeErrorClass();
});
APP.input.setActionFn('ARROW_DOWN', function(){
// Move cursor
APP.design.input.moveCursor('next');
// Reset error button class
APP.design.removeErrorClass();
});
}
});
},
// Generate game path list
makeGamePath: function(indexBase){
// Variables
var settingsData = APP.settings.data,
res = {html: '', totalItems: parseInt(indexBase + settingsData.gamePaths.length)};
// Check if there's more paths on game list
if (settingsData.gamePaths.length !== 0){
// Process game paths
settingsData.gamePaths.forEach(function(cPath, cIndex){
// Variables
var pathName = APP.path.parse(cPath).base;
// Set HTML
res.html = res.html + '