feat: change order of filters in ui
This commit is contained in:
parent
ae43dad64d
commit
0c76f4aee2
|
@ -141,11 +141,7 @@ namespace NoSoliciting.Interface {
|
|||
return;
|
||||
}
|
||||
|
||||
foreach (var category in (MessageCategory[]) Enum.GetValues(typeof(MessageCategory))) {
|
||||
if (category == MessageCategory.Normal) {
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach (var category in MessageCategoryExt.UiOrder) {
|
||||
var check = this.Plugin.Config.BasicMlFilters.Contains(category);
|
||||
if (ImGui.Checkbox(category.Name(), ref check)) {
|
||||
if (check) {
|
||||
|
@ -181,11 +177,7 @@ namespace NoSoliciting.Interface {
|
|||
ImGui.TextUnformatted("The machine learning model was trained with certain channels in mind.");
|
||||
ImGui.PopStyleColor();
|
||||
|
||||
foreach (var category in (MessageCategory[]) Enum.GetValues(typeof(MessageCategory))) {
|
||||
if (category == MessageCategory.Normal) {
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach (var category in MessageCategoryExt.UiOrder) {
|
||||
if (!ImGui.CollapsingHeader(category.Name())) {
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -15,6 +15,18 @@ namespace NoSoliciting.Ml {
|
|||
}
|
||||
|
||||
public static class MessageCategoryExt {
|
||||
public static readonly MessageCategory[] UiOrder = {
|
||||
MessageCategory.Trade,
|
||||
MessageCategory.FreeCompany,
|
||||
MessageCategory.Phishing,
|
||||
MessageCategory.RmtContent,
|
||||
MessageCategory.RmtGil,
|
||||
MessageCategory.Roleplaying,
|
||||
MessageCategory.Static,
|
||||
MessageCategory.StaticSub,
|
||||
MessageCategory.Community,
|
||||
};
|
||||
|
||||
public static MessageCategory? FromString(string? category) => category switch {
|
||||
"TRADE" => MessageCategory.Trade,
|
||||
"FC" => MessageCategory.FreeCompany,
|
||||
|
|
Loading…
Reference in New Issue