Beispiel #1
0
        public static void Log(object text, ConsoleColor color)
        {
            ConsoleOutput output = (ConsoleOutput)fiOutput.GetValue(null);
            ConsoleInput  input  = (ConsoleInput)fiInput.GetValue(null);
            bool          cancel = false;

            ServerEvents.RunConsoleOutput(ref text, ref color, ref cancel);
            if (cancel)
            {
                return;
            }
            if (output == null)
            {
                Debug.Log(text);
                return;
            }
            Console.ForegroundColor = color;
            if (Console.CursorLeft != 0)
            {
                input.clearLine();
            }
            Console.WriteLine(text);
            input.redrawInputLine();
        }