diff --git a/src/itdelatrisu/opsu/GameData.java b/src/itdelatrisu/opsu/GameData.java index 0b79409b..d05423b4 100644 --- a/src/itdelatrisu/opsu/GameData.java +++ b/src/itdelatrisu/opsu/GameData.java @@ -47,7 +47,7 @@ public class GameData { /** Time, in milliseconds, for a hit result to fade. */ public static final int HITRESULT_FADE_TIME = 500; - /** Time, in milliseconds, that a combo pops on the screen. */ + /** Duration, in milliseconds, of a combo pop effect. */ private static final int COMBO_POP_TIME = 250; /** Time, in milliseconds, for a hit error tick to fade. */ @@ -671,6 +671,8 @@ public class GameData { ki = GameImage.SCOREBAR_KI_DANGER.getImage(); else ki = GameImage.SCOREBAR_KI_DANGER2.getImage(); + if (comboPopTime < COMBO_POP_TIME) + ki = ki.getScaledCopy(1f + (0.45f * (1f - (float) comboPopTime / COMBO_POP_TIME))); ki.drawCentered(colourX + colourCropped.getWidth(), colourY); // combo burst @@ -1265,6 +1267,11 @@ public class GameData { return replay; } + /** + * Sets the replay object. + */ + public void setReplay(Replay replay) { this.replay = replay; } + /** * Returns whether or not this object is used for gameplay. * @return true if gameplay, false if score viewing diff --git a/src/itdelatrisu/opsu/states/Game.java b/src/itdelatrisu/opsu/states/Game.java index 7428bc16..0ee78b8e 100644 --- a/src/itdelatrisu/opsu/states/Game.java +++ b/src/itdelatrisu/opsu/states/Game.java @@ -489,7 +489,9 @@ public class Game extends BasicGameState { // go to ranking screen else { ((GameRanking) game.getState(Opsu.STATE_GAMERANKING)).setGameData(data); - if (!isReplay && replayFrames != null) { + if (isReplay) + data.setReplay(replay); + else if (replayFrames != null) { // finalize replay frames with start/skip frames if (!replayFrames.isEmpty()) replayFrames.getFirst().setTimeDiff(replaySkipTime * -1); @@ -945,7 +947,11 @@ public class Game extends BasicGameState { // sleep execution try { - Thread.sleep(0, 256000); + int diff = replay.frames[replayIndex].getTime() - trackPosition - 1; + if (diff < 1) + Thread.sleep(0, 256000); + else + Thread.sleep(diff); } catch (InterruptedException e) {} } } @@ -1036,10 +1042,13 @@ public class Game extends BasicGameState { leadInTime = 0; MusicController.resume(); } - replaySkipTime = (isReplay) ? -1 : trackPosition; - if (replayThread != null && replayThread.isAlive()) - replayThread.interrupt(); MusicController.setPosition(firstObjectTime - SKIP_OFFSET); + replaySkipTime = (isReplay) ? -1 : trackPosition; + if (replayThread != null && replayThread.isAlive()) { + replayX = (int) skipButton.getX(); + replayY = (int) skipButton.getY(); + replayThread.interrupt(); + } SoundController.playSound(SoundEffect.MENUHIT); return true; }