display intro section properly

This commit is contained in:
ReznoRMichael 2021-07-09 23:53:42 +02:00
parent 3d0f1b1642
commit d675c051be
3 changed files with 21 additions and 27 deletions

View file

@ -2589,7 +2589,7 @@ var HK = {
id: "timePlayed", id: "timePlayed",
icon: "clock", icon: "clock",
name: "Time Played:", name: "Time Played:",
spoiler: "0 h 0 min 0 sec", spoiler: "0 h 00 min 00 sec",
timeH: 0, timeH: 0,
timeM: 0, timeM: 0,
timeS: 0 timeS: 0
@ -5066,18 +5066,20 @@ function GenerateInnerHTML(db) {
switch (section) { switch (section) {
/* ############### Game Status (intro) ################ */ /* ############### Game Status (intro) ################ */
case "intro": case "intro":
obj.b = ["", ""]; /* ############## Looping entries (intro) ############### */
obj.span = ["<b>", "</b>"];
/* ############## Loop ############### */
for (var entry in entries) { for (var entry in entries) {
obj.b = ["", ""];
obj.span = ["<b>", "</b>"];
obj.textPrefix = entries[entry].name; obj.textPrefix = entries[entry].name;
obj.textSuffix = entries[entry].spoiler; obj.textSuffix = entries[entry].spoiler;
obj.spoilerAfter = "";
/* Different text and images for each entry in the "Game Status" section */ /* Different text and images for each entry in the "Game Status" section */
switch (entries[entry].id) { switch (entry) {
case "gameCompletion": case "gameCompletion":
obj.textSuffix = "".concat(obj.textSuffix, " %"); obj.textSuffix = "".concat(obj.textSuffix, " %");
obj.spoilerAfter = "</b> ".concat(entries[entry].spoilerAfter);
obj.span[1] = "";
break; break;
case "health": case "health":
@ -5152,13 +5154,6 @@ function GenerateInnerHTML(db) {
default: default:
} }
/* Optimized only for the "intro" section! */
if (entries[entry].hasOwnProperty("spoilerAfter")) {
obj.spoilerAfter = "</b> ".concat(entries[entry].spoilerAfter);
obj.span[1] = "";
}
textFill += SingleEntryFill(obj); textFill += SingleEntryFill(obj);
} }
@ -5172,9 +5167,9 @@ function GenerateInnerHTML(db) {
obj.span = ["<span>", "</span>"]; obj.span = ["<span>", "</span>"];
obj.icon = iconNull; obj.icon = iconNull;
obj.textPrefix = ""; obj.textPrefix = "";
obj.textSuffix = entries[sections[section].current].spoiler;
/* display only one (current) hint */ /* display only one (current) hint */
obj.textSuffix = entries[sections[section].current].spoiler;
textFill += SingleEntryFill(obj); textFill += SingleEntryFill(obj);
break; break;

File diff suppressed because one or more lines are too long

View file

@ -194,21 +194,25 @@ function GenerateInnerHTML(db) {
/* ############### Game Status (intro) ################ */ /* ############### Game Status (intro) ################ */
case "intro": case "intro":
obj.b = ["", ""];
obj.span = ["<b>", "</b>"];
/* ############## Loop ############### */ /* ############## Looping entries (intro) ############### */
for (let entry in entries) { for (let entry in entries) {
obj.b = ["", ""];
obj.span = ["<b>", "</b>"];
obj.textPrefix = entries[entry].name; obj.textPrefix = entries[entry].name;
obj.textSuffix = entries[entry].spoiler; obj.textSuffix = entries[entry].spoiler;
obj.spoilerAfter = "";
/* Different text and images for each entry in the "Game Status" section */ /* Different text and images for each entry in the "Game Status" section */
switch (entries[entry].id) { switch (entry) {
case "gameCompletion": case "gameCompletion":
obj.textSuffix = `${obj.textSuffix} %`; obj.textSuffix = `${obj.textSuffix} %`;
obj.spoilerAfter = `</b> ${entries[entry].spoilerAfter}`;
obj.span[1] = "";
break; break;
@ -289,12 +293,6 @@ function GenerateInnerHTML(db) {
default: default:
} }
/* Optimized only for the "intro" section! */
if (entries[entry].hasOwnProperty("spoilerAfter")) {
obj.spoilerAfter = `</b> ${entries[entry].spoilerAfter}`;
obj.span[1] = "";
}
textFill += SingleEntryFill(obj); textFill += SingleEntryFill(obj);
} }
@ -307,9 +305,10 @@ function GenerateInnerHTML(db) {
obj.span = ["<span>", "</span>"]; obj.span = ["<span>", "</span>"];
obj.icon = iconNull; obj.icon = iconNull;
obj.textPrefix = ""; obj.textPrefix = "";
obj.textSuffix = entries[sections[section].current].spoiler;
/* display only one (current) hint */ /* display only one (current) hint */
obj.textSuffix = entries[sections[section].current].spoiler;
textFill += SingleEntryFill(obj); textFill += SingleEntryFill(obj);
break; break;