|
|
|
@@ -91,6 +91,7 @@ function displayBuildings() { |
|
|
|
|
|
|
|
document.querySelector("#building-" + key + " > .building-button-name").innerText = value.count + " " + (value.count == 1 ? buildings[key].name : buildings[key].plural); |
|
|
|
document.querySelector("#building-" + key + " > .building-button-cost").innerText = costOfBuilding(key) + " food"; |
|
|
|
document.querySelector("#building-" + key + " > .building-button-prod").innerText = Math.round(productivityMultiplierOf(key) * buildings[key].prod * 10) / 10 + " food/sec"; |
|
|
|
|
|
|
|
if (costOfBuilding(key) > resources.food) { |
|
|
|
button.classList.add("building-button-disabled"); |
|
|
|
@@ -207,9 +208,13 @@ function createBuildings() { |
|
|
|
buttonName.classList.add("building-button-name"); |
|
|
|
let buttonCost = document.createElement("div"); |
|
|
|
buttonCost.classList.add("building-button-cost"); |
|
|
|
let buttonProd = document.createElement("div"); |
|
|
|
buttonProd.classList.add("building-button-prod"); |
|
|
|
|
|
|
|
|
|
|
|
button.appendChild(buttonName); |
|
|
|
button.appendChild(buttonCost); |
|
|
|
button.appendChild(buttonProd); |
|
|
|
|
|
|
|
container.appendChild(button); |
|
|
|
} |
|
|
|
|