From c94fc64b8e30dccff3197abae5a3990b02572637 Mon Sep 17 00:00:00 2001 From: slweeb <91897291+slweeb@users.noreply.github.com> Date: Sun, 11 Feb 2024 13:11:32 -0500 Subject: [PATCH] Update survival.js --- mods/survival.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/mods/survival.js b/mods/survival.js index 4ccccd72..0a2e214b 100644 --- a/mods/survival.js +++ b/mods/survival.js @@ -308,6 +308,18 @@ window.addEventListener("load",function(){ shopDiv.appendChild(button); } shopDiv.insertAdjacentHTML("beforeend",`
`); + + createCategoryDiv("prices"); + var pricesDiv = document.getElementById("category-prices"); + pricesDiv.style.display = "none"; + for (var element in elementWorth) { + var name = (elements[element].name||element).replace(/_/g, " ").replace("."," ").replace(/\w\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();}).replace(" ","."); + // create text with the name of the element and its worth, separated by • + var text = name+"="+elementWorth[element] + " • "; + pricesDiv.insertAdjacentHTML("beforeend",`${text}`); + } + pricesDiv.innerHTML = pricesDiv.innerHTML.slice(0,-2); + pricesDiv.innerHTML = ""+pricesDiv.innerHTML+"
"; }); runAfterLoad(function(){ checkUnlock = function(element) {