fix rendering too much merged slider after loading checkpoint
This commit is contained in:
parent
2000aacde3
commit
4c64eee4db
|
@ -288,7 +288,7 @@ public class Game extends BasicGameState {
|
||||||
sbOverlay = new SBOverlay(this);
|
sbOverlay = new SBOverlay(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setObjectIndex(int newObjIndex) {
|
public void loadCheckpoint(int checkpoint) {
|
||||||
try {
|
try {
|
||||||
restart = Restart.MANUAL;
|
restart = Restart.MANUAL;
|
||||||
enter(container, game);
|
enter(container, game);
|
||||||
|
@ -298,7 +298,6 @@ public class Game extends BasicGameState {
|
||||||
epiImgTime = 0;
|
epiImgTime = 0;
|
||||||
MusicController.resume();
|
MusicController.resume();
|
||||||
}
|
}
|
||||||
int checkpoint = gameObjects[newObjIndex].getTime();
|
|
||||||
// skip to checkpoint
|
// skip to checkpoint
|
||||||
MusicController.setPosition(checkpoint);
|
MusicController.setPosition(checkpoint);
|
||||||
while (objectIndex < gameObjects.length && beatmap.objects[objectIndex].getTime() <= checkpoint) {
|
while (objectIndex < gameObjects.length && beatmap.objects[objectIndex].getTime() <= checkpoint) {
|
||||||
|
@ -1031,28 +1030,9 @@ public class Game extends BasicGameState {
|
||||||
int checkpoint = Options.getCheckpoint();
|
int checkpoint = Options.getCheckpoint();
|
||||||
if (checkpoint == 0 || checkpoint > beatmap.endTime)
|
if (checkpoint == 0 || checkpoint > beatmap.endTime)
|
||||||
break; // invalid checkpoint
|
break; // invalid checkpoint
|
||||||
try {
|
loadCheckpoint(checkpoint);
|
||||||
restart = Restart.MANUAL;
|
SoundController.playSound(SoundEffect.MENUHIT);
|
||||||
enter(container, game);
|
UI.sendBarNotification("Checkpoint loaded.");
|
||||||
checkpointLoaded = true;
|
|
||||||
if (isLeadIn()) {
|
|
||||||
leadInTime = 0;
|
|
||||||
MusicController.resume();
|
|
||||||
}
|
|
||||||
SoundController.playSound(SoundEffect.MENUHIT);
|
|
||||||
UI.sendBarNotification("Checkpoint loaded.");
|
|
||||||
|
|
||||||
// skip to checkpoint
|
|
||||||
MusicController.setPosition(checkpoint);
|
|
||||||
MusicController.setPitch(GameMod.getSpeedMultiplier() * playbackSpeed.getModifier());
|
|
||||||
while (objectIndex < gameObjects.length &&
|
|
||||||
beatmap.objects[objectIndex++].getTime() <= checkpoint)
|
|
||||||
;
|
|
||||||
objectIndex--;
|
|
||||||
lastReplayTime = beatmap.objects[objectIndex].getTime();
|
|
||||||
} catch (SlickException e) {
|
|
||||||
ErrorHandler.error("Failed to load checkpoint.", e, false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case Input.KEY_F:
|
case Input.KEY_F:
|
||||||
|
|
|
@ -172,7 +172,7 @@ public class SBOverlay {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setMusicPosition() {
|
private void setMusicPosition() {
|
||||||
game.setObjectIndex(index);
|
game.loadCheckpoint(gameObjects[index].getTime());
|
||||||
if (speed != 0) {
|
if (speed != 0) {
|
||||||
MusicController.setPitch(speed / 10f);
|
MusicController.setPitch(speed / 10f);
|
||||||
MusicController.resume();
|
MusicController.resume();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user