Minor cleanup of gamemode description PR

This commit is contained in:
Anuken
2018-03-16 00:39:39 -04:00
parent 4cb500277b
commit b9f565f5fc
4 changed files with 15 additions and 14 deletions

View File

@@ -341,10 +341,12 @@ 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.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.waves.description=the normal mode. limited resources and automatic incoming waves.
mode.sandbox.name=sandbox mode.sandbox.name=sandbox
mode.sandbox.description=infinite resources and no timer for waves.
mode.freebuild.name=freebuild mode.freebuild.name=freebuild
mode.freebuild.description=limited resources and no timer for waves.
upgrade.standard.name=standard upgrade.standard.name=standard
upgrade.standard.description=The standard mech. upgrade.standard.description=The standard mech.
upgrade.blaster.name=blaster upgrade.blaster.name=blaster

View File

@@ -1,7 +1,7 @@
#Autogenerated file. Do not modify. #Autogenerated file. Do not modify.
#Thu Mar 15 14:23:19 EDT 2018 #Fri Mar 16 00:38:49 EDT 2018
version=release version=release
androidBuildCode=412 androidBuildCode=414
name=Mindustry name=Mindustry
code=3.4 code=3.4
build=custom build build=custom build

View File

@@ -18,6 +18,10 @@ public enum GameMode{
public boolean infiniteResources; public boolean infiniteResources;
public boolean disableWaveTimer; public boolean disableWaveTimer;
public String description(){
return Bundles.get("mode."+name()+".description");
}
@Override @Override
public String toString(){ public String toString(){
return Bundles.get("mode."+name()+".name"); return Bundles.get("mode."+name()+".name");

View File

@@ -22,7 +22,6 @@ import static io.anuke.mindustry.Vars.*;
public class LevelDialog extends FloatingDialog{ public class LevelDialog extends FloatingDialog{
private Map selectedMap = world.maps().getMap(0); private Map selectedMap = world.maps().getMap(0);
private TextureRegion region = new TextureRegion();
private ScrollPane pane; private ScrollPane pane;
public LevelDialog(){ public LevelDialog(){
@@ -56,7 +55,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); selmode.addButton("?", this::displayGameModeHelp).size(50f, 54f).padLeft(18f);
content().add(selmode); content().add(selmode);
content().row(); content().row();
@@ -181,17 +180,13 @@ public class LevelDialog extends FloatingDialog{
ScrollPane pane = new ScrollPane(table, "clear"); ScrollPane pane = new ScrollPane(table, "clear");
pane.setFadeScrollBars(false); pane.setFadeScrollBars(false);
table.row(); table.row();
Label desclabel = new Label( for(GameMode mode : GameMode.values()){
Bundles.format("mode.text.help.description", table.labelWrap("[accent]" + mode.toString() + ":[] [lightgray]" + mode.description()).width(600f);
Bundles.get("mode.waves.name"), table.row();
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.content().add(pane);
d.buttons().addButton("$text.ok", ()-> d.hide()).size(110, 50).pad(10f); d.buttons().addButton("$text.ok", d::hide).size(110, 50).pad(10f);
d.show(); d.show();
} }