public DebugTextDisplayLine AddLine(string text, Color background, Color foreground)
        {
            var l = new DebugTextDisplayLine(() => text);

            l.SetColor(foreground);
            l.SetBackground(background);
            return(AddLine(l));
        }
        public DebugTextDisplayLine AddLine(DebugTextDisplayLine l)
        {
            lines.Add(l);

            lines = lines.OrderBy(n => n.Order).ToList();

            return(l);
        }
        public DebugTextDisplayLine AddLineFromAsync(Func <string> text, Color background, Color foreground)
        {
            var l = new DebugTextDisplayLine(text);

            l.SetColor(foreground);
            l.SetBackground(background);
            return(AddLineFromAsync(l));
        }
Beispiel #4
0
        private static DebugTextDisplayLine CreateLine(SAMLogEntry e)
        {
            DebugTextDisplayLine line;

            switch (e.Level)
            {
            case SAMLogLevel.FATAL_ERROR:
                line = new DebugTextDisplayLine(() => $"[{e.Type}] {e.MessageShort}");
                line.SetBackground(Color.Red);
                line.SetColor(Color.Black);
                return(line);

            case SAMLogLevel.ERROR:
                line = new DebugTextDisplayLine(() => $"[{e.Type}] {e.MessageShort}");
                line.SetBackground(Color.Red * 0.6f);
                line.SetColor(Color.Black);
                return(line);

            case SAMLogLevel.WARNING:
                line = new DebugTextDisplayLine(() => $"[{e.Type}] {e.MessageShort}");
                line.SetBackground(Color.DarkOrange * 0.6f);
                line.SetColor(Color.Black);
                line.SetLifetime(60);
                return(line);

            case SAMLogLevel.INFORMATION:
                line = new DebugTextDisplayLine(() => $"[{e.Type}] {e.MessageShort}");
                line.SetBackground(Color.DodgerBlue * 0.5f);
                line.SetColor(Color.Black);
                line.SetLifetime(30);
                return(line);

            case SAMLogLevel.DEBUG:
                line = new DebugTextDisplayLine(() => $"[{e.Type}] {e.MessageShort}");
                line.SetBackground(Color.GreenYellow * 0.5f);
                line.SetColor(Color.Black);
                line.SetLifetime(5);
                line.SetSpawntime(0.5f);
                line.SetDecaytime(2);
                return(line);

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
		public DebugTextDisplayLine AddLine(DebugTextDisplayLine l)
		{
			lines.Add(l);

			return l;
		}
		public DebugTextDisplayLine AddLine(DebugTextDisplayLine l) => dummy;
 public DebugTextDisplayLine AddLineFromAsync(DebugTextDisplayLine l)
 {
     asyncBacklog.Enqueue(l);
     return(l);
 }