basic banning
This commit is contained in:
parent
b1510458a7
commit
c16e2141a7
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue