This commit is contained in:
Anuken
2019-09-17 19:25:37 -04:00
parent 5e8da856e7
commit 0ceb58a105
4 changed files with 12 additions and 30 deletions

View File

@@ -325,8 +325,9 @@ public class UI implements ApplicationListener, Loadable{
cont.row();
cont.addImage().width(300f).pad(2).height(4f).color(Color.scarlet);
cont.row();
cont.add(text).pad(2f).growX().wrap();
buttons.addButton("$ok", this::hide).size(120, 50).pad(4);
cont.add(text).pad(2f).growX().wrap().get().setAlignment(Align.center);
cont.row();
cont.addButton("$ok", this::hide).size(120, 50).pad(4);
}}.show();
}

View File

@@ -67,33 +67,7 @@ public class MobileInput extends InputHandler implements GestureListener{
public MobileInput(){
Events.on(ClientLoadEvent.class, e -> {
GestureDetector dec = new GestureDetector(20, 0.5f, 0.4f, 0.15f, this){
boolean clearMouse = false;
@Override
public boolean touchDown(int x, int y, int pointer, KeyCode button){
if(Core.scene.hasMouse(x, y)){
clearMouse = true;
return false;
}
return super.touchDown(x, y, pointer, button);
}
@Override
public boolean touchDragged(int x, int y, int pointer){
if(!clearMouse){
return super.touchDragged(x, y, pointer);
}
return false;
}
@Override
public boolean touchUp(int x, int y, int pointer, KeyCode button){
clearMouse = false;
return super.touchUp(x, y, pointer, button);
}
};
Core.input.getInputProcessors().insert(0, dec);
Core.input.getInputProcessors().add(new GestureDetector(20, 0.5f, 0.4f, 0.15f, this));
});
}

View File

@@ -53,12 +53,18 @@ public class MapsDialog extends FloatingDialog{
buttons.addImageTextButton("$editor.newmap", Icon.add, () -> {
ui.showTextInput("$editor.newmap", "$name", "", text -> {
ui.loadAnd(() -> {
Runnable show = () -> ui.loadAnd(() -> {
hide();
ui.editor.show();
ui.editor.editor.getTags().put("name", text);
Events.fire(new MapMakeEvent());
});
if(maps.byName(text) != null){
ui.showErrorMessage("$editor.exists");
}else{
show.run();
}
});
}).size(210f, 64f);