Consolidate EDITOR controls and regular gameplay controls.

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

@ -279,34 +279,54 @@ public class LLSIG implements KeyListener{
@Override @Override
public void keyPressed(KeyEvent e) { public void keyPressed(KeyEvent e) {
int lane = -1; int lane = -1;
switch (e.getKeyCode()) { if (EDITOR) {
case KeyEvent.VK_A:{ switch (e.getKeyCode()) {
if (BPM_MEASURE) { case KeyEvent.VK_A:{lane=0;}break;
beats.add(System.nanoTime()); case KeyEvent.VK_S:{lane=1;}break;
} case KeyEvent.VK_D:{lane=2;}break;
lane=0; case KeyEvent.VK_F:{lane=3;}break;
}break; case KeyEvent.VK_SPACE:{lane=4;}break;
case KeyEvent.VK_BACK_SLASH:{ case KeyEvent.VK_J:{lane=5;}break;
if (METRONOME) { case KeyEvent.VK_K:{lane=6;}break;
testOffset=musicPlayer.getPlayPosition(); case KeyEvent.VK_L:{lane=7;}break;
beatNumber=0; case KeyEvent.VK_SEMICOLON:{lane=8;}break;
} case KeyEvent.VK_P:{if (LLSIG.game.PLAYING&&musicPlayer.isPaused()) {musicPlayer.resume();} else {musicPlayer.pause();}}break;
musicPlayer.seek(148900); case KeyEvent.VK_Q:{if (LLSIG.game.PLAYING) {musicPlayer.pause();SaveSongData(song,lanes);}}break;
}break; case KeyEvent.VK_DOWN:{EDITOR_CURSOR_BEAT+=1d/EDITOR_BEAT_DIVISIONS;}break;
case KeyEvent.VK_S:{lane=1;}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_D:{lane=2;}break; case KeyEvent.VK_UP:{EDITOR_CURSOR_BEAT=Math.max(EDITOR_CURSOR_BEAT-(1d/EDITOR_BEAT_DIVISIONS),0);}break;
case KeyEvent.VK_F:{lane=3;}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;
case KeyEvent.VK_SPACE:{lane=4;}break; }
case KeyEvent.VK_J:{lane=5;}break; } else {
case KeyEvent.VK_K:{lane=6;}break; switch (e.getKeyCode()) {
case KeyEvent.VK_L:{lane=7;}break; case KeyEvent.VK_A:{
case KeyEvent.VK_SEMICOLON:{lane=8;}break; if (BPM_MEASURE) {
case KeyEvent.VK_P:{if (LLSIG.game.PLAYING&&musicPlayer.isPaused()) {musicPlayer.resume();} else {musicPlayer.pause();}}break; beats.add(System.nanoTime());
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; lane=0;
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; }break;
case KeyEvent.VK_UP:{EDITOR_CURSOR_BEAT=Math.max(EDITOR_CURSOR_BEAT-(1d/EDITOR_BEAT_DIVISIONS),0);}break; case KeyEvent.VK_BACK_SLASH:{
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 (METRONOME) {
testOffset=musicPlayer.getPlayPosition();
beatNumber=0;
}
musicPlayer.seek(148900);
}break;
case KeyEvent.VK_S:{lane=1;}break;
case KeyEvent.VK_D:{lane=2;}break;
case KeyEvent.VK_F:{lane=3;}break;
case KeyEvent.VK_SPACE:{lane=4;}break;
case KeyEvent.VK_J:{lane=5;}break;
case KeyEvent.VK_K:{lane=6;}break;
case KeyEvent.VK_L:{lane=7;}break;
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 (lane!=-1) {
if (PLAYING&&EDITMODE) { if (PLAYING&&EDITMODE) {

Loading…
Cancel
Save