mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-11 11:04:05 +09:00
new inventory category 'fixtures'; fixture code refactoring
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user