ability to change map offset while playing (- and + keys)

This commit is contained in:
yugecin
2016-11-20 13:49:53 +01:00
parent 7daafd612e
commit da90c98fce
2 changed files with 16 additions and 2 deletions

View File

@@ -256,6 +256,8 @@ public class Game extends BasicGameState {
/** Music position bar coordinates and dimensions (for replay seeking). */
private float musicBarX, musicBarY, musicBarWidth, musicBarHeight;
public static int currentMapMusicOffset;
private int mirrorFrom;
private int mirrorTo;
@@ -1143,6 +1145,14 @@ public class Game extends BasicGameState {
Dancer.mirror = true;
}
break;
case Input.KEY_MINUS:
currentMapMusicOffset += 5;
UI.sendBarNotification("Current map offset: " + currentMapMusicOffset);
break;
}
if (key == Input.KEY_ADD || c == '+') {
currentMapMusicOffset -= 5;
UI.sendBarNotification("Current map offset: " + currentMapMusicOffset);
}
}
@@ -1654,6 +1664,9 @@ public class Game extends BasicGameState {
* @param beatmap the beatmap to load
*/
public void loadBeatmap(Beatmap beatmap) {
if (this.beatmap == null || this.beatmap.beatmapID != beatmap.beatmapID) {
currentMapMusicOffset = 0;
}
this.beatmap = beatmap;
Display.setTitle(String.format("%s - %s", game.getTitle(), beatmap.toString()));
if (beatmap.timingPoints == null)