fix: make checkboxes work if multiple sections are expanded

This commit is contained in:
Anna 2021-03-05 01:46:36 -05:00
parent 21a2838ad4
commit 7ca62ed34e
Signed by: anna
GPG Key ID: 0B391D8F06FCD9E0

View File

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