fixed a bug where closing the inventory ui while tooltip is showing will make it persist when the ui is opened again

This commit is contained in:
minjaesong
2022-03-12 17:52:48 +09:00
parent 54f1f590c4
commit 40a7c6876a
11 changed files with 87 additions and 17 deletions

View File

@@ -34,6 +34,26 @@ import kotlin.math.roundToInt
*
* PosX/Y and relativeMouseX/Y are explained in ```work_files/terrarum_ui_elements_coord_explained.png```
*
* ## Show/Hide/Opening/Closing Timeline
*
* The functions `show`, `doOpening`, `doClosing`, `hide`, `endOpening`, `endClosing` are called sequentially in this order:
*
* ```
* (open has triggered)
* show()
* doOpening()
* doOpening()
* ...
* endOpening()
* ...
* (close has triggered)
* hide()
* doClosing()
* doClosing()
* ...
* endClosing()
* ```
*
* Created by minjaesong on 2015-12-31.
*/
abstract class UICanvas(

View File

@@ -34,7 +34,7 @@ class UIItemSpinner(
private val fbo = FrameBuffer(Pixmap.Format.RGBA8888, width - 2*buttonW - 6, height - 4, false)
var value = initialValue.coerceIn(min, max)
private var fboUpdateLatch = true
var fboUpdateLatch = true
private var mouseOnButton = 0 // 0: nothing, 1: left, 2: right

View File

@@ -124,6 +124,14 @@ open class UIItemTransitionContainer(
return true
}
override fun show() {
uis.forEach { it.show() }
}
override fun hide() {
uis.forEach { it.hide() }
}
override fun dispose() {
uis.forEach { it.dispose() }
}