mirror of
https://github.com/sp-tarkov/assembly-tool.git
synced 2025-02-12 17:10:45 -05:00
25 lines
499 B
C#
25 lines
499 B
C#
using System.Diagnostics;
|
|
using ReCodeItLib.Utils;
|
|
|
|
namespace ReCodeItCLI.Utils;
|
|
|
|
public static class Debugger
|
|
{
|
|
[Conditional("WAIT_FOR_DEBUGGER")]
|
|
public static void TryWaitForDebuggerAttach()
|
|
{
|
|
const int maxDots = 3;
|
|
var dotCount = 0;
|
|
|
|
while (!System.Diagnostics.Debugger.IsAttached)
|
|
{
|
|
var dots = new string('.', dotCount);
|
|
|
|
Console.Clear();
|
|
Logger.LogSync($"Waiting for debugger{dots}");
|
|
|
|
dotCount = (dotCount + 1) % (maxDots + 1);
|
|
Thread.Sleep(500);
|
|
}
|
|
}
|
|
} |