From ca72a6fbe59ce9d67942730553d04ccff002de49 Mon Sep 17 00:00:00 2001 From: minjaesong Date: Sat, 21 Aug 2021 21:03:39 +0900 Subject: [PATCH] trying to write a new ingamecontroller so that its update can be manually controlled --- src/net/torvald/terrarum/TitleScreen.kt | 5 - .../gamecontroller/IngameController.kt | 220 ++++++++++++++++-- .../terrarum/gamecontroller/KeyToggler.kt | 2 +- .../terrarum/modulebasegame/BuildingMaker.kt | 5 - .../terrarum/modulebasegame/TerrarumIngame.kt | 7 +- .../terrarum/modulebasegame/ui/UIRemoCon.kt | 8 - src/net/torvald/terrarum/ui/UICanvas.kt | 13 +- src/net/torvald/terrarum/ui/UIHandler.kt | 10 - src/net/torvald/terrarum/ui/UIItem.kt | 12 +- .../torvald/terrarum/ui/UIItemImageGallery.kt | 28 --- .../torvald/terrarum/ui/UIItemIntSlider.kt | 3 - .../terrarum/ui/UIItemTextButtonList.kt | 4 - .../terrarum/ui/UIItemTransitionContainer.kt | 5 - src/net/torvald/terrarum/ui/UINSMenu.kt | 3 - 14 files changed, 214 insertions(+), 111 deletions(-) diff --git a/src/net/torvald/terrarum/TitleScreen.kt b/src/net/torvald/terrarum/TitleScreen.kt index 473c51057..bffd15af6 100644 --- a/src/net/torvald/terrarum/TitleScreen.kt +++ b/src/net/torvald/terrarum/TitleScreen.kt @@ -325,11 +325,6 @@ class TitleScreen(batch: SpriteBatch) : IngameInstance(batch) { return true } - override fun mouseMoved(screenX: Int, screenY: Int): Boolean { - screen.uiContainer.forEach { it?.mouseMoved(screenX, screenY) } - return true - } - override fun keyTyped(character: Char): Boolean { screen.uiContainer.forEach { it?.keyTyped(character) } return true diff --git a/src/net/torvald/terrarum/gamecontroller/IngameController.kt b/src/net/torvald/terrarum/gamecontroller/IngameController.kt index fad8c80ac..530ad8121 100644 --- a/src/net/torvald/terrarum/gamecontroller/IngameController.kt +++ b/src/net/torvald/terrarum/gamecontroller/IngameController.kt @@ -2,13 +2,13 @@ package net.torvald.terrarum.gamecontroller import com.badlogic.gdx.Gdx import com.badlogic.gdx.Input +import com.badlogic.gdx.Input.Keys import com.badlogic.gdx.InputAdapter import com.badlogic.gdx.controllers.Controllers import com.badlogic.gdx.utils.GdxRuntimeException import net.torvald.terrarum.AppLoader import net.torvald.terrarum.AppLoader.printdbg import net.torvald.terrarum.AppLoader.printdbgerr -import net.torvald.terrarum.TerrarumAppConfiguration import net.torvald.terrarum.TerrarumAppConfiguration.TILE_SIZE import net.torvald.terrarum.controller.TerrarumController import net.torvald.terrarum.floorInt @@ -17,9 +17,8 @@ import net.torvald.terrarum.gameitem.GameItem import net.torvald.terrarum.gameworld.fmod import net.torvald.terrarum.itemproperties.ItemCodex import net.torvald.terrarum.modulebasegame.TerrarumIngame -import net.torvald.terrarum.modulebasegame.gameactors.FixtureBase -import net.torvald.terrarum.worlddrawer.CreateTileAtlas import net.torvald.terrarum.worlddrawer.WorldCamera +import java.util.* /** * Created by minjaesong on 2015-12-31. @@ -61,6 +60,12 @@ class IngameController(val terrarumIngame: TerrarumIngame) : InputAdapter() { private var worldPrimaryClickLatched = false + private val keyStatus = BitSet(256) + private var inputMouseX = -1 + private var inputMouseY = -1 + private val mouseStatus = BitSet(8) + private val controllerButtonStatus = BitSet(64) + fun update(delta: Float) { /////////////////// @@ -107,11 +112,45 @@ class IngameController(val terrarumIngame: TerrarumIngame) : InputAdapter() { //KeyToggler.update(terrarumIngame.canPlayerControl) //printdbg(this, terrarumIngame.canPlayerControl) + // control key events + var noKeyHeldDown = true + for (key in 1..Input.Keys.MAX_KEYCODE) { + val keyDown = Gdx.input.isKeyPressed(key) + + noKeyHeldDown = noKeyHeldDown and keyDown + + if (keyDown && !keyStatus[key]) + tKeyDown(key) + else if (!keyDown && keyStatus[key]) + tKeyUp(key) + + keyStatus[key] = keyDown + } + // control mouse/touch events + val newmx = Gdx.input.x + val newmy = Gdx.input.y + for (touch in 0..4) { + val touchDown = Gdx.input.isButtonPressed(touch) + + if (touchDown && !mouseStatus[touch]) + tTouchDown(newmx, newmy, 0, touch) + else if (!touchDown && keyStatus[touch]) + tTouchUp(newmx, newmy, 0, touch) + + if (touchDown && mouseStatus.bitCount() != 0) { + tTouchDragged(newmx, newmy, 0) + } + + mouseStatus[touch] = touchDown + } + + inputMouseX = newmx + inputMouseY = newmy } private var f12Down = false - override fun keyDown(keycode: Int): Boolean { + private fun tKeyDown(keycode: Int): Boolean { if (!terrarumIngame.paused) { terrarumIngame.actorNowPlaying?.keyDown(keycode) @@ -148,7 +187,7 @@ class IngameController(val terrarumIngame: TerrarumIngame) : InputAdapter() { return true } - override fun keyUp(keycode: Int): Boolean { + private fun tKeyUp(keycode: Int): Boolean { if (AppLoader.getConfigIntArray("config_keyquickselalt").contains(keycode) || keycode == AppLoader.getConfigInt("config_keyquicksel")) { terrarumIngame.uiPieMenu.setAsClose() @@ -169,12 +208,7 @@ class IngameController(val terrarumIngame: TerrarumIngame) : InputAdapter() { return true } - override fun mouseMoved(screenX: Int, screenY: Int): Boolean { - terrarumIngame.uiContainer.forEach { it?.mouseMoved(screenX, screenY) } - return true - } - - override fun touchUp(screenX: Int, screenY: Int, pointer: Int, button: Int): Boolean { + private fun tTouchUp(screenX: Int, screenY: Int, pointer: Int, button: Int): Boolean { // don't separate Player from this! Physics will break, esp. airborne manoeuvre if (!terrarumIngame.paused) { // fire world click events; the event is defined as Ingame's (or any others') WorldClick event @@ -216,12 +250,12 @@ class IngameController(val terrarumIngame: TerrarumIngame) : InputAdapter() { return true } - override fun touchDragged(screenX: Int, screenY: Int, pointer: Int): Boolean { + private fun tTouchDragged(screenX: Int, screenY: Int, pointer: Int): Boolean { terrarumIngame.uiContainer.forEach { it?.touchDragged(screenX, screenY, pointer) } return true } - override fun touchDown(screenX: Int, screenY: Int, pointer: Int, button: Int): Boolean { + private fun tTouchDown(screenX: Int, screenY: Int, pointer: Int, button: Int): Boolean { terrarumIngame.uiContainer.forEach { it?.touchDown(screenX, screenY, pointer, button) } // pie menu @@ -233,5 +267,163 @@ class IngameController(val terrarumIngame: TerrarumIngame) : InputAdapter() { return true } + companion object { + const val KEY_DELAY = 0.2f + const val KEY_REPEAT = 1f / 40f + val KEYCODE_TO_CHAR = hashMapOf( + Keys.NUM_1 to '1', + Keys.NUM_2 to '2', + Keys.NUM_3 to '3', + Keys.NUM_4 to '4', + Keys.NUM_5 to '5', + Keys.NUM_6 to '6', + Keys.NUM_7 to '7', + Keys.NUM_8 to '8', + Keys.NUM_9 to '9', + Keys.NUM_0 to '0', -} + Keys.A to 'a', + Keys.B to 'b', + Keys.C to 'c', + Keys.D to 'd', + Keys.E to 'e', + Keys.F to 'f', + Keys.G to 'g', + Keys.H to 'h', + Keys.I to 'i', + Keys.J to 'j', + Keys.K to 'k', + Keys.L to 'l', + Keys.M to 'm', + Keys.N to 'n', + Keys.O to 'o', + Keys.P to 'p', + Keys.Q to 'q', + Keys.R to 'r', + Keys.S to 's', + Keys.T to 't', + Keys.U to 'u', + Keys.V to 'v', + Keys.W to 'w', + Keys.X to 'x', + Keys.Y to 'y', + Keys.Z to 'z', + + Keys.GRAVE to '`', + Keys.MINUS to '-', + Keys.EQUALS to '=', + Keys.BACKSPACE to 8.toChar(), + + Keys.LEFT_BRACKET to '[', + Keys.RIGHT_BRACKET to ']', + Keys.BACKSLASH to '\\', + + Keys.SEMICOLON to ';', + Keys.APOSTROPHE to '\'', + Keys.ENTER to 10.toChar(), + + Keys.COMMA to ',', + Keys.PERIOD to '.', + Keys.SLASH to '/', + + Keys.SPACE to ' ', + + Keys.NUMPAD_0 to '0', + Keys.NUMPAD_1 to '1', + Keys.NUMPAD_2 to '2', + Keys.NUMPAD_3 to '3', + Keys.NUMPAD_4 to '4', + Keys.NUMPAD_5 to '5', + Keys.NUMPAD_6 to '6', + Keys.NUMPAD_7 to '7', + Keys.NUMPAD_8 to '8', + Keys.NUMPAD_9 to '9', + + Keys.NUMPAD_DIVIDE to '/', + Keys.NUMPAD_MULTIPLY to '*', + Keys.NUMPAD_SUBTRACT to '-', + Keys.NUMPAD_ADD to '+', + Keys.NUMPAD_DOT to '.', + Keys.NUMPAD_ENTER to 10.toChar() + ) + val KEYCODE_TO_CHAR_SHIFT = hashMapOf( + Keys.NUM_1 to '!', + Keys.NUM_2 to '@', + Keys.NUM_3 to '#', + Keys.NUM_4 to '$', + Keys.NUM_5 to '%', + Keys.NUM_6 to '^', + Keys.NUM_7 to '&', + Keys.NUM_8 to '*', + Keys.NUM_9 to '(', + Keys.NUM_0 to ')', + + Keys.A to 'A', + Keys.B to 'B', + Keys.C to 'C', + Keys.D to 'D', + Keys.E to 'E', + Keys.F to 'F', + Keys.G to 'G', + Keys.H to 'H', + Keys.I to 'I', + Keys.J to 'J', + Keys.K to 'K', + Keys.L to 'L', + Keys.M to 'M', + Keys.N to 'N', + Keys.O to 'O', + Keys.P to 'P', + Keys.Q to 'Q', + Keys.R to 'R', + Keys.S to 'S', + Keys.T to 'T', + Keys.U to 'U', + Keys.V to 'V', + Keys.W to 'W', + Keys.X to 'X', + Keys.Y to 'Y', + Keys.Z to 'Z', + + Keys.GRAVE to '~', + Keys.MINUS to '_', + Keys.EQUALS to '+', + Keys.BACKSPACE to 8.toChar(), + + Keys.LEFT_BRACKET to '{', + Keys.RIGHT_BRACKET to '}', + Keys.BACKSLASH to '|', + + Keys.SEMICOLON to ':', + Keys.APOSTROPHE to '"', + Keys.ENTER to 10.toChar(), + + Keys.COMMA to '<', + Keys.PERIOD to '>', + Keys.SLASH to '?', + + Keys.SPACE to ' ', + + Keys.NUMPAD_0 to '0', + Keys.NUMPAD_1 to '1', + Keys.NUMPAD_2 to '2', + Keys.NUMPAD_3 to '3', + Keys.NUMPAD_4 to '4', + Keys.NUMPAD_5 to '5', + Keys.NUMPAD_6 to '6', + Keys.NUMPAD_7 to '7', + Keys.NUMPAD_8 to '8', + Keys.NUMPAD_9 to '9', + + Keys.NUMPAD_DIVIDE to '/', + Keys.NUMPAD_MULTIPLY to '*', + Keys.NUMPAD_SUBTRACT to '-', + Keys.NUMPAD_ADD to '+', + Keys.NUMPAD_DOT to '.', + Keys.NUMPAD_ENTER to 10.toChar() + ) + } + + private inline fun BitSet.bitCount() = this.cardinality() + +} \ No newline at end of file diff --git a/src/net/torvald/terrarum/gamecontroller/KeyToggler.kt b/src/net/torvald/terrarum/gamecontroller/KeyToggler.kt index c4a0934dd..37a89a3aa 100644 --- a/src/net/torvald/terrarum/gamecontroller/KeyToggler.kt +++ b/src/net/torvald/terrarum/gamecontroller/KeyToggler.kt @@ -33,7 +33,7 @@ object KeyToggler { * Set ```toggleGameKeys = true``` to make toggling work for keys like Q, W, E, ...; otherwise only F1-F12 keys will be toggled */ fun update(toggleGameKeys: Boolean) { - for (it in 0..255) { + for (it in 1..255) { if (!toggleGameKeys && gameKeys.contains(it)) { continue } diff --git a/src/net/torvald/terrarum/modulebasegame/BuildingMaker.kt b/src/net/torvald/terrarum/modulebasegame/BuildingMaker.kt index 9429bbf88..e6f39684b 100644 --- a/src/net/torvald/terrarum/modulebasegame/BuildingMaker.kt +++ b/src/net/torvald/terrarum/modulebasegame/BuildingMaker.kt @@ -505,11 +505,6 @@ class BuildingMakerController(val screen: BuildingMaker) : InputAdapter() { return true } - override fun mouseMoved(screenX: Int, screenY: Int): Boolean { - screen.uiContainer.forEach { it?.mouseMoved(screenX, screenY) } - return true - } - override fun keyTyped(character: Char): Boolean { screen.uiContainer.forEach { it?.keyTyped(character) } return true diff --git a/src/net/torvald/terrarum/modulebasegame/TerrarumIngame.kt b/src/net/torvald/terrarum/modulebasegame/TerrarumIngame.kt index add870cd7..8e1f8814d 100644 --- a/src/net/torvald/terrarum/modulebasegame/TerrarumIngame.kt +++ b/src/net/torvald/terrarum/modulebasegame/TerrarumIngame.kt @@ -564,6 +564,10 @@ open class TerrarumIngame(batch: SpriteBatch) : IngameInstance(batch) { particlesActive = 0 + // synchronised Ingame Input Updater + ingameController.update(delta) + + if (!paused) { //hypothetical_input_capturing_function_if_you_finally_decided_to_forgo_gdx_input_processor_and_implement_your_own_to_synchronise_everything() @@ -611,9 +615,6 @@ open class TerrarumIngame(batch: SpriteBatch) : IngameInstance(batch) { } - // world click events (e.g. opening the UI that a fixture has) must go here - ingameController.update(delta) - /*if (!paused) { // completely consume block change queues because why not terrainChangeQueue.clear() diff --git a/src/net/torvald/terrarum/modulebasegame/ui/UIRemoCon.kt b/src/net/torvald/terrarum/modulebasegame/ui/UIRemoCon.kt index 438e2f231..f9befd7fc 100644 --- a/src/net/torvald/terrarum/modulebasegame/ui/UIRemoCon.kt +++ b/src/net/torvald/terrarum/modulebasegame/ui/UIRemoCon.kt @@ -188,14 +188,6 @@ open class UIRemoCon(treeRepresentation: QNDTreeNode) : UICanvas() { } - override fun mouseMoved(screenX: Int, screenY: Int): Boolean { - screens.forEach { - it.second.mouseMoved(screenX, screenY) // again, underlying handler will block unnecessary renders - } - - return true - } - override fun touchDragged(screenX: Int, screenY: Int, pointer: Int): Boolean { screens.forEach { it.second.touchDragged(screenX, screenY, pointer) // again, underlying handler will block unnecessary renders diff --git a/src/net/torvald/terrarum/ui/UICanvas.kt b/src/net/torvald/terrarum/ui/UICanvas.kt index de2e47736..d1da476be 100644 --- a/src/net/torvald/terrarum/ui/UICanvas.kt +++ b/src/net/torvald/terrarum/ui/UICanvas.kt @@ -14,10 +14,10 @@ import kotlin.math.roundToInt * ## UI Items * * UI can contain one or more UI elements (called UIItem). Each UIItem can have one or more events programmed to it. - * Events have their own listener are governed by their GDX event handlers (e.g. mouseMoved). + * Events have their own listener are governed by their GDX event handlers (e.g. touchDragged). * These GDX handlers are what makes the our own handler to work. * - * UIItems have following event handlers: updateLister, keyDownListener, mouseMovedListener, touchDraggedListener, touchDownListener, touchUpListener, scrolledListener, and clickOnceListener. + * UIItems have following event handlers: updateLister, keyDownListener, touchDraggedListener, touchDownListener, touchUpListener, scrolledListener, and clickOnceListener. * (perhaps clickOnceListener is the one most useful) * * To make them work without any hassle on your part, @@ -150,15 +150,6 @@ abstract class UICanvas( fun mouseInScreen(x: Int, y: Int) = x in 0 until AppLoader.screenSize.screenW && y in 0 until AppLoader.screenSize.screenH - open fun mouseMoved(screenX: Int, screenY: Int): Boolean { - if (this.isVisible) { - uiItems.forEach { it.mouseMoved(screenX, screenY) } - handler.subUIs.forEach { it.mouseMoved(screenX, screenY) } - return true - } - else return false - } - /** * Called by the screen's InputProcessor * diff --git a/src/net/torvald/terrarum/ui/UIHandler.kt b/src/net/torvald/terrarum/ui/UIHandler.kt index 39f26f129..261fa0a59 100644 --- a/src/net/torvald/terrarum/ui/UIHandler.kt +++ b/src/net/torvald/terrarum/ui/UIHandler.kt @@ -346,16 +346,6 @@ void main() { TerrarumIngame.setCameraPosition(batch, camera, newX, newY) } - fun mouseMoved(uiItems: List, screenX: Int, screenY: Int): Boolean { - if (isVisible) { - uiItems.forEach { it.mouseMoved(screenX, screenY) } - subUIs.forEach { it.mouseMoved(screenX, screenY) } - return true - } - else { - return false - } - } fun touchDragged(uiItems: List, screenX: Int, screenY: Int, pointer: Int): Boolean { if (isVisible) { uiItems.forEach { it.touchDragged(screenX, screenY, pointer) } diff --git a/src/net/torvald/terrarum/ui/UIItem.kt b/src/net/torvald/terrarum/ui/UIItem.kt index 303e75393..eac6473aa 100644 --- a/src/net/torvald/terrarum/ui/UIItem.kt +++ b/src/net/torvald/terrarum/ui/UIItem.kt @@ -16,8 +16,7 @@ import net.torvald.terrarum.Terrarum * - updateListener * - keyDownListener * - keyUpListener - * - mouseMovedListene - * - touchDraggedListe + * - touchDraggedLister * - touchDownListener * - touchUpListener * - scrolledListener @@ -104,7 +103,6 @@ abstract class UIItem(var parentUI: UICanvas, val initialX: Int, val initialY: I open var keyDownListener: ((Int) -> Unit)? = null /** Parametre: keycode */ open var keyUpListener: ((Int) -> Unit)? = null - open var mouseMovedListener: ((Int, Int) -> Unit)? = null open var touchDraggedListener: ((Int, Int, Int) -> Unit)? = null /** Parameters: screenX, screenY, pointer, button */ open var touchDownListener: ((Int, Int, Int, Int) -> Unit)? = null @@ -177,14 +175,6 @@ abstract class UIItem(var parentUI: UICanvas, val initialX: Int, val initialY: I } // mouse controlled - open fun mouseMoved(screenX: Int, screenY: Int): Boolean { - if (parentUI.isVisible && mouseMovedListener != null) { - mouseMovedListener!!.invoke(relativeMouseX, relativeMouseY) - return true - } - - return false - } open fun touchDragged(screenX: Int, screenY: Int, pointer: Int): Boolean { if (parentUI.isVisible && touchDraggedListener != null) { touchDraggedListener!!.invoke(relativeMouseX, relativeMouseY, pointer) diff --git a/src/net/torvald/terrarum/ui/UIItemImageGallery.kt b/src/net/torvald/terrarum/ui/UIItemImageGallery.kt index e771ba369..e4e6894d0 100644 --- a/src/net/torvald/terrarum/ui/UIItemImageGallery.kt +++ b/src/net/torvald/terrarum/ui/UIItemImageGallery.kt @@ -43,34 +43,6 @@ class UIItemImageGallery( } } - override fun keyDown(keycode: Int): Boolean { - TODO("not implemented") //To change body of created functions use File | Settings | File Templates. - } - - override fun keyUp(keycode: Int): Boolean { - TODO("not implemented") //To change body of created functions use File | Settings | File Templates. - } - - override fun mouseMoved(screenX: Int, screenY: Int): Boolean { - TODO("not implemented") //To change body of created functions use File | Settings | File Templates. - } - - override fun touchDragged(screenX: Int, screenY: Int, pointer: Int): Boolean { - TODO("not implemented") //To change body of created functions use File | Settings | File Templates. - } - - override fun touchDown(screenX: Int, screenY: Int, pointer: Int, button: Int): Boolean { - TODO("not implemented") //To change body of created functions use File | Settings | File Templates. - } - - override fun touchUp(screenX: Int, screenY: Int, pointer: Int, button: Int): Boolean { - TODO("not implemented") //To change body of created functions use File | Settings | File Templates. - } - - override fun scrolled(amountX: Float, amountY: Float): Boolean { - TODO("not implemented") //To change body of created functions use File | Settings | File Templates. - } - override fun dispose() { imageList.forEach { it.dispose() } } diff --git a/src/net/torvald/terrarum/ui/UIItemIntSlider.kt b/src/net/torvald/terrarum/ui/UIItemIntSlider.kt index d35948f06..b8721c13d 100644 --- a/src/net/torvald/terrarum/ui/UIItemIntSlider.kt +++ b/src/net/torvald/terrarum/ui/UIItemIntSlider.kt @@ -103,9 +103,6 @@ class UIItemIntSlider( override var keyUpListener: ((Int) -> Unit)? get() = super.keyUpListener set(_) {} - override var mouseMovedListener: ((Int, Int) -> Unit)? - get() = super.mouseMovedListener - set(_) {} override var touchDraggedListener: ((Int, Int, Int) -> Unit)? get() = super.touchDraggedListener set(_) {} diff --git a/src/net/torvald/terrarum/ui/UIItemTextButtonList.kt b/src/net/torvald/terrarum/ui/UIItemTextButtonList.kt index 17d480e2a..8c3ddd64c 100644 --- a/src/net/torvald/terrarum/ui/UIItemTextButtonList.kt +++ b/src/net/torvald/terrarum/ui/UIItemTextButtonList.kt @@ -257,10 +257,6 @@ class UIItemTextButtonList( return super.keyUp(keycode) || buttons.map { it.keyUp(keycode).toInt() }.sum() != 0 } - override fun mouseMoved(screenX: Int, screenY: Int): Boolean { - return super.mouseMoved(screenX, screenY) || buttons.map { it.mouseMoved(screenX, screenY).toInt() }.sum() != 0 - } - override fun touchDragged(screenX: Int, screenY: Int, pointer: Int): Boolean { return super.touchDragged(screenX, screenY, pointer) || buttons.map { it.touchDragged(screenX, screenY, pointer).toInt() }.sum() != 0 } diff --git a/src/net/torvald/terrarum/ui/UIItemTransitionContainer.kt b/src/net/torvald/terrarum/ui/UIItemTransitionContainer.kt index c7a47d494..9f6ec4fa4 100644 --- a/src/net/torvald/terrarum/ui/UIItemTransitionContainer.kt +++ b/src/net/torvald/terrarum/ui/UIItemTransitionContainer.kt @@ -96,11 +96,6 @@ open class UIItemTransitionContainer( return true } - override fun mouseMoved(screenX: Int, screenY: Int): Boolean { - uis.forEachIndexed { index, ui -> if (timeToUpdate(index)) ui.mouseMoved(screenX, screenY) } - return true - } - override fun touchDragged(screenX: Int, screenY: Int, pointer: Int): Boolean { uis.forEachIndexed { index, ui -> if (timeToUpdate(index)) ui.touchDragged(screenX, screenY, pointer) } return true diff --git a/src/net/torvald/terrarum/ui/UINSMenu.kt b/src/net/torvald/terrarum/ui/UINSMenu.kt index cefb6d07a..302031315 100644 --- a/src/net/torvald/terrarum/ui/UINSMenu.kt +++ b/src/net/torvald/terrarum/ui/UINSMenu.kt @@ -202,9 +202,6 @@ class UINSMenu( override fun endClosing(delta: Float) { } - override fun mouseMoved(screenX: Int, screenY: Int): Boolean { - return super.mouseMoved(screenX, screenY) - } private var dragOriginX = 0 // relative mousepos private var dragOriginY = 0 // relative mousepos