Add editor navigation controls.

Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
main
Nic0Nic0Nii 3 years ago
parent aa6611ff2f
commit e84e56c87f
  1. 6
      LLSIG/src/main/java/LLSIG/LLSIG.java

@ -52,7 +52,7 @@ public class LLSIG implements KeyListener{
public boolean PLAYING = true; //Whether or not a song is loaded and playing.
public boolean EDITOR = false; //Whether or not we are in beatmap editing mode.
public static int EDITOR_CURSOR_BEAT = 0;
public static double EDITOR_CURSOR_BEAT = 0;
public static int EDITOR_BEAT_DIVISIONS = 4;
public static BeatTiming EDITOR_CURSOR_WINDOW;
@ -303,6 +303,10 @@ public class LLSIG implements KeyListener{
case KeyEvent.VK_SEMICOLON:{lane=8;}break;
case KeyEvent.VK_P:{if (LLSIG.game.PLAYING&&musicPlayer.isPaused()) {musicPlayer.resume();} else {musicPlayer.pause();}}break;
case KeyEvent.VK_Q:{if (LLSIG.game.PLAYING) {musicPlayer.pause();SaveSongData(song,lanes);}}break;
case KeyEvent.VK_DOWN:{EDITOR_CURSOR_BEAT+=1d/EDITOR_BEAT_DIVISIONS;}break;
case KeyEvent.VK_RIGHT:{EDITOR_BEAT_DIVISIONS=Math.max(EDITOR_BEAT_DIVISIONS*2,1);EDITOR_CURSOR_BEAT=Math.floor(EDITOR_CURSOR_BEAT*EDITOR_BEAT_DIVISIONS)/EDITOR_BEAT_DIVISIONS;}break;
case KeyEvent.VK_UP:{EDITOR_CURSOR_BEAT=Math.max(EDITOR_CURSOR_BEAT-(1d/EDITOR_BEAT_DIVISIONS),0);}break;
case KeyEvent.VK_LEFT:{EDITOR_BEAT_DIVISIONS=(int)Math.max(Math.floor(EDITOR_BEAT_DIVISIONS/2),0);EDITOR_CURSOR_BEAT=Math.floor(EDITOR_CURSOR_BEAT*EDITOR_BEAT_DIVISIONS)/EDITOR_BEAT_DIVISIONS;}break;
}
if (lane!=-1) {
if (PLAYING&&EDITMODE) {

Loading…
Cancel
Save