greekbuilding names ,live synch button ,market capacity
This commit is contained in:
@@ -223,3 +223,28 @@ window.dismissCaptchaBanner = function() {
|
||||
banner.dataset.dismissed = '1';
|
||||
}
|
||||
};
|
||||
|
||||
window.requestLiveSync = async function() {
|
||||
const btn = document.getElementById('live-btn');
|
||||
const originalText = btn.textContent;
|
||||
btn.textContent = '⏳ Requesting...';
|
||||
btn.disabled = true;
|
||||
|
||||
try {
|
||||
const res = await fetch('/api/sync-request?player_id=' + window.PLAYER_ID, { method: 'POST' });
|
||||
const data = await res.json();
|
||||
if (data.ok) {
|
||||
btn.textContent = '✅ Requested!';
|
||||
setTimeout(() => {
|
||||
btn.textContent = originalText;
|
||||
btn.disabled = false;
|
||||
}, 5000);
|
||||
}
|
||||
} catch (e) {
|
||||
btn.textContent = '❌ Failed';
|
||||
setTimeout(() => {
|
||||
btn.textContent = originalText;
|
||||
btn.disabled = false;
|
||||
}, 3000);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -144,8 +144,10 @@ window.renderBuildQueuePreview = function() {
|
||||
el.innerHTML = '<span style="color:#444">Build queue: empty</span>';
|
||||
return;
|
||||
}
|
||||
const items = town.build_queue.map(o =>
|
||||
`<span>${o.building_type || o.name || JSON.stringify(o)}</span>`
|
||||
).join('');
|
||||
const items = town.build_queue.map(o => {
|
||||
const raw = o.building_type || o.name || "";
|
||||
const nameGr = window.BUILDING_NAMES_GR[raw] || raw || JSON.stringify(o);
|
||||
return `<span style="background: rgba(0,0,0,0.3); padding: 2px 6px; border-radius: 4px; margin-right: 4px; font-size: 0.8rem;">${nameGr}</span>`;
|
||||
}).join('');
|
||||
el.innerHTML = `<div style="margin-top:6px;color:#888;font-size:0.72rem;text-transform:uppercase;letter-spacing:0.5px;margin-bottom:4px;">Current queue</div>${items}`;
|
||||
};
|
||||
|
||||
@@ -160,6 +160,11 @@ window.renderTownDetails = function() {
|
||||
<div>${window.RES_ICONS.iron} Ασήμι: ${resHtml(resObj.iron || 0, reservedIron)}</div>
|
||||
<div style="margin-top: 6px;">${window.RES_ICONS.pop} Πληθυσμός: <strong style="color:#fff">${resObj.population || 0}</strong></div>
|
||||
`;
|
||||
|
||||
const mCap = resObj.market_capacity || 0;
|
||||
document.getElementById('td-market').innerHTML = `
|
||||
📦 Εμπορική Χωρητικότητα: <strong>${window.fmt(mCap)}</strong>
|
||||
`;
|
||||
|
||||
const godName = t.god ? t.god.charAt(0).toUpperCase() + t.god.slice(1) : 'Κανένας';
|
||||
const seaStr = t.sea != null ? `Θ${t.sea}` : '—';
|
||||
|
||||
Reference in New Issue
Block a user