public void AddLine(string text, ChatChannel channel, Color color) { if (!ThreadUtility.IsOnMainThread()) { var formatted = new FormattedMessage(3); formatted.PushColor(color); formatted.AddText(text); formatted.Pop(); _messageQueue.Enqueue(formatted); return; } _flushQueue(); if (!firstLine) { Contents.NewLine(); } else { firstLine = false; } Contents.PushColor(color); Contents.AddText(text); Contents.Pop(); // Pop the color off. }
private void AddTextCell(string Text, Color Color) { DisplayLabel.PushCell(); DisplayLabel.PushColor(Color); DisplayLabel.AppendBbcode(Text); DisplayLabel.Pop(); DisplayLabel.Pop(); }
public void AddLine(string text, ChatChannel channel, Color color) { if (!firstLine) { Contents.NewLine(); } else { firstLine = false; } Contents.PushColor(color); Contents.AddText(text); Contents.Pop(); // Pop the color off. }
private void AddText(string Text, Color Color) { DisplayLabel.PushCell(); DisplayLabel.PushColor(Color); DisplayLabel.AddText(Text); DisplayLabel.Pop(); DisplayLabel.Pop(); }
public void Write([NotNull] string text, [NotNull] RichTextLabel label) { Ensure.Any.IsNotNull(text, nameof(text)); Ensure.Any.IsNotNull(label, nameof(label)); if (Color.HasValue) { label.PushColor(Color.Value); } if (Underline) { label.PushUnderline(); } if (Bold || Italics) { var sb = new StringBuilder(text.Length + 7 * 2); if (Bold) { sb.Append("[b]"); } if (Italics) { sb.Append("[i]"); } sb.Append(text); if (Italics) { sb.Append("[/i]"); } if (Bold) { sb.Append("[/b]"); } label.AppendBbcode(sb.ToString()); } else { label.AddText(text); } if (Color.HasValue || Underline) { label.Pop(); } }
public void AddLine(string message, ChatChannel channel, Color color) { if (Disposed) { return; } if (ChannelBlacklist.Contains(channel)) { return; } if (!firstLine) { contents.NewLine(); } else { firstLine = false; } contents.PushColor(color); contents.AddText(message); contents.Pop(); // Pop the color off. }