feat: hide system menu buttons when using /xlui (#846)

This commit is contained in:
Aireil 2022-05-18 18:49:19 +02:00 committed by GitHub
parent 43861e9206
commit 125e089966
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -9,6 +9,7 @@ using Dalamud.Game.Text;
using Dalamud.Game.Text.SeStringHandling;
using Dalamud.Game.Text.SeStringHandling.Payloads;
using Dalamud.Hooking;
using Dalamud.Interface;
using Dalamud.Interface.Internal;
using Dalamud.Interface.Windowing;
using FFXIVClientStructs.FFXIV.Component.GUI;
@ -90,8 +91,9 @@ namespace Dalamud.Game.Internal
{
var systemText = Service<DataManager>.Get().GetExcelSheet<Addon>()!.GetRow(1059)!.Text.RawString; // "System"
var configuration = Service<DalamudConfiguration>.Get();
var interfaceManager = Service<InterfaceManager>.Get();
if (args.Title == systemText && configuration.DoButtonsSystemMenu)
if (args.Title == systemText && configuration.DoButtonsSystemMenu && interfaceManager.IsDispatchingEvents)
{
var dalamudInterface = Service<DalamudInterface>.Get();
@ -131,8 +133,9 @@ namespace Dalamud.Game.Internal
}
var configuration = Service<DalamudConfiguration>.Get();
var interfaceManager = Service<InterfaceManager>.Get();
if (!configuration.DoButtonsSystemMenu)
if (!configuration.DoButtonsSystemMenu || !interfaceManager.IsDispatchingEvents)
{
this.hookAgentHudOpenSystemMenu.Original(thisPtr, atkValueArgs, menuSize);
return;