feat: add support for quest and error toasts

This commit is contained in:
Anna 2021-04-07 13:49:56 -04:00
parent ff0724e6ce
commit 145b42ed82
1 changed files with 18 additions and 1 deletions

View File

@ -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;
}