Skip to content

Commit

Permalink
Config from diferent obj
Browse files Browse the repository at this point in the history
  • Loading branch information
ran-j committed Nov 3, 2020
1 parent f93aa35 commit e867c52
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@ const defaultsConfig = {

var config = localStorage.getItem('config') ? JSON.parse(localStorage.getItem('config')) : defaultsConfig

var gameConfigPath = localStorage.getItem('gameConfigPath') ? JSON.parse(localStorage.getItem('gameConfigPath')) : {}

var app = new Vue({
el: '#app',
data: {
dir: './tmp',
gamesListMeta: [],
gameList: [], // { name: '', image: '', path: '', filename: '', configPath: '' }
gameList: [], // { name: '', image: '', path: '', filename: '', configPath: '', region: '' }
apiKey: secrets.apiKey,
regionTypes: ['SLUS', 'SLES'],
regionTyeps2: ['SCUS'],
Expand All @@ -46,11 +48,11 @@ var app = new Vue({
remote.getCurrentWindow().hide()
},
focusApp () {
remote.getCurrentWindow().show()
var win = remote.getCurrentWindow();
win.setAlwaysOnTop(true);
win.focus();
win.setAlwaysOnTop(false);
remote.getCurrentWindow().show()
console.log("Focus");
},
clearTemp() {
Expand Down Expand Up @@ -344,9 +346,11 @@ var app = new Vue({
}).then((result) => {
if (result.isConfirmed) {
let command = `"${config.pcsx2Path}" "${path.join(gameObj.path, gameObj.filename)}" ${config.parans}`
if(gameObj.configPath) {
command += ` --cfgpath="${gameObj.configPath}"`

if(gameConfigPath[gameObj.region]) {
command += ` --cfgpath="${gameConfigPath[gameObj.region]}"`
}

console.log("Running:"+ command )

this.showLoadingEmulator()
Expand Down Expand Up @@ -394,6 +398,8 @@ var app = new Vue({
const cfgpath = document.getElementById("cfgpath").value
if(cfgpath) {
this.gameList[index].configPath = cfgpath
gameConfigPath[gameObj.region] = cfgpath
localStorage.setItem('gameConfigPath', JSON.stringify(gameConfigPath))
Swal.fire(
'Success!',
'Saved',
Expand Down

0 comments on commit e867c52

Please # to comment.