Преглед изворни кода

Redid upgrade tooltips a bit

tags/v0.0.1
Fen Dweller пре 7 година
родитељ
комит
16ac58d3b1
No known key found for this signature in database GPG Key ID: E80B35A6F11C3656
2 измењених фајлова са 5 додато и 11 уклоњено
  1. +2
    -7
      gorge.css
  2. +3
    -4
      gorge.js

+ 2
- 7
gorge.css Прегледај датотеку

@@ -181,7 +181,6 @@ button {
#upgrade-tooltip { #upgrade-tooltip {
position: absolute; position: absolute;
width: 200px; width: 200px;
padding-bottom: 50px;
background: #333; background: #333;
display: none; display: none;
z-index: 1; z-index: 1;
@@ -209,15 +208,11 @@ button {
} }


#upgrade-tooltip-cost { #upgrade-tooltip-cost {
position: absolute;
right: 10px;
bottom: 10px;
margin: 10px;
} }


#upgrade-tooltip-prereqs { #upgrade-tooltip-prereqs {
position: absolute;
left: 10px;
bottom: 10px;
margin: 10px;
} }


.cost-met { .cost-met {


+ 3
- 4
gorge.js Прегледај датотеку

@@ -115,7 +115,6 @@ function displayResources() {
function renderResources() { function renderResources() {
let list = []; let list = [];



for (const [key, value] of Object.entries(resources)) { for (const [key, value] of Object.entries(resources)) {


let line1 = render(value, 3, 0) + " " + resourceTypes[key].name; let line1 = render(value, 3, 0) + " " + resourceTypes[key].name;
@@ -450,7 +449,7 @@ function renderCost(cost) {


for (const [key, value] of Object.entries(cost)) { for (const [key, value] of Object.entries(cost)) {
list.push({ list.push({
"text": value + " " + resourceTypes[key].name,
"text": render(value,0) + " " + resourceTypes[key].name,
"valid": resources[key] >= value "valid": resources[key] >= value
}); });
} }
@@ -469,14 +468,14 @@ function renderPrereqs(prereqs) {
if (key == "buildings") { if (key == "buildings") {
for (const [id, amount] of Object.entries(prereqs.buildings)) { for (const [id, amount] of Object.entries(prereqs.buildings)) {
list.push({ list.push({
"text": buildings[id].name + " x" + amount,
"text": buildings[id].name + " x" + render(amount,0),
"valid": belongings[id].count >= amount "valid": belongings[id].count >= amount
}); });
} }
} else if (key == "productivity") { } else if (key == "productivity") {
for (const [id, amount] of Object.entries(prereqs.productivity)) { for (const [id, amount] of Object.entries(prereqs.productivity)) {
list.push({ list.push({
"text": amount + " " + resourceTypes[id].name + "/s",
"text": render(amount,0) + " " + resourceTypes[id].name + "/s",
"valid": currentProductivity[id] >= amount "valid": currentProductivity[id] >= amount
}); });
} }


Loading…
Откажи
Сачувај