change note style on change

This commit is contained in:
lemz
2024-07-12 02:13:14 -04:00
committed by EliteMasterEric
parent ca2cbb44f5
commit 040fc85a62
2 changed files with 27 additions and 1 deletions
@@ -4,6 +4,8 @@ import haxe.ui.components.DropDown;
import haxe.ui.components.TextField;
import haxe.ui.events.UIEvent;
import funkin.ui.debug.charting.util.ChartEditorDropdowns;
import funkin.ui.debug.charting.components.ChartEditorNoteSprite;
import funkin.ui.debug.charting.components.ChartEditorHoldNoteSprite;
import funkin.play.notes.notestyle.NoteStyle;
import funkin.play.notes.notekind.NoteKindManager;
@@ -59,8 +61,32 @@ class ChartEditorNoteDataToolbox extends ChartEditorBaseToolbox
if (!_initializing && chartEditorState.currentNoteSelection.length > 0)
{
// Edit the note data of any selected notes.
var noteSprites:Array<ChartEditorNoteSprite> = chartEditorState.renderedNotes.members.copy();
var holdNoteSprites:Array<ChartEditorHoldNoteSprite> = chartEditorState.renderedHoldNotes.members.copy();
for (note in chartEditorState.currentNoteSelection)
{
// update note sprites
for (noteSprite in noteSprites)
{
if (noteSprite.noteData == note)
{
noteSprite.noteStyle = NoteKindManager.getNoteStyleId(chartEditorState.noteKindToPlace) ?? chartEditorState.currentSongNoteStyle;
noteSprites.remove(noteSprite);
break;
}
}
// update hold note sprites
for (holdNoteSprite in holdNoteSprites)
{
if (holdNoteSprite.noteData == note)
{
holdNoteSprite.noteStyle = NoteKindManager.getNoteStyleId(chartEditorState.noteKindToPlace) ?? chartEditorState.currentSongNoteStyle;
holdNoteSprites.remove(holdNoteSprite);
break;
}
}
note.kind = chartEditorState.noteKindToPlace;
}
chartEditorState.saveDataDirty = true;