Fixed not being able to select notes, and fixed the delete note bug.

This commit is contained in:
NeeEoo 2021-07-02 14:57:46 +02:00
parent 1263e69444
commit ececb4c3b2
No known key found for this signature in database
GPG Key ID: 3F30D4573260F7A6
3 changed files with 6 additions and 4 deletions

View File

@ -1240,6 +1240,7 @@ class ChartingState extends MusicBeatState
var daSus = i[2];
var note:Note = new Note(daStrumTime, daNoteInfo % 4,null,false,true);
note.rawNoteData = daNoteInfo;
note.sustainLength = daSus;
note.setGraphicSize(GRID_SIZE, GRID_SIZE);
note.updateHitbox();
@ -1282,7 +1283,7 @@ class ChartingState extends MusicBeatState
for (i in _song.notes[curSection].sectionNotes)
{
if (i.strumTime == note.strumTime && i.noteData % 4 == note.noteData)
if (i[0] == note.strumTime && i[1] == note.rawNoteData)
{
curSelectedNote = _song.notes[curSection].sectionNotes[swagNum];
}
@ -1300,7 +1301,7 @@ class ChartingState extends MusicBeatState
lastNote = note;
for (i in _song.notes[curSection].sectionNotes)
{
if (i[0] == note.strumTime && i[1] % 4 == note.noteData)
if (i[0] == note.strumTime && i[1] == note.rawNoteData)
{
_song.notes[curSection].sectionNotes.remove(i);
}

View File

@ -19,6 +19,7 @@ class Note extends FlxSprite
public var mustPress:Bool = false;
public var noteData:Int = 0;
public var rawNoteData:Int = 0;
public var canBeHit:Bool = false;
public var tooLate:Bool = false;
public var wasGoodHit:Bool = false;

View File

@ -2,7 +2,7 @@ package;
typedef SwagSection =
{
var sectionNotes:Array<Dynamic>;
var sectionNotes:Array<Array<Dynamic>>;
var lengthInSteps:Int;
var typeOfSection:Int;
var mustHitSection:Bool;
@ -13,7 +13,7 @@ typedef SwagSection =
class Section
{
public var sectionNotes:Array<Dynamic> = [];
public var sectionNotes:Array<Array<Dynamic>> = [];
public var lengthInSteps:Int = 16;
public var typeOfSection:Int = 0;