diff --git a/modAssist_main.js b/modAssist_main.js index 127262a7..ec5839ee 100644 --- a/modAssist_main.js +++ b/modAssist_main.js @@ -169,6 +169,12 @@ let foldersDirty = true let firstMin = true let gameSettings = mcStore.get('game_settings') + +if ( ! gameSettings.endsWith('.xml') ) { + gameSettings = path.join(pathBestGuess, 'gameSettings.xml') + mcStore.set('game_settings', gameSettings) +} + let gameSettingsXML = null let overrideFolder = null let overrideIndex = '999' @@ -693,7 +699,6 @@ ipcMain.on('toMain_setGamePath', (event) => { }).then((result) => { if ( ! result.canceled ) { mcStore.set('game_path', result.filePaths[0]) - gameSettings = result.filePaths[0] parseSettings() refreshClientModList() event.sender.send( 'fromMain_allSettings', mcStore.store ) @@ -800,6 +805,12 @@ function modIdsToRecords(mods) { /** Business Functions */ function parseSettings(newSetting = false) { + if ( ! gameSettings.endsWith('.xml') ) { + log.log.danger(`Game settings is not an xml file ${gameSettings}, fixing`, 'game-settings') + gameSettings = path.join(pathBestGuess, 'gameSettings.xml') + mcStore.set('game_settings', gameSettings) + } + let XMLString = '' const XMLParser = new fxml.XMLParser({ commentPropName : '#comment', diff --git a/package.json b/package.json index ef7b5a61..02a4e57f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fsg-mod-assistant", - "version": "1.0.0", + "version": "1.0.1", "description": "FSG Farm Sim Mod Assistant", "main": "modAssist_main.js", "homepage": "https://github.com/FSGModding/FSG_Mod_Assistant#readme",