feat: prevent AgentHud::OpenSystemMenu when any ImGui window has focus

This commit is contained in:
goat 2021-09-02 17:54:12 +02:00
parent 3f927ee7f0
commit 9228fac4ee
No known key found for this signature in database
GPG key ID: F18F057873895461
2 changed files with 4 additions and 3 deletions

View file

@ -76,7 +76,7 @@ namespace Dalamud.Game.Internal
private IntPtr AtkUnitBaseReceiveGlobalEventDetour(AtkUnitBase* thisPtr, ushort cmd, uint a3, IntPtr a4, uint* a5)
{
Log.Information("{0}: cmd#{1} a3#{2} - HasAnyFocus:{3}", Marshal.PtrToStringAnsi(new IntPtr(thisPtr->Name)), cmd, a3, WindowSystem.HasAnyWindowSystemFocus);
// Log.Information("{0}: cmd#{1} a3#{2} - HasAnyFocus:{3}", Marshal.PtrToStringAnsi(new IntPtr(thisPtr->Name)), cmd, a3, WindowSystem.HasAnyWindowSystemFocus);
// "Close Addon"
if (cmd == 12 && WindowSystem.HasAnyWindowSystemFocus)
@ -87,6 +87,9 @@ namespace Dalamud.Game.Internal
private void AgentHudOpenSystemMenuDetour(void* thisPtr, AtkValue* atkValueArgs, uint menuSize)
{
if (WindowSystem.HasAnyWindowSystemFocus)
return;
var configuration = Service<DalamudConfiguration>.Get();
if (!configuration.DoButtonsSystemMenu)

View file

@ -2,8 +2,6 @@ using System.Numerics;
using Dalamud.Game.ClientState.Keys;
using ImGuiNET;
using Microsoft.CodeAnalysis;
using Serilog;
namespace Dalamud.Interface.Windowing
{