the file io is cursed

This commit is contained in:
minjaesong
2023-07-08 03:12:15 +09:00
parent b31da6ffec
commit d507d84950
14 changed files with 427 additions and 399 deletions

View File

@@ -1,6 +1,6 @@
package net.torvald.terrarum.ui
import com.jme3.math.FastMath
import net.torvald.terrarum.App.printdbg
import net.torvald.terrarum.INGAME
import net.torvald.terrarum.modulebasegame.ui.NullUI
import kotlin.math.absoluteValue
@@ -36,13 +36,13 @@ class UIItemHorizontalFadeSlide(
override val uis: List<UICanvas>; get() = listOf(leftUI, centreUI, rightUI)
fun setLeftUI(index: Int) {
fun setLeftUIto(index: Int) {
leftUI = uisOnLeft[index]
}
fun setCentreUI(index: Int) {
fun setCentreUIto(index: Int) {
centreUI = uisOnCentre[index]
}
fun setRightUI(index: Int) {
fun setRightUIto(index: Int) {
rightUI = uisOnRight[index]
}
@@ -79,4 +79,31 @@ class UIItemHorizontalFadeSlide(
}
INGAME.setTooltipMessage(null)
}
override fun dispose() {
uisOnLeft.forEach { try { it.dispose() } catch (e: IllegalArgumentException) {} }
uisOnCentre.forEach { try { it.dispose() } catch (e: IllegalArgumentException) {} }
uisOnRight.forEach { try { it.dispose() } catch (e: IllegalArgumentException) {} }
}
override fun keyDown(keycode: Int): Boolean {
return super.keyDown(keycode)
}
override fun keyUp(keycode: Int): Boolean {
return super.keyUp(keycode)
}
override fun touchDown(screenX: Int, screenY: Int, pointer: Int, button: Int): Boolean {
printdbg(this, "touchDown UIs: ${uis.joinToString { it.javaClass.simpleName }}")
return super.touchDown(screenX, screenY, pointer, button)
}
override fun touchUp(screenX: Int, screenY: Int, pointer: Int, button: Int): Boolean {
return super.touchUp(screenX, screenY, pointer, button)
}
override fun scrolled(amountX: Float, amountY: Float): Boolean {
return super.scrolled(amountX, amountY)
}
}