From 194a79d134c4ec2de0d2d6a3421b456c2ea87efb Mon Sep 17 00:00:00 2001 From: minjaesong Date: Sun, 20 Mar 2022 00:58:37 +0900 Subject: [PATCH] fixed a bug where fullscreen inventory ui would errenously unpause the game --- .../modulebasegame/gameactors/FixtureStorageChest.kt | 10 ++++++++-- .../terrarum/modulebasegame/gameactors/UICrafting.kt | 5 ++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/net/torvald/terrarum/modulebasegame/gameactors/FixtureStorageChest.kt b/src/net/torvald/terrarum/modulebasegame/gameactors/FixtureStorageChest.kt index 79f1a43cf..a4e4a892d 100644 --- a/src/net/torvald/terrarum/modulebasegame/gameactors/FixtureStorageChest.kt +++ b/src/net/torvald/terrarum/modulebasegame/gameactors/FixtureStorageChest.kt @@ -138,7 +138,7 @@ internal class UIStorageChest : UICanvas( { INGAME.actorNowPlaying!!.inventory }, // literally a player's inventory INVENTORY_CELLS_OFFSET_X() - halfSlotOffset + (listGap + UIItemInventoryElemWide.height) * 7, INVENTORY_CELLS_OFFSET_Y(), - 6, CELLS_VRT - 1, + 6, CELLS_VRT, drawScrollOnRightside = true, drawWallet = false, keyDownFun = { _, _, _ -> Unit }, @@ -211,6 +211,10 @@ internal class UIStorageChest : UICanvas( if (openingClickLatched && !Terrarum.mouseDown) openingClickLatched = false } + private val thisOffsetX = UIInventoryFull.INVENTORY_CELLS_OFFSET_X() - halfSlotOffset + private val thisOffsetX2 = thisOffsetX + (listGap + UIItemInventoryElemWide.height) * 7 + private val thisOffsetY = UIInventoryFull.INVENTORY_CELLS_OFFSET_Y() + override fun renderUI(batch: SpriteBatch, camera: Camera) { // background fill UIInventoryFull.drawBackground(batch) @@ -255,7 +259,9 @@ internal class UIStorageChest : UICanvas( // chest name text batch.color = Color.WHITE - App.fontGame.draw(batch, chestName, chestNameXpos, encumbBarYPos - 3f) + App.fontGame.draw(batch, chestName, thisOffsetX + 2, thisOffsetY - 30) + App.fontGame.draw(batch, Lang["GAME_INVENTORY"], thisOffsetX2 + 2, thisOffsetY - 30) + // encumb text batch.color = Color.WHITE App.fontGame.draw(batch, encumbranceText, encumbBarTextXPos, encumbBarYPos - 3f + diff --git a/src/net/torvald/terrarum/modulebasegame/gameactors/UICrafting.kt b/src/net/torvald/terrarum/modulebasegame/gameactors/UICrafting.kt index cf89f067b..9f1abc951 100644 --- a/src/net/torvald/terrarum/modulebasegame/gameactors/UICrafting.kt +++ b/src/net/torvald/terrarum/modulebasegame/gameactors/UICrafting.kt @@ -8,7 +8,6 @@ import net.torvald.terrarum.App.printdbg import net.torvald.terrarum.gameitems.GameItem import net.torvald.terrarum.langpack.Lang import net.torvald.terrarum.modulebasegame.ui.* -import net.torvald.terrarum.modulebasegame.ui.UIInventoryCells import net.torvald.terrarum.modulebasegame.ui.UIItemInventoryItemGrid.Companion.listGap import net.torvald.terrarum.ui.Toolkit import net.torvald.terrarum.ui.UICanvas @@ -246,12 +245,12 @@ class UICrafting(val full: UIInventoryFull) : UICanvas( } override fun doOpening(delta: Float) { - INGAME.pause() +// INGAME.pause() INGAME.setTooltipMessage(null) } override fun doClosing(delta: Float) { - INGAME.resume() +// INGAME.resume() INGAME.setTooltipMessage(null) }