diff --git a/hmm.json b/hmm.json index 0f06acaa7..a10eed1a6 100644 --- a/hmm.json +++ b/hmm.json @@ -49,14 +49,14 @@ "name": "haxeui-core", "type": "git", "dir": null, - "ref": "5d4ac180f85b39e72624f4b8d17925d91ebe4278", + "ref": "032192e849cdb7d1070c0a3241c58ee555ffaccc", "url": "https://github.com/haxeui/haxeui-core" }, { "name": "haxeui-flixel", "type": "git", "dir": null, - "ref": "89a4cf621e5c204922f7a12fbde5d1d84f8b47f5", + "ref": "d90758b229d05206400df867d333c79d9fdbd478", "url": "https://github.com/haxeui/haxeui-flixel" }, { diff --git a/source/funkin/ui/debug/charting/ChartEditorState.hx b/source/funkin/ui/debug/charting/ChartEditorState.hx index 9a2bfe63c..3696369d4 100644 --- a/source/funkin/ui/debug/charting/ChartEditorState.hx +++ b/source/funkin/ui/debug/charting/ChartEditorState.hx @@ -2643,7 +2643,7 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState * Open the backups folder in the file explorer. * Don't call this on HTML5. */ - function openBackupsFolder():Void + function openBackupsFolder(?_):Void { #if sys // TODO: Is there a way to open a folder and highlight a file in it? diff --git a/source/funkin/ui/debug/charting/dialogs/ChartEditorBaseDialog.hx b/source/funkin/ui/debug/charting/dialogs/ChartEditorBaseDialog.hx index 3de67b826..6f76e543e 100644 --- a/source/funkin/ui/debug/charting/dialogs/ChartEditorBaseDialog.hx +++ b/source/funkin/ui/debug/charting/dialogs/ChartEditorBaseDialog.hx @@ -29,6 +29,12 @@ class ChartEditorBaseDialog extends Dialog this.onDialogClosed = event -> onClose(event); } + public override function showDialog(modal:Bool = true):Void + { + super.showDialog(modal); + fadeInComponent(this, 1); + } + private override function onReady():Void { _overlay.opacity = 0; @@ -65,8 +71,8 @@ class ChartEditorBaseDialog extends Dialog this.closable = params.closable ?? false; } - static final OVERLAY_EASE_DURATION:Float = 5.0; - static final OVERLAY_EASE_TYPE:String = "linear"; + static final OVERLAY_EASE_DURATION:Float = 0.2; + static final OVERLAY_EASE_TYPE:String = "easeOut"; function fadeInDialogOverlay():Void { @@ -82,11 +88,16 @@ class ChartEditorBaseDialog extends Dialog return; } - var builder = new AnimationBuilder(_overlay, OVERLAY_EASE_DURATION, "linear"); - builder.setPosition(0, "opacity", 0, true); // 0% absolute - builder.setPosition(100, "opacity", 1, true); + fadeInComponent(_overlay, 0.5); + } - trace('Fading in dialog overlay...'); + function fadeInComponent(component:Component, fadeTo:Float = 1):Void + { + var builder = new AnimationBuilder(component, OVERLAY_EASE_DURATION, OVERLAY_EASE_TYPE); + builder.setPosition(0, "opacity", 0, true); // 0% absolute + builder.setPosition(100, "opacity", fadeTo, true); + + trace('Fading in dialog component...'); builder.play(); } } diff --git a/source/funkin/ui/debug/charting/handlers/ChartEditorNotificationHandler.hx b/source/funkin/ui/debug/charting/handlers/ChartEditorNotificationHandler.hx index 14d95347b..10da77694 100644 --- a/source/funkin/ui/debug/charting/handlers/ChartEditorNotificationHandler.hx +++ b/source/funkin/ui/debug/charting/handlers/ChartEditorNotificationHandler.hx @@ -5,6 +5,7 @@ import haxe.ui.containers.HBox; import haxe.ui.notifications.Notification; import haxe.ui.notifications.NotificationManager; import haxe.ui.notifications.NotificationType; +import haxe.ui.notifications.NotificationData.NotificationActionData; class ChartEditorNotificationHandler { @@ -77,7 +78,7 @@ class ChartEditorNotificationHandler * @param actions The actions to add to the notification. * @return The notification that was sent. */ - public static function infoWithActions(state:ChartEditorState, title:String, body:String, actions:Array):Notification + public static function infoWithActions(state:ChartEditorState, title:String, body:String, actions:Array):Notification { return sendNotification(state, title, body, NotificationType.Info, actions); } @@ -101,7 +102,8 @@ class ChartEditorNotificationHandler NotificationManager.instance.removeNotification(notif); } - static function sendNotification(state:ChartEditorState, title:String, body:String, ?type:NotificationType, ?actions:Array):Notification + static function sendNotification(state:ChartEditorState, title:String, body:String, ?type:NotificationType, + ?actions:Array):Notification { var actionNames:Array = actions == null ? [] : actions.map(action -> action.text); @@ -111,10 +113,10 @@ class ChartEditorNotificationHandler body: body, type: type ?? NotificationType.Default, expiryMs: Constants.NOTIFICATION_DISMISS_TIME, - actions: actionNames + actions: actions }); - if (actionNames.length > 0) + if (actions != null && actions.length > 0) { // TODO: Tell Ian that this is REALLY dumb. var actionsContainer:HBox = notif.findComponent('actionsContainer', HBox); @@ -122,13 +124,13 @@ class ChartEditorNotificationHandler if (Std.isOfType(component, Button)) { var button:Button = cast component; - var action:Null = actions.find(action -> action.text == button.text); + var action:Null = actions.find(action -> action.text == button.text); if (action != null && action.callback != null) { button.onClick = function(_) { // Don't allow actions to be clicked while the playtest is open. if (state.subState != null) return; - action.callback(); + action.callback(action); }; } }