1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2025-11-26 14:16:00 +00:00

fixed a bit

This commit is contained in:
lemz 2024-06-03 00:03:47 +02:00 committed by EliteMasterEric
parent 040fc85a62
commit bb97549171
3 changed files with 15 additions and 16 deletions

View file

@ -3606,10 +3606,11 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
holdNoteSprite.noteData = noteSprite.noteData; holdNoteSprite.noteData = noteSprite.noteData;
holdNoteSprite.noteDirection = noteSprite.noteData.getDirection(); holdNoteSprite.noteDirection = noteSprite.noteData.getDirection();
holdNoteSprite.noteStyle = NoteKindManager.getNoteStyleId(noteSprite.noteData.kind) ?? currentSongNoteStyle;
holdNoteSprite.setHeightDirectly(noteLengthPixels); holdNoteSprite.setHeightDirectly(noteLengthPixels);
holdNoteSprite.noteStyle = NoteKindManager.getNoteStyleId(noteSprite.noteData.kind) ?? currentSongNoteStyle;
holdNoteSprite.updateHoldNotePosition(renderedHoldNotes); holdNoteSprite.updateHoldNotePosition(renderedHoldNotes);
trace(holdNoteSprite.x + ', ' + holdNoteSprite.y + ', ' + holdNoteSprite.width + ', ' + holdNoteSprite.height); trace(holdNoteSprite.x + ', ' + holdNoteSprite.y + ', ' + holdNoteSprite.width + ', ' + holdNoteSprite.height);
@ -3672,9 +3673,10 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
holdNoteSprite.noteData = noteData; holdNoteSprite.noteData = noteData;
holdNoteSprite.noteDirection = noteData.getDirection(); holdNoteSprite.noteDirection = noteData.getDirection();
holdNoteSprite.noteStyle = NoteKindManager.getNoteStyleId(noteData.kind) ?? currentSongNoteStyle;
holdNoteSprite.setHeightDirectly(noteLengthPixels); holdNoteSprite.setHeightDirectly(noteLengthPixels);
holdNoteSprite.noteStyle = NoteKindManager.getNoteStyleId(noteData.kind) ?? currentSongNoteStyle;
holdNoteSprite.updateHoldNotePosition(renderedHoldNotes); holdNoteSprite.updateHoldNotePosition(renderedHoldNotes);
displayedHoldNoteData.push(noteData); displayedHoldNoteData.push(noteData);
@ -4571,9 +4573,8 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
gridGhostHoldNote.visible = true; gridGhostHoldNote.visible = true;
gridGhostHoldNote.noteData = currentPlaceNoteData; gridGhostHoldNote.noteData = currentPlaceNoteData;
gridGhostHoldNote.noteDirection = currentPlaceNoteData.getDirection(); gridGhostHoldNote.noteDirection = currentPlaceNoteData.getDirection();
gridGhostHoldNote.noteStyle = NoteKindManager.getNoteStyleId(currentPlaceNoteData.kind) ?? currentSongNoteStyle;
gridGhostHoldNote.setHeightDirectly(dragLengthPixels, true); gridGhostHoldNote.setHeightDirectly(dragLengthPixels, true);
gridGhostHoldNote.noteStyle = NoteKindManager.getNoteStyleId(currentPlaceNoteData.kind) ?? currentSongNoteStyle;
gridGhostHoldNote.updateHoldNotePosition(renderedHoldNotes); gridGhostHoldNote.updateHoldNotePosition(renderedHoldNotes);
} }
else else
@ -5284,10 +5285,10 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
// Readd the new ghost hold note. // Readd the new ghost hold note.
ghostHold.noteData = targetNoteData.clone(); ghostHold.noteData = targetNoteData.clone();
ghostHold.noteDirection = ghostHold.noteData.getDirection(); ghostHold.noteDirection = ghostHold.noteData.getDirection();
ghostHold.noteStyle = NoteKindManager.getNoteStyleId(ghostHold.noteData.kind) ?? currentSongNoteStyle;
ghostHold.visible = true; ghostHold.visible = true;
ghostHold.alpha = 0.6; ghostHold.alpha = 0.6;
ghostHold.setHeightDirectly(0); ghostHold.setHeightDirectly(0);
ghostHold.noteStyle = NoteKindManager.getNoteStyleId(ghostHold.noteData.kind) ?? currentSongNoteStyle;
ghostHold.updateHoldNotePosition(renderedHoldNotes); ghostHold.updateHoldNotePosition(renderedHoldNotes);
} }

View file

@ -73,6 +73,8 @@ class ChartEditorHoldNoteSprite extends SustainTrail
flipY = false; flipY = false;
setup(); setup();
triggerRedraw();
} }
public override function updateHitbox():Void public override function updateHitbox():Void

View file

@ -60,34 +60,30 @@ class ChartEditorNoteDataToolbox extends ChartEditorBaseToolbox
if (!_initializing && chartEditorState.currentNoteSelection.length > 0) 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) for (note in chartEditorState.currentNoteSelection)
{ {
// Edit the note data of any selected notes.
note.kind = chartEditorState.noteKindToPlace;
// update note sprites // update note sprites
for (noteSprite in noteSprites) for (noteSprite in chartEditorState.renderedNotes.members)
{ {
if (noteSprite.noteData == note) if (noteSprite.noteData == note)
{ {
noteSprite.noteStyle = NoteKindManager.getNoteStyleId(chartEditorState.noteKindToPlace) ?? chartEditorState.currentSongNoteStyle; noteSprite.noteStyle = NoteKindManager.getNoteStyleId(note.kind) ?? chartEditorState.currentSongNoteStyle;
noteSprites.remove(noteSprite);
break; break;
} }
} }
// update hold note sprites // update hold note sprites
for (holdNoteSprite in holdNoteSprites) for (holdNoteSprite in chartEditorState.renderedHoldNotes.members)
{ {
if (holdNoteSprite.noteData == note) if (holdNoteSprite.noteData == note)
{ {
holdNoteSprite.noteStyle = NoteKindManager.getNoteStyleId(chartEditorState.noteKindToPlace) ?? chartEditorState.currentSongNoteStyle; holdNoteSprite.noteStyle = NoteKindManager.getNoteStyleId(note.kind) ?? chartEditorState.currentSongNoteStyle;
holdNoteSprites.remove(holdNoteSprite);
break; break;
} }
} }
note.kind = chartEditorState.noteKindToPlace;
} }
chartEditorState.saveDataDirty = true; chartEditorState.saveDataDirty = true;
chartEditorState.noteDisplayDirty = true; chartEditorState.noteDisplayDirty = true;