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

Merge remote-tracking branch 'origin/feature/chart-note-snapping-ui' into HEAD

This commit is contained in:
EliteMasterEric 2023-09-08 18:25:20 -04:00
commit 1acce31123
2 changed files with 15 additions and 28 deletions

View file

@ -185,7 +185,6 @@ class ChartEditorState extends HaxeUIState
* INSTANCE DATA * INSTANCE DATA
*/ */
// ============================== // ==============================
public var currentZoomLevel:Float = 1.0;
/** /**
* The internal index of what note snapping value is in use. * The internal index of what note snapping value is in use.
@ -1789,7 +1788,6 @@ class ChartEditorState extends HaxeUIState
// These ones only happen if the modal dialog is not open. // These ones only happen if the modal dialog is not open.
handleScrollKeybinds(); handleScrollKeybinds();
// handleZoom();
handleSnap(); handleSnap();
handleCursor(); handleCursor();
@ -2020,32 +2018,9 @@ class ChartEditorState extends HaxeUIState
if (shouldPause) stopAudioPlayback(); if (shouldPause) stopAudioPlayback();
} }
function handleZoom():Void
{
if (FlxG.keys.justPressed.MINUS)
{
currentZoomLevel /= 2;
// Update the grid.
ChartEditorThemeHandler.updateTheme(this);
// Update the note positions.
noteDisplayDirty = true;
}
if (FlxG.keys.justPressed.PLUS)
{
currentZoomLevel *= 2;
// Update the grid.
ChartEditorThemeHandler.updateTheme(this);
// Update the note positions.
noteDisplayDirty = true;
}
}
function handleSnap():Void function handleSnap():Void
{ {
if (FlxG.keys.justPressed.LEFT) if (FlxG.keys.justPressed.LEFT && !FlxG.keys.pressed.CONTROL)
{ {
noteSnapQuantIndex--; noteSnapQuantIndex--;
#if !mac #if !mac
@ -2059,7 +2034,7 @@ class ChartEditorState extends HaxeUIState
#end #end
} }
if (FlxG.keys.justPressed.RIGHT) if (FlxG.keys.justPressed.RIGHT && !FlxG.keys.pressed.CONTROL)
{ {
noteSnapQuantIndex++; noteSnapQuantIndex++;
#if !mac #if !mac
@ -2934,6 +2909,8 @@ class ChartEditorState extends HaxeUIState
var songRemainingString:String = '-${songRemainingMinutes}:${songRemainingSeconds}'; var songRemainingString:String = '-${songRemainingMinutes}:${songRemainingSeconds}';
setUIValue('playbarSongRemaining', songRemainingString); setUIValue('playbarSongRemaining', songRemainingString);
setUIValue('playbarNoteSnap', '1/${noteSnapQuant}');
} }
/** /**
@ -3144,6 +3121,16 @@ class ChartEditorState extends HaxeUIState
refreshSongMetadataToolbox(); refreshSongMetadataToolbox();
} }
} }
#if !mac
NotificationManager.instance.addNotification(
{
title: 'Switch Difficulty',
body: 'Switched difficulty to ${selectedDifficulty.toTitleCase()}',
type: NotificationType.Success,
expiryMs: ChartEditorState.NOTIFICATION_DISMISS_TIME
});
#end
} }
/** /**

View file

@ -132,7 +132,7 @@ class ChartEditorThemeHandler
// 2 * (Strumline Size) + 1 grid squares wide, by (4 * quarter notes per measure) grid squares tall. // 2 * (Strumline Size) + 1 grid squares wide, by (4 * quarter notes per measure) grid squares tall.
// This gets reused to fill the screen. // This gets reused to fill the screen.
var gridWidth:Int = Std.int(ChartEditorState.GRID_SIZE * TOTAL_COLUMN_COUNT); var gridWidth:Int = Std.int(ChartEditorState.GRID_SIZE * TOTAL_COLUMN_COUNT);
var gridHeight:Int = Std.int(ChartEditorState.GRID_SIZE * Conductor.stepsPerMeasure * state.currentZoomLevel); var gridHeight:Int = Std.int(ChartEditorState.GRID_SIZE * Conductor.stepsPerMeasure);
state.gridBitmap = FlxGridOverlay.createGrid(ChartEditorState.GRID_SIZE, ChartEditorState.GRID_SIZE, gridWidth, gridHeight, true, gridColor1, gridColor2); state.gridBitmap = FlxGridOverlay.createGrid(ChartEditorState.GRID_SIZE, ChartEditorState.GRID_SIZE, gridWidth, gridHeight, true, gridColor1, gridColor2);
// Selection borders // Selection borders