From 290c568cb5be0456741ed1c3acf7791389beeb24 Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Fri, 24 Nov 2023 16:11:53 -0500 Subject: [PATCH] Disable notification actions while playtest is open. --- .../handlers/ChartEditorNotificationHandler.hx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/source/funkin/ui/debug/charting/handlers/ChartEditorNotificationHandler.hx b/source/funkin/ui/debug/charting/handlers/ChartEditorNotificationHandler.hx index 796e70381..a81b704b7 100644 --- a/source/funkin/ui/debug/charting/handlers/ChartEditorNotificationHandler.hx +++ b/source/funkin/ui/debug/charting/handlers/ChartEditorNotificationHandler.hx @@ -21,7 +21,7 @@ class ChartEditorNotificationHandler */ public static function success(state:ChartEditorState, title:String, body:String):Notification { - return sendNotification(title, body, NotificationType.Success); + return sendNotification(state, title, body, NotificationType.Success); } /** @@ -30,7 +30,7 @@ class ChartEditorNotificationHandler */ public static function warning(state:ChartEditorState, title:String, body:String):Notification { - return sendNotification(title, body, NotificationType.Warning); + return sendNotification(state, title, body, NotificationType.Warning); } /** @@ -48,7 +48,7 @@ class ChartEditorNotificationHandler */ public static function error(state:ChartEditorState, title:String, body:String):Notification { - return sendNotification(title, body, NotificationType.Error); + return sendNotification(state, title, body, NotificationType.Error); } /** @@ -66,7 +66,7 @@ class ChartEditorNotificationHandler */ public static function info(state:ChartEditorState, title:String, body:String):Notification { - return sendNotification(title, body, NotificationType.Info); + return sendNotification(state, title, body, NotificationType.Info); } /** @@ -79,7 +79,7 @@ class ChartEditorNotificationHandler */ public static function infoWithActions(state:ChartEditorState, title:String, body:String, actions:Array):Notification { - return sendNotification(title, body, NotificationType.Info, actions); + return sendNotification(state, title, body, NotificationType.Info, actions); } /** @@ -101,7 +101,7 @@ class ChartEditorNotificationHandler NotificationManager.instance.removeNotification(notif); } - static function sendNotification(title:String, body:String, ?type:NotificationType, ?actions:Array):Notification + static function sendNotification(state:ChartEditorState, title:String, body:String, ?type:NotificationType, ?actions:Array):Notification { #if !mac var actionNames:Array = actions == null ? [] : actions.map(action -> action.text); @@ -127,6 +127,8 @@ class ChartEditorNotificationHandler 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(); }; }