Browse Source

Redid upgrade tooltips a bit

tags/v0.0.1
Fen Dweller 7 years ago
parent
commit
16ac58d3b1
No known key found for this signature in database GPG Key ID: E80B35A6F11C3656
2 changed files with 5 additions and 11 deletions
  1. +2
    -7
      gorge.css
  2. +3
    -4
      gorge.js

+ 2
- 7
gorge.css View File

@@ -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 {


+ 3
- 4
gorge.js View File

@@ -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
});
}


Loading…
Cancel
Save