mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-09 21:31:51 +09:00
fix: ui show() and hide() was only called when it feels like
This commit is contained in:
@@ -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()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user