|
@@ -71,37 +71,31 @@ namespace BepInEx
|
|
|
|
|
|
public static void SetConsoleTitle(string title)
|
|
public static void SetConsoleTitle(string title)
|
|
{
|
|
{
|
|
- if (!ConsoleActive)
|
|
|
|
- throw new InvalidOperationException("Console is not currently active");
|
|
|
|
-
|
|
|
|
switch (Environment.OSVersion.Platform)
|
|
switch (Environment.OSVersion.Platform)
|
|
{
|
|
{
|
|
case PlatformID.Win32NT:
|
|
case PlatformID.Win32NT:
|
|
{
|
|
{
|
|
|
|
+ if (!ConsoleActive)
|
|
|
|
+ return;
|
|
|
|
+
|
|
ConsoleWindow.Title = title;
|
|
ConsoleWindow.Title = title;
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
- default:
|
|
|
|
- throw new PlatformNotSupportedException("Spawning a console is not currently supported on this platform");
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
public static void SetConsoleColor(ConsoleColor color)
|
|
public static void SetConsoleColor(ConsoleColor color)
|
|
{
|
|
{
|
|
- if (!ConsoleActive)
|
|
|
|
- throw new InvalidOperationException("Console is not currently active");
|
|
|
|
-
|
|
|
|
switch (Environment.OSVersion.Platform)
|
|
switch (Environment.OSVersion.Platform)
|
|
{
|
|
{
|
|
case PlatformID.Win32NT:
|
|
case PlatformID.Win32NT:
|
|
{
|
|
{
|
|
|
|
+ if (!ConsoleActive)
|
|
|
|
+ return;
|
|
|
|
+
|
|
Kon.ForegroundColor = color;
|
|
Kon.ForegroundColor = color;
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
- default:
|
|
|
|
- {
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
|
|
|
|
Console.ForegroundColor = color;
|
|
Console.ForegroundColor = color;
|