Skip to content

Commit

Permalink
Add: game launch arguments, Add: non-modhub flag in savegame check, b…
Browse files Browse the repository at this point in the history
…ump to 0.10.2
  • Loading branch information
jtsage committed Oct 31, 2022
1 parent 6b2d2ce commit e2799e5
Show file tree
Hide file tree
Showing 13 changed files with 67 additions and 20 deletions.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
"MODNAME",
"modsdirectoryoverride",
"modtiny",
"nohub",
"nomp",
"nonmh",
"norecord",
Expand Down
5 changes: 3 additions & 2 deletions modAssist_main.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ const settingsSchema = {
game_settings : { type : 'string', default : path.join(pathBestGuess, 'gameSettings.xml') },
game_path : { type : 'string', default : foundGame },
cache_version : { type : 'string', default : '0.0.0' },
game_args : { type : 'string', default : '' },
}

const Store = require('electron-store')
Expand Down Expand Up @@ -608,7 +609,7 @@ ipcMain.on('toMain_startFarmSim', () => {
if ( mcStore.get('game_path') !== '' ) {
const cp = require('child_process')
const progPath = mcStore.get('game_path')
const child = cp.spawn(progPath, { detached : true, stdio : ['ignore', 'ignore', 'ignore'] })
const child = cp.spawn(progPath, mcStore.get('game_args').split(' '), { detached : true, stdio : ['ignore', 'ignore', 'ignore'] })
child.unref()
} else {
const dialogOpts = {
Expand Down Expand Up @@ -711,7 +712,7 @@ function openSaveGame(zipMode = false) {
if ( !result.canceled ) {
try {
const thisSavegame = new saveFileChecker(result.filePaths[0], !zipMode, log)
windows.save.webContents.send('fromMain_saveInfo', modList, thisSavegame)
windows.save.webContents.send('fromMain_saveInfo', modList, thisSavegame, modHubList)
} catch (e) {
log.log.danger(`Load failed: ${e}`, 'savegame')
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fsg-mod-assistant",
"version": "0.10.1",
"version": "0.10.2",
"description": "FSG Farm Sim Mod Assistant",
"main": "modAssist_main.js",
"homepage": "https://github.com/FSGModding/FSG_Mod_Assistant#readme",
Expand Down
21 changes: 15 additions & 6 deletions renderer/prefs.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,22 @@ <h2 class="ps-2 mastHead"><l10n name="app_name"></l10n> <l10n class="ver" name="
</div>

<div class="row mx-4 mb-3 pb-2 border-bottom">
<div class="col-8">
<h5><l10n name="user_pref_title_game_path"></l10n></h5>
<p class="ps-2"><l10n name="user_pref_blurb_game_path"></l10n></p>
<em class="ps-2 text-monospace small" id="game_path">TODO: FIX THIS</em>
<div class="row ms-2">
<div class="col-8">
<h5><l10n name="user_pref_title_game_path"></l10n></h5>
<p class="ps-2"><l10n name="user_pref_blurb_game_path"></l10n></p>
<em class="ps-2 text-monospace small" id="game_path">TODO: FIX THIS</em>
</div>
<div class="col-4">
<div class="d-block btn btn-success btn-sm w-100 mt-5 mx-auto mb-3" onclick="window.mods.setGamePath()"><l10n name="user_pref_button_game_path"></l10n></div>
</div>
</div>
<div class="col-4">
<div class="d-block btn btn-success btn-sm w-100 mt-5 mx-auto mb-3" onclick="window.mods.setGamePath()"><l10n name="user_pref_button_game_path"></l10n></div>
<div class="row ms-2 mt-2">
<label for="game_args" class="col-6 col-form-label"><l10n name="user_pref_setting_game_args"></l10n></label>
<div class="col-6">
<input onchange="clientSetPref('game_args')" type="text" class="form-control form-control-sm" id="game_args">
</div>
<div class="col-12 text-end"><small class="text-muted"><l10n name="user_pref_setting_game_args_example"></l10n></small> </div>
</div>
</div>

Expand Down
10 changes: 8 additions & 2 deletions renderer/renderJS/savegame_ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ window.mods.receive('fromMain_collectionName', (collection, modList) => {
processL10N()
})

window.mods.receive('fromMain_saveInfo', (modList, savegame) => {
console.log(savegame.errorList)
window.mods.receive('fromMain_saveInfo', (modList, savegame, modHubList) => {
console.log(modHubList)
const fullModSet = new Set()
const haveModSet = {}
const modSetHTML = []
Expand Down Expand Up @@ -87,8 +87,10 @@ window.mods.receive('fromMain_saveInfo', (modList, savegame) => {
isDLC : false,
usedBy : null,
versionMismatch : false,
isModHub : typeof modHubList.mods[thisMod] !== 'undefined',
}

console.log(thisMod, thisModDetail.isModHub)
if ( thisMod.startsWith('pdlc_')) {
thisModDetail.isDLC = true
thisModDetail.isPresent = true
Expand Down Expand Up @@ -164,6 +166,9 @@ function makeLine(name, mod, singleFarm) {
}
thisHTML.push('</div>')

if ( !mod.isModHub && !mod.isDLC ) {
thisHTML.push(fsgUtil.badge('info bg-gradient rounded-1 ms-1', 'savegame_nohub', true))
}
if ( mod.isDLC ) {
thisHTML.push(fsgUtil.badge('info bg-gradient rounded-1 ms-1', 'savegame_dlc', true))
}
Expand Down Expand Up @@ -199,6 +204,7 @@ function clientChangeFilter() {
isused : false,
inactive : false,
unused : false,
nohub : false,
}

if ( filtersActive === 0 ) {
Expand Down
2 changes: 2 additions & 0 deletions renderer/savegame.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ <h2 class="ps-2 mastHead"><l10n name="app_name"></l10n> <l10n class="ver" name="
<label class="btn btn-outline-success btn-sm border" for="check_savegame_unused"><l10n name="savegame_unused"></l10n></label>
<input type="checkbox" class="btn-check filter_only" id="check_savegame_inactive" onchange="clientChangeFilter()" autocomplete="off">
<label class="btn btn-outline-success btn-sm border" for="check_savegame_inactive"><l10n name="savegame_inactive"></l10n></label>
<input type="checkbox" class="btn-check filter_only" id="check_savegame_nohub" onchange="clientChangeFilter()" autocomplete="off">
<label class="btn btn-outline-success btn-sm border" for="check_savegame_nohub"><l10n name="savegame_nohub"></l10n></label>
</div>

<div class="list-group mx-2 my-3" id="modList"></div>
Expand Down
6 changes: 5 additions & 1 deletion translations/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -203,5 +203,9 @@
"savegame_unused__title": "Diese Mod wurde nicht im Spiel gekauft",
"savegame_error": "Fehler im Speicherspiel gefunden",
"savegame_unreadable": "Datei konnte nicht gelesen werden:",
"savegame_parse_error": "Datei konnte nicht geparst werden:"
"savegame_parse_error": "Datei konnte nicht geparst werden:",
"user_pref_setting_game_args": "Spiel-Argumente",
"user_pref_setting_game_args_example": "(e.g. <em>-cheats -skipStartVideos -scriptDebug -autoStartSavegameId ##</em>)",
"savegame_nohub": "Non-ModHub",
"savegmae_nohub__title": "Diese Mod ist nicht im Modhub des Spiels enthalten"
}
6 changes: 5 additions & 1 deletion translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -203,5 +203,9 @@
"savegame_unused__title" : "This mod has not been purchased in-game",
"savegame_error" : "Errors found with savegame",
"savegame_unreadable" : "Could not read file:",
"savegame_parse_error" : "Could not parse file:"
"savegame_parse_error" : "Could not parse file:",
"user_pref_setting_game_args" : "Game Arguments",
"user_pref_setting_game_args_example" : "(e.g. <em>-cheats -skipStartVideos -scriptDebug -autoStartSavegameId ##</em>)",
"savegame_nohub" : "Non-ModHub",
"savegmae_nohub__title" : "This mod is not on the in-game modhub"
}
6 changes: 5 additions & 1 deletion translations/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -203,5 +203,9 @@
"savegame_unused__title": "Este mod no ha sido comprado en el juego",
"savegame_error": "Errores encontrados en la partida guardada",
"savegame_unreadable": "No se pudo leer el archivo:",
"savegame_parse_error": "No se pudo analizar el archivo:"
"savegame_parse_error": "No se pudo analizar el archivo:",
"user_pref_setting_game_args": "Argumentos del juego",
"user_pref_setting_game_args_example": "(e.g. <em>-cheats -skipStartVideos -scriptDebug -autoStartSavegameId ##</em>)",
"savegame_nohub": "No-ModHub",
"savegmae_nohub__title": "Este mod no está en el modhub del juego"
}
6 changes: 5 additions & 1 deletion translations/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -203,5 +203,9 @@
"savegame_unused__title": "Ce mod n'a pas été acheté dans le jeu",
"savegame_error": "Erreurs trouvées avec le jeu de sauvegarde",
"savegame_unreadable": "Impossible de lire le fichier :",
"savegame_parse_error": "Impossible d'analyser le fichier :"
"savegame_parse_error": "Impossible d'analyser le fichier :",
"user_pref_setting_game_args": "Arguments de jeu",
"user_pref_setting_game_args_example": "(e.g. <em>-cheats -skipStartVideos -scriptDebug -autoStartSavegameId ##</em>)",
"savegame_nohub": "Non-ModHub",
"savegmae_nohub__title": "Ce mod n'est pas sur le modhub du jeu"
}
6 changes: 5 additions & 1 deletion translations/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -203,5 +203,9 @@
"savegame_unused__title": "Deze mod is niet gekocht in het spel",
"savegame_error": "Fouten gevonden met savegame",
"savegame_unreadable": "Kon bestand niet lezen:",
"savegame_parse_error": "Kon bestand niet parsen:"
"savegame_parse_error": "Kon bestand niet parsen:",
"user_pref_setting_game_args": "Spelargumenten",
"user_pref_setting_game_args_example": "(e.g. <em>-cheats -skipStartVideos -scriptDebug -autoStartSavegameId ##</em>)",
"savegame_nohub": "Non-ModHub",
"savegmae_nohub__title": "Deze mod staat niet op de in-game modhub."
}
8 changes: 6 additions & 2 deletions translations/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -203,5 +203,9 @@
"savegame_unused__title": "Ten mod nie został zakupiony w grze",
"savegame_error": "Błędy znalezione przy zapisie gry",
"savegame_unreadable": "Nie można odczytać pliku:",
"savegame_parse_error": "Nie można przetworzyć pliku:"
}
"savegame_parse_error": "Nie można przetworzyć pliku:",
"user_pref_setting_game_args": "Argumenty za grą",
"user_pref_setting_game_args_example": "(e.g. <em>-cheats -skipStartVideos -scriptDebug -autoStartSavegameId ##</em>)",
"savegame_nohub": "Non-ModHub",
"savegmae_nohub__title": "Tego moda nie ma na modhubie w grze"
}
8 changes: 6 additions & 2 deletions translations/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -203,5 +203,9 @@
"savegame_unused__title": "Этот мод не был приобретен в игре",
"savegame_error": "Найдены ошибки при сохранении игры",
"savegame_unreadable": "Не удалось прочитать файл:",
"savegame_parse_error": "Не удалось разобрать файл:"
}
"savegame_parse_error": "Не удалось разобрать файл:",
"user_pref_setting_game_args": "Аргументы игры",
"user_pref_setting_game_args_example": "(e.g. <em>-cheats -skipStartVideos -scriptDebug -autoStartSavegameId ##</em>)",
"savegame_nohub": "Non-ModHub",
"savegmae_nohub__title": "Этого мода нет на внутриигровом модхабе"
}

0 comments on commit e2799e5

Please sign in to comment.