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.MusicControls;
|
||||||
import zero1hd.rhythmbullet.graphics.ui.components.ScrollText;
|
import zero1hd.rhythmbullet.graphics.ui.components.ScrollText;
|
||||||
import zero1hd.rhythmbullet.graphics.ui.components.TitleBarVisualizer;
|
import zero1hd.rhythmbullet.graphics.ui.components.TitleBarVisualizer;
|
||||||
|
import zero1hd.rhythmbullet.screens.MainMenu;
|
||||||
|
|
||||||
public class MainPage extends Page implements Observer {
|
public class MainPage extends Page implements Observer {
|
||||||
private Label versionLabel;
|
private Label versionLabel;
|
||||||
@ -34,7 +35,7 @@ public class MainPage extends Page implements Observer {
|
|||||||
private MusicControls musicControls;
|
private MusicControls musicControls;
|
||||||
|
|
||||||
private ScrollText scrollText;
|
private ScrollText scrollText;
|
||||||
public MainPage(RhythmBullet core, Vector3 targetPosition, SongListController sc) {
|
public MainPage(RhythmBullet core, Vector3 targetPosition, SongListController sc, MainMenu mm) {
|
||||||
this.sc = sc;
|
this.sc = sc;
|
||||||
setTextureBackground(core.getAssetManager().get("gradients.atlas", TextureAtlas.class).findRegion("red-linear"));
|
setTextureBackground(core.getAssetManager().get("gradients.atlas", TextureAtlas.class).findRegion("red-linear"));
|
||||||
|
|
||||||
@ -57,7 +58,7 @@ public class MainPage extends Page implements Observer {
|
|||||||
@Override
|
@Override
|
||||||
public void changed(ChangeEvent event, Actor actor) {
|
public void changed(ChangeEvent event, Actor actor) {
|
||||||
targetPosition.x = Gdx.graphics.getWidth()*1.5f;
|
targetPosition.x = Gdx.graphics.getWidth()*1.5f;
|
||||||
Gdx.input.setInputProcessor(getStage());
|
getStage().setKeyboardFocus(mm.getMusicSelectionPage());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
table.add(playButton).width(Gdx.graphics.getWidth()*0.2f);
|
table.add(playButton).width(Gdx.graphics.getWidth()*0.2f);
|
||||||
|
@ -119,7 +119,6 @@ public class MusicSelectionPage extends Page {
|
|||||||
index = songTable.getChildren().size;
|
index = songTable.getChildren().size;
|
||||||
}
|
}
|
||||||
deselectAll();
|
deselectAll();
|
||||||
//ez broken casting.
|
|
||||||
((MusicSelectable)songTable.getChildren().get(index)).select();
|
((MusicSelectable)songTable.getChildren().get(index)).select();
|
||||||
scrollbar.scrollTo(currentlySelected.getX(), currentlySelected.getY(), currentlySelected.getWidth(), currentlySelected.getHeight());
|
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() {
|
public void postTransition() {
|
||||||
attemptLoadShaders();
|
attemptLoadShaders();
|
||||||
|
|
||||||
mainPage = new MainPage(core, cameraPosition, sc);
|
mainPage = new MainPage(core, cameraPosition, sc, this);
|
||||||
mainPage.setPosition(0, 0);
|
mainPage.setPosition(0, 0);
|
||||||
stage.addActor(mainPage);
|
stage.addActor(mainPage);
|
||||||
//End main menu
|
//End main menu
|
||||||
@ -373,4 +373,28 @@ public class MainMenu extends ScreenAdapter implements TransitionAdapter, Observ
|
|||||||
musicSelectionPage.refresh();
|
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…
x
Reference in New Issue
Block a user