inventory ui itemgrid:removed inventoryfull dependency

This commit is contained in:
minjaesong
2021-03-12 10:38:53 +09:00
parent ae3bf663e0
commit bd89ca67fb
9 changed files with 123 additions and 106 deletions

View File

@@ -15,13 +15,14 @@ import net.torvald.terrarum.modulebasegame.ui.UIItemInventoryCellCommonRes
import net.torvald.terrarum.modulebasegame.ui.UIItemInventoryCellCommonRes.toItemCountText
import net.torvald.terrarum.ui.Toolkit
import net.torvald.terrarum.ui.Toolkit.DEFAULT_BOX_BORDER_COL
import net.torvald.terrarum.ui.UICanvas
import net.torvald.terrarum.ui.UIItemTextButton
/**
* Created by minjaesong on 2017-10-20.
*/
class UIItemInventoryElemSimple(
parentUI: UIInventoryFull,
parentUI: UICanvas,
initialX: Int,
initialY: Int,
override var item: GameItem?,
@@ -36,15 +37,14 @@ class UIItemInventoryElemSimple(
val highlightCol: Color = UIItemTextButton.defaultHighlightCol,
override var quickslot: Int? = null,
override var equippedSlot: Int? = null,
val drawBackOnNull: Boolean = true
val drawBackOnNull: Boolean = true,
val listRebuildFun: () -> Unit
) : UIItemInventoryCellBase(parentUI, initialX, initialY, item, amount, itemImage, quickslot, equippedSlot) {
companion object {
val height = UIItemInventoryElem.height
}
private val inventoryUI = parentUI
override val width = UIItemInventoryElemSimple.height
override val height = UIItemInventoryElemSimple.height
@@ -191,7 +191,7 @@ class UIItemInventoryElemSimple(
}
}
inventoryUI.rebuildList()
listRebuildFun()
return super.touchDown(screenX, screenY, pointer, button)
}