diff options
| author | Michael <[email protected]> | 2017-03-09 16:14:35 -0500 |
|---|---|---|
| committer | Michael <[email protected]> | 2017-03-09 16:14:35 -0500 |
| commit | 3f08cb807c1490af423450e3eb03a46aa11caf2f (patch) | |
| tree | 38ec804cae9d1106f78074eea4b926f3204fd8f9 /ShiftOS_TheReturn | |
| parent | d9b4e79bcffea6139fadefcd95a020029941eda7 (diff) | |
| download | shiftos_thereturn-3f08cb807c1490af423450e3eb03a46aa11caf2f.tar.gz shiftos_thereturn-3f08cb807c1490af423450e3eb03a46aa11caf2f.tar.bz2 shiftos_thereturn-3f08cb807c1490af423450e3eb03a46aa11caf2f.zip | |
Colored terminal text
Diffstat (limited to 'ShiftOS_TheReturn')
| -rw-r--r-- | ShiftOS_TheReturn/ConsoleEx.cs | 28 | ||||
| -rw-r--r-- | ShiftOS_TheReturn/ServerManager.cs | 2 | ||||
| -rw-r--r-- | ShiftOS_TheReturn/ShiftOS.Engine.csproj | 1 |
3 files changed, 31 insertions, 0 deletions
diff --git a/ShiftOS_TheReturn/ConsoleEx.cs b/ShiftOS_TheReturn/ConsoleEx.cs new file mode 100644 index 0000000..69f6a18 --- /dev/null +++ b/ShiftOS_TheReturn/ConsoleEx.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ShiftOS.Engine +{ + public static class ConsoleEx + { + static ConsoleEx() + { + ForegroundColor = ConsoleColor.White; + BackgroundColor = ConsoleColor.Black; + + Bold = false; + Italic = false; + Underline = false; + } + + public static ConsoleColor ForegroundColor { get; set; } + public static ConsoleColor BackgroundColor { get; set; } + + public static bool Bold { get; set; } + public static bool Italic { get; set; } + public static bool Underline { get; set; } + } +} diff --git a/ShiftOS_TheReturn/ServerManager.cs b/ShiftOS_TheReturn/ServerManager.cs index a121ab6..7da09f1 100644 --- a/ShiftOS_TheReturn/ServerManager.cs +++ b/ShiftOS_TheReturn/ServerManager.cs @@ -154,7 +154,9 @@ namespace ShiftOS.Engine { var ex = JsonConvert.DeserializeObject<Exception>(msg.Contents); TerminalBackend.PrefixEnabled = true; + ConsoleEx.ForegroundColor = ConsoleColor.DarkYellow; Console.WriteLine($@"{{MUD_ERROR}}: {ex.Message}"); + ConsoleEx.ForegroundColor = ConsoleColor.White; TerminalBackend.PrefixEnabled = true; Console.Write($"{SaveSystem.CurrentSave.Username}@{CurrentSave.SystemName}:~$ "); } diff --git a/ShiftOS_TheReturn/ShiftOS.Engine.csproj b/ShiftOS_TheReturn/ShiftOS.Engine.csproj index 20ca879..00d828f 100644 --- a/ShiftOS_TheReturn/ShiftOS.Engine.csproj +++ b/ShiftOS_TheReturn/ShiftOS.Engine.csproj @@ -99,6 +99,7 @@ <Compile Include="AudioManager.cs" /> <Compile Include="Commands.cs" /> <Compile Include="Command.cs" /> + <Compile Include="ConsoleEx.cs" /> <Compile Include="CrashHandler.cs" /> <Compile Include="CrashHandler.Designer.cs"> <DependentUpon>CrashHandler.cs</DependentUpon> |
