From 145b42ed82c46f8b1c3c34fbed48fd4ceb92bec7 Mon Sep 17 00:00:00 2001 From: Anna Date: Wed, 7 Apr 2021 13:49:56 -0400 Subject: [PATCH] feat: add support for quest and error toasts --- BurntToast/Filter.cs | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/BurntToast/Filter.cs b/BurntToast/Filter.cs index a1e5e99..676883e 100755 --- a/BurntToast/Filter.cs +++ b/BurntToast/Filter.cs @@ -1,5 +1,6 @@ using System; using System.Linq; +using Dalamud.Game.Internal.Gui.Toast; using Dalamud.Game.Text.SeStringHandling; namespace BurntToast { @@ -10,13 +11,29 @@ namespace BurntToast { this.Plugin = plugin; this.Plugin.Interface.Framework.Gui.Toast.OnToast += this.OnToast; + this.Plugin.Interface.Framework.Gui.Toast.OnQuestToast += this.OnQuestToast; + this.Plugin.Interface.Framework.Gui.Toast.OnErrorToast += this.OnErrorToast; } public void Dispose() { + this.Plugin.Interface.Framework.Gui.Toast.OnErrorToast -= this.OnErrorToast; + this.Plugin.Interface.Framework.Gui.Toast.OnQuestToast -= this.OnQuestToast; this.Plugin.Interface.Framework.Gui.Toast.OnToast -= this.OnToast; } - private void OnToast(ref SeString message, ref bool isHandled) { + private void OnToast(ref SeString message, ref ToastOptions options, ref bool isHandled) { + this.DoFilter(message, ref isHandled); + } + + private void OnErrorToast(ref SeString message, ref bool isHandled) { + this.DoFilter(message, ref isHandled); + } + + private void OnQuestToast(ref SeString message, ref QuestToastOptions options, ref bool isHandled) { + this.DoFilter(message, ref isHandled); + } + + private void DoFilter(SeString message, ref bool isHandled) { if (isHandled) { return; }