market revert back

This commit is contained in:
2026-04-28 23:28:13 +03:00
parent edd7666905
commit d952e7ca56
5 changed files with 8 additions and 34 deletions

View File

@@ -166,22 +166,11 @@ window.renderTownDetails = function() {
`;
const mCap = resObj.market_capacity || 0;
const aCap = resObj.available_trade_capacity != null ? resObj.available_trade_capacity : mCap;
// 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
? `📦 Εμπορική Χωρητικότητα: <strong>${window.fmt(mCap)}</strong>`
: '';
const mCapLabel = document.getElementById('market-capacity-label');
if (mCapLabel) {
if (mCap > 0) {
mCapLabel.innerHTML = `🏪 Διαθέσιμη Χωρητικότητα: <strong style="color:#6fcfcf">${window.fmt(aCap)}</strong> / <span style="color:#aaa">${window.fmt(mCap)} max</span>`;
} else {
mCapLabel.innerHTML = `<span style="color:#ff6666">⚠️ Αυτή η πόλη δεν έχει Αγορά</span>`;
}
}
if (mCapLabel) mCapLabel.textContent = `Χωρητικότητα: ${window.fmt(mCap)}`;
const godName = t.god ? t.god.charAt(0).toUpperCase() + t.god.slice(1) : 'Κανένας';
const seaStr = t.sea != null ? `Θ${t.sea}` : '—';