diff --git a/src/net/torvald/terrarum/ui/UICanvas.kt b/src/net/torvald/terrarum/ui/UICanvas.kt index 86fbd7ac6..57ec43136 100644 --- a/src/net/torvald/terrarum/ui/UICanvas.kt +++ b/src/net/torvald/terrarum/ui/UICanvas.kt @@ -50,11 +50,11 @@ import kotlin.math.roundToInt * endOpening() * ... * (close has triggered) - * hide() * doClosing() * doClosing() * ... * endClosing() + * hide() * ``` * NOTE: show/hide is a UICanvas function, while do/endSomething() is UIHandler function. * @@ -280,17 +280,14 @@ abstract class UICanvas( fun setAsAlwaysVisible() { handler.setAsAlwaysVisible() - show() } open fun setAsOpen() { handler.setAsOpen() - show() } open fun setAsClose() { handler.setAsClose() - hide() } open fun toggleOpening() { @@ -301,13 +298,11 @@ abstract class UICanvas( if (isVisible) { if (!isClosing) { setAsClose() - hide() } } else { if (!isOpening) { setAsOpen() - show() } } } diff --git a/src/net/torvald/terrarum/ui/UIHandler.kt b/src/net/torvald/terrarum/ui/UIHandler.kt index 085d9f568..08a8898b3 100644 --- a/src/net/torvald/terrarum/ui/UIHandler.kt +++ b/src/net/torvald/terrarum/ui/UIHandler.kt @@ -229,6 +229,7 @@ void main() { } if (isOpening) { + if (openFired) ui.show() openFired = false isVisible = true @@ -270,6 +271,7 @@ void main() { isOpened = false isVisible = false openCloseCounter = 0f + ui.hide() } }