Skip to content

Commit

Permalink
fix sustains in chart editor
Browse files Browse the repository at this point in the history
  • Loading branch information
Vortex2Oblivion committed Sep 7, 2024
1 parent 27731c0 commit e7fd9c5
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions source/toolbox/ChartingState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ class ChartingState extends MusicBeatState {
var dummyArrow:FlxSprite;

var curRenderedNotes:FlxTypedGroup<Note>;
var curRenderedSustains:FlxTypedGroup<Note>;
var curRenderedIds:FlxTypedGroup<FlxSprite>;
var curRenderedEvents:FlxTypedGroup<EventSprite>;

Expand Down Expand Up @@ -225,7 +224,6 @@ class ChartingState extends MusicBeatState {
add(gridEventBlackLine);

curRenderedNotes = new FlxTypedGroup<Note>();
curRenderedSustains = new FlxTypedGroup<Note>();
curRenderedEvents = new FlxTypedGroup<EventSprite>();
curRenderedIds = new FlxTypedGroup<FlxSprite>();

Expand Down Expand Up @@ -270,7 +268,6 @@ class ChartingState extends MusicBeatState {
add(dummyArrow);

add(curRenderedNotes);
add(curRenderedSustains);
add(curRenderedIds);
add(curRenderedEvents);

Expand Down Expand Up @@ -932,11 +929,7 @@ class ChartingState extends MusicBeatState {
while (curRenderedNotes.members.length > 0) {
curRenderedNotes.remove(curRenderedNotes.members[0], true);
}

while (curRenderedSustains.members.length > 0) {
curRenderedSustains.remove(curRenderedSustains.members[0], true);
}


while (curRenderedEvents.members.length > 0) {
curRenderedEvents.remove(curRenderedEvents.members[0], true);
}
Expand Down Expand Up @@ -1816,13 +1809,6 @@ class ChartingState extends MusicBeatState {
sprite.destroy();
}, true);

curRenderedSustains.clear();

curRenderedSustains.forEach(function(sprite:FlxSprite) {
sprite.kill();
sprite.destroy();
}, true);

curRenderedEvents.clear();

curRenderedEvents.forEach(function(sprite:EventSprite) {
Expand Down Expand Up @@ -1918,7 +1904,7 @@ class ChartingState extends MusicBeatState {
var oldNote = curRenderedNotes.members[curRenderedNotes.members.length - 1];
var sustainNote:Note = new Note(daStrumTime + (Conductor.stepCrochet * susNote) + Conductor.stepCrochet, goodNoteInfo, oldNote, true, 0,
daType, _song, [0], mustPress, true);
sustainNote.setGraphicSize(sustainNote.width / 3, 40);
sustainNote.scale.set(note.scale.x, note.scale.y);
sustainNote.updateHitbox();
sustainNote.x = note.x + (GRID_SIZE / 2) - Std.parseFloat(PlayState.instance.arrow_Configs.get(daType)[1]) - sustainNote.width / 2;
sustainNote.y = note.height
Expand Down

0 comments on commit e7fd9c5

Please sign in to comment.