feat: ignore private pfs unless told otherwise

This commit is contained in:
Anna 2021-02-16 19:41:59 -05:00
parent acd8f04937
commit 450415f6cc
3 changed files with 14 additions and 0 deletions

View File

@ -212,6 +212,11 @@ namespace NoSoliciting {
continue;
}
// ignore private listings if configured
if (!this.Plugin.Config.ConsiderPrivatePfs && (listing.searchArea & (1 << 1)) != 0) {
continue;
}
var desc = listing.Description();
string? reason = null;

View File

@ -59,6 +59,7 @@ namespace NoSoliciting {
MessageCategory.RmtContent,
MessageCategory.Phishing,
};
public Dictionary<MessageCategory, HashSet<ChatType>> MlFilters { get; set; } = new() {
[MessageCategory.RmtGil] = new HashSet<ChatType> {
ChatType.Say,
@ -91,6 +92,8 @@ namespace NoSoliciting {
public bool LogFilteredPfs { get; set; } = true;
public bool LogFilteredChat { get; set; } = true;
public bool ConsiderPrivatePfs { get; set; }
public void Initialise(DalamudPluginInterface pi) {
this.pi = pi ?? throw new ArgumentNullException(nameof(pi), "DalamudPluginInterface cannot be null");
this.CompileRegexes();

View File

@ -147,6 +147,12 @@ namespace NoSoliciting {
this.Plugin.Config.Save();
}
var considerPrivate = this.Plugin.Config.ConsiderPrivatePfs;
if (ImGui.Checkbox("Apply filters to private Party Finder listings", ref considerPrivate)) {
this.Plugin.Config.ConsiderPrivatePfs = considerPrivate;
this.Plugin.Config.Save();
}
var customPf = this.Plugin.Config.CustomPFFilter;
if (ImGui.Checkbox("Enable custom Party Finder filters", ref customPf)) {
this.Plugin.Config.CustomPFFilter = customPf;