Skip to content
This repository has been archived by the owner on Jun 25, 2024. It is now read-only.

Commit

Permalink
Add some more detail on the detail screen. In support of "actions" ev…
Browse files Browse the repository at this point in the history
…entually.
  • Loading branch information
jtsage committed May 31, 2021
1 parent 9da6602 commit 2724127
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 6 deletions.
3 changes: 3 additions & 0 deletions lib/mod-checker.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,9 @@ module.exports = class modFileSlurp {
return Array.from(this.activeGames).sort((a, b) => a - b)
})
}
get activeArray() {
return Array.from(this.activeGames).sort((a, b) => a - b)
}

#search(options = {} ) {
const returnList = []
Expand Down
3 changes: 3 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -366,11 +366,14 @@ function openDetailWindow(thisModRecord) {

detailWindow.webContents.on('did-finish-load', async (event) => {
const sendData = {
total_games : modList.activeArray,
title : thisModRecord.title,
version : thisModRecord.mod_version,
filesize : thisModRecord.fileSizeString,
active_games : thisModRecord.activeGames,
used_games : thisModRecord.usedGames,
active_game : thisModRecord.activeGame,
used_game : thisModRecord.usedGame,
has_scripts : thisModRecord.hasScripts,
description : thisModRecord.descDescription,
}
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": "fs19-mod-checker",
"version": "1.9.12",
"version": "1.9.13",
"description": "FS19 Mod Folder Checker",
"main": "main.js",
"homepage": "https://github.com/jtsage/FS19_Mod_Checker#readme",
Expand Down
7 changes: 4 additions & 3 deletions renderer/detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,13 @@ <h3 class="text-center my-3" id="title"></h3>
<table class="table">
<tr><th class="i18n" data-i18n="header_mod_version"></th><td class="text-end" id="version"></td></tr>
<tr><th class="i18n" data-i18n="header_mod_size"></th><td class="text-end" id="filesize"></td></tr>
<tr><th class="i18n" data-i18n="header_mod_active_games"></th><td class="text-end" id="active_games"></td></tr>
<tr><th class="i18n" data-i18n="header_mod_used_games"></th><td class="text-end" id="used_games"></td></tr>
<tr><th class="i18n" data-i18n="header_mod_has_scripts"></th><td class="text-center" id="has_scripts"></td></tr>
</table>
</table>
</div>
</div>
<div class="mb-3">
<table class="table table-bordered" id="used_active_table"></table>
</div>
<div style="white-space: pre-wrap" class="px-5" id="description"></div>
</div>

Expand Down
9 changes: 7 additions & 2 deletions renderer/preload-detail.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,15 @@ ipcRenderer.on('mod-record', ( event, modDetails ) => {
byId('title').innerHTML = modDetails.title
byId('version').innerHTML = modDetails.version
byId('filesize').innerHTML = modDetails.filesize
byId('active_games').innerHTML = modDetails.active_games
byId('used_games').innerHTML = modDetails.used_games
byId('has_scripts').innerHTML = ((modDetails.has_scripts) ? iconGreenCheckMark : iconRedX)
byId('description').innerHTML = modDetails.description

const row_legend = modDetails.total_games.map((thisGame) => { return `<td class="text-center fw-bold">${thisGame}</td>`})
const row_active = modDetails.total_games.map((thisGame) => { return `<td class="${(modDetails.active_game[thisGame])?'bg-success':'bg-danger'}">&nbsp;</td>`})
const row_used = modDetails.total_games.map((thisGame) => { return `<td class="${(modDetails.used_game[thisGame])?'bg-success':'bg-danger'}">&nbsp;</td>`})

byId('used_active_table').innerHTML = `<tr><th class="i18n" data-i18n="active_used_table_savegame"></th>${row_legend.join('')}</tr><tr><th class="i18n" data-i18n="active_used_table_active"></th>${row_active.join('')}</tr><tr><th class="i18n" data-i18n="active_used_table_used"></th>${row_used.join('')}</tr>`

})

ipcRenderer.on('mod-icon', (event, pngData) => {
Expand Down
4 changes: 4 additions & 0 deletions translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@
"header_mod_used_games" : "Used In Saves",
"header_mod_full_path" : "Full Path",
"header_mod_has_scripts" : "Uses Scripts",

"active_used_table_savegame" : "Savegame",
"active_used_table_active" : "Active",
"active_used_table_used" : "Used",

"file_error_name_starts_digit" : "This file starts with a digit. FS19 requires that mods start with a letter.",
"file_error_likely_copy" : "This file name suggests that it is a duplicate copy of another mod.",
Expand Down

0 comments on commit 2724127

Please sign in to comment.