more remove and on framework only

This commit is contained in:
Anna 2022-09-13 17:26:54 -04:00
parent 91e8d1d722
commit b6c8978acc
Signed by: anna
GPG Key ID: 0B391D8F06FCD9E0
2 changed files with 13 additions and 2 deletions

View File

@ -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": {

View File

@ -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) {