change control working on the esc menu

This commit is contained in:
minjaesong
2022-01-26 23:28:44 +09:00
parent 9b4dd019ca
commit 71176dcc9e
2 changed files with 20 additions and 2 deletions

View File

@@ -80,6 +80,10 @@ class UIInventoryEscMenu(val full: UIInventoryFull) : UICanvas() {
private var oldScreen = 0
private var screen = 0
fun toInitScreen() {
screen = 0
}
init {
uiItems.add(gameMenuButtons)
@@ -187,6 +191,9 @@ class UIInventoryEscMenu(val full: UIInventoryFull) : UICanvas() {
savingUI.render(batch, camera)
},
{ batch: SpriteBatch, camera: Camera ->
// control hints
App.fontGame.draw(batch, full.gameMenuControlHelp, full.offsetX, full.yEnd - 20)
keyConfigUI.render(batch, camera)
},
)
@@ -198,10 +205,21 @@ class UIInventoryEscMenu(val full: UIInventoryFull) : UICanvas() {
override fun updateUI(delta: Float) {
val yeet = screens[screen]
if (oldScreen != screen) {
val yeOlde = screens[oldScreen]
if (yeOlde is UIItem)
yeOlde.hide()
else if (yeOlde is UICanvas) {
yeOlde.setAsClose()
}
if (yeet is UIItem)
yeet.show()
else if (yeet is UICanvas)
else if (yeet is UICanvas) {
yeet.show()
yeet.setPosition(0,42)
yeet.setAsOpen()
}
oldScreen = screen
}
if (yeet is UIItem)

View File

@@ -8,7 +8,6 @@ import net.torvald.ENDASH
import net.torvald.getKeycapPC
import net.torvald.terrarum.*
import net.torvald.terrarum.App.*
import net.torvald.terrarum.blockstats.MinimapComposer
import net.torvald.terrarum.langpack.Lang
import net.torvald.terrarum.modulebasegame.gameactors.ActorHumanoid
import net.torvald.terrarum.ui.Toolkit
@@ -206,6 +205,7 @@ class UIInventoryFull(
INGAME.setTooltipMessage(null)
transitionPanel.forcePosition(2)
catBar.setSelectedPanel(2)
transitionalEscMenu.toInitScreen()
it.setAsOpen()
}
else if (it.isOpened)