recruit line
This commit is contained in:
@@ -489,3 +489,27 @@ window.renderBuildQueuePreview = function() {
|
||||
}).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}`;
|
||||
};
|
||||
|
||||
window.renderUnitQueuePreview = function() {
|
||||
const town = window.getSelectedTown();
|
||||
const el = document.getElementById('unit-queue-preview');
|
||||
if (!el) return;
|
||||
|
||||
if (!town || !town.unit_queue || !town.unit_queue.length) {
|
||||
el.innerHTML = '<span style="color:#444">Recruit queue: empty</span>';
|
||||
return;
|
||||
}
|
||||
|
||||
const items = town.unit_queue.map(o => {
|
||||
const raw = o.unit_type || o.unit_id || 'unknown';
|
||||
const nameGr = window.UNIT_NAMES_GR ? (window.UNIT_NAMES_GR[raw] || raw) : raw;
|
||||
const total = o.count || 0;
|
||||
const left = o.units_left !== undefined ? o.units_left : total;
|
||||
const countStr = left < total ? `${left}/${total}` : `${total}`;
|
||||
return `<span style="background: rgba(0,0,0,0.3); padding: 2px 6px; border-radius: 4px; margin-right: 4px; font-size: 0.8rem; display: inline-flex; align-items: center; gap: 4px;">
|
||||
<span style="color:#fff; font-weight:bold;">${countStr}x</span> ${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;">Recruitment queue</div>${items}`;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user