fix 3
This commit is contained in:
@@ -9,6 +9,11 @@ window.onCmdTypeChange = function() {
|
||||
document.getElementById('amount-group').style.display = type === 'recruit' ? '' : 'none';
|
||||
document.getElementById('market-options').style.display = type === 'market_offer' ? '' : 'none';
|
||||
document.getElementById('research-options').style.display = type === 'research' ? '' : 'none';
|
||||
|
||||
// Refresh market capacity label whenever market tab is opened
|
||||
if (type === 'market_offer' && window.renderTownDetails) {
|
||||
window.renderTownDetails();
|
||||
}
|
||||
};
|
||||
|
||||
// Building emoji icons for the visual grid
|
||||
|
||||
@@ -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>`;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user