fix: make checkboxes work if multiple sections are expanded

This commit is contained in:
Anna 2021-03-05 01:46:36 -05:00
parent f96ef4fc1b
commit bdf82b9170
1 changed files with 4 additions and 4 deletions

View File

@ -196,11 +196,11 @@ namespace NoSoliciting.Interface {
var types = this.Plugin.Config.MlFilters[category];
void DrawTypes(ChatType type) {
void DrawTypes(ChatType type, string id) {
var name = type.Name(this.Plugin.Interface.Data);
var check = types.Contains(type);
if (!ImGui.Checkbox(name, ref check)) {
if (!ImGui.Checkbox($"{name}##{id}", ref check)) {
return;
}
@ -213,10 +213,10 @@ namespace NoSoliciting.Interface {
this.Plugin.Config.Save();
}
DrawTypes(ChatType.None);
DrawTypes(ChatType.None, category.ToString());
foreach (var type in Filter.FilteredChatTypes) {
DrawTypes(type);
DrawTypes(type, category.ToString());
}
}