return to songmenu when closing game ranking screen
This commit is contained in:
parent
2d0e2143d1
commit
0af6bc8c09
|
@ -1894,7 +1894,9 @@ public class Game extends ComplexOpsuState {
|
|||
* Resets all game data and structures.
|
||||
*/
|
||||
public void resetGameData() {
|
||||
data.clear();
|
||||
if (data != null) {
|
||||
data.clear();
|
||||
}
|
||||
objectIndex = 0;
|
||||
breakIndex = 0;
|
||||
breakTime = 0;
|
||||
|
@ -1916,7 +1918,9 @@ public class Game extends ComplexOpsuState {
|
|||
autoMousePosition = new Vec2f();
|
||||
autoMousePressed = false;
|
||||
flashlightRadius = displayContainer.height * 2 / 3;
|
||||
scoreboardStarStream.clear();
|
||||
if (scoreboardStarStream != null) {
|
||||
scoreboardStarStream.clear();
|
||||
}
|
||||
gameFinished = false;
|
||||
gameFinishedTimer.setTime(0);
|
||||
|
||||
|
|
|
@ -220,6 +220,17 @@ public class GameRanking extends BaseOpsuState {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCloseRequest() {
|
||||
SongMenu songmenu = instanceContainer.provide(SongMenu.class);
|
||||
if (data != null && data.isGameplay()) {
|
||||
songmenu.resetTrackOnLoad();
|
||||
}
|
||||
songmenu.resetGameDataOnLoad();
|
||||
displayContainer.switchState(SongMenu.class);
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns to the song menu.
|
||||
*/
|
||||
|
|
|
@ -1025,7 +1025,7 @@ public class SongMenu extends ComplexOpsuState {
|
|||
if (button != Input.MOUSE_RIGHT_BUTTON) {
|
||||
// view score
|
||||
instanceContainer.provide(GameRanking.class).setGameData(new GameData(focusScores[rank], displayContainer.width, displayContainer.height));
|
||||
// TODO d displayContainer.switchState(GameRanking.class);
|
||||
displayContainer.switchState(GameRanking.class);
|
||||
} else {
|
||||
// score management
|
||||
instanceContainer.provide(ButtonMenu.class).setMenuState(MenuState.SCORE, focusScores[rank]);
|
||||
|
|
Loading…
Reference in New Issue
Block a user