diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2015-11-05 09:43:07 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2015-11-05 09:43:07 +0100 |
commit | 9c3e23977e80a17153a0c908ba258a7ec0624741 (patch) | |
tree | b45da5c2b374b8d079fe76355db2895d47d27ad6 | |
parent | 523bfbe43633931ef4d2a331969ee9d1a47b9fcd (diff) | |
download | RustAndDust-9c3e23977e80a17153a0c908ba258a7ec0624741.zip RustAndDust-9c3e23977e80a17153a0c908ba258a7ec0624741.tar.gz |
menu/screens : use PlayMenu
-rw-r--r-- | core/src/ch/asynk/rustanddust/menu/MainMenu.java | 10 | ||||
-rw-r--r-- | core/src/ch/asynk/rustanddust/screens/MenuScreen.java | 30 |
2 files changed, 20 insertions, 20 deletions
diff --git a/core/src/ch/asynk/rustanddust/menu/MainMenu.java b/core/src/ch/asynk/rustanddust/menu/MainMenu.java index 769adb3..ff65d50 100644 --- a/core/src/ch/asynk/rustanddust/menu/MainMenu.java +++ b/core/src/ch/asynk/rustanddust/menu/MainMenu.java @@ -13,7 +13,7 @@ public class MainMenu extends Menu EXIT(0), OPTIONS(1), TUTORIALS(2), - SCENARIOS(3), + PLAY(3), NONE(4); public int i; Items(int i) @@ -28,9 +28,9 @@ public class MainMenu extends Menu { super(Items.NONE, font, atlas.createPatch("typewriter")); - label(Items.OPTIONS).write("Options"); + label(Items.PLAY).write("Play"); label(Items.TUTORIALS).write("Tutorials"); - label(Items.SCENARIOS).write("Scenarios"); + label(Items.OPTIONS).write("Options"); label(Items.EXIT).write("Exit"); this.visible = true; @@ -49,8 +49,8 @@ public class MainMenu extends Menu if (!visible) return ret; - if (label(Items.SCENARIOS).hit(x, y)) { - menuItem = Items.SCENARIOS; + if (label(Items.PLAY).hit(x, y)) { + menuItem = Items.PLAY; ret = true; } else if (label(Items.TUTORIALS).hit(x, y)) { menuItem = Items.TUTORIALS; diff --git a/core/src/ch/asynk/rustanddust/screens/MenuScreen.java b/core/src/ch/asynk/rustanddust/screens/MenuScreen.java index 0ca8a63..97d5637 100644 --- a/core/src/ch/asynk/rustanddust/screens/MenuScreen.java +++ b/core/src/ch/asynk/rustanddust/screens/MenuScreen.java @@ -15,8 +15,8 @@ import com.badlogic.gdx.math.Interpolation; import ch.asynk.rustanddust.RustAndDust; import ch.asynk.rustanddust.ui.Position; import ch.asynk.rustanddust.menu.MainMenu; +import ch.asynk.rustanddust.menu.PlayMenu; import ch.asynk.rustanddust.menu.OptionsMenu; -import ch.asynk.rustanddust.menu.ScenariosMenu; import ch.asynk.rustanddust.menu.TutorialsMenu; public class MenuScreen implements Screen @@ -49,8 +49,8 @@ public class MenuScreen implements Screen private Sprite usFlag; private MainMenu mainMenu; + private PlayMenu playMenu; private OptionsMenu optionsMenu; - private ScenariosMenu scenariosMenu; private TutorialsMenu tutorialsMenu; private final MenuCamera camera; @@ -79,8 +79,8 @@ public class MenuScreen implements Screen this.geFlag = new Sprite(game.menuAtlas.findRegion("ge-flag")); this.mainMenu = new MainMenu(game.fontB, game.uiAtlas); + this.playMenu = new PlayMenu(game, game.fontB, game.uiAtlas); this.optionsMenu = new OptionsMenu(game, game.fontB, game.uiAtlas); - this.scenariosMenu = new ScenariosMenu(game, game.fontB, game.uiAtlas); this.tutorialsMenu = new TutorialsMenu(game, game.fontB, game.uiAtlas); this.game.config.battle = null; @@ -101,15 +101,15 @@ public class MenuScreen implements Screen mainMenu.visible = false; showNextMenu(); return true; - } else if (optionsMenu.hit(x, y)) { + } else if (playMenu.hit(x, y)) { mainMenu.visible = true; - optionsMenu.visible = false; + playMenu.visible = false; + if (playMenu.launch) + startLoading(); return true; - } else if (scenariosMenu.hit(x, y)) { + } else if (optionsMenu.hit(x, y)) { mainMenu.visible = true; - scenariosMenu.visible = false; - if (scenariosMenu.launch) - startLoading(); + optionsMenu.visible = false; return true; } else if (tutorialsMenu.hit(x, y)) { mainMenu.visible = true; @@ -124,10 +124,10 @@ public class MenuScreen implements Screen { MainMenu.Items item = mainMenu.getMenu(); - if (item == MainMenu.Items.OPTIONS) + if (item == MainMenu.Items.PLAY) + playMenu.visible = true; + else if (item == MainMenu.Items.OPTIONS) optionsMenu.visible = true; - else if (item == MainMenu.Items.SCENARIOS) - scenariosMenu.visible = true; else if (item == MainMenu.Items.TUTORIALS) tutorialsMenu.visible = true; } @@ -183,8 +183,8 @@ public class MenuScreen implements Screen batch.setProjectionMatrix(camera.uiCombined()); batch.begin(); mainMenu.draw(batch); + playMenu.draw(batch); optionsMenu.draw(batch); - scenariosMenu.draw(batch); tutorialsMenu.draw(batch); batch.end(); } @@ -210,8 +210,8 @@ public class MenuScreen implements Screen setCenteredPosition(geFlag, xPath[n - 1], yPath[n - 1]); mainMenu.setPosition(); + playMenu.setPosition(); optionsMenu.setPosition(); - scenariosMenu.setPosition(); tutorialsMenu.setPosition(); } @@ -225,8 +225,8 @@ public class MenuScreen implements Screen public void dispose() { mainMenu.dispose(); + playMenu.dispose(); optionsMenu.dispose(); - scenariosMenu.dispose(); tutorialsMenu.dispose(); } |