some fixes
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user