mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-11 11:04:05 +09:00
jukebox ui wont pause the game AND not allow inventory to open
This commit is contained in:
@@ -994,6 +994,14 @@ open class TerrarumIngame(batch: FlippingSpriteBatch) : IngameInstance(batch) {
|
||||
}
|
||||
|
||||
uiContainer.forEach {
|
||||
|
||||
// suppress inventory opening if fixture inventory is opened
|
||||
if (uiFixture?.isClosed == false)
|
||||
uiInventoryPlayer.handler.lockToggle()
|
||||
else
|
||||
uiInventoryPlayer.handler.unlockToggle()
|
||||
|
||||
|
||||
when (it) {
|
||||
is Id_UICanvasNullable -> it.get()?.update(Gdx.graphics.deltaTime)
|
||||
is UICanvas -> it.update(Gdx.graphics.deltaTime)
|
||||
|
||||
@@ -181,7 +181,10 @@ open class ActorHumanoid : ActorWithBody, Controllable, Pocketed, Factionable, L
|
||||
var isJumpDown = false; protected set
|
||||
var isJumpJustDown = false; protected set // TODO if jump key is held in current update frame
|
||||
protected inline val isGamer: Boolean
|
||||
get() = if (Terrarum.ingame == null) false else this == INGAME.actorNowPlaying
|
||||
get() = if (Terrarum.ingame?.playerControlDisabled != false) // if (ingame is null) or (playerControlDisabled is true)
|
||||
false
|
||||
else
|
||||
(this == INGAME.actorNowPlaying)
|
||||
|
||||
private var jumpJustPressedLatched = false
|
||||
|
||||
|
||||
@@ -115,13 +115,13 @@ class UIJukebox : UICanvas(
|
||||
|
||||
override fun doOpening(delta: Float) {
|
||||
super.doOpening(delta)
|
||||
INGAME.pause()
|
||||
INGAME.disablePlayerControl()
|
||||
INGAME.setTooltipMessage(null)
|
||||
}
|
||||
|
||||
override fun doClosing(delta: Float) {
|
||||
super.doClosing(delta)
|
||||
INGAME.resume()
|
||||
INGAME.resumePlayerControl()
|
||||
INGAME.setTooltipMessage(null)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user