Compare commits
2 Commits
45128396d2
...
4077719af2
Author | SHA1 | Date |
---|---|---|
Anna | 4077719af2 | |
Anna | ca8beb53cc |
|
@ -722,6 +722,7 @@ namespace Glamaholic.Ui {
|
||||||
if (ImGui.InputTextWithHint("##tag-input", "Input a tag and press Enter", ref this._tagInput, 128, ImGuiInputTextFlags.EnterReturnsTrue)) {
|
if (ImGui.InputTextWithHint("##tag-input", "Input a tag and press Enter", ref this._tagInput, 128, ImGuiInputTextFlags.EnterReturnsTrue)) {
|
||||||
if (!plate.Tags.Contains(this._tagInput)) {
|
if (!plate.Tags.Contains(this._tagInput)) {
|
||||||
plate.Tags.Add(this._tagInput);
|
plate.Tags.Add(this._tagInput);
|
||||||
|
plate.Tags.Sort();
|
||||||
this.Ui.Plugin.SaveConfig();
|
this.Ui.Plugin.SaveConfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -906,6 +907,7 @@ namespace Glamaholic.Ui {
|
||||||
private string Query { get; }
|
private string Query { get; }
|
||||||
private HashSet<ClassJob> WantedJobs { get; } = new();
|
private HashSet<ClassJob> WantedJobs { get; } = new();
|
||||||
private HashSet<string> Tags { get; } = new();
|
private HashSet<string> Tags { get; } = new();
|
||||||
|
private HashSet<string> ExcludeTags { get; } = new();
|
||||||
private HashSet<uint> ItemIds { get; } = new();
|
private HashSet<uint> ItemIds { get; } = new();
|
||||||
private HashSet<string> ItemNames { get; } = new();
|
private HashSet<string> ItemNames { get; } = new();
|
||||||
|
|
||||||
|
@ -933,6 +935,9 @@ namespace Glamaholic.Ui {
|
||||||
case 2:
|
case 2:
|
||||||
this.ItemNames.Add(quoted);
|
this.ItemNames.Add(quoted);
|
||||||
break;
|
break;
|
||||||
|
case 3:
|
||||||
|
this.ExcludeTags.Add(quoted);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
quoted = null;
|
quoted = null;
|
||||||
|
@ -983,6 +988,21 @@ namespace Glamaholic.Ui {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (word.StartsWith("!t:")) {
|
||||||
|
if (word.StartsWith("!t:\"")) {
|
||||||
|
if (word.EndsWith('"') && word.Length >= 6) {
|
||||||
|
this.ExcludeTags.Add(word[4..^1]);
|
||||||
|
} else {
|
||||||
|
quoteType = 3;
|
||||||
|
quoted = word[4..];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.ExcludeTags.Add(word[3..]);
|
||||||
|
}
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (word.StartsWith("id:")) {
|
if (word.StartsWith("id:")) {
|
||||||
if (uint.TryParse(word[3..], out var id)) {
|
if (uint.TryParse(word[3..], out var id)) {
|
||||||
this.ItemIds.Add(id);
|
this.ItemIds.Add(id);
|
||||||
|
@ -1019,7 +1039,13 @@ namespace Glamaholic.Ui {
|
||||||
}
|
}
|
||||||
|
|
||||||
// if there's nothing custom about this filter, this is a match
|
// if there's nothing custom about this filter, this is a match
|
||||||
if (this.MaxLevel == 0 && this.WantedJobs.Count == 0 && this.Tags.Count == 0 && this.ItemIds.Count == 0 && this.ItemNames.Count == 0) {
|
var notCustom = this.MaxLevel == 0
|
||||||
|
&& this.WantedJobs.Count == 0
|
||||||
|
&& this.Tags.Count == 0
|
||||||
|
&& this.ExcludeTags.Count == 0
|
||||||
|
&& this.ItemIds.Count == 0
|
||||||
|
&& this.ItemNames.Count == 0;
|
||||||
|
if (notCustom) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1029,6 +1055,12 @@ namespace Glamaholic.Ui {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foreach (var tag in this.ExcludeTags) {
|
||||||
|
if (plate.Tags.Contains(tag)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (this.ItemIds.Count > 0) {
|
if (this.ItemIds.Count > 0) {
|
||||||
var matching = plate.Items.Values
|
var matching = plate.Items.Values
|
||||||
.Select(mirage => mirage.ItemId)
|
.Select(mirage => mirage.ItemId)
|
||||||
|
|
Loading…
Reference in New Issue