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

@@ -253,6 +253,7 @@ launch = < LAUNCH >
launch.title = Launch Successful launch.title = Launch Successful
launch.next = [LIGHT_GRAY]next opportunity at wave {0} launch.next = [LIGHT_GRAY]next opportunity at wave {0}
launch.unable = [scarlet]Unable to LAUNCH.[] Enemies. launch.unable = [scarlet]Unable to LAUNCH.[] Enemies.
launch.confirm = This will launch all resources in your core.\nYou will not be able to return to this base.
zone.unlocked = [LIGHT_GRAY]{0} unlocked. zone.unlocked = [LIGHT_GRAY]{0} unlocked.
connectfail = [crimson]Failed to connect to server:\n\n[accent]{0} connectfail = [crimson]Failed to connect to server:\n\n[accent]{0}

View File

@@ -277,7 +277,7 @@ public class UI implements ApplicationListener{
public void showConfirm(String title, String text, Runnable confirmed){ public void showConfirm(String title, String text, Runnable confirmed){
FloatingDialog dialog = new FloatingDialog(title); 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.buttons.defaults().size(200f, 54f).pad(2f);
dialog.setFillParent(false); dialog.setFillParent(false);
dialog.buttons.addButton("$cancel", dialog::hide); dialog.buttons.addButton("$cancel", dialog::hide);

View File

@@ -60,13 +60,6 @@ public class MapInfoDialog extends FloatingDialog{
}).size(400, 55f).get(); }).size(400, 55f).get();
author.setMessageText("$unknown"); 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(); name.change();
description.change(); description.change();
author.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"); 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 @Override
public String toString(){ public String toString(){
return "MapMeta{" + return "MapMeta{" +

View File

@@ -140,8 +140,6 @@ public class MapsDialog extends FloatingDialog{
t.add(map.meta.description()).growX().wrap().padTop(2); t.add(map.meta.description()).growX().wrap().padTop(2);
t.row(); t.row();
t.add("$editor.oregen.info").padRight(10).color(Color.GRAY); 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); }).height(mapsize).width(mapsize);
table.row(); table.row();

View File

@@ -219,7 +219,7 @@ public class HudFragment extends Fragment{
parent.fill(t -> { parent.fill(t -> {
t.top().visible(() -> !state.is(State.menu)); 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.getStyle().disabledFontColor = Color.WHITE;
button.visible(() -> button.visible(() ->