Skip to content

Commit

Permalink
Add "active" selection for savegame compare
Browse files Browse the repository at this point in the history
  • Loading branch information
jtsage committed Jan 25, 2023
1 parent 482da5d commit 37f2158
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions renderer/renderJS/savegame_ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const selectList = {
inactive : [],
unused : [],
nohub : [],
active : [],
}
const selectCount = {
dlc : 0,
Expand All @@ -29,6 +30,7 @@ const selectCount = {
inactive : 0,
unused : 0,
nohub : 0,
active : 0,
}

function processL10N() { clientGetL10NEntries() }
Expand Down Expand Up @@ -76,6 +78,7 @@ window.mods.receive('fromMain_saveInfo', (modList, savegame, modHubList) => {
selectList.inactive = []
selectList.unused = []
selectList.nohub = []
selectList.active = []

selectCount.isloaded = 0
selectCount.dlc = 0
Expand All @@ -85,6 +88,7 @@ window.mods.receive('fromMain_saveInfo', (modList, savegame, modHubList) => {
selectCount.unused = 0
selectCount.inactive = 0
selectCount.nohub = 0
selectCount.active = 0

if ( savegame.errorList.length > 0 ) {
const errors = []
Expand Down Expand Up @@ -175,6 +179,9 @@ window.mods.receive('fromMain_saveInfo', (modList, savegame, modHubList) => {
if ( thisModDetail.isModHub === false ) {
selectList.nohub.push(`${thisCollection}--${thisUUID}`)
}
if ( thisModDetail.isLoaded === true ) {
selectList.active.push(`${thisCollection}--${thisUUID}`)
}
}

modSetHTML.push(makeLine(thisMod, thisModDetail, savegame.singleFarm))
Expand All @@ -185,6 +192,7 @@ window.mods.receive('fromMain_saveInfo', (modList, savegame, modHubList) => {
selectCount.nohub = selectList.nohub.length
selectCount.inactive = selectList.inactive.length
selectCount.unused = selectList.unused.length
selectCount.active = selectList.active.length

updateCounts()
processL10N()
Expand Down
1 change: 1 addition & 0 deletions renderer/savegame.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ <h2 class="ps-2 mastHead"><l10n name="app_name"></l10n> <l10n class="ver" name="
<span class="input-group-text" id="basic-addon1"><l10n name="select_main"></l10n></span>
<button class="btn btn-outline-primary btn-sm border" onclick="clientSelectMain('unused')" for="check_savegame_unused"><l10n name="savegame_unused"></l10n><span class="small"> [<span class="quantity">0</span>]</span></button>
<button class="btn btn-outline-primary btn-sm border" onclick="clientSelectMain('inactive')" for="check_savegame_inactive"><l10n name="savegame_inactive"></l10n><span class="small"> [<span class="quantity">0</span>]</span></button>
<button class="btn btn-outline-primary btn-sm border" onclick="clientSelectMain('active')" for="check_savegame_active"><l10n name="savegame_isloaded"></l10n><span class="small"> [<span class="quantity">0</span>]</span></button>
<button class="btn btn-outline-primary btn-sm border" onclick="clientSelectMain('nohub')" for="check_savegame_nohub"><l10n name="savegame_nohub"></l10n><span class="small"> [<span class="quantity">0</span>]</span></label>
</div>

Expand Down

0 comments on commit 37f2158

Please sign in to comment.