From 2f26a97dcb5070295370ffcea8f5adab401e5116 Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Thu, 31 Aug 2023 21:56:49 -0400 Subject: [PATCH] WIP on chart editor snapping --- .../ui/debug/charting/ChartEditorState.hx | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/source/funkin/ui/debug/charting/ChartEditorState.hx b/source/funkin/ui/debug/charting/ChartEditorState.hx index 83c052050..8cc90aead 100644 --- a/source/funkin/ui/debug/charting/ChartEditorState.hx +++ b/source/funkin/ui/debug/charting/ChartEditorState.hx @@ -179,6 +179,8 @@ class ChartEditorState extends HaxeUIState */ static final SNAP_QUANTS:Array = [4, 8, 12, 16, 20, 24, 32, 48, 64, 96, 192]; + static final BASE_QUANT:Int = 16; + /** * INSTANCE DATA */ @@ -1770,7 +1772,7 @@ class ChartEditorState extends HaxeUIState // These ones only happen if the modal dialog is not open. handleScrollKeybinds(); // handleZoom(); - // handleSnap(); + handleSnap(); handleCursor(); handleMenubar(); @@ -2028,11 +2030,25 @@ class ChartEditorState extends HaxeUIState if (FlxG.keys.justPressed.LEFT) { noteSnapQuantIndex--; + NotificationManager.instance.addNotification( + { + title: 'Note Snapping', + body: 'Updated note snapping to 1/${noteSnapQuant}', + type: NotificationType.Success, + expiryMs: ChartEditorState.NOTIFICATION_DISMISS_TIME + }); } if (FlxG.keys.justPressed.RIGHT) { noteSnapQuantIndex++; + NotificationManager.instance.addNotification( + { + title: 'Note Snapping', + body: 'Updated note snapping to 1/${noteSnapQuant}', + type: NotificationType.Success, + expiryMs: ChartEditorState.NOTIFICATION_DISMISS_TIME + }); } }