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