a cell for items to craft will highlight when selected

This commit is contained in:
minjaesong
2022-06-29 00:02:18 +09:00
parent b34502ebd3
commit 9edfc90ad8
7 changed files with 46 additions and 34 deletions

View File

@@ -16,8 +16,8 @@ class UIItemCraftingCandidateGrid(
initialX: Int, initialY: Int,
horizontalCells: Int, verticalCells: Int,
drawScrollOnRightside: Boolean = false,
keyDownFun: (GameItem?, Long, Int, Any?) -> Unit, // Item, Amount, Keycode, extra info
touchDownFun: (GameItem?, Long, Int, Any?) -> Unit // Item, Amount, Button, extra info
keyDownFun: (GameItem?, Long, Int, Any?, UIItemInventoryCellBase) -> Unit, // Item, Amount, Keycode, extra info, keyed button
touchDownFun: (GameItem?, Long, Int, Any?, UIItemInventoryCellBase) -> Unit // Item, Amount, Button, extra info, clicked button
) : UIItemInventoryItemGrid(
parentUI, catBar,
{ TODO() /* UNUSED and MUST NOT BE USED! */ },
@@ -37,6 +37,11 @@ class UIItemCraftingCandidateGrid(
internal val recipesSortList = ArrayList<CraftingCodex.CraftingRecipe>() // a dual to the [inventorySortList] which contains the actual recipes instead of crafting recipes
fun highlightButton(button: UIItemInventoryCellBase) {
items.forEach { it.forceHighlighted = false }
button.forceHighlighted = true
}
override fun rebuild(filter: Array<String>) {
// test fill craftingRecipes with every possible recipes in the game
craftingRecipes.clear()