mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-12 19:44:05 +09:00
inventory now shows equipped position
Former-commit-id: 10950ffc409accfa914b9f531193b2fac0783f7d
This commit is contained in:
@@ -142,13 +142,24 @@ class UIInventory(
|
||||
|
||||
// set quickslot number
|
||||
for (qs in 1..QUICKSLOT_MAX) {
|
||||
if (sortListItem.item.id == actorValue.getAsInt(AVKey.__PLAYER_QSPREFIX + qs)) {
|
||||
if (-sortListItem.item.id == actorValue.getAsInt(AVKey.__PLAYER_QSPREFIX + qs)) {
|
||||
items[k].quickslot = qs % 10 // 10 -> 0, 1..9 -> 1..9
|
||||
break
|
||||
}
|
||||
else
|
||||
items[k].quickslot = null
|
||||
}
|
||||
|
||||
for (eq in 0..actor.itemEquipped.size - 1) {
|
||||
if (eq < actor.itemEquipped.size) {
|
||||
if (actor.itemEquipped[eq] == items[k].item) {
|
||||
items[k].equippedSlot = eq
|
||||
break
|
||||
}
|
||||
else
|
||||
items[k].equippedSlot = null
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (e: IndexOutOfBoundsException) {
|
||||
items[k].item = null
|
||||
|
||||
Reference in New Issue
Block a user