|
|
|
@@ -391,9 +391,13 @@ function createBuildings() { |
|
|
|
let buttonCost = document.createElement("div"); |
|
|
|
buttonCost.classList.add("building-button-cost"); |
|
|
|
|
|
|
|
let buildingIcon = document.createElement("img"); |
|
|
|
buildingIcon.classList.add("building-icon"); |
|
|
|
buildingIcon.src = "images/buildings/" + key + ".svg"; |
|
|
|
|
|
|
|
button.appendChild(buttonName); |
|
|
|
button.appendChild(buttonCost); |
|
|
|
|
|
|
|
button.appendChild(buildingIcon); |
|
|
|
button.addEventListener("mousemove", function(e) { buildingTooltip(key, e); }); |
|
|
|
button.addEventListener("mouseleave", function() { buildingTooltipRemove(); }); |
|
|
|
button.addEventListener("click", function() { buyBuilding(key); }); |
|
|
|
@@ -478,7 +482,13 @@ function createUpgrades() { |
|
|
|
let buttonName = document.createElement("div"); |
|
|
|
buttonName.classList.add("upgrade-button-name"); |
|
|
|
buttonName.innerText = value.name; |
|
|
|
|
|
|
|
let upgradeIcon = document.createElement("img"); |
|
|
|
upgradeIcon.src = "images/" + value.icon + ".svg"; |
|
|
|
upgradeIcon.classList.add("upgrade-icon"); |
|
|
|
|
|
|
|
button.appendChild(buttonName); |
|
|
|
button.appendChild(upgradeIcon); |
|
|
|
|
|
|
|
button.addEventListener("mousemove", function(e) { upgradeTooltip(key, e); }); |
|
|
|
button.addEventListener("mouseleave", function() { upgradeTooltipRemove(); }); |
|
|
|
|