mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-17 05:54:05 +09:00
Quickbar: all working except for equip/unequip
This commit is contained in:
@@ -93,9 +93,7 @@ object AVKey {
|
||||
|
||||
|
||||
const val __PLAYER_QUICKSLOTSEL = "__quickslotselection"
|
||||
/** SYNOPSIS: __qsitem1 .. __qsitem10
|
||||
* contains tem ID; they are supposed to be unique. Indices must be ONE-BASED! */
|
||||
const val __PLAYER_QSPREFIX = "__qsitem" // __qsitem1 .. __qsitem10 (NOT ZERO BASED!)
|
||||
|
||||
/** Double
|
||||
* When using tool/arm/etc. how long action button is held, in milliseconds (Int)
|
||||
* Or for NPCs, how long it has been waiting for next move
|
||||
|
||||
@@ -3,6 +3,7 @@ package net.torvald.terrarum.gameactors
|
||||
import com.jme3.math.FastMath
|
||||
import net.torvald.terrarum.Terrarum
|
||||
import net.torvald.terrarum.gameactors.faction.Faction
|
||||
import net.torvald.terrarum.gamecontroller.Key
|
||||
import net.torvald.terrarum.itemproperties.InventoryItem
|
||||
import net.torvald.terrarum.itemproperties.Material
|
||||
import net.torvald.terrarum.realestate.LandUtil
|
||||
@@ -333,7 +334,9 @@ open class ActorHumanoid(birth: GameDate, death: GameDate? = null)
|
||||
}
|
||||
|
||||
override fun keyPressed(key: Int, c: Char) {
|
||||
|
||||
if (key in Key.NUM_1..Key.NUM_0) {
|
||||
actorValue[AVKey.__PLAYER_QUICKSLOTSEL] = key - Key.NUM_1
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -33,7 +33,7 @@ class ActorInventory(val actor: Pocketed, var maxCapacity: Int, var capacityMode
|
||||
* Sorted by referenceID.
|
||||
*/
|
||||
private val itemList = ArrayList<InventoryPair>()
|
||||
private val quickBar = Array<ItemID?>(10, { null })
|
||||
private val quickBar = Array<ItemID?>(10, { null }) // 0: Slot 1, 9: Slot 10
|
||||
|
||||
init {
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user