/// <summary> /// Render console /// </summary> /// <param name="time"><see cref="GameTime"/></param> public override void Render(GameTime time) { if (!IsVisible) { return; } DH.RenderScene(Scene, color: COLOR.DarkestGray * .75f, logic: () => { DH.Box(0, (int)Height, (int)Width, 35, COLOR.DarkestGray, AlignType.LB); DH.Line(0, Height - 35, Width, Height - 35, color: COLOR.DarkGray); // Command input DH.Text(Font, $"Command: {Command}" + (_typeWall ? "|" : ""), new Vector2(10, Height - 10), false, COLOR.DarkGray, AlignType.LB); if (LOG.Logs.Count == 0) { return; } int row = 0; LOG.Logs.ForEach(log => { Color color = LOG.GetColor(log); // Display message if (!string.IsNullOrWhiteSpace(log.Message)) { foreach (string data in TEXT.GetDividedText(Font, $"[{log.CDate.ToLongTimeString( )}][{log.Type}]: {log.Message}", Width - 20, false)) { DH.Text(Font, data, new Vector2(10, 10 + (row++) * LineHeight), false, color); } } // Display exception if (log.Exception == null) { return; } string[] raw = TEXT.ExpandException(log.Exception); // Add time and type at the beginning raw[0] = raw[0].Insert(0, $"[{log.CDate.ToLongTimeString( )}][{log.Type}]: "); foreach (string data in raw) { foreach (string displayData in TEXT.GetDividedText(Font, data, Width - 20, false)) { DH.Text(Font, displayData, new Vector2(10, 10 + (row++) * LineHeight), false, color); } } }); }); }