mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +01:00
feat: add Window.RespectCloseHotkey
This commit is contained in:
parent
d5d18e1712
commit
647d095fcc
1 changed files with 6 additions and 1 deletions
|
|
@ -48,6 +48,11 @@ namespace Dalamud.Interface.Windowing
|
|||
/// </summary>
|
||||
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.
|
||||
/// </summary>
|
||||
public bool RespectCloseHotkey { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the position of this window.
|
||||
/// </summary>
|
||||
|
|
@ -196,7 +201,7 @@ namespace Dalamud.Interface.Windowing
|
|||
this.IsFocused = ImGui.IsWindowFocused();
|
||||
|
||||
var escapeDown = Service<KeyState>.Get()[VirtualKey.ESCAPE];
|
||||
if (escapeDown && this.IsFocused && !wasEscPressedLastFrame)
|
||||
if (escapeDown && this.IsFocused && !wasEscPressedLastFrame && this.RespectCloseHotkey)
|
||||
{
|
||||
this.IsOpen = false;
|
||||
wasEscPressedLastFrame = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue