From b6c8978acc631d7270a57eea3b63b5549e35824e Mon Sep 17 00:00:00 2001 From: Anna Clemens Date: Tue, 13 Sep 2022 17:26:54 -0400 Subject: [PATCH] more remove and on framework only --- client/Commands.cs | 6 ++++-- client/Ui/MainWindowTabs/Settings.cs | 9 +++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/client/Commands.cs b/client/Commands.cs index c350e6e..cfba9eb 100644 --- a/client/Commands.cs +++ b/client/Commands.cs @@ -40,8 +40,10 @@ internal class Commands : IDisposable { this.Plugin.SaveConfig(); this.Plugin.ChatGui.Print($"Added {name} to the ban list."); - this.Plugin.Messages.RemoveVfx(); - this.Plugin.Messages.Clear(); + this.Plugin.Framework.RunOnFrameworkThread(() => { + this.Plugin.Messages.RemoveVfx(); + this.Plugin.Messages.Clear(); + }); break; } case "unban": { diff --git a/client/Ui/MainWindowTabs/Settings.cs b/client/Ui/MainWindowTabs/Settings.cs index 9387c8f..02f5ea6 100644 --- a/client/Ui/MainWindowTabs/Settings.cs +++ b/client/Ui/MainWindowTabs/Settings.cs @@ -152,10 +152,19 @@ internal class Settings : ITab { if (toRemove > -1) { this.Plugin.Config.BannedTerritories.Remove((uint) toRemove); + if (this.Plugin.ClientState.TerritoryType == toRemove) { + this.Plugin.Messages.SpawnVfx(); + } } if (toAdd > -1) { this.Plugin.Config.BannedTerritories.Add((uint) toAdd); + if (this.Plugin.ClientState.TerritoryType == toAdd) { + this.Plugin.Framework.RunOnFrameworkThread(() => { + this.Plugin.Messages.RemoveVfx(); + this.Plugin.Messages.Clear(); + }); + } } if (toRemove > -1 || toAdd > -1) {