pop24
This commit is contained in:
parent
620b214671
commit
48e2e4e5cd
@ -66,13 +66,17 @@ async function loadEquipment() {
|
|||||||
const equipment = await res.json();
|
const equipment = await res.json();
|
||||||
|
|
||||||
equipment.forEach((item) => {
|
equipment.forEach((item) => {
|
||||||
const slot = document.querySelector(
|
const slot = document.querySelector('.slot[data-slot="' + item.slot + '"]');
|
||||||
'.equip-slot[data-slot="' + item.slot + '"]',
|
|
||||||
);
|
|
||||||
|
|
||||||
if (!slot) return;
|
if (!slot) return;
|
||||||
|
|
||||||
|
const label = slot.querySelector(".slot-label");
|
||||||
|
|
||||||
slot.innerHTML = `<img src="${item.icon}">`;
|
slot.innerHTML = `<img src="${item.icon}">`;
|
||||||
|
|
||||||
|
if (label) {
|
||||||
|
slot.appendChild(label);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -178,8 +182,14 @@ function initDrop() {
|
|||||||
'.inventory-slot[data-id="' + itemId + '"] img',
|
'.inventory-slot[data-id="' + itemId + '"] img',
|
||||||
).src;
|
).src;
|
||||||
|
|
||||||
|
const label = slot.querySelector(".slot-label");
|
||||||
|
|
||||||
slot.innerHTML = `<img src="${icon}">`;
|
slot.innerHTML = `<img src="${icon}">`;
|
||||||
|
|
||||||
|
if (label) {
|
||||||
|
slot.appendChild(label);
|
||||||
|
}
|
||||||
|
|
||||||
saveEquipment(targetSlot, itemId, itemLevel);
|
saveEquipment(targetSlot, itemId, itemLevel);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user