Skip to content

Commit

Permalink
change note style on change
Browse files Browse the repository at this point in the history
  • Loading branch information
lemz1 committed Jun 2, 2024
1 parent 9a5694b commit 1228d65
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class ChartEditorHoldNoteSprite extends SustainTrail
function updateHoldNoteGraphic():Void
{
var bruhStyle:NoteStyle = NoteStyleRegistry.instance.fetchEntry(noteStyle);
this.setupHoldNoteGraphic(bruhStyle);
setupHoldNoteGraphic(bruhStyle);

zoom = 1.0;
zoom *= bruhStyle.fetchHoldNoteScale();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 1228d65

Please sign in to comment.