Working on hold note indicators
This commit is contained in:
parent
7554a765c3
commit
3ca3168f30
@ -52,7 +52,7 @@ public class LLSIG implements KeyListener,MouseWheelListener{
|
|||||||
public boolean METRONOME = false;
|
public boolean METRONOME = false;
|
||||||
public boolean BPM_MEASURE = false;
|
public boolean BPM_MEASURE = false;
|
||||||
public boolean PLAYING = true; //Whether or not a song is loaded and playing.
|
public boolean PLAYING = true; //Whether or not a song is loaded and playing.
|
||||||
public boolean EDITOR = true; //Whether or not we are in beatmap editing mode.
|
public boolean EDITOR = false; //Whether or not we are in beatmap editing mode.
|
||||||
public boolean HOLDING_CTRL_KEY = false;
|
public boolean HOLDING_CTRL_KEY = false;
|
||||||
|
|
||||||
public static double EDITOR_CURSOR_BEAT = 0;
|
public static double EDITOR_CURSOR_BEAT = 0;
|
||||||
@ -135,6 +135,7 @@ public class LLSIG implements KeyListener,MouseWheelListener{
|
|||||||
window.add(canvas);
|
window.add(canvas);
|
||||||
window.setVisible(true);
|
window.setVisible(true);
|
||||||
window.addKeyListener(this);
|
window.addKeyListener(this);
|
||||||
|
window.addMouseWheelListener(this);
|
||||||
|
|
||||||
new Thread() {
|
new Thread() {
|
||||||
public void run(){
|
public void run(){
|
||||||
@ -175,6 +176,7 @@ public class LLSIG implements KeyListener,MouseWheelListener{
|
|||||||
l.clearOutInactiveNotes();
|
l.clearOutInactiveNotes();
|
||||||
}*/
|
}*/
|
||||||
l.clearOutDeletedNotes();
|
l.clearOutDeletedNotes();
|
||||||
|
l.addFromQueue();
|
||||||
}
|
}
|
||||||
for (BeatTiming bt : timings) {
|
for (BeatTiming bt : timings) {
|
||||||
if (bt.active&&musicPlayer.getPlayPosition()>=bt.offset&&bt.offset>offset) {
|
if (bt.active&&musicPlayer.getPlayPosition()>=bt.offset&&bt.offset>offset) {
|
||||||
@ -412,6 +414,8 @@ public class LLSIG implements KeyListener,MouseWheelListener{
|
|||||||
LLSIG.game.lanes.get(lane).addNote(n,true);
|
LLSIG.game.lanes.get(lane).addNote(n,true);
|
||||||
LLSIG.game.lanes.get(lane).lastNoteAdded=n;
|
LLSIG.game.lanes.get(lane).lastNoteAdded=n;
|
||||||
l.keyPressed=true;
|
l.keyPressed=true;
|
||||||
|
clap.setFramePosition(0);
|
||||||
|
clap.start();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
@ -508,6 +512,8 @@ public class LLSIG implements KeyListener,MouseWheelListener{
|
|||||||
lastNote.setNoteType(NoteType.HOLD);
|
lastNote.setNoteType(NoteType.HOLD);
|
||||||
lastNote.setBeatSnapEnd(EDITOR_CURSOR_BEAT);
|
lastNote.setBeatSnapEnd(EDITOR_CURSOR_BEAT);
|
||||||
lastNote.active2=false;
|
lastNote.active2=false;
|
||||||
|
clap.setFramePosition(0);
|
||||||
|
clap.start();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LLSIG.game.lanes.get(lane).keyPressed=false;
|
LLSIG.game.lanes.get(lane).keyPressed=false;
|
||||||
@ -540,6 +546,7 @@ public class LLSIG implements KeyListener,MouseWheelListener{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
keyState[lane]=false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
package main.java.LLSIG;
|
package main.java.LLSIG;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class Lane{
|
public class Lane{
|
||||||
List<Note> noteChart;
|
List<Note> noteChart;
|
||||||
|
List<Note> addQueue = new ArrayList<Note>();
|
||||||
int currentNoteIndex = 0;
|
int currentNoteIndex = 0;
|
||||||
TimingRating lastRating = TimingRating.MISS;
|
TimingRating lastRating = TimingRating.MISS;
|
||||||
double lastNote = -1;
|
double lastNote = -1;
|
||||||
@ -49,23 +51,26 @@ public class Lane{
|
|||||||
addNote(n,false);
|
addNote(n,false);
|
||||||
}
|
}
|
||||||
public void addNote(Note n,boolean performReorderingOfList) {
|
public void addNote(Note n,boolean performReorderingOfList) {
|
||||||
if (performReorderingOfList) {
|
addQueue.add(n);
|
||||||
boolean added=false;
|
}
|
||||||
for (int i=0;i<noteChart.size();i++) {
|
|
||||||
Note nn = noteChart.get(i);
|
public void addFromQueue() {
|
||||||
if (nn.start>n.start) {
|
for (Note n : addQueue) {
|
||||||
noteChart.add(i,n);
|
boolean added=false;
|
||||||
added=true;
|
for (int i=0;i<noteChart.size();i++) {
|
||||||
break;
|
Note nn = noteChart.get(i);
|
||||||
|
if (nn.start>n.start) {
|
||||||
|
noteChart.add(i,n);
|
||||||
|
added=true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
if (!added) {
|
||||||
if (!added) {
|
noteChart.add(n);
|
||||||
noteChart.add(n);
|
}
|
||||||
}
|
System.out.println("Note added: "+n);
|
||||||
} else {
|
|
||||||
noteChart.add(n);
|
|
||||||
}
|
}
|
||||||
System.out.println("Note added: "+n);
|
addQueue.clear();
|
||||||
}
|
}
|
||||||
public void markMissedNotes() {
|
public void markMissedNotes() {
|
||||||
if (LLSIG.game.PLAYING) {
|
if (LLSIG.game.PLAYING) {
|
||||||
|
@ -7,6 +7,7 @@ public class Note {
|
|||||||
boolean active2=false; //Set to false when the end section of the note has been scored.
|
boolean active2=false; //Set to false when the end section of the note has been scored.
|
||||||
double beatSnapStart,beatSnapEnd = -1;
|
double beatSnapStart,beatSnapEnd = -1;
|
||||||
boolean deleted=false; //Set this marker to delete it on the next frame (when using the editor)
|
boolean deleted=false; //Set this marker to delete it on the next frame (when using the editor)
|
||||||
|
boolean multiple=false; //Whether or not to display an indicator showing this is a multi-press note.
|
||||||
public Note(NoteType type,double start,double end) {
|
public Note(NoteType type,double start,double end) {
|
||||||
this.type=type;
|
this.type=type;
|
||||||
this.start=start;
|
this.start=start;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user