diff --git a/forge-gui-mobile/src/forge/Forge.java b/forge-gui-mobile/src/forge/Forge.java index a97ee3afba7..c64a2cee4ba 100644 --- a/forge-gui-mobile/src/forge/Forge.java +++ b/forge-gui-mobile/src/forge/Forge.java @@ -84,6 +84,7 @@ public class Forge implements ApplicationListener { public static int lastButtonIndex = 0; public static String CJK_Font = ""; public static int hoveredCount = 0; + public static boolean afterDBloaded = false; public static ApplicationListener getApp(Clipboard clipboard0, IDeviceAdapter deviceAdapter0, String assetDir0, boolean value, boolean androidOrientation, int totalRAM, boolean isTablet, int AndroidAPI, String AndroidRelease, String deviceName) { if (GuiBase.getInterface() == null) { @@ -251,6 +252,7 @@ public class Forge implements ApplicationListener { Gdx.input.setCatchKey(Keys.MENU, true); openHomeScreen(-1, null); //default for startup splashScreen = null; + afterDBloaded = true; boolean isLandscapeMode = isLandscapeMode(); if (isLandscapeMode) { //open preferred new game screen by default if landscape mode @@ -925,6 +927,9 @@ public class Forge implements ApplicationListener { public boolean mouseMoved(int screenX, int screenY) { mouseMovedX = screenX; mouseMovedY = screenY; + //todo: mouse listener for android? + if (GuiBase.isAndroid()) + return true; hoveredCount = 0; //reset try { diff --git a/forge-gui-mobile/src/forge/toolbox/FDisplayObject.java b/forge-gui-mobile/src/forge/toolbox/FDisplayObject.java index aa3b410d847..fea12a2ba1f 100644 --- a/forge-gui-mobile/src/forge/toolbox/FDisplayObject.java +++ b/forge-gui-mobile/src/forge/toolbox/FDisplayObject.java @@ -6,6 +6,7 @@ import com.badlogic.gdx.math.Rectangle; import forge.Forge; import forge.Graphics; +import forge.gui.GuiBase; public abstract class FDisplayObject { protected static final float DISABLED_COMPOSITE = 0.25f; @@ -126,17 +127,17 @@ public abstract class FDisplayObject { } public abstract void draw(Graphics g); - public float scrX, scrY; public void buildTouchListeners(float screenX, float screenY, List listeners) { if (enabled && visible && screenPos.contains(screenX, screenY)) { listeners.add(this); } - Forge.hoveredCount = listeners.size(); - if (!Forge.getCurrentScreen().toString().contains("Match")) - Forge.hoveredCount = 1; - setHovered(this.enabled && this.visible && this.screenPos.contains(screenX, screenY) && Forge.hoveredCount < 2); - scrX = screenX; - scrY = screenY; + //TODO: mouse detection on android? + if (Forge.afterDBloaded && !GuiBase.isAndroid()) { + Forge.hoveredCount = listeners.size(); + if (!Forge.getCurrentScreen().toString().contains("Match")) + Forge.hoveredCount = 1; + setHovered(this.enabled && this.visible && this.screenPos.contains(screenX, screenY) && Forge.hoveredCount < 2); + } } public boolean press(float x, float y) {