Compare commits

...

2 Commits

Author SHA1 Message Date
Anna b6c8978acc
more remove and on framework only 2022-09-13 17:26:54 -04:00
Anna 91e8d1d722
config button 2022-09-13 15:56:06 -04:00
3 changed files with 19 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

@ -20,12 +20,18 @@ public class PluginUi : IDisposable {
this.ViewerButton = new ViewerButton(this.Plugin);
this.Plugin.Interface.UiBuilder.Draw += this.Draw;
this.Plugin.Interface.UiBuilder.OpenConfigUi += this.OpenConfig;
}
public void Dispose() {
this.Plugin.Interface.UiBuilder.OpenConfigUi -= this.OpenConfig;
this.Plugin.Interface.UiBuilder.Draw -= this.Draw;
}
private void OpenConfig() {
this.MainWindow.Visible = true;
}
private void Draw() {
this.MainWindow.Draw();
this.ViewerButton.Draw();

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