Launch confirm dialog

This commit is contained in:
Anuken
2019-02-06 08:52:30 -05:00
parent 1bdea1b8d8
commit d0c6d9a489
6 changed files with 3 additions and 15 deletions

View File

@@ -277,7 +277,7 @@ public class UI implements ApplicationListener{
public void showConfirm(String title, String text, Runnable confirmed){
FloatingDialog dialog = new FloatingDialog(title);
dialog.cont.add(text).width(400f).wrap().pad(4f).get().setAlignment(Align.center, Align.center);
dialog.cont.add(text).width(500f).wrap().pad(4f).get().setAlignment(Align.center, Align.center);
dialog.buttons.defaults().size(200f, 54f).pad(2f);
dialog.setFillParent(false);
dialog.buttons.addButton("$cancel", dialog::hide);

View File

@@ -60,13 +60,6 @@ public class MapInfoDialog extends FloatingDialog{
}).size(400, 55f).get();
author.setMessageText("$unknown");
cont.row();
cont.add().padRight(8).left();
cont.addCheck("$editor.oregen", enabled -> {
tags.put("oregen", enabled ? "1" : "0");
}).update(c -> c.setChecked(!tags.get("oregen", "0").equals("0"))).left();
name.change();
description.change();
author.change();

View File

@@ -35,10 +35,6 @@ public class MapMeta{
return tags.containsKey(name) && !tags.get(name).trim().isEmpty() ? tags.get(name): Core.bundle.get("unknown");
}
public boolean hasOreGen(){
return !tags.get("oregen", "0").equals("0");
}
@Override
public String toString(){
return "MapMeta{" +

View File

@@ -140,8 +140,6 @@ public class MapsDialog extends FloatingDialog{
t.add(map.meta.description()).growX().wrap().padTop(2);
t.row();
t.add("$editor.oregen.info").padRight(10).color(Color.GRAY);
t.row();
t.add(map.meta.hasOreGen() ? "$on" : "$off").padTop(2);
}).height(mapsize).width(mapsize);
table.row();

View File

@@ -219,7 +219,7 @@ public class HudFragment extends Fragment{
parent.fill(t -> {
t.top().visible(() -> !state.is(State.menu));
TextButton button = Elements.newButton("$launch", Call::launchZone);
TextButton button = Elements.newButton("$launch", () -> ui.showConfirm("$launch", "$launch.confirm", Call::launchZone));
button.getStyle().disabledFontColor = Color.WHITE;
button.visible(() ->