fix: require window to be open to be added

This commit is contained in:
Anna 2021-03-17 13:45:42 -04:00
parent 7e4db37b2a
commit 6cbe5b24a7
1 changed files with 7 additions and 1 deletions

View File

@ -930,8 +930,14 @@ namespace HUD_Manager {
}
if (ImGui.BeginPopup(Popups.AddWindow)) {
ImGui.TextUnformatted("Windows must be open to add them");
ImGui.Separator();
foreach (var window in WindowKindExt.All) {
if (!ImGui.Selectable(window)) {
var addon = this.Plugin.Interface.Framework.Gui.GetAddonByName(window, 1);
var flags = addon?.Visible == true ? ImGuiSelectableFlags.None : ImGuiSelectableFlags.Disabled;
if (!ImGui.Selectable(window, false, flags)) {
continue;
}