mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-06 08:38:30 +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()
|
* endOpening()
|
||||||
* ...
|
* ...
|
||||||
* (close has triggered)
|
* (close has triggered)
|
||||||
* hide()
|
|
||||||
* doClosing()
|
* doClosing()
|
||||||
* doClosing()
|
* doClosing()
|
||||||
* ...
|
* ...
|
||||||
* endClosing()
|
* endClosing()
|
||||||
|
* hide()
|
||||||
* ```
|
* ```
|
||||||
* NOTE: show/hide is a UICanvas function, while do/endSomething() is UIHandler function.
|
* NOTE: show/hide is a UICanvas function, while do/endSomething() is UIHandler function.
|
||||||
*
|
*
|
||||||
@@ -280,17 +280,14 @@ abstract class UICanvas(
|
|||||||
|
|
||||||
fun setAsAlwaysVisible() {
|
fun setAsAlwaysVisible() {
|
||||||
handler.setAsAlwaysVisible()
|
handler.setAsAlwaysVisible()
|
||||||
show()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
open fun setAsOpen() {
|
open fun setAsOpen() {
|
||||||
handler.setAsOpen()
|
handler.setAsOpen()
|
||||||
show()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
open fun setAsClose() {
|
open fun setAsClose() {
|
||||||
handler.setAsClose()
|
handler.setAsClose()
|
||||||
hide()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
open fun toggleOpening() {
|
open fun toggleOpening() {
|
||||||
@@ -301,13 +298,11 @@ abstract class UICanvas(
|
|||||||
if (isVisible) {
|
if (isVisible) {
|
||||||
if (!isClosing) {
|
if (!isClosing) {
|
||||||
setAsClose()
|
setAsClose()
|
||||||
hide()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (!isOpening) {
|
if (!isOpening) {
|
||||||
setAsOpen()
|
setAsOpen()
|
||||||
show()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -229,6 +229,7 @@ void main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isOpening) {
|
if (isOpening) {
|
||||||
|
if (openFired) ui.show()
|
||||||
openFired = false
|
openFired = false
|
||||||
|
|
||||||
isVisible = true
|
isVisible = true
|
||||||
@@ -270,6 +271,7 @@ void main() {
|
|||||||
isOpened = false
|
isOpened = false
|
||||||
isVisible = false
|
isVisible = false
|
||||||
openCloseCounter = 0f
|
openCloseCounter = 0f
|
||||||
|
ui.hide()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user