inventory lister's category setting must be held by its parent

This commit is contained in:
minjaesong
2019-08-06 02:28:07 +09:00
parent 0f283f2aaa
commit 08c18caa25
4 changed files with 45 additions and 34 deletions

View File

@@ -36,8 +36,10 @@ class UIItemInventoryCatBar(
private val mainButtons: Array<UIItemImageButton>
private val buttonGapSize = (width.toFloat() - (catArrangement.size * catIcons.tileW)) / (catArrangement.size)
var selectedIndex = 0 // default to ALL
/** raw order */
private var selectedIndex = 0 // default to ALL
private set
/** re-arranged order */
val selectedIcon: Int
get() = catArrangement[selectedIndex]
@@ -141,7 +143,8 @@ class UIItemInventoryCatBar(
}
/** (oldIndex: Int?, newIndex: Int) -> Unit */
/** (oldIndex: Int?, newIndex: Int) -> Unit
* Indices are raw index. That is, not re-arranged. */
var selectionChangeListener: ((Int?, Int) -> Unit)? = null
override fun update(delta: Float) {