mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-11 19:14:05 +09:00
crafting ui item cell highlighting works as intended
This commit is contained in:
@@ -28,7 +28,8 @@ abstract class UIItemInventoryCellBase(
|
||||
open var equippedSlot: Int? = null,
|
||||
val keyDownFun: (GameItem?, Long, Int, Any?, UIItemInventoryCellBase) -> Unit, // Item, Amount, Keycode, extra info, self
|
||||
val touchDownFun: (GameItem?, Long, Int, Any?, UIItemInventoryCellBase) -> Unit, // Item, Amount, Button, extra info, self
|
||||
open var extraInfo: Any?
|
||||
open var extraInfo: Any?,
|
||||
open protected val highlightEquippedItem: Boolean = true // for some UIs that only cares about getting equipped slot number but not highlighting
|
||||
) : UIItem(parentUI, initialX, initialY) {
|
||||
abstract override fun update(delta: Float)
|
||||
abstract override fun render(batch: SpriteBatch, camera: Camera)
|
||||
|
||||
@@ -45,7 +45,8 @@ open class UIItemInventoryItemGrid(
|
||||
val hideSidebar: Boolean = false,
|
||||
keyDownFun: (GameItem?, Long, Int, Any?, UIItemInventoryCellBase) -> Unit, // Item, Amount, Keycode, extra info, self
|
||||
touchDownFun: (GameItem?, Long, Int, Any?, UIItemInventoryCellBase) -> Unit, // Item, Amount, Button, extra info, self
|
||||
protected val useHighlightingManager: Boolean = true // only used by UIItemCraftingCandidateGrid which addresses buttons directly to set highlighting
|
||||
protected val useHighlightingManager: Boolean = true, // only used by UIItemCraftingCandidateGrid which addresses buttons directly to set highlighting
|
||||
open protected val highlightEquippedItem: Boolean = true // for some UIs that only cares about getting equipped slot number but not highlighting
|
||||
) : UIItem(parentUI, initialX, initialY) {
|
||||
|
||||
// deal with the moving position
|
||||
@@ -184,7 +185,8 @@ open class UIItemInventoryItemGrid(
|
||||
itemImage = null,
|
||||
drawBackOnNull = true,
|
||||
keyDownFun = keyDownFun,
|
||||
touchDownFun = touchDownFun
|
||||
touchDownFun = touchDownFun,
|
||||
highlightEquippedItem = highlightEquippedItem
|
||||
)
|
||||
}
|
||||
// automatically determine how much columns are needed. Minimum Width = 5 grids
|
||||
@@ -202,7 +204,8 @@ open class UIItemInventoryItemGrid(
|
||||
itemImage = null,
|
||||
drawBackOnNull = true,
|
||||
keyDownFun = keyDownFun,
|
||||
touchDownFun = touchDownFun
|
||||
touchDownFun = touchDownFun,
|
||||
highlightEquippedItem = highlightEquippedItem
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user