From d427616532a45f0c02eae09ebebeb6c7cf4b5436 Mon Sep 17 00:00:00 2001 From: "J.T. Sage" Date: Mon, 23 Jan 2023 23:37:21 -0500 Subject: [PATCH 1/6] UI changes, non-working build. --- renderer/find.html | 4 +- renderer/main.html | 92 ++++++++++++++++++++++++++++++++-- renderer/renderJS/assist_ui.js | 44 ++++------------ translations/en.json | 5 +- 4 files changed, 102 insertions(+), 43 deletions(-) diff --git a/renderer/find.html b/renderer/find.html index f21b08ca..378cc57e 100644 --- a/renderer/find.html +++ b/renderer/find.html @@ -36,8 +36,8 @@

- - + +
diff --git a/renderer/main.html b/renderer/main.html index 3f55aefb..03e62a58 100644 --- a/renderer/main.html +++ b/renderer/main.html @@ -100,8 +100,8 @@
-
-
+
+

@@ -122,7 +122,7 @@

-
+
@@ -141,14 +141,96 @@

+
+
+
+ + + +
+
+
+
+ + + + + +
+
+ +
+ +
+
+
+ + + + +
+
+ +
-
+

-
+
0
diff --git a/renderer/renderJS/assist_ui.js b/renderer/renderJS/assist_ui.js index d58c576b..33899b6b 100644 --- a/renderer/renderJS/assist_ui.js +++ b/renderer/renderJS/assist_ui.js @@ -257,39 +257,7 @@ function makeModCollection(id, name, modsRows, website, dlEnabled, tagLine, admi - - - - - ${modsRows.join('')} -
-
-
-
- ${getText('filter_only')} - - -
-
-
-
- - - - - -
-
-
-
- ${getText('select_pick')} - - - -
-
-
-
+ ${modsRows.join('')}
` } @@ -298,7 +266,15 @@ function makeModCollection(id, name, modsRows, website, dlEnabled, tagLine, admi function makeModRow(id, thisMod, badges, modId, metDepend) { const theseBadges = ( metDepend ) ? badges : fsgUtil.badge('warning', 'depend') + badges - return ` + const data_searchString = fsgUtil.escapeSpecial([thisMod.fileDetail.shortName, thisMod.l10n.title, thisMod.modDesc.author].join(' ')) + const data_tags = [] + + const tagRegEx = /"mod_badge_(.+?)"/g + const tagMatch = [...theseBadges.matchAll(tagRegEx)] + + tagMatch.forEach((match) => { data_tags.push(match[1].toLowerCase()) }) + + return ` diff --git a/translations/en.json b/translations/en.json index 1e908144..3b48f2c0 100644 --- a/translations/en.json +++ b/translations/en.json @@ -77,7 +77,7 @@ "mod_badge_broken__title" : "This mod is broken", "mod_badge_broken" : "broken", "mod_badge_folder__title" : "This is a folder", - "mod_badge_folder" : "Folder", + "mod_badge_folder" : "folder", "mod_badge_new__title" : "This file is new since the last scan", "mod_badge_new" : "new", "mod_badge_nomp__title" : "This can't be used in multiplayer", @@ -290,5 +290,6 @@ "folder_up_button__title" : "Move folder up", "folder_down_button__title" : "Move folder down", "folder_bot_button__title" : "Move folder to bottom", - "translate_blurb_tagline" : "Feel free to support the translation effort on" + "translate_blurb_tagline" : "Feel free to support the translation effort on", + "filter_badges" : "Limit to Tags" } \ No newline at end of file From f906a23d88606f97e979de833f81e9094f52af36 Mon Sep 17 00:00:00 2001 From: "J.T. Sage" Date: Tue, 24 Jan 2023 13:56:58 -0500 Subject: [PATCH 2/6] Update badge storage / how they work --- lib/single-mod-checker.js | 18 ++----- modAssist_main.js | 21 ++++++++- renderer/renderJS/assist_ui.js | 85 +++++++++++++++++++++------------- renderer/renderJS/detail_ui.js | 24 +++++----- renderer/renderJS/fsg_util.js | 17 ++++++- test/mod-reader-test.js | 3 +- 6 files changed, 108 insertions(+), 60 deletions(-) diff --git a/lib/single-mod-checker.js b/lib/single-mod-checker.js index 550a4a3e..f93507e1 100644 --- a/lib/single-mod-checker.js +++ b/lib/single-mod-checker.js @@ -187,7 +187,7 @@ class modFileChecker { this.populateL10n() this.populateIcon() - this.badges = this.#getBadges() + this.badgeArray = this.#getBadges() this.issues = this.#populateIssues() this.currentLocal = this.#locale() } @@ -208,7 +208,7 @@ class modFileChecker { md5Sum : this.md5Sum, fileDetail : this.fileDetail, issues : this.issues, - badges : this.badges, + badgeArray : this.badgeArray, l10n : this.l10n, modDesc : {}, uuid : this.uuid, @@ -264,14 +264,6 @@ class modFileChecker { } #getBadges() { - const badgeColor = { - broken : 'danger', - problem : 'warning', - noMP : 'secondary', - PCOnly : 'info', - folder : 'primary', - notmod : 'danger', - } const badges = { broken : false, problem : false, @@ -293,11 +285,11 @@ class modFileChecker { const badgeCollection = [] Object.keys(badges).forEach((badge) => { if ( badges[badge] === true ) { - badgeCollection.push(``) + badgeCollection.push(badge) } }) - return badgeCollection.join('') + return badgeCollection } #isFileNameBad() { @@ -777,7 +769,7 @@ class notModFileChecker { pngTexture : [], } - badges = '' + badgeArray = ['broken', 'notmod'] canNotUse = true currentLocale = null diff --git a/modAssist_main.js b/modAssist_main.js index 6b11eb4b..75c537b1 100644 --- a/modAssist_main.js +++ b/modAssist_main.js @@ -282,9 +282,28 @@ let devControls = false /** Upgrade Cache Version Here */ if ( semverGt('1.0.2', mcStore.get('cache_version'))) { - log.log.warning('Invalid Mod Cache (old), resetting.') + log.log.warning('Invalid Mod Cache (very old), resetting.') maCache.clear() log.log.info('Mod Cache Cleared') +} else if ( semverGt('1.9.3', mcStore.get('cache_version'))) { + log.log.debug('Mod Cache 1.9.3 Update Running') + const oldCache = maCache.store + const tagRegEx = /"mod_badge_(.+?)"/g + + Object.keys(oldCache).forEach((key) => { + if ( typeof oldCache[key].badgeArray === 'undefined' ) { + oldCache[key].badgeArray = [] + + if ( typeof oldCache[key].badges !== 'undefined' ) { + const tagMatch = [...oldCache[key].badges.matchAll(tagRegEx)] + + tagMatch.forEach((match) => { oldCache[key].badgeArray.push(match[1].toLowerCase()) }) + delete oldCache[key].badges + } + } + }) + maCache.store = oldCache + } else { log.log.debug('Mod Cache Version Good') } diff --git a/renderer/renderJS/assist_ui.js b/renderer/renderJS/assist_ui.js index 33899b6b..c32f7eb9 100644 --- a/renderer/renderJS/assist_ui.js +++ b/renderer/renderJS/assist_ui.js @@ -82,11 +82,26 @@ window.mods.receive('fromMain_selectOnlyFilter', (selectMod, filterText) => { }) -let lastLocale = 'en' -let lastQuickLists = {} +let lastLocale = 'en' +let lastQuickLists = {} +let searchStringMap = {} +let searchTagMap = {} window.mods.receive('fromMain_modList', (opts) => { - lastQuickLists = {} + lastQuickLists = {} + searchStringMap = {} + searchTagMap = { + broken : [], + folder : [], + new : [], + nomp : [], + notmod : [], + pconly : [], + problem : [], + recent : [], + update : [], + nonmh : [], + } lastLocale = opts.currentLocale const lastOpenAcc = document.querySelector('.accordion-collapse.show') @@ -106,45 +121,61 @@ window.mods.receive('fromMain_modList', (opts) => { opts.modList[collection].mods.forEach((thisMod) => { try { - const extraBadges = [] - const modId = opts.modHub.list.mods[thisMod.fileDetail.shortName] || null - const modVer = opts.modHub.version[modId] || null + const displayBadges = thisMod.badgeArray || [] + const modId = opts.modHub.list.mods[thisMod.fileDetail.shortName] || null + const modVer = opts.modHub.version[modId] || null + const modColUUID = `${collection}--${thisMod.uuid}` sizeOfFolder += thisMod.fileDetail.fileSize if ( Object.keys(thisMod.modDesc.binds).length > 0 ) { if ( typeof opts.bindConflict[collection][thisMod.fileDetail.shortName] !== 'undefined' ) { - extraBadges.push(fsgUtil.badge('danger', 'keys_bad')) + displayBadges.push('keys_bad') } else { - extraBadges.push(fsgUtil.badge('success', 'keys_ok')) + displayBadges.push('keys_ok') } } if ( modVer !== null && thisMod.modDesc.version !== modVer) { - extraBadges.push(fsgUtil.badge('light', 'update')) + displayBadges.push('update') } if ( opts.newMods.includes(thisMod.md5Sum) && !thisMod.canNotUse ) { - extraBadges.push(fsgUtil.badge('success', 'new')) + displayBadges.push('new') } if ( modId !== null && opts.modHub.list.last.includes(modId) ) { - extraBadges.push(fsgUtil.badge('success', 'recent')) + displayBadges.push('recent') } if ( modId === null ) { - extraBadges.push(fsgUtil.badge('dark', 'nonmh')) + displayBadges.push('nonmh') } - let theseBadges = thisMod.badges + extraBadges.join('') + if ( displayBadges.includes('broken') && displayBadges.includes('notmod') ) { + const brokenIdx = displayBadges.indexOf('broken') + displayBadges.splice(brokenIdx, brokenIdx !== -1 ? 1 : 0) + } - if ( theseBadges.match('mod_badge_broken') && theseBadges.match('mod_badge_notmod') ) { - theseBadges = theseBadges.replace(fsgUtil.badge('danger', 'broken'), '') + if ( ! metDepend(thisMod.modDesc.depend, collection, opts.modList[collection].mods) ) { + displayBadges.unshift('depend') } + searchStringMap[modColUUID] = [ + thisMod.fileDetail.shortName, + thisMod.l10n.title, + thisMod.modDesc.author + ].join(' ') + + displayBadges.forEach((badge) => { + if ( typeof searchTagMap?.[badge]?.push === 'function' ) { + searchTagMap[badge].push(modColUUID) + } + }) + modRows.push(makeModRow( - `${collection}--${thisMod.uuid}`, + modColUUID, thisMod, - theseBadges, - modId, - metDepend(thisMod.modDesc.depend, collection, opts.modList[collection].mods) + displayBadges, + modId )) + } catch (e) { window.log.notice(`Error building mod row: ${e}`, 'main') } @@ -263,18 +294,10 @@ function makeModCollection(id, name, modsRows, website, dlEnabled, tagLine, admi } -function makeModRow(id, thisMod, badges, modId, metDepend) { - const theseBadges = ( metDepend ) ? badges : fsgUtil.badge('warning', 'depend') + badges - - const data_searchString = fsgUtil.escapeSpecial([thisMod.fileDetail.shortName, thisMod.l10n.title, thisMod.modDesc.author].join(' ')) - const data_tags = [] - - const tagRegEx = /"mod_badge_(.+?)"/g - const tagMatch = [...theseBadges.matchAll(tagRegEx)] - - tagMatch.forEach((match) => { data_tags.push(match[1].toLowerCase()) }) +function makeModRow(id, thisMod, badges, modId) { + const badgeHTML = Array.from(badges, (badge) => fsgUtil.badge(false, badge)) - return ` + return ` @@ -282,7 +305,7 @@ function makeModRow(id, thisMod, badges, modId, metDepend) { -
${thisMod.fileDetail.shortName}
${fsgUtil.escapeSpecial(thisMod.l10n.title)} - ${fsgUtil.escapeSpecial(thisMod.modDesc.author)}
${theseBadges}
+
${thisMod.fileDetail.shortName}
${fsgUtil.escapeSpecial(thisMod.l10n.title)} - ${fsgUtil.escapeSpecial(thisMod.modDesc.author)}
${badgeHTML.join(' ')}
${fsgUtil.escapeSpecial(thisMod.modDesc.version)}
${( thisMod.fileDetail.fileSize > 0 ) ? fsgUtil.bytesToHR(thisMod.fileDetail.fileSize, lastLocale) : ''} diff --git a/renderer/renderJS/detail_ui.js b/renderer/renderJS/detail_ui.js index c6c40767..37ce5dce 100644 --- a/renderer/renderJS/detail_ui.js +++ b/renderer/renderJS/detail_ui.js @@ -106,24 +106,24 @@ window.mods.receive('fromMain_modRecord', (modRecord, modhubRecord, bindConflict fsgUtil.byId('problems').innerHTML = `${problems.join('')}
` } - const extraBadges = [] + const displayBadges = modRecord.badgeArray || [] if ( Object.keys(modRecord.modDesc.binds).length > 0 ) { if ( typeof bindConflict[modRecord.currentCollection][modRecord.fileDetail.shortName] !== 'undefined' ) { - extraBadges.push(fsgUtil.badge('danger', 'keys_bad')) + displayBadges.push('keys_bad') } else { - extraBadges.push(fsgUtil.badge('success', 'keys_ok')) + displayBadges.push('keys_ok') } } if ( modhubRecord[0] !== null && modhubRecord[1] !== null && modRecord.modDesc.version !== modhubRecord[1]) { - extraBadges.push(fsgUtil.badge('light', 'update')) + displayBadges.push('update') } if ( modhubRecord[2] ) { - extraBadges.push(fsgUtil.badge('success', 'recent')) + displayBadges.push('recent') } if ( modhubRecord[0] === null ) { - extraBadges.push(fsgUtil.badge('dark', 'nonmh')) + displayBadges.push('nonmh') fsgUtil.byId('modhub_link').classList.add('d-none') } else { const modhubLink = `https://www.farming-simulator.com/mod.php?mod_id=${modhubRecord[0]}` @@ -131,16 +131,16 @@ window.mods.receive('fromMain_modRecord', (modRecord, modhubRecord, bindConflict } if ( typeof modRecord.modDesc.depend !== 'undefined' && modRecord.modDesc.depend.length > 0 ) { - extraBadges.push(fsgUtil.badge('success', 'depend_flag')) + displayBadges.push('depend_flag') } - extraBadges.push(modRecord.badges) - let theseBadges = extraBadges.join('') - - if ( theseBadges.match('mod_badge_broken') && theseBadges.match('mod_badge_notmod') ) { - theseBadges = theseBadges.replace(fsgUtil.badge('danger', 'broken'), '') + if ( displayBadges.includes('broken') && displayBadges.includes('notmod') ) { + const brokenIdx = displayBadges.indexOf('broken') + displayBadges.splice(brokenIdx, brokenIdx !== -1 ? 1 : 0) } + const theseBadges = Array.from(displayBadges, (badge) => fsgUtil.badge(false, badge)).join(' ') + textOrHide( 'badges', theseBadges, diff --git a/renderer/renderJS/fsg_util.js b/renderer/renderJS/fsg_util.js index b1819f29..bb69e0fc 100644 --- a/renderer/renderJS/fsg_util.js +++ b/renderer/renderJS/fsg_util.js @@ -101,5 +101,20 @@ const fsgUtil = { .replaceAll(/"/g, '"') .replaceAll(/'/g, ''') }, - badge : (color, name, fullName = false) => `${getText(`${(fullName)?'':'mod_badge_'}${name}`)}`, + badgeDefault : { + broken : 'danger', + problem : 'warning', + nomp : 'secondary', + pconly : 'info', + folder : 'primary', + notmod : 'danger', + update : 'light', + keys_bad : 'danger', + keys_ok : 'success', + new : 'success', + recent : 'success', + nonmh : 'dark', + depend : 'warning', + }, + badge : (color, name, fullName = false) => `${getText(`${(fullName)?'':'mod_badge_'}${name}`)}`, } diff --git a/test/mod-reader-test.js b/test/mod-reader-test.js index 0e98f721..c8ff7714 100644 --- a/test/mod-reader-test.js +++ b/test/mod-reader-test.js @@ -40,10 +40,9 @@ folderContents.forEach((thisFile) => { logger, () => { return 'en'} ) - const badgeNames = Array.from(thisMod.badges.matchAll(/"mod_badge_(.+?)"/g), (m) => `${m[1]}`) console.log(` Giants HASH : ${thisMod.giantsHash}`) console.log(` Issues : ${thisMod.issues.join(', ')}`) - console.log(` Badges : ${badgeNames.join(', ')}`) + console.log(` Badges : ${thisMod.badgeArray.join(', ')}`) console.log(` Extra : ${thisMod.fileDetail.extraFiles.join(', ')}`) } catch (e) { console.log(` Unable to read ${thisFile} :: ${e}`) From 7a27ca2eca4b82564d3432e75e2d06e95b8f7619 Mon Sep 17 00:00:00 2001 From: "J.T. Sage" Date: Tue, 24 Jan 2023 16:41:49 -0500 Subject: [PATCH 3/6] Search, filter tags, broken/nonmod buttons working. Next is selection. --- renderer/main.html | 22 ++------ renderer/renderJS/assist_ui.js | 12 ++--- renderer/renderJS/select_lib_ui.js | 82 +++++++++++++++++++++++------- translations/en.json | 3 +- 4 files changed, 76 insertions(+), 43 deletions(-) diff --git a/renderer/main.html b/renderer/main.html index 03e62a58..2e6dffcd 100644 --- a/renderer/main.html +++ b/renderer/main.html @@ -165,8 +165,10 @@

0 -

@@ -208,20 +210,6 @@

-
diff --git a/renderer/renderJS/assist_ui.js b/renderer/renderJS/assist_ui.js index c32f7eb9..ecbb698a 100644 --- a/renderer/renderJS/assist_ui.js +++ b/renderer/renderJS/assist_ui.js @@ -161,7 +161,7 @@ window.mods.receive('fromMain_modList', (opts) => { thisMod.fileDetail.shortName, thisMod.l10n.title, thisMod.modDesc.author - ].join(' ') + ].join(' ').toLowerCase() displayBadges.forEach((badge) => { if ( typeof searchTagMap?.[badge]?.push === 'function' ) { @@ -314,10 +314,8 @@ function makeModRow(id, thisMod, badges, modId) { } -function clientClearInput(id) { - const filterId = id.replace('__filter', '') - - select_lib.filter(filterId, '') +function clientClearInput() { + select_lib.filter(null, '') } function clientBatchOperation(mode) { @@ -367,8 +365,8 @@ function clientOpenFarmSim() { window.mods.startFarmSim() } -window.addEventListener('hide.bs.collapse', () => { select_lib.clear_all() }) -window.addEventListener('show.bs.collapse', () => { select_lib.clear_all() }) +// window.addEventListener('hide.bs.collapse', () => { select_lib.clear_all() }) +// window.addEventListener('show.bs.collapse', () => { select_lib.clear_all() }) const giantsLED = { filters : [{ vendorId : fsgUtil.led.vendor, productId : fsgUtil.led.product }] } diff --git a/renderer/renderJS/select_lib_ui.js b/renderer/renderJS/select_lib_ui.js index 200de599..81c62a69 100644 --- a/renderer/renderJS/select_lib_ui.js +++ b/renderer/renderJS/select_lib_ui.js @@ -7,7 +7,7 @@ // Selection library, split for readability of main ui script /* exported select_lib */ -/* global fsgUtil */ +/* global fsgUtil searchStringMap searchTagMap */ const select_lib = { last_alt_select : null, @@ -29,7 +29,11 @@ const select_lib = { }) if ( openTable !== false ) { select_lib.open_table(openTable) } }, - clear_range : () => { select_lib.last_select_mod = null; select_lib.last_select_table = null; select_lib.update_color() }, + clear_range : () => { + select_lib.last_select_mod = null + select_lib.last_select_table = null + select_lib.update_color() + }, click_alt : (modID) => { select_lib.last_alt_select = modID const moveButtons = fsgUtil.byId('moveButtonsInt').querySelectorAll('button') @@ -100,7 +104,7 @@ const select_lib = { fsgUtil.byId('select_quantity').innerHTML = newCount }, click_only : (tableID, checkList) => { - fsgUtil.byId(`${tableID}__filter`).value = '' + fsgUtil.byId('filter_input').value = '' select_lib.get_checks(tableID).forEach((check) => { const modRow = check.parentElement.parentElement check.checked = checkList.includes(check.id) @@ -134,10 +138,12 @@ const select_lib = { const allMods = fsgUtil.query('.mod-row') const moveButtons = fsgUtil.byId('moveButtonsInt').querySelectorAll('button') const allModChecks = fsgUtil.query('.mod-row-checkbox') - const filterBoxes = fsgUtil.query('.mod-row-filter') + const filterInput = fsgUtil.byId('filter_input') + const filterTags = fsgUtil.query('.filter_tag_buttons') const filterChecks = fsgUtil.query('.mod-row-filter_check') - filterBoxes.forEach( (thisBox) => { thisBox.value = '' }) + filterInput.value = '' + filterTags.forEach( (thisCheck) => { thisCheck.checked = false }) allModChecks.forEach((thisCheck) => { thisCheck.checked = false }) filterChecks.forEach((thisCheck) => { thisCheck.checked = true }) moveButtons.forEach( (button) => { button.classList.add('disabled') }) @@ -178,33 +184,73 @@ const select_lib = { }, filter : (table, forceValue = false) => { if ( forceValue !== false ) { - fsgUtil.byId(`${table}__filter`).value = forceValue + fsgUtil.byId('filter_input').value = forceValue } - const theseMods = fsgUtil.byId(table).querySelectorAll('.mod-row') - const rawSearchTerm = fsgUtil.byId(`${table}__filter`).value.toLowerCase() - const showNonMods = fsgUtil.byId(`${table}__show_non_mod`).checked - const showBroken = fsgUtil.byId(`${table}__show_broken`).checked + + const tagLimit = fsgUtil.byId('filter__tags').querySelectorAll(':checked') + const theseMods = fsgUtil.byId('mod-collections').querySelectorAll('.mod-row') + const rawSearchTerm = fsgUtil.byId('filter_input').value.toLowerCase() + const showNonMods = fsgUtil.byId('filter__show_non_mod').checked + const showBroken = fsgUtil.byId('filter__show_broken').checked const inverseSearch = rawSearchTerm.startsWith('!') const searchTerm = ( inverseSearch ) ? rawSearchTerm.substring(1) : rawSearchTerm - fsgUtil.byId(`${table}__filter_clear`).classList[(rawSearchTerm === '') ? 'add' : 'remove']('d-none') - + fsgUtil.byId('tag_filter_count').innerHTML = tagLimit.length + fsgUtil.byId('filter_clear').classList[(rawSearchTerm === '') ? 'add' : 'remove']('d-none') + + const shownByTags_sets = [] + let showOnlyTags = false + + if ( tagLimit.length > 0 ) { + tagLimit.forEach((element) => { + const thisTag = element.id.split('__')[1] + shownByTags_sets.push(searchTagMap[thisTag]) + }) + + showOnlyTags = select_lib.setIntersection(shownByTags_sets) + } + theseMods.forEach((modRow) => { + const modRowUUID = modRow.id + modRow.classList.remove('d-none') if ( modRow.querySelector('.mod-row-checkbox').checked ) { return } - const modBadges = modRow.querySelector('.issue_badges').innerHTML - - if ( !showBroken && modBadges.match('mod_badge_broken') ) { modRow.classList.add('d-none'); return } - if ( !showNonMods && modBadges.match('mod_badge_notmod') ) { modRow.classList.add('d-none'); return } + if ( !showBroken && searchTagMap.broken.includes(modRowUUID) ) { modRow.classList.add('d-none'); return } + if ( !showNonMods && searchTagMap.notmod.includes(modRowUUID) ) { modRow.classList.add('d-none'); return } - if ( searchTerm.length < 2 ) { modRow.classList.remove('d-none'); return } + if ( showOnlyTags !== false ) { + if ( ! showOnlyTags.has(modRowUUID) ) { modRow.classList.add('d-none'); return } + } + + if ( searchTerm.length < 2 ) { return } - const modText = modRow.querySelector('td:nth-child(3)').innerText.toLowerCase() + const modText = searchStringMap[modRowUUID] const showMe = ( inverseSearch ) ? !modText.match(searchTerm) : modText.match(searchTerm) modRow.classList[(showMe?'remove':'add')]('d-none') }) }, + tag_reset : () => { + const filterTags = fsgUtil.query('.filter_tag_buttons') + + filterTags.forEach( (thisCheck) => { thisCheck.checked = false }) + select_lib.filter() + }, + setIntersection : (sets) => { + sets.sort((a, b) => b.length - a.length) + + const smallestSet = sets[sets.length-1] + const returnSet = new Set(sets[sets.length-1]) + + if ( sets.length === 1 ) { return returnSet } + + smallestSet.forEach((thisMod) => { + for (let i = 0; i < sets.length-1; i++ ) { + if ( ! sets[i].includes(thisMod) ) { returnSet.delete(thisMod) } + } + }) + return returnSet + }, } \ No newline at end of file diff --git a/translations/en.json b/translations/en.json index 3b48f2c0..685fdcb5 100644 --- a/translations/en.json +++ b/translations/en.json @@ -291,5 +291,6 @@ "folder_down_button__title" : "Move folder down", "folder_bot_button__title" : "Move folder to bottom", "translate_blurb_tagline" : "Feel free to support the translation effort on", - "filter_badges" : "Limit to Tags" + "filter_badges" : "Limit to Tags", + "filter_tag_reset" : "RESET" } \ No newline at end of file From 482da5d3ed63c5b35da40bd7a472b39a2a67b04a Mon Sep 17 00:00:00 2001 From: "J.T. Sage" Date: Tue, 24 Jan 2023 20:27:38 -0500 Subject: [PATCH 4/6] More visuals. Fix selection. Add pull down to hide specific tags --- renderer/main.html | 49 +++++++++++++- renderer/renderJS/assist_ui.js | 16 +++-- renderer/renderJS/fsg_util.js | 2 +- renderer/renderJS/select_lib_ui.js | 103 ++++++++++++++++++++--------- translations/de.json | 10 +-- translations/en.json | 8 +-- translations/es.json | 10 +-- translations/fr.json | 10 +-- translations/nl.json | 10 +-- translations/pl.json | 10 +-- translations/pt.json | 10 +-- translations/ru.json | 10 +-- 12 files changed, 166 insertions(+), 82 deletions(-) diff --git a/renderer/main.html b/renderer/main.html index 2e6dffcd..e764a190 100644 --- a/renderer/main.html +++ b/renderer/main.html @@ -64,7 +64,7 @@ vertical-align: middle; } td.folder-icon { - width: 66px; + width: 81px; vertical-align: middle; } td.folder-name { @@ -149,7 +149,7 @@

-
+ + +
+
+
From 37f25f9be5b9cb0b2b28ea55e2ad0d7d516339bf Mon Sep 17 00:00:00 2001 From: "J.T. Sage" Date: Tue, 24 Jan 2023 20:57:57 -0500 Subject: [PATCH 6/6] Fix window refresh with remembered search. Bump to test version, update changelog --- package.json | 2 +- renderer/a_changelog.html | 5 +++++ renderer/main.html | 9 --------- renderer/renderJS/assist_ui.js | 2 +- 4 files changed, 7 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index a207a861..3aa31993 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fsg-mod-assistant", - "version": "1.9.2", + "version": "1.9.9", "description": "FSG Farm Sim Mod Assistant", "main": "modAssist_main.js", "homepage": "https://github.com/FSGModding/FSG_Mod_Assistant#readme", diff --git a/renderer/a_changelog.html b/renderer/a_changelog.html index 2dbe442a..35c0cbfc 100644 --- a/renderer/a_changelog.html +++ b/renderer/a_changelog.html @@ -42,6 +42,11 @@

+

2.0.0

+
    +
  • Rework mod filtering to a unified interface
  • +
  • FIX: Add "select active" mods to savegame compare
  • +

1.9.2

  • FIX: Cache cleaning could happen "invisibly", add a timeout
  • diff --git a/renderer/main.html b/renderer/main.html index e764a190..5564215a 100644 --- a/renderer/main.html +++ b/renderer/main.html @@ -149,15 +149,6 @@

-