From 69947c30d27aa947307a4c8bf57543e9e5f1ae85 Mon Sep 17 00:00:00 2001 From: haunter Date: Mon, 20 Apr 2026 00:52:27 +0300 Subject: [PATCH] fix 1 --- templates/dashboard.html | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/templates/dashboard.html b/templates/dashboard.html index 3eaa147..527b26b 100644 --- a/templates/dashboard.html +++ b/templates/dashboard.html @@ -520,12 +520,10 @@ function renderBuildingDropdown() { const r = town.resources; const resMissing = (r.wood < d.wood || r.stone < d.stone || r.iron < d.iron || r.population < d.pop); - if (d.buildable === false) { - if (resMissing) { - extraText = ' (Λείπουν πόροι/πληθ.)'; - } else { - extraText = ' (Κλειδωμένο)'; - } + if (resMissing) { + extraText = ' (Λείπουν πόροι/πληθ.)'; + } else if (!d.buildable) { + extraText = ' (Κλειδωμένο / Πλήρες)'; } } @@ -586,11 +584,11 @@ async function sendCommand() { const resMissing = (r.wood < d.wood || r.stone < d.stone || r.iron < d.iron); const popMissing = (r.population < d.pop); - if (d.buildable === false) { - if (popMissing) return alert(`Αδυναμία: Δεν επαρκεί ο πληθυσμός! (Απαιτεί ${d.pop})`); - if (resMissing) return alert(`Αδυναμία: Δεν επαρκούν οι πόροι!\n\nΑπαιτεί:\nΞύλο: ${d.wood}\nΠέτρα: ${d.stone}\nΑσήμι: ${d.iron}`); - - return alert("Αδυναμία: Απαιτούνται άλλα κτίρια πρώτα (Το κτίριο είναι κλειδωμένο)."); + if (resMissing) return alert(`Αδυναμία: Δεν επαρκούν οι πόροι!\n\nΑπαιτεί:\nΞύλο: ${d.wood}\nΠέτρα: ${d.stone}\nΑσήμι: ${d.iron}`); + if (popMissing) return alert(`Αδυναμία: Δεν επαρκεί ο πληθυσμός! (Απαιτεί ${d.pop})`); + + if (!d.buildable) { + return alert("Αδυναμία: Το κτίριο είναι κλειδωμένο (απαιτούνται άλλα κτίρια) ή πλήρως αναβαθμισμένο."); } }