basic banning

This commit is contained in:
Anna 2022-09-04 19:43:58 -04:00
parent b1510458a7
commit c16e2141a7
3 changed files with 21 additions and 3 deletions

View File

@ -18,6 +18,23 @@ internal class Commands : IDisposable {
}
private void OnCommand(string command, string arguments) {
this.Plugin.Ui.MainWindow.Visible ^= true;
switch (arguments) {
case "ban":
this.Plugin.Config.BannedTerritories.Add(this.Plugin.ClientState.TerritoryType);
this.Plugin.SaveConfig();
this.Plugin.Messages.SpawnVfx();
break;
case "unban":
this.Plugin.Config.BannedTerritories.Remove(this.Plugin.ClientState.TerritoryType);
this.Plugin.SaveConfig();
this.Plugin.Messages.SpawnVfx();
break;
case "refresh":
this.Plugin.Messages.SpawnVfx();
break;
default:
this.Plugin.Ui.MainWindow.Visible ^= true;
break;
}
}
}

View File

@ -1,10 +1,11 @@
using Dalamud.Configuration;
namespace OrangeGuidanceTomestone;
namespace OrangeGuidanceTomestone;
[Serializable]
public class Configuration : IPluginConfiguration {
public int Version { get; set; } = 1;
public string ApiKey { get; set; } = string.Empty;
public HashSet<uint> BannedTerritories { get; set; } = new();
}

View File

@ -60,7 +60,7 @@ internal class Messages : IDisposable {
internal void SpawnVfx() {
var territory = this.Plugin.ClientState.TerritoryType;
if (territory == 0) {
if (territory == 0 || this.Plugin.Config.BannedTerritories.Contains(territory)) {
return;
}