summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/rustanddust/menu
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/ch/asynk/rustanddust/menu')
-rw-r--r--core/src/ch/asynk/rustanddust/menu/MainMenu.java29
1 files changed, 17 insertions, 12 deletions
diff --git a/core/src/ch/asynk/rustanddust/menu/MainMenu.java b/core/src/ch/asynk/rustanddust/menu/MainMenu.java
index 620205a..e69329f 100644
--- a/core/src/ch/asynk/rustanddust/menu/MainMenu.java
+++ b/core/src/ch/asynk/rustanddust/menu/MainMenu.java
@@ -9,29 +9,34 @@ public class MainMenu extends Menu
{
public enum Items implements Menu.MenuItem
{
- EXIT(0),
- OPTIONS(1),
- TUTORIALS(2),
- PLAY(3),
- NONE(4);
+ EXIT(0, "Exit"),
+ OPTIONS(1, "Options"),
+ TUTORIALS(2, "Tutorials"),
+ PLAY(3, "Play"),
+ NONE(5, null);
public int i;
- Items(int i)
+ public String s;
+ Items(int i, String s)
{
this.i = i;
+ this.s = s;
}
+ public String s() { return s; }
public int i() { return i; }
public int last() { return NONE.i; }
+ public Menu.MenuItem get(int i)
+ {
+ if (i == EXIT.i) return EXIT;
+ else if (i == OPTIONS.i) return OPTIONS;
+ else if (i == TUTORIALS.i) return TUTORIALS;
+ else if (i == PLAY.i) return PLAY;
+ else return NONE;
+ }
};
public MainMenu(RustAndDust game)
{
super(Items.NONE, game.font, game.ninePatch);
-
- label(Items.PLAY).write("Play");
- label(Items.TUTORIALS).write("Tutorials");
- label(Items.OPTIONS).write("Options");
- label(Items.EXIT).write("Exit");
-
this.visible = true;
}