Merged with the small debug update.
This commit is contained in:
commit
6f65417fe7
@ -1,6 +1,6 @@
|
|||||||
namespace SrcMod.Shell;
|
namespace SrcMod.Shell;
|
||||||
|
|
||||||
internal static class LoadingBar
|
public static class LoadingBar
|
||||||
{
|
{
|
||||||
public static int position = -1;
|
public static int position = -1;
|
||||||
public static int bufferSize = 0;
|
public static int bufferSize = 0;
|
||||||
|
|||||||
@ -239,25 +239,28 @@ public class Shell
|
|||||||
|
|
||||||
void runCommand(object? sender, DoWorkEventArgs e)
|
void runCommand(object? sender, DoWorkEventArgs e)
|
||||||
{
|
{
|
||||||
#if RELEASE
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
#endif
|
|
||||||
command.Invoke(args);
|
command.Invoke(args);
|
||||||
#if RELEASE
|
|
||||||
}
|
}
|
||||||
|
#if RELEASE
|
||||||
catch (TargetInvocationException ex)
|
catch (TargetInvocationException ex)
|
||||||
{
|
{
|
||||||
Write($"[ERROR] {ex.InnerException!.Message}", ConsoleColor.Red);
|
Write($"[ERROR] {ex.InnerException!.Message}", ConsoleColor.Red);
|
||||||
if (LoadingBar.Enabled) LoadingBar.End();
|
if (LoadingBar.Enabled) LoadingBar.End();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
#if RELEASE
|
||||||
Write($"[ERROR] {ex.Message}", ConsoleColor.Red);
|
Write($"[ERROR] {ex.Message}", ConsoleColor.Red);
|
||||||
if (LoadingBar.Enabled) LoadingBar.End();
|
if (LoadingBar.Enabled) LoadingBar.End();
|
||||||
}
|
#else
|
||||||
|
Write($"[ERROR] {ex}", ConsoleColor.Red);
|
||||||
|
if (LoadingBar.Enabled) LoadingBar.End();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
activeCommand = new();
|
activeCommand = new();
|
||||||
activeCommand.DoWork += runCommand;
|
activeCommand.DoWork += runCommand;
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
namespace SrcMod.Shell;
|
namespace SrcMod.Shell;
|
||||||
|
|
||||||
internal static class Tools
|
public static class Tools
|
||||||
{
|
{
|
||||||
public static JsonSerializer Serializer { get; private set; }
|
public static JsonSerializer Serializer { get; private set; }
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user