inventory now shows equipped position

Former-commit-id: 10950ffc409accfa914b9f531193b2fac0783f7d
This commit is contained in:
Song Minjae
2017-03-31 17:26:44 +09:00
parent 84f91e6a7a
commit 5bfc5c3a38
4 changed files with 50 additions and 26 deletions

View File

@@ -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