NoSoliciting/NoSoliciting/PluginConfiguration.cs
Anna ec2bfc03d0 feat: allow specifying main filters dynamically
Main filters (e.g. RMT, RP, FC) can now be fully specified by the
definitions file, allowing entire new classes of filters to be added
without a plugin update.
2020-08-21 13:46:42 -04:00

47 lines
1.6 KiB
C#

using Dalamud.Configuration;
using Dalamud.Plugin;
using System;
using System.Collections.Generic;
namespace NoSoliciting {
[Serializable]
public class PluginConfiguration : IPluginConfiguration {
[NonSerialized]
private DalamudPluginInterface pi;
public int Version { get; set; } = 1;
[Obsolete("Use EnabledFilters")]
public bool FilterChat { get; set; } = true;
[Obsolete("Use EnabledFilters")]
public bool FilterFCRecruitments { get; set; } = false;
[Obsolete("Use EnabledFilters")]
public bool FilterChatRPAds { get; set; } = false;
[Obsolete("Use EnabledFilters")]
public bool FilterPartyFinder { get; set; } = true;
[Obsolete("Use EnabledFilters")]
public bool FilterPartyFinderRPAds { get; set; } = false;
public Dictionary<string, bool> FilterStatus { get; private set; } = new Dictionary<string, bool>();
public bool AdvancedMode { get; set; } = false;
public bool CustomChatFilter { get; set; } = false;
public List<string> ChatSubstrings { get; } = new List<string>();
public List<string> ChatRegexes { get; } = new List<string>();
public bool CustomPFFilter { get; set; } = false;
public List<string> PFSubstrings { get; } = new List<string>();
public List<string> PFRegexes { get; } = new List<string>();
public void Initialise(DalamudPluginInterface pi) {
this.pi = pi ?? throw new ArgumentNullException(nameof(pi), "DalamudPluginInterface cannot be null");
}
public void Save() {
this.pi.SavePluginConfig(this);
}
}
}