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

@@ -288,6 +288,7 @@ editor.resizemap = Resize Map
editor.mapname = Map Name: editor.mapname = Map Name:
editor.overwrite = [accent]Warning!\nThis overwrites an existing map. editor.overwrite = [accent]Warning!\nThis overwrites an existing map.
editor.overwrite.confirm = [scarlet]Warning![] A map with this name already exists. Are you sure you want to overwrite it? editor.overwrite.confirm = [scarlet]Warning![] A map with this name already exists. Are you sure you want to overwrite it?
editor.exists = A map with this name already exists.
editor.selectmap = Select a map to load: editor.selectmap = Select a map to load:
toolmode.replace = Replace toolmode.replace = Replace

View File

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

View File

@@ -67,33 +67,7 @@ public class MobileInput extends InputHandler implements GestureListener{
public MobileInput(){ public MobileInput(){
Events.on(ClientLoadEvent.class, e -> { Events.on(ClientLoadEvent.class, e -> {
GestureDetector dec = new GestureDetector(20, 0.5f, 0.4f, 0.15f, this){ Core.input.getInputProcessors().add(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);
}); });
} }

View File

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