able to "lock" the toggle key of the UI to prevent them from being closed while saving

This commit is contained in:
minjaesong
2021-09-14 23:24:21 +09:00
parent 1b71aa1760
commit 16a0b28696
4 changed files with 46 additions and 23 deletions

View File

@@ -83,8 +83,13 @@ class UIInventoryEscMenu(val full: UIInventoryFull) : UICanvas() {
when (new) {
0 -> {
screen = 3; gameMenuButtons.deselect()
full.handler.lockToggle()
// save the game
WriteSavegame(Terrarum.ingame!!.savegameArchive, File(App.defaultSaveDir, "${App.getTIME_T()}"), Terrarum.ingame!! as TerrarumIngame)
WriteSavegame(Terrarum.ingame!!.savegameArchive, File(App.defaultSaveDir, "${App.getTIME_T()}"), Terrarum.ingame!! as TerrarumIngame) {
// callback:
screen = 0
full.handler.unlockToggle()
}
}
4 -> {
screen = 2; gameMenuButtons.deselect()
@@ -127,7 +132,6 @@ class UIInventoryEscMenu(val full: UIInventoryFull) : UICanvas() {
},
{ delta: Float ->
savingUI.update(delta)
// TODO make UI not closable until saving is done
}
)
private val screenRenders = arrayOf(