display amounts

This commit is contained in:
ReznoRMichael 2021-07-08 10:39:17 +02:00
parent 91cf86a80e
commit d3055983de
4 changed files with 23 additions and 3 deletions

View file

@ -721,9 +721,11 @@ function CheckAdditionalThings(section, dataObject, playerData, worldData, scene
} }
countTotal = amount; countTotal = amount;
dataObject[i].amount = amount;
if (i === "journalEntriesCompleted" || i === "journalNotesCompleted") { if (i === "journalEntriesCompleted" || i === "journalNotesCompleted") {
countTotal = "".concat(amount, " / ").concat(playerData.journalEntriesTotal); countTotal = "".concat(amount, " / ").concat(playerData.journalEntriesTotal);
dataObject[i].amountTotal = playerData.journalEntriesTotal;
} }
if (i === "grubsCollected") { if (i === "grubsCollected") {
@ -1194,8 +1196,7 @@ function CheckMrMushroomState(section, entry) {
function CheckHintsTrue(section, dataObject, playerData, worldData) { function CheckHintsTrue(section, dataObject, playerData, worldData) {
var sFillText = ""; /* let sFillText = ""; */
if (playerData.killedHollowKnight === true) { if (playerData.killedHollowKnight === true) {
// a text to show when player already finished their first playthrough (killed Hollow Knight first time) // a text to show when player already finished their first playthrough (killed Hollow Knight first time)
@ -5203,6 +5204,15 @@ function SingleEntryFill(section, entry) {
default: default:
span = ["<span class='spoiler-span'>", "</span>"]; span = ["<span class='spoiler-span'>", "</span>"];
spoiler = ["<span class='spoiler-text'>", "</span>"]; spoiler = ["<span class='spoiler-text'>", "</span>"];
if (entry.hasOwnProperty("amount")) {
textPrefix += ": ".concat(entry.amount);
}
if (entry.hasOwnProperty("amountTotal")) {
textPrefix += " / ".concat(entry.amountTotal);
}
if (textSuffix.length && textPrefix.length) textSuffix = "\u2014 ".concat(textSuffix); if (textSuffix.length && textPrefix.length) textSuffix = "\u2014 ".concat(textSuffix);
if (textPrefix.includes("<del>")) textSuffix = "<del>".concat(textSuffix, "</del>"); if (textPrefix.includes("<del>")) textSuffix = "<del>".concat(textSuffix, "</del>");
} }

File diff suppressed because one or more lines are too long

View file

@ -817,9 +817,11 @@ function CheckAdditionalThings(section, dataObject, playerData, worldData, scene
} }
countTotal = amount; countTotal = amount;
dataObject[i].amount = amount;
if (i === "journalEntriesCompleted" || i === "journalNotesCompleted") { if (i === "journalEntriesCompleted" || i === "journalNotesCompleted") {
countTotal = `${amount} / ${playerData.journalEntriesTotal}`; countTotal = `${amount} / ${playerData.journalEntriesTotal}`;
dataObject[i].amountTotal = playerData.journalEntriesTotal;
} }
if (i === "grubsCollected") { if (i === "grubsCollected") {

View file

@ -438,6 +438,14 @@ function SingleEntryFill(section, entry) {
span = ["<span class='spoiler-span'>", "</span>"]; span = ["<span class='spoiler-span'>", "</span>"];
spoiler = ["<span class='spoiler-text'>", "</span>"]; spoiler = ["<span class='spoiler-text'>", "</span>"];
if (entry.hasOwnProperty("amount")) {
textPrefix += `: ${entry.amount}`;
}
if (entry.hasOwnProperty("amountTotal")) {
textPrefix += ` / ${entry.amountTotal}`;
}
if (textSuffix.length && textPrefix.length) textSuffix = `${textSuffix}`; if (textSuffix.length && textPrefix.length) textSuffix = `${textSuffix}`;
if (textPrefix.includes("<del>")) textSuffix = `<del>${textSuffix}</del>`; if (textPrefix.includes("<del>")) textSuffix = `<del>${textSuffix}</del>`;
} }