änderungen Mine
This commit is contained in:
parent
ae46dcb20f
commit
c33762781f
@ -8,11 +8,14 @@ const tooltip = document.getElementById("map-tooltip");
|
|||||||
const tooltipCache = {};
|
const tooltipCache = {};
|
||||||
|
|
||||||
const buildingModules = {
|
const buildingModules = {
|
||||||
11: loadWohnhaus,
|
11: loadWohnhaus, // Tabs ausblenden, eigenes UI
|
||||||
12: loadSchwarzmarkt,
|
12: loadSchwarzmarkt, // Tabs ausblenden, eigenes UI
|
||||||
10: loadMine,
|
10: loadMine, // Tabs bleiben sichtbar, nur Aktionen-Tab befüllen
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Gebäude die ihre eigenen Tabs behalten sollen
|
||||||
|
const keepTabsVisible = new Set([10]);
|
||||||
|
|
||||||
/* ================================
|
/* ================================
|
||||||
Tabs zurücksetzen
|
Tabs zurücksetzen
|
||||||
================================ */
|
================================ */
|
||||||
@ -80,14 +83,29 @@ document.querySelectorAll(".building").forEach((building) => {
|
|||||||
tabs.style.display = "flex";
|
tabs.style.display = "flex";
|
||||||
|
|
||||||
// Prüfen ob Gebäude eigenes UI hat
|
// Prüfen ob Gebäude eigenes UI hat
|
||||||
if (buildingModules[Number(data.type)]) {
|
const buildingType = Number(data.type);
|
||||||
// Tabs ausblenden
|
if (buildingModules[buildingType]) {
|
||||||
tabs.style.display = "none";
|
if (keepTabsVisible.has(buildingType)) {
|
||||||
|
// Tabs sichtbar lassen (z.B. Mine)
|
||||||
|
tabs.style.display = "flex";
|
||||||
|
// Aktionen-Tab aktivieren
|
||||||
|
document
|
||||||
|
.querySelectorAll(".tab")
|
||||||
|
.forEach((t) => t.classList.remove("active"));
|
||||||
|
document
|
||||||
|
.querySelectorAll(".tab-content")
|
||||||
|
.forEach((c) => c.classList.remove("active"));
|
||||||
|
document
|
||||||
|
.querySelector(".tab[data-tab='actions']")
|
||||||
|
.classList.add("active");
|
||||||
|
document.getElementById("tab-actions").classList.add("active");
|
||||||
|
} else {
|
||||||
|
// Tabs ausblenden, eigenes Voll-UI (Wohnhaus, Schwarzmarkt)
|
||||||
|
tabs.style.display = "none";
|
||||||
|
infoTab.innerHTML = `<div class="building-ui"></div>`;
|
||||||
|
}
|
||||||
|
|
||||||
// Info ersetzen durch Wohnhaus UI
|
buildingModules[buildingType](buildingType);
|
||||||
infoTab.innerHTML = `<div class="building-ui"></div>`;
|
|
||||||
|
|
||||||
buildingModules[data.type](data);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
document.getElementById("tab-upgrade").innerHTML = `
|
document.getElementById("tab-upgrade").innerHTML = `
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user