fix: require window to be open to be added

This commit is contained in:
Anna 2021-03-17 13:45:42 -04:00
parent dc0ff6ccb2
commit 4654548721
Signed by: anna
GPG Key ID: 0B391D8F06FCD9E0

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;
}