feat: add DALAMUD_NO_CONTEXTMENU env var

This commit is contained in:
goaaats 2022-04-14 22:56:36 +02:00
parent c4bc791d6f
commit 0d0496bee1
No known key found for this signature in database
GPG key ID: 49E2AA8C6A76498B
2 changed files with 9 additions and 1 deletions

View file

@ -32,6 +32,11 @@ namespace Dalamud.Configuration.Internal
/// </summary>
public static bool DalamudWaitForDebugger { get; } = GetEnvironmentVariable("DALAMUD_WAIT_DEBUGGER");
/// <summary>
/// Gets a value indicating whether or not Dalamud context menus should be disabled.
/// </summary>
public static bool DalamudNoContextMenu { get; } = GetEnvironmentVariable("DALAMUD_NO_CONTEXTMENU");
private static bool GetEnvironmentVariable(string name)
=> bool.Parse(Environment.GetEnvironmentVariable(name) ?? "false");
}

View file

@ -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,6 +427,8 @@ namespace Dalamud.Game.Gui
Service<ToastGui>.Get().Enable();
Service<FlyTextGui>.Get().Enable();
Service<PartyFinderGui>.Get().Enable();
if (!EnvironmentConfiguration.DalamudNoContextMenu)
Service<ContextMenu>.Get().Enable();
this.setGlobalBgmHook.Enable();