set keyboard focus on change to music selection page
This commit is contained in:
parent
e65769f392
commit
16992e1345
@ -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);
|
||||
|
@ -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());
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user