add an info button for descriptions of the game mode.

This commit is contained in:
Cedric L'homme
2018-03-15 21:18:06 +01:00
parent 2037ebaaba
commit 4dff6d834a
2 changed files with 26 additions and 0 deletions

View File

@@ -340,6 +340,8 @@ keybind.weapon_3.name=weapon_3
keybind.weapon_4.name=weapon_4 keybind.weapon_4.name=weapon_4
keybind.weapon_5.name=weapon_5 keybind.weapon_5.name=weapon_5
keybind.weapon_6.name=weapon_6 keybind.weapon_6.name=weapon_6
mode.text.help.title=Description of modes
mode.text.help.description="{0}" is the normal mode: limited resources and automatic incoming waves.\n"{1}" is a mode with infinite resources and no timer for waves.\n"{2}" is a mode with limited resources and no timer for waves.
mode.waves.name=waves mode.waves.name=waves
mode.sandbox.name=sandbox mode.sandbox.name=sandbox
mode.freebuild.name=freebuild mode.freebuild.name=freebuild

View File

@@ -56,6 +56,7 @@ public class LevelDialog extends FloatingDialog{
group.add(b[0]); group.add(b[0]);
selmode.add(b[0]).size(130f, 54f); selmode.add(b[0]).size(130f, 54f);
} }
selmode.addButton("?", () -> displayGameModeHelp()).size(54f, 54f).padLeft(15f);
content().add(selmode); content().add(selmode);
content().row(); content().row();
@@ -171,4 +172,27 @@ public class LevelDialog extends FloatingDialog{
}); });
}); });
} }
private void displayGameModeHelp() {
FloatingDialog d = new FloatingDialog(Bundles.get("mode.text.help.title"));
d.setFillParent(false);
Table table = new Table();
table.defaults().pad(1f);
ScrollPane pane = new ScrollPane(table, "clear");
pane.setFadeScrollBars(false);
table.row();
Label desclabel = new Label(
Bundles.format("mode.text.help.description",
Bundles.get("mode.waves.name"),
Bundles.get("mode.sandbox.name"),
Bundles.get("mode.freebuild.name")));
desclabel.setWrap(true);
table.add(desclabel).width(600);
table.row();
d.content().add(pane);
d.buttons().addButton("$text.ok", ()-> d.hide()).size(110, 50).pad(10f);
d.show();
}
} }