Launch confirm dialog
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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{" +
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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(() ->
|
||||
|
||||
Reference in New Issue
Block a user