some fixes

This commit is contained in:
2026-04-20 19:31:49 +03:00
parent 69d56f621b
commit 3c658dc0a8
3 changed files with 31 additions and 5 deletions

View File

@@ -36,15 +36,16 @@ window.renderBuildingDropdown = function() {
const popStr = pop > 0 ? ` 🧔:${pop} ` : ' ';
const costStr = `Ξ:${w} Π:${st} Α:${i}${popStr}· ⏱ ${t}`;
// Figure out the state
const isLocked = (!data.dependencies) || (data.missing_dependencies && data.missing_dependencies.length > 0);
// Figure out the state - missing_dependencies is an Object!
const missingKeys = data.missing_dependencies ? Object.keys(data.missing_dependencies) : [];
const isLocked = (!data.dependencies) || (missingKeys.length > 0);
const option = document.createElement('option');
option.value = key;
if (isLocked) {
option.textContent = `${text} — 🔒 Κλειδωμένο (Προϋποθέσεις)`;
option.style.color = '#777777';
option.style.color = '#ff4444'; // Red as requested
} else if (data.can_upgrade === true) {
option.textContent = `${text} — ✅ ${costStr}`;
} else if (data.enough_resources === false) {