blueprint function
This commit is contained in:
@@ -212,4 +212,43 @@ window.renderTownDetails = function() {
|
||||
if(unitsHtml === '') unitsHtml = '<div style="color:#666">Κανένα στράτευμα</div>';
|
||||
|
||||
document.getElementById('td-units').innerHTML = unitsHtml;
|
||||
|
||||
// ---- Blueprint Lock & Indicator ----
|
||||
const isBlueprintActive = !!t.blueprint_active;
|
||||
const bpName = t.blueprint_name || 'Standard Growth';
|
||||
|
||||
if (isBlueprintActive) {
|
||||
document.getElementById('td-general').innerHTML += `
|
||||
<div style="margin-top:10px; padding: 4px 8px; background: rgba(200,164,74,0.15); border-left: 3px solid #c8a44a; border-radius:4px; font-size:0.8rem;">
|
||||
🤖 Blueprint: <strong style="color:#c8a44a">${bpName}</strong> <span style="color:#2ecc71">(ΕΝΕΡΓΟ)</span>
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
|
||||
const btnBuild = document.getElementById('seg-build');
|
||||
const btnResearch = document.getElementById('seg-research');
|
||||
|
||||
if (btnBuild && btnResearch) {
|
||||
if (isBlueprintActive) {
|
||||
btnBuild.style.opacity = '0.3';
|
||||
btnBuild.style.pointerEvents = 'none';
|
||||
btnBuild.title = 'Απενεργοποιημένο λόγω Blueprint';
|
||||
|
||||
btnResearch.style.opacity = '0.3';
|
||||
btnResearch.style.pointerEvents = 'none';
|
||||
btnResearch.title = 'Απενεργοποιημένο λόγω Blueprint';
|
||||
|
||||
if (window.currentCmdType === 'build' || window.currentCmdType === 'research') {
|
||||
window.setCmdType('recruit');
|
||||
}
|
||||
} else {
|
||||
btnBuild.style.opacity = '1';
|
||||
btnBuild.style.pointerEvents = 'auto';
|
||||
btnBuild.title = '';
|
||||
|
||||
btnResearch.style.opacity = '1';
|
||||
btnResearch.style.pointerEvents = 'auto';
|
||||
btnResearch.title = '';
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user