diff options
5 files changed, 8 insertions, 6 deletions
diff --git a/core/src/ch/asynk/rustanddust/menu/MainMenu.java b/core/src/ch/asynk/rustanddust/menu/MainMenu.java index 335e527..19567ce 100644 --- a/core/src/ch/asynk/rustanddust/menu/MainMenu.java +++ b/core/src/ch/asynk/rustanddust/menu/MainMenu.java @@ -83,7 +83,7 @@ public class MainMenu extends Patch implements MenuCtrl.Panel } @Override - public boolean prepare() { return true; } + public MenuCtrl.MenuType prepare() { return MenuCtrl.MenuType.MAIN; } @Override public MenuCtrl.MenuType touch(float x, float y) diff --git a/core/src/ch/asynk/rustanddust/menu/MenuCtrl.java b/core/src/ch/asynk/rustanddust/menu/MenuCtrl.java index 6b7bfa8..56015fd 100644 --- a/core/src/ch/asynk/rustanddust/menu/MenuCtrl.java +++ b/core/src/ch/asynk/rustanddust/menu/MenuCtrl.java @@ -25,7 +25,7 @@ public class MenuCtrl implements Disposable, Drawable interface Panel extends Disposable, Drawable { - public boolean prepare(); + public MenuType prepare(); public void computePosition(); public MenuType touch(float x, float y); } @@ -60,8 +60,10 @@ public class MenuCtrl implements Disposable, Drawable } if (next != MenuType.NONE) { - if (panels[next.i].prepare()) + while(current != next) { current = next; + next = panels[next.i].prepare(); + } } return false; diff --git a/core/src/ch/asynk/rustanddust/menu/OptionsMenu.java b/core/src/ch/asynk/rustanddust/menu/OptionsMenu.java index e5401ff..04796a2 100644 --- a/core/src/ch/asynk/rustanddust/menu/OptionsMenu.java +++ b/core/src/ch/asynk/rustanddust/menu/OptionsMenu.java @@ -149,7 +149,7 @@ public class OptionsMenu extends Patch implements MenuCtrl.Panel } @Override - public boolean prepare() { return true; } + public MenuCtrl.MenuType prepare() { return MenuCtrl.MenuType.OPTIONS; } @Override public MenuCtrl.MenuType touch(float x, float y) diff --git a/core/src/ch/asynk/rustanddust/menu/PlayMenu.java b/core/src/ch/asynk/rustanddust/menu/PlayMenu.java index 805efa0..0ed7f95 100644 --- a/core/src/ch/asynk/rustanddust/menu/PlayMenu.java +++ b/core/src/ch/asynk/rustanddust/menu/PlayMenu.java @@ -172,7 +172,7 @@ public class PlayMenu extends Patch implements MenuCtrl.Panel } @Override - public boolean prepare() { return true; } + public MenuCtrl.MenuType prepare() { return MenuCtrl.MenuType.PLAY; } @Override public void dispose() diff --git a/core/src/ch/asynk/rustanddust/menu/TutorialsMenu.java b/core/src/ch/asynk/rustanddust/menu/TutorialsMenu.java index cae9b6c..5a8d03f 100644 --- a/core/src/ch/asynk/rustanddust/menu/TutorialsMenu.java +++ b/core/src/ch/asynk/rustanddust/menu/TutorialsMenu.java @@ -25,7 +25,7 @@ public class TutorialsMenu extends Patch implements MenuCtrl.Panel } @Override - public boolean prepare() { return true; } + public MenuCtrl.MenuType prepare() { return MenuCtrl.MenuType.TUTORIALS; } @Override public void computePosition() |