diff --git a/core/src/io/anuke/mindustry/core/Control.java b/core/src/io/anuke/mindustry/core/Control.java index a41d93b3b1..af9b1f7e2a 100644 --- a/core/src/io/anuke/mindustry/core/Control.java +++ b/core/src/io/anuke/mindustry/core/Control.java @@ -197,6 +197,11 @@ public class Control extends Module{ }); } + //FIXME figure out what's causing this problem in the first place + public void triggerInputUpdate(){ + Gdx.input = proxy; + } + public void setError(Throwable error){ this.error = error; } @@ -301,9 +306,7 @@ public class Control extends Module{ throw new RuntimeException(error); } - if(Gdx.input != proxy){ - Gdx.input = proxy; - } + Gdx.input = proxy; if(Inputs.keyTap("console")){ console = !console; @@ -327,16 +330,21 @@ public class Control extends Module{ controly -= ya*baseControllerSpeed*scl; controlling = true; + Gdx.input.setCursorCatched(true); + Inputs.getProcessor().touchDragged(Gdx.input.getX(), Gdx.input.getY(), 0); } controlx = Mathf.clamp(controlx, 0, Gdx.graphics.getWidth()); controly = Mathf.clamp(controly, 0, Gdx.graphics.getHeight()); - if(Gdx.input.getDeltaX() > 1 || Gdx.input.getDeltaY() > 1) - controlling = false; + if(Gdx.input.getDeltaX() > 1 || Gdx.input.getDeltaY() > 1) { + controlling = false; + Gdx.input.setCursorCatched(false); + } }else{ controlling = false; + Gdx.input.setCursorCatched(false); } if(!controlling){ diff --git a/core/src/io/anuke/mindustry/core/Logic.java b/core/src/io/anuke/mindustry/core/Logic.java index ef703fd940..e66845828f 100644 --- a/core/src/io/anuke/mindustry/core/Logic.java +++ b/core/src/io/anuke/mindustry/core/Logic.java @@ -111,6 +111,8 @@ public class Logic extends Module { if(!state.is(State.menu)){ + if(control != null) control.triggerInputUpdate(); + if(!state.is(State.paused) || Net.active()){ Timers.update(); }