1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2025-01-27 23:37:06 +00:00

Fix a bug where ghost note would be properly snapped but placed note would not.

This commit is contained in:
EliteMasterEric 2023-09-11 18:29:08 -04:00
parent 96a0b2fe87
commit d3f5a81b13

View file

@ -2414,7 +2414,7 @@ class ChartEditorState extends HaxeUIState
// Handle extending the note as you drag. // Handle extending the note as you drag.
// TODO: This should be beat snapped? // TODO: This should be beat snapped?
var dragLengthSteps:Float = Conductor.getTimeInSteps(cursorMs) - currentPlaceNoteData.stepTime; var dragLengthSteps:Float = Conductor.getTimeInSteps(cursorSnappedMs) - currentPlaceNoteData.stepTime;
// Without this, the newly placed note feels too short compared to the user's input. // Without this, the newly placed note feels too short compared to the user's input.
var INCREMENT:Float = 1.0; var INCREMENT:Float = 1.0;
@ -2508,14 +2508,14 @@ class ChartEditorState extends HaxeUIState
{ {
// Create an event and place it in the chart. // Create an event and place it in the chart.
// TODO: Figure out configuring event data. // TODO: Figure out configuring event data.
var newEventData:SongEventData = new SongEventData(cursorMs, selectedEventKind, selectedEventData); var newEventData:SongEventData = new SongEventData(cursorSnappedMs, selectedEventKind, selectedEventData);
performCommand(new AddEventsCommand([newEventData], FlxG.keys.pressed.CONTROL)); performCommand(new AddEventsCommand([newEventData], FlxG.keys.pressed.CONTROL));
} }
else else
{ {
// Create a note and place it in the chart. // Create a note and place it in the chart.
var newNoteData:SongNoteData = new SongNoteData(cursorMs, cursorColumn, 0, selectedNoteKind); var newNoteData:SongNoteData = new SongNoteData(cursorSnappedMs, cursorColumn, 0, selectedNoteKind);
performCommand(new AddNotesCommand([newNoteData], FlxG.keys.pressed.CONTROL)); performCommand(new AddNotesCommand([newNoteData], FlxG.keys.pressed.CONTROL));
@ -2598,8 +2598,7 @@ class ChartEditorState extends HaxeUIState
if (gridGhostNote == null) throw "ERROR: Tried to handle cursor, but gridGhostNote is null! Check ChartEditorState.buildGrid()"; if (gridGhostNote == null) throw "ERROR: Tried to handle cursor, but gridGhostNote is null! Check ChartEditorState.buildGrid()";
var noteData:SongNoteData = gridGhostNote.noteData != null ? gridGhostNote.noteData : new SongNoteData(cursorMs, cursorColumn, 0, var noteData:SongNoteData = gridGhostNote.noteData != null ? gridGhostNote.noteData : new SongNoteData(cursorMs, cursorColumn, 0, selectedNoteKind);
selectedNoteKind);
if (cursorColumn != noteData.data || selectedNoteKind != noteData.kind) if (cursorColumn != noteData.data || selectedNoteKind != noteData.kind)
{ {