From 3b793d5ad4d9d7b7cffcfd832681edb7efa7dae2 Mon Sep 17 00:00:00 2001 From: minjaesong Date: Fri, 6 Mar 2020 01:30:33 +0900 Subject: [PATCH] fixing bug where blocks cant be placed if mouse is over quickslot and watch --- .../terrarum/gamecontroller/IngameController.kt | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/net/torvald/terrarum/gamecontroller/IngameController.kt b/src/net/torvald/terrarum/gamecontroller/IngameController.kt index 6cccb5296..bccbc34ef 100644 --- a/src/net/torvald/terrarum/gamecontroller/IngameController.kt +++ b/src/net/torvald/terrarum/gamecontroller/IngameController.kt @@ -56,16 +56,17 @@ class IngameController(val terrarumIngame: TerrarumIngame) : InputAdapter() { // 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 - if (terrarumIngame.uiContainer.map { if ((it.isOpening || it.isOpened) && it.mouseUp) 1 else 0 }.sum() == 0) { // no UI on the mouse, right? - if (Gdx.input.isButtonPressed(AppLoader.getConfigInt("mouseprimary"))) { + // DON'T DO UI-FILTERING HERE; they're already done on ingame.worldPrimaryClickStart + // also, some UIs should NOT affect item usage (e.g. quickslot) and ingame's uiOpened property is doing + // the very job. - terrarumIngame.worldPrimaryClickStart(AppLoader.UPDATE_RATE) - } - /*if Gdx.input.isButtonPressed(AppLoader.getConfigInt("mousesecondary")) { - ingame.worldSecondaryClickStart(AppLoader.UPDATE_RATE) - }*/ + if (Gdx.input.isButtonPressed(AppLoader.getConfigInt("mouseprimary"))) { + terrarumIngame.worldPrimaryClickStart(AppLoader.UPDATE_RATE) } + /*if Gdx.input.isButtonPressed(AppLoader.getConfigInt("mousesecondary")) { + ingame.worldSecondaryClickStart(AppLoader.UPDATE_RATE) + }*/ }