mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-02-18 22:07:44 +01:00
feat: do not close addons when any Window is still open
This commit is contained in:
parent
647d095fcc
commit
412a335b93
6 changed files with 68 additions and 28 deletions
|
|
@ -49,7 +49,7 @@ namespace Dalamud.Interface.Windowing
|
|||
public bool IsFocused { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Allow this window to be closed with a hotkey, like Escape, and keep game addons open in turn if it is closed.
|
||||
/// Gets or sets a value indicating whether this window is to be closed with a hotkey, like Escape, and keep game addons open in turn if it is closed.
|
||||
/// </summary>
|
||||
public bool RespectCloseHotkey { get; set; } = true;
|
||||
|
||||
|
|
@ -112,6 +112,9 @@ namespace Dalamud.Interface.Windowing
|
|||
set
|
||||
{
|
||||
this.internalIsOpen = value;
|
||||
|
||||
if (value == false)
|
||||
this.IsFocused = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -22,6 +22,12 @@ namespace Dalamud.Interface.Windowing
|
|||
this.Namespace = imNamespace;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether any window in this <see cref="WindowSystem"/> has focus and is
|
||||
/// not marked to be excluded from consideration.
|
||||
/// </summary>
|
||||
public bool HasAnyFocus { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the name/ID-space of this <see cref="WindowSystem"/>.
|
||||
/// </summary>
|
||||
|
|
@ -75,6 +81,8 @@ namespace Dalamud.Interface.Windowing
|
|||
window.DrawInternal();
|
||||
}
|
||||
|
||||
this.HasAnyFocus = this.windows.Any(x => x.IsFocused && x.RespectCloseHotkey);
|
||||
|
||||
if (hasNamespace)
|
||||
ImGui.PopID();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue