mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-10 10:34:06 +09:00
the file io is cursed
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user