1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2024-11-04 13:54:22 +00:00

WIP on chart editor snapping

This commit is contained in:
EliteMasterEric 2023-08-31 21:56:49 -04:00
parent cb81371b4a
commit 2f26a97dcb

View file

@ -179,6 +179,8 @@ class ChartEditorState extends HaxeUIState
*/
static final SNAP_QUANTS:Array<Int> = [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
});
}
}