diff --git a/core/src/zero1hd/rhythmbullet/graphics/ui/pages/MainPage.java b/core/src/zero1hd/rhythmbullet/graphics/ui/pages/MainPage.java index 94d4de7..f24212a 100755 --- a/core/src/zero1hd/rhythmbullet/graphics/ui/pages/MainPage.java +++ b/core/src/zero1hd/rhythmbullet/graphics/ui/pages/MainPage.java @@ -20,6 +20,7 @@ import zero1hd.rhythmbullet.audio.SongListController; import zero1hd.rhythmbullet.graphics.ui.components.MusicControls; import zero1hd.rhythmbullet.graphics.ui.components.ScrollText; import zero1hd.rhythmbullet.graphics.ui.components.TitleBarVisualizer; +import zero1hd.rhythmbullet.screens.MainMenu; public class MainPage extends Page implements Observer { private Label versionLabel; @@ -34,7 +35,7 @@ public class MainPage extends Page implements Observer { private MusicControls musicControls; private ScrollText scrollText; - public MainPage(RhythmBullet core, Vector3 targetPosition, SongListController sc) { + public MainPage(RhythmBullet core, Vector3 targetPosition, SongListController sc, MainMenu mm) { this.sc = sc; setTextureBackground(core.getAssetManager().get("gradients.atlas", TextureAtlas.class).findRegion("red-linear")); @@ -57,7 +58,7 @@ public class MainPage extends Page implements Observer { @Override public void changed(ChangeEvent event, Actor actor) { targetPosition.x = Gdx.graphics.getWidth()*1.5f; - Gdx.input.setInputProcessor(getStage()); + getStage().setKeyboardFocus(mm.getMusicSelectionPage()); } }); table.add(playButton).width(Gdx.graphics.getWidth()*0.2f); diff --git a/core/src/zero1hd/rhythmbullet/graphics/ui/pages/MusicSelectionPage.java b/core/src/zero1hd/rhythmbullet/graphics/ui/pages/MusicSelectionPage.java index a563f9f..b3b994d 100755 --- a/core/src/zero1hd/rhythmbullet/graphics/ui/pages/MusicSelectionPage.java +++ b/core/src/zero1hd/rhythmbullet/graphics/ui/pages/MusicSelectionPage.java @@ -119,7 +119,6 @@ public class MusicSelectionPage extends Page { index = songTable.getChildren().size; } deselectAll(); - //ez broken casting. ((MusicSelectable)songTable.getChildren().get(index)).select(); scrollbar.scrollTo(currentlySelected.getX(), currentlySelected.getY(), currentlySelected.getWidth(), currentlySelected.getHeight()); } diff --git a/core/src/zero1hd/rhythmbullet/screens/MainMenu.java b/core/src/zero1hd/rhythmbullet/screens/MainMenu.java index 283e3f7..656acb9 100755 --- a/core/src/zero1hd/rhythmbullet/screens/MainMenu.java +++ b/core/src/zero1hd/rhythmbullet/screens/MainMenu.java @@ -80,7 +80,7 @@ public class MainMenu extends ScreenAdapter implements TransitionAdapter, Observ public void postTransition() { attemptLoadShaders(); - mainPage = new MainPage(core, cameraPosition, sc); + mainPage = new MainPage(core, cameraPosition, sc, this); mainPage.setPosition(0, 0); stage.addActor(mainPage); //End main menu @@ -373,4 +373,28 @@ public class MainMenu extends ScreenAdapter implements TransitionAdapter, Observ musicSelectionPage.refresh(); } } + + public MainPage getMainPage() { + return mainPage; + } + + public CreditsPage getCreditsPage() { + return creditsPage; + } + + public VideoOptionsPage getGraphicsPage() { + return graphicsPage; + } + + public KeybindOptionsPage getKeybindPage() { + return keybindPage; + } + + public MusicSelectionPage getMusicSelectionPage() { + return musicSelectionPage; + } + + public OptionsPage getOptionsPage() { + return optionsPage; + } }