From 36df9c387b6c247c1276f931a30f63312bbc3e7a Mon Sep 17 00:00:00 2001 From: James Groom Date: Thu, 23 Nov 2023 07:45:40 +0000 Subject: [PATCH] Add `IDialogParent.AddOnScreenMessage` extension --- src/BizHawk.Client.Common/DialogControllerExtensions.cs | 3 +++ src/BizHawk.Client.Common/movie/MovieSession.cs | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/BizHawk.Client.Common/DialogControllerExtensions.cs b/src/BizHawk.Client.Common/DialogControllerExtensions.cs index d6f17dccd3..ef1ad31d50 100644 --- a/src/BizHawk.Client.Common/DialogControllerExtensions.cs +++ b/src/BizHawk.Client.Common/DialogControllerExtensions.cs @@ -7,6 +7,9 @@ namespace BizHawk.Client.Common { public static class DialogControllerExtensions { + public static void AddOnScreenMessage(this IDialogParent dialogParent, string message, int? duration = null) + => dialogParent.DialogController.AddOnScreenMessage(message, duration); + public static void DoWithTempMute(this IDialogController dialogController, Action action) { dialogController.StopSound(); diff --git a/src/BizHawk.Client.Common/movie/MovieSession.cs b/src/BizHawk.Client.Common/movie/MovieSession.cs index 21887e484b..7f06fdfb64 100644 --- a/src/BizHawk.Client.Common/movie/MovieSession.cs +++ b/src/BizHawk.Client.Common/movie/MovieSession.cs @@ -321,7 +321,7 @@ namespace BizHawk.Client.Common public void PopupMessage(string message) => _dialogParent.ModalMessageBox(message, "Warning", EMsgBoxIcon.Warning); private void Output(string message) - => _dialogParent.DialogController.AddOnScreenMessage(message); + => _dialogParent.AddOnScreenMessage(message); private void LatchInputToUser() {