DT/HF/Playback changes.
Can watch HalfTime on half speed. Reset pitch on leaving the game state. Load songInfo when entering select song menu. Playback button fades in on hover instead of expands. Reverted spinner changes. It should be fixed separately.
This commit is contained in:
@@ -889,7 +889,7 @@ public class Game extends BasicGameState {
|
||||
}
|
||||
if (button != Input.MOUSE_MIDDLE_BUTTON && playbackButton.contains(x, y)) {
|
||||
PlaybackSpeed playbackSpeed = PlaybackSpeed.next();
|
||||
playbackButton.setImage(playbackSpeed.getImage());
|
||||
playbackButton = playbackSpeed.getButton();
|
||||
MusicController.setPitch(GameMod.getSpeedMultiplier() * playbackSpeed.getModifier());
|
||||
return;
|
||||
}
|
||||
@@ -1158,6 +1158,9 @@ public class Game extends BasicGameState {
|
||||
// replays
|
||||
if (isReplay)
|
||||
GameMod.loadModState(previousMods);
|
||||
|
||||
// reset playback speed
|
||||
MusicController.setPitch(1f);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1340,11 +1343,8 @@ public class Game extends BasicGameState {
|
||||
}
|
||||
skipButton.setHoverExpand(1.1f, MenuButton.Expand.UP_LEFT);
|
||||
|
||||
if (isReplay || GameMod.AUTO.isActive()) {
|
||||
Image playback = GameImage.REPLAY_1XPLAYBACK.getImage();
|
||||
playbackButton = new MenuButton(playback, width * 0.98f - (playback.getWidth() / 2f), height * 0.25f);
|
||||
playbackButton.setHoverExpand(1.1f, MenuButton.Expand.CENTER);
|
||||
}
|
||||
if (isReplay || GameMod.AUTO.isActive())
|
||||
playbackButton = PlaybackSpeed.NORMAL.getButton();
|
||||
|
||||
// load other images...
|
||||
((GamePauseMenu) game.getState(Opsu.STATE_GAMEPAUSEMENU)).loadImages();
|
||||
|
||||
@@ -336,12 +336,8 @@ public class SongMenu extends BasicGameState {
|
||||
int iconWidth = musicNote.getWidth();
|
||||
|
||||
// song info text
|
||||
if (songInfo == null || GameMod.justChanged()) {
|
||||
songInfo = focusNode.getInfo();
|
||||
if (Options.useUnicodeMetadata()) { // load glyphs
|
||||
OsuFile osu = focusNode.osuFiles.get(0);
|
||||
Utils.loadGlyphs(Utils.FONT_LARGE, osu.titleUnicode, osu.artistUnicode);
|
||||
}
|
||||
if (songInfo == null) {
|
||||
songInfo = getSongInfo();
|
||||
}
|
||||
marginX += 5;
|
||||
float headerTextY = marginY;
|
||||
@@ -983,6 +979,9 @@ public class SongMenu extends BasicGameState {
|
||||
resetGame = false;
|
||||
}
|
||||
|
||||
// load song info
|
||||
songInfo = getSongInfo();
|
||||
|
||||
// state-based action
|
||||
if (stateAction != null) {
|
||||
switch (stateAction) {
|
||||
@@ -1303,6 +1302,20 @@ public class SongMenu extends BasicGameState {
|
||||
return null; // incorrect map
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an array of strings containing song information.
|
||||
* @return the String array
|
||||
*/
|
||||
private String[] getSongInfo () {
|
||||
songInfo = focusNode.getInfo();
|
||||
if (Options.useUnicodeMetadata()) { // load glyphs
|
||||
OsuFile osu = focusNode.osuFiles.get(0);
|
||||
Utils.loadGlyphs(Utils.FONT_LARGE, osu.titleUnicode, osu.artistUnicode);
|
||||
}
|
||||
return songInfo;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Starts the game.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user