fix: add unique id to checkboxes

This commit is contained in:
Anna 2021-05-08 16:31:50 -04:00
parent e3c881d944
commit 44a9c71fd3
1 changed files with 5 additions and 1 deletions

View File

@ -73,6 +73,8 @@ namespace SoundFilter.Ui {
ImGui.Separator();
if (ImGui.BeginChild("filtered-sounds")) {
var i = 0;
foreach (var entry in this.Plugin.Config.Filtered.ToList()) {
var glob = entry.Key;
@ -89,12 +91,14 @@ namespace SoundFilter.Ui {
ImGui.SameLine();
shouldSave |= ImGui.Checkbox(entry.Value.Name, ref entry.Value.Enabled);
shouldSave |= ImGui.Checkbox($"{entry.Value.Name}##{i}-{glob}", ref entry.Value.Enabled);
if (ImGui.IsItemHovered()) {
ImGui.BeginTooltip();
ImGui.TextUnformatted(glob);
ImGui.EndTooltip();
}
i += 1;
}
ImGui.EndChild();