fix time and cost v1
This commit is contained in:
@@ -35,30 +35,20 @@ window.renderBuildingDropdown = function() {
|
||||
const data = bData[key];
|
||||
|
||||
let text = `${nameGr} [Επίπεδο ${level}]`;
|
||||
let buildable = true;
|
||||
|
||||
if (data) {
|
||||
if (data && data.dependencies) {
|
||||
const w = window.fmt(data.wood || 0);
|
||||
const st = window.fmt(data.stone || 0);
|
||||
const i = window.fmt(data.iron || 0);
|
||||
const t = formatTime(data.build_time);
|
||||
buildable = data.buildable;
|
||||
|
||||
// Only show costs if the prerequisites are fulfilled and it's not max level
|
||||
if (data.dependencies) {
|
||||
text += ` — Ξ:${w} Π:${st} Α:${i} · ⏱ ${t}`;
|
||||
} else {
|
||||
text += ` — (Μη διαθέσιμο)`;
|
||||
}
|
||||
// Only show costs if the prerequisites are fulfilled
|
||||
text += ` — Ξ:${w} Π:${st} Α:${i} · ⏱ ${t}`;
|
||||
}
|
||||
|
||||
const option = document.createElement('option');
|
||||
option.value = key;
|
||||
option.textContent = (!buildable && data?.dependencies) ? `❌ ${text}` : text;
|
||||
|
||||
if (!buildable) {
|
||||
option.style.color = '#aa5555';
|
||||
}
|
||||
option.textContent = text;
|
||||
|
||||
bSelect.appendChild(option);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user