diff --git a/gorge.css b/gorge.css index bc5c01f..2519398 100644 --- a/gorge.css +++ b/gorge.css @@ -181,7 +181,6 @@ button { #upgrade-tooltip { position: absolute; width: 200px; - padding-bottom: 50px; background: #333; display: none; z-index: 1; @@ -209,15 +208,11 @@ button { } #upgrade-tooltip-cost { - position: absolute; - right: 10px; - bottom: 10px; + margin: 10px; } #upgrade-tooltip-prereqs { - position: absolute; - left: 10px; - bottom: 10px; + margin: 10px; } .cost-met { diff --git a/gorge.js b/gorge.js index 4eaa384..35ad2fc 100644 --- a/gorge.js +++ b/gorge.js @@ -115,7 +115,6 @@ function displayResources() { function renderResources() { let list = []; - for (const [key, value] of Object.entries(resources)) { let line1 = render(value, 3, 0) + " " + resourceTypes[key].name; @@ -450,7 +449,7 @@ function renderCost(cost) { for (const [key, value] of Object.entries(cost)) { list.push({ - "text": value + " " + resourceTypes[key].name, + "text": render(value,0) + " " + resourceTypes[key].name, "valid": resources[key] >= value }); } @@ -469,14 +468,14 @@ function renderPrereqs(prereqs) { if (key == "buildings") { for (const [id, amount] of Object.entries(prereqs.buildings)) { list.push({ - "text": buildings[id].name + " x" + amount, + "text": buildings[id].name + " x" + render(amount,0), "valid": belongings[id].count >= amount }); } } else if (key == "productivity") { for (const [id, amount] of Object.entries(prereqs.productivity)) { list.push({ - "text": amount + " " + resourceTypes[id].name + "/s", + "text": render(amount,0) + " " + resourceTypes[id].name + "/s", "valid": currentProductivity[id] >= amount }); }