Fixed various UI bugs

This commit is contained in:
Anuken
2018-02-02 15:00:00 -05:00
parent 9cd0545fc4
commit ec67418f8a
4 changed files with 24 additions and 14 deletions

View File

@@ -23,6 +23,7 @@ import io.anuke.ucore.scene.Element;
import io.anuke.ucore.scene.event.InputEvent;
import io.anuke.ucore.scene.event.InputListener;
import io.anuke.ucore.scene.event.Touchable;
import io.anuke.ucore.scene.ui.TextField;
import io.anuke.ucore.scene.ui.layout.Unit;
import io.anuke.ucore.util.Mathf;
import io.anuke.ucore.util.Tmp;
@@ -176,10 +177,12 @@ public class MapView extends Element implements GestureListener{
public void act(float delta){
super.act(delta);
float ax = Inputs.getAxis("move_x");
float ay = Inputs.getAxis("move_y");
offsetx -= ax * 15f / zoom;
offsety -= ay * 15f / zoom;
if(Core.scene.getKeyboardFocus() == null || !(Core.scene.getKeyboardFocus() instanceof TextField)) {
float ax = Inputs.getAxis("move_x");
float ay = Inputs.getAxis("move_y");
offsetx -= ax * 15f / zoom;
offsety -= ay * 15f / zoom;
}
if(ui.editor.hasPane()) return;

View File

@@ -1,6 +1,5 @@
package io.anuke.mindustry.net;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.utils.Array;
import com.badlogic.gdx.utils.IntMap;
import com.badlogic.gdx.utils.ObjectMap;
@@ -48,7 +47,7 @@ public class Net{
public static void setClientLoaded(boolean loaded){
clientLoaded = loaded;
if(loaded){
if(loaded && false){ //TODO enable.
//handle all packets that were skipped while loading
for(int i = 0; i < packetQueue.size; i ++){
Log.info("Processing {0} packet post-load.", ClassReflection.getSimpleName(packetQueue.get(i).getClass()));
@@ -185,10 +184,10 @@ public class Net{
if(listeners.get(object.getClass()) != null) listeners.get(object.getClass()).accept(object);
}else{
packetQueue.add(object);
Log.info("Recieved {0}, but ignoring data, as client is not loaded.", ClassReflection.getSimpleName(object.getClass()));
Log.info("Queuing packet {0}.", ClassReflection.getSimpleName(object.getClass()));
}
}else{
Gdx.app.error("Mindustry::Net", "Unhandled packet type: '" + object.getClass() + "'!");
Log.err("Unhandled packet type: '{0}'!", ClassReflection.getSimpleName(object.getClass()));
}
}
@@ -200,7 +199,7 @@ public class Net{
if(serverListeners.get(object.getClass()) != null) serverListeners.get(object.getClass()).accept(connection, object);
if(listeners.get(object.getClass()) != null) listeners.get(object.getClass()).accept(object);
}else{
Gdx.app.error("Mindustry::Net", "Unhandled packet type: '" + object.getClass() + "'!");
Log.err("Unhandled packet type: '{0}'!", ClassReflection.getSimpleName(object.getClass()));
}
}

View File

@@ -33,7 +33,7 @@ public class PlacementFragment implements Fragment{
InputHandler input = control.input();
float s = 50f;
float translation = Unit.dp.scl(54f);
float translation = Unit.dp.scl(58f);
new table(){{
visible(() -> !state.is(State.menu));
@@ -96,6 +96,7 @@ public class PlacementFragment implements Fragment{
row();
//break menu
new table() {{
abottom();
aleft();
@@ -116,7 +117,7 @@ public class PlacementFragment implements Fragment{
breaktable = new table("pane") {{
visible(() -> shown);
margin(5f);
marginLeft(0f);
marginLeft(-(Unit.dp.scl(1f) - 1f) * 2.5f);
touchable(Touchable.enabled);
aleft();
@@ -150,6 +151,7 @@ public class PlacementFragment implements Fragment{
row();
//place menu
new table() {{
touchable(Touchable.enabled);