Fix edit mode press and release holding tracking for editing mode.

main
Joshua Sigona 3 years ago
parent 82c6f63538
commit 39759fa789
  1. 6
      LLSIG/src/main/java/LLSIG/LLSIG.java
  2. 1
      LLSIG/src/main/java/LLSIG/Lane.java

@ -402,12 +402,15 @@ public class LLSIG implements KeyListener{
}
} else
if (PLAYING&&EDITMODE) {
if (!LLSIG.game.lanes.get(lane).keyPressed) {
Note n = new Note(NoteType.NORMAL,musicPlayer.getPlayPosition());
n.active=false;
//System.out.println(Math.round(((musicPlayer.getPlayPosition()-offset)/beatDelay)*NOTE_RECORD_BEAT_SNAP_MULTIPLE)/(double)NOTE_RECORD_BEAT_SNAP_MULTIPLE);
n.setBeatSnap(Math.round(((musicPlayer.getPlayPosition()-offset)/beatDelay)*NOTE_RECORD_BEAT_SNAP_MULTIPLE)/(double)NOTE_RECORD_BEAT_SNAP_MULTIPLE);
LLSIG.game.lanes.get(lane).addNote(n);
LLSIG.game.lanes.get(lane).lastNoteAdded=n;
LLSIG.game.lanes.get(lane).keyPressed=true;
}
} else
if (PLAYING&&!EDITMODE&&!EDITOR) {
Lane l = lanes.get(lane);
@ -466,6 +469,7 @@ public class LLSIG implements KeyListener{
}
if (lane!=-1) {
if (PLAYING&&EDITMODE) {
if (LLSIG.game.lanes.get(lane).keyPressed) {
double noteBeat = Math.round(((musicPlayer.getPlayPosition()-offset)/beatDelay)*NOTE_RECORD_BEAT_SNAP_MULTIPLE)/(double)NOTE_RECORD_BEAT_SNAP_MULTIPLE;
Note lastNote = LLSIG.game.lanes.get(lane).lastNoteAdded;
if (lastNote!=null) {
@ -476,6 +480,8 @@ public class LLSIG implements KeyListener{
LLSIG.game.lanes.get(lane).lastNoteAdded=null;
}
}
LLSIG.game.lanes.get(lane).keyPressed=false;
}
}
if (PLAYING&&!EDITMODE&&!EDITOR) {
keyState[lane]=false;

@ -7,6 +7,7 @@ public class Lane{
TimingRating lastRating = TimingRating.MISS;
double lastNote = -1;
Note lastNoteAdded;
boolean keyPressed=false;
public Lane(List<Note> noteChart) {
super();
this.noteChart = noteChart;

Loading…
Cancel
Save