This commit is contained in:
2026-04-28 23:08:35 +03:00
parent 53f1176ef8
commit 76ab83620b
4 changed files with 48 additions and 15 deletions

View File

@@ -167,18 +167,19 @@ window.renderTownDetails = function() {
const mCap = resObj.market_capacity || 0;
const aCap = resObj.available_trade_capacity != null ? resObj.available_trade_capacity : mCap;
console.log("Town:", t.town_name, "MarketCap:", mCap, "AvailCap:", aCap, "ResObj:", resObj);
// Always update td-market in the details panel
document.getElementById('td-market').innerHTML = mCap > 0
? `📦 Εμπορική Χωρητικότητα: <strong style="color:#6fcfcf">${window.fmt(aCap)}</strong> / <strong>${window.fmt(mCap)}</strong>`
: '';
: `📦 Εμπορική Χωρητικότητα: <span style="color:#555">Χωρίς Αγορά (Επ.0)</span>`;
// Always update the label inside the market command form
const mCapLabel = document.getElementById('market-capacity-label');
if (mCapLabel) {
if (mCap > 0) {
mCapLabel.innerHTML = `Χωρητικότητα: <strong style="color:#6fcfcf">${window.fmt(aCap)}</strong> / ${window.fmt(mCap)}`;
mCapLabel.innerHTML = `🏪 Διαθέσιμη Χωρητικότητα: <strong style="color:#6fcfcf">${window.fmt(aCap)}</strong> / <span style="color:#aaa">${window.fmt(mCap)} max</span>`;
} else {
mCapLabel.textContent = '';
mCapLabel.innerHTML = `<span style="color:#ff6666">⚠️ Αυτή η πόλη δεν έχει Αγορά</span>`;
}
}