inventory ui update

This commit is contained in:
Song Minjae
2017-04-13 03:25:49 +09:00
parent 47b9b92797
commit a47eb41d9a
16 changed files with 476 additions and 159 deletions

View File

@@ -57,20 +57,14 @@ internal object Inventory : ConsoleCommand {
private fun addItem(refId: Int, amount: Int = 1) {
if (target != null) {
target!!.inventory.add(ItemCodex[refId], amount)
target!!.addItem(ItemCodex[refId], amount)
}
}
private fun equipItem(refId: Int) {
if (target != null) {
val item = ItemCodex[refId]
// if the item does not exist, add it first
if (!target!!.inventory.hasItem(item)) {
target!!.inventory.add(item)
}
target!!.inventory.itemEquipped[item.equipPosition] = item
target!!.equipItem(item)
}
}