mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-12 03:24:06 +09:00
quickslot selections are controlled by the ingame rather than the 'bar UI'
This commit is contained in:
@@ -358,14 +358,7 @@ open class ActorHumanoid(
|
||||
}
|
||||
|
||||
override fun keyDown(keycode: Int): Boolean {
|
||||
// quickslot (quickbar)
|
||||
val quickbarKeys = AppLoader.getConfigIntArray("keyquickbars")
|
||||
if (keycode in quickbarKeys) {
|
||||
actorValue[AVKey.__PLAYER_QUICKSLOTSEL] = quickbarKeys.indexOf(keycode)
|
||||
}
|
||||
|
||||
|
||||
return true
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -11,8 +11,8 @@ import net.torvald.terrarum.itemproperties.ItemCodex.ITEM_WALLS
|
||||
import net.torvald.terrarum.itemproperties.ItemID
|
||||
import net.torvald.terrarum.lock
|
||||
import net.torvald.terrarum.modulebasegame.Ingame
|
||||
import net.torvald.terrarum.modulebasegame.ui.UIQuickslotBar
|
||||
import java.util.*
|
||||
import java.util.concurrent.locks.Lock
|
||||
import java.util.concurrent.locks.ReentrantLock
|
||||
|
||||
/**
|
||||
@@ -30,13 +30,13 @@ class ActorInventory(val actor: Pocketed, var maxCapacity: Int, var capacityMode
|
||||
/**
|
||||
* List of all equipped items (tools, armours, rings, necklaces, etc.)
|
||||
*/
|
||||
val itemEquipped = Array<GameItem?>(GameItem.EquipPosition.INDEX_MAX, { null })
|
||||
val itemEquipped = Array<GameItem?>(GameItem.EquipPosition.INDEX_MAX) { null }
|
||||
|
||||
/**
|
||||
* Sorted by referenceID.
|
||||
*/
|
||||
val itemList = ArrayList<InventoryPair>()
|
||||
val quickBar = Array<ItemID?>(10, { null }) // 0: Slot 1, 9: Slot 10
|
||||
val quickSlot = Array<ItemID?>(UIQuickslotBar.SLOT_COUNT) { null } // 0: Slot 1, 9: Slot 10
|
||||
|
||||
var currency = 0 // unified currency for whole civs; Dwarf Fortress approach seems too complicated
|
||||
|
||||
@@ -127,10 +127,10 @@ class ActorInventory(val actor: Pocketed, var maxCapacity: Int, var capacityMode
|
||||
}
|
||||
|
||||
fun setQuickBar(slot: Int, dynamicID: ItemID?) {
|
||||
quickBar[slot] = dynamicID
|
||||
quickSlot[slot] = dynamicID
|
||||
}
|
||||
|
||||
fun getQuickslot(slot: Int): InventoryPair? = getByDynamicID(quickBar[slot])
|
||||
fun getQuickslot(slot: Int): InventoryPair? = getByDynamicID(quickSlot[slot])
|
||||
|
||||
/**
|
||||
* HashMap<GameItem, Amounts>
|
||||
|
||||
Reference in New Issue
Block a user