feat: add IsFocusManagementEnabled to dalamud config

This commit is contained in:
goat 2021-09-11 20:04:03 +02:00
parent eb11857bac
commit 5d5f2354c1
No known key found for this signature in database
GPG key ID: 7773BB5B43BA52E5
4 changed files with 16 additions and 4 deletions

View file

@ -1,5 +1,5 @@
using System.Numerics;
using Dalamud.Configuration.Internal;
using Dalamud.Game.ClientState.Keys;
using ImGuiNET;
@ -200,7 +200,8 @@ namespace Dalamud.Interface.Windowing
this.IsFocused = ImGui.IsWindowFocused(ImGuiFocusedFlags.RootAndChildWindows);
var escapeDown = Service<KeyState>.Get()[VirtualKey.ESCAPE];
if (escapeDown && this.IsFocused && !wasEscPressedLastFrame && this.RespectCloseHotkey)
var isAllowed = Service<DalamudConfiguration>.Get().IsFocusManagementEnabled;
if (escapeDown && this.IsFocused && isAllowed && !wasEscPressedLastFrame && this.RespectCloseHotkey)
{
this.IsOpen = false;
wasEscPressedLastFrame = true;