fixed a bug where fullscreen inventory ui would errenously unpause the game

This commit is contained in:
minjaesong
2022-03-20 00:58:37 +09:00
parent b8ccee3882
commit 194a79d134
2 changed files with 10 additions and 5 deletions

View File

@@ -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 +

View File

@@ -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)
}