new inventory category 'fixtures'; fixture code refactoring

This commit is contained in:
minjaesong
2023-10-04 01:03:40 +09:00
parent fc8138f3b1
commit 9a527a4508
25 changed files with 73 additions and 158 deletions

View File

@@ -72,7 +72,7 @@ internal class UIInventoryCells(
fun rebuildList() {
// App.printdbg(this, "rebuilding list")
itemList.rebuild(full.catBar.catIconsMeaning[full.catBar.selectedIcon])
itemList.rebuild(full.catBar.catIconsMeaning[full.catBar.selectedIndex])
equipped.rebuild()
encumbrancePerc = full.actor.inventory.encumberment.toFloat()
@@ -81,7 +81,7 @@ internal class UIInventoryCells(
fun resetStatusAsCatChanges(oldcat: Int?, newcat: Int) {
itemList.itemPage = 0 // set scroll to zero
itemList.rebuild(full.catBar.catIconsMeaning[full.catBar.catArrangement[newcat]]) // have to manually rebuild, too!
itemList.rebuild(full.catBar.catIconsMeaning[newcat]) // have to manually rebuild, too!
}
override fun updateUI(delta: Float) {

View File

@@ -176,6 +176,7 @@ class UINewWorld(val remoCon: UIRemoCon) : UICanvas() {
val ingame = TerrarumIngame(App.batch)
val playerDisk = existingPlayer ?: App.savegamePlayers[UILoadGovernor.playerUUID]!!.loadable()
playerDisk.rebuild()
val player = ReadActor.invoke(
playerDisk,
ByteArray64Reader(playerDisk.getFile(SAVEGAMEINFO)!!.bytes, Common.CHARSET)

View File

@@ -131,8 +131,8 @@ internal class UIStorageChest : UICanvas(
}
private fun itemListUpdate() {
itemListChest.rebuild(catBar.catIconsMeaning[catBar.selectedIcon])
itemListPlayer.rebuild(catBar.catIconsMeaning[catBar.selectedIcon])
itemListChest.rebuild(catBar.catIconsMeaning[catBar.selectedIndex])
itemListPlayer.rebuild(catBar.catIconsMeaning[catBar.selectedIndex])
encumbrancePerc = getPlayerInventory().capacity.toFloat() / getPlayerInventory().maxCapacity
isEncumbered = getPlayerInventory().isEncumbered
@@ -143,13 +143,13 @@ internal class UIStorageChest : UICanvas(
itemListChest.navRemoCon.gridModeButtons[0].highlighted = !yes
itemListChest.navRemoCon.gridModeButtons[1].highlighted = yes
itemListChest.itemPage = 0
itemListChest.rebuild(catBar.catIconsMeaning[catBar.selectedIcon])
itemListChest.rebuild(catBar.catIconsMeaning[catBar.selectedIndex])
itemListPlayer.isCompactMode = yes
itemListPlayer.navRemoCon.gridModeButtons[0].highlighted = !yes
itemListPlayer.navRemoCon.gridModeButtons[1].highlighted = yes
itemListPlayer.itemPage = 0
itemListPlayer.rebuild(catBar.catIconsMeaning[catBar.selectedIcon])
itemListPlayer.rebuild(catBar.catIconsMeaning[catBar.selectedIndex])
itemListUpdate()
}

View File

@@ -123,8 +123,8 @@ class UIWorldPortalCargo(val full: UIWorldPortal) : UICanvas(), HasInventory {
}
private fun itemListUpdate() {
itemListChest.rebuild(catBar.catIconsMeaning[catBar.selectedIcon])
itemListPlayer.rebuild(catBar.catIconsMeaning[catBar.selectedIcon])
itemListChest.rebuild(catBar.catIconsMeaning[catBar.selectedIndex])
itemListPlayer.rebuild(catBar.catIconsMeaning[catBar.selectedIndex])
encumbrancePerc = getPlayerInventory().capacity.toFloat() / getPlayerInventory().maxCapacity
isEncumbered = getPlayerInventory().isEncumbered
@@ -135,13 +135,13 @@ class UIWorldPortalCargo(val full: UIWorldPortal) : UICanvas(), HasInventory {
itemListChest.navRemoCon.gridModeButtons[0].highlighted = !yes
itemListChest.navRemoCon.gridModeButtons[1].highlighted = yes
itemListChest.itemPage = 0
itemListChest.rebuild(catBar.catIconsMeaning[catBar.selectedIcon])
itemListChest.rebuild(catBar.catIconsMeaning[catBar.selectedIndex])
itemListPlayer.isCompactMode = yes
itemListPlayer.navRemoCon.gridModeButtons[0].highlighted = !yes
itemListPlayer.navRemoCon.gridModeButtons[1].highlighted = yes
itemListPlayer.itemPage = 0
itemListPlayer.rebuild(catBar.catIconsMeaning[catBar.selectedIcon])
itemListPlayer.rebuild(catBar.catIconsMeaning[catBar.selectedIndex])
itemListUpdate()
}