Add hold note generation when recording.

Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
main
sigonasr2, Sig, Sigo 3 years ago
parent 30ffb07e63
commit 2ad46ea580
  1. 20
      LLSIG/src/main/java/LLSIG/LLSIG.java
  2. 3
      LLSIG/src/main/java/LLSIG/Lane.java

@ -80,6 +80,8 @@ public class LLSIG implements KeyListener{
public static double LAST_MISS = 0;
public static int COMBO = 0;
public final static int NOTE_RECORD_BEAT_SNAP_MULTIPLE = 4; //How many beat divisions max we can snap to.
public final static long TIMEPERTICK = 16666667l;
public static double DRAWTIME=0;
@ -337,9 +339,10 @@ public class LLSIG implements KeyListener{
if (PLAYING&&EDITMODE) {
Note n = new Note(NoteType.NORMAL,musicPlayer.getPlayPosition());
n.active=false;
System.out.println(Math.round(((musicPlayer.getPlayPosition()-offset)/beatDelay)*4)/(double)4);
n.setBeatSnap(Math.round(((musicPlayer.getPlayPosition()-offset)/beatDelay)*4)/(double)4);
//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;
}
if (PLAYING&&!EDITMODE&&!EDITOR) {
Lane l = lanes.get(lane);
@ -391,6 +394,18 @@ public class LLSIG implements KeyListener{
case KeyEvent.VK_SEMICOLON:{lane=8;}break;
}
if (lane!=-1) {
if (PLAYING&&EDITMODE) {
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) {
if (noteBeat-lastNote.getBeatSnap()>=1) {
lastNote.setBeatSnapEnd(noteBeat);
lastNote.active2=false;
LLSIG.game.lanes.get(lane).lastNoteAdded=null;
}
}
}
if (PLAYING&&!EDITMODE&&!EDITOR) {
keyState[lane]=false;
Lane l = lanes.get(lane);
if (l.noteExists()) {
@ -404,3 +419,4 @@ public class LLSIG implements KeyListener{
}
}
}
}

@ -6,6 +6,7 @@ public class Lane{
int currentNoteIndex = 0;
TimingRating lastRating = TimingRating.MISS;
double lastNote = -1;
Note lastNoteAdded;
public Lane(List<Note> noteChart) {
super();
this.noteChart = noteChart;
@ -34,7 +35,7 @@ public class Lane{
for (int i=0;i<noteChart.size();i++)
{
Note n = getNote(i);
if (n.active) {return n;}
if (n.active||n.active2) {return n;}
}
return null;
}

Loading…
Cancel
Save