feat: consider all WindowSystems globally

This commit is contained in:
goat 2021-09-01 20:44:21 +02:00
parent f6a68bac6e
commit 3e9c1f8d53
No known key found for this signature in database
GPG key ID: F18F057873895461
3 changed files with 16 additions and 5 deletions

View file

@ -17,11 +17,17 @@ namespace Dalamud.Interface.Windowing
/// Initializes a new instance of the <see cref="WindowSystem"/> class.
/// </summary>
/// <param name="imNamespace">The name/ID-space of this <see cref="WindowSystem"/>.</param>
public WindowSystem(string imNamespace = null)
public WindowSystem(string? imNamespace = null)
{
this.Namespace = imNamespace;
}
/// <summary>
/// Gets a value indicating whether any <see cref="WindowSystem"/> contains any <see cref="Window"/>
/// that has focus and is not marked to be excluded from consideration.
/// </summary>
public static bool HasAnyWindowSystemFocus { get; internal set; }
/// <summary>
/// Gets a value indicating whether any window in this <see cref="WindowSystem"/> has focus and is
/// not marked to be excluded from consideration.
@ -31,7 +37,7 @@ namespace Dalamud.Interface.Windowing
/// <summary>
/// Gets or sets the name/ID-space of this <see cref="WindowSystem"/>.
/// </summary>
public string Namespace { get; set; }
public string? Namespace { get; set; }
/// <summary>
/// Add a window to this <see cref="WindowSystem"/>.
@ -83,6 +89,9 @@ namespace Dalamud.Interface.Windowing
this.HasAnyFocus = this.windows.Any(x => x.IsFocused && x.RespectCloseHotkey);
if (this.HasAnyFocus)
HasAnyWindowSystemFocus = true;
if (hasNamespace)
ImGui.PopID();
}