AI8
This commit is contained in:
parent
44ab3f31d8
commit
07c5c5efa7
@ -505,6 +505,13 @@ body {
|
|||||||
transform: scale(1.1);
|
transform: scale(1.1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#inv-left:disabled,
|
||||||
|
#inv-right:disabled {
|
||||||
|
opacity: 0.25;
|
||||||
|
cursor: not-allowed;
|
||||||
|
transform: none;
|
||||||
|
}
|
||||||
|
|
||||||
#inventory-nav {
|
#inventory-nav {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|||||||
@ -63,9 +63,16 @@ export async function loadWohnhaus() {
|
|||||||
<button id="inv-right">►</button>
|
<button id="inv-right">►</button>
|
||||||
</div>`;
|
</div>`;
|
||||||
|
|
||||||
|
// Variablen zurücksetzen beim Öffnen
|
||||||
|
inventoryPage = 0;
|
||||||
|
totalInventoryPages = 1;
|
||||||
|
inventoryItems = [];
|
||||||
|
|
||||||
|
// Buttons zuerst initialisieren
|
||||||
|
initInventoryButtons();
|
||||||
|
|
||||||
await loadInventory();
|
await loadInventory();
|
||||||
await loadEquipment();
|
await loadEquipment();
|
||||||
initInventoryButtons();
|
|
||||||
initDrag();
|
initDrag();
|
||||||
initSlotDrag();
|
initSlotDrag();
|
||||||
initDrop();
|
initDrop();
|
||||||
@ -143,6 +150,13 @@ function renderInventory() {
|
|||||||
document.getElementById("inventory-page").innerText =
|
document.getElementById("inventory-page").innerText =
|
||||||
"Seite " + (inventoryPage + 1) + " / " + totalInventoryPages;
|
"Seite " + (inventoryPage + 1) + " / " + totalInventoryPages;
|
||||||
|
|
||||||
|
// Buttons aktivieren/deaktivieren
|
||||||
|
const btnLeft = document.getElementById("inv-left");
|
||||||
|
const btnRight = document.getElementById("inv-right");
|
||||||
|
|
||||||
|
if (btnLeft) btnLeft.disabled = inventoryPage === 0;
|
||||||
|
if (btnRight) btnRight.disabled = inventoryPage >= totalInventoryPages - 1;
|
||||||
|
|
||||||
initDrag();
|
initDrag();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user