change note style on change
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user