Fix holds

This commit is contained in:
NeeEoo
2023-07-21 18:21:24 +02:00
parent e9db14487d
commit 1cc7214e01
2 changed files with 9 additions and 5 deletions
+5 -2
View File
@@ -101,13 +101,16 @@ class Note extends FlxSprite
return __customNoteTypeExists[path];
return __customNoteTypeExists[path] = Assets.exists(path);
}
public function new(strumLine:StrumLine, noteData:ChartNote, sustain:Bool = false, sustainLength:Float = 0, sustainOffset:Float = 0)
public function new(strumLine:StrumLine, noteData:ChartNote, sustain:Bool = false, sustainLength:Float = 0, sustainOffset:Float = 0, ?prev:Note)
{
super();
moves = false;
this.prevNote = strumLine.notes.members.last();
if(prev != null)
this.prevNote = prev;
else
this.prevNote = strumLine.notes.members.last();
this.noteTypeID = noteData.type.getDefault(0);
this.isSustainNote = sustain;
this.sustainLength = sustainLength;
+4 -3
View File
@@ -116,22 +116,23 @@ class StrumLine extends FlxTypedGroup<Strum> {
}
notes.preallocate(total);
notes.length = total;
var il = 0;
var prev:Note = null;
if (strumLine.notes != null) for(note in strumLine.notes) {
if (startTime != null && startTime > note.time)
continue;
notes.members[total-(il++)-1] = new Note(this, note, false);
notes.members[total-(il++)-1] = prev = new Note(this, note, false, prev);
if (note.sLen > Conductor.stepCrochet * 0.75) {
var len:Float = note.sLen;
var curLen:Float = 0;
while(len > 10) {
curLen = Math.min(len, Conductor.stepCrochet);
notes.members[total-(il++)-1] = new Note(this, note, true, curLen, note.sLen - len);
notes.members[total-(il++)-1] = prev = new Note(this, note, true, curLen, note.sLen - len, prev);
len -= curLen;
}
}