mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +01:00
feat: add DALAMUD_WAIT_DEBUGGER env var
This commit is contained in:
parent
c06a29a2d4
commit
93863dbc8a
2 changed files with 13 additions and 0 deletions
|
|
@ -27,6 +27,11 @@ namespace Dalamud.Configuration.Internal
|
|||
/// </summary>
|
||||
public static bool DalamudForceMinHook { get; } = GetEnvironmentVariable("DALAMUD_FORCE_MINHOOK");
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether or not Dalamud should wait for a debugger to be attached when initializing.
|
||||
/// </summary>
|
||||
public static bool DalamudWaitForDebugger { get; } = GetEnvironmentVariable("DALAMUD_WAIT_DEBUGGER");
|
||||
|
||||
private static bool GetEnvironmentVariable(string name)
|
||||
=> bool.Parse(Environment.GetEnvironmentVariable(name) ?? "false");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,6 +52,14 @@ namespace Dalamud
|
|||
/// <param name="info">The <see cref="DalamudStartInfo"/> containing information needed to initialize Dalamud.</param>
|
||||
private static void RunThread(DalamudStartInfo info)
|
||||
{
|
||||
if (EnvironmentConfiguration.DalamudWaitForDebugger)
|
||||
{
|
||||
while (!Debugger.IsAttached)
|
||||
{
|
||||
Thread.Sleep(100);
|
||||
}
|
||||
}
|
||||
|
||||
// Setup logger
|
||||
var levelSwitch = InitLogging(info.WorkingDirectory);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue