diff --git a/Dalamud/Configuration/Internal/EnvironmentConfiguration.cs b/Dalamud/Configuration/Internal/EnvironmentConfiguration.cs index 2cb89915c..e7cc3b189 100644 --- a/Dalamud/Configuration/Internal/EnvironmentConfiguration.cs +++ b/Dalamud/Configuration/Internal/EnvironmentConfiguration.cs @@ -32,6 +32,11 @@ namespace Dalamud.Configuration.Internal /// public static bool DalamudWaitForDebugger { get; } = GetEnvironmentVariable("DALAMUD_WAIT_DEBUGGER"); + /// + /// Gets a value indicating whether or not Dalamud context menus should be disabled. + /// + public static bool DalamudNoContextMenu { get; } = GetEnvironmentVariable("DALAMUD_NO_CONTEXTMENU"); + private static bool GetEnvironmentVariable(string name) => bool.Parse(Environment.GetEnvironmentVariable(name) ?? "false"); } diff --git a/Dalamud/Game/Gui/GameGui.cs b/Dalamud/Game/Gui/GameGui.cs index 02afad2cd..7891738c0 100644 --- a/Dalamud/Game/Gui/GameGui.cs +++ b/Dalamud/Game/Gui/GameGui.cs @@ -2,6 +2,7 @@ using System; using System.Numerics; using System.Runtime.InteropServices; +using Dalamud.Configuration.Internal; using Dalamud.Game.Gui.ContextMenus; using Dalamud.Game.Gui.Dtr; using Dalamud.Game.Gui.FlyText; @@ -426,7 +427,9 @@ namespace Dalamud.Game.Gui Service.Get().Enable(); Service.Get().Enable(); Service.Get().Enable(); - Service.Get().Enable(); + + if (!EnvironmentConfiguration.DalamudNoContextMenu) + Service.Get().Enable(); this.setGlobalBgmHook.Enable(); this.handleItemHoverHook.Enable();