diff --git a/game.js b/game.js index bd70b25..a974e21 100644 --- a/game.js +++ b/game.js @@ -86,6 +86,15 @@ function renderTime(time) { function updateStatDisplay(stats, statType) { Object.entries(stats).forEach(([key, val]) => { + + if (val.hidden === true) { + const field = document.querySelector("#" + statType + "-info-" + key); + field.style.display = "none"; + } else if (val.hidden === false) { + const field = document.querySelector("#" + statType + "-info-" + key); + field.style.display = "block"; + } + if (val.type == "meter") { const field = document.querySelector("#" + statType + "-info-" + key + " > .stat-bar"); field.style.width = (val.value / val.max * 100) + "%";