// NOTIFY PLAYERS OF LOBBY ACTIVITY private void OnLobbyChatUpdate(LobbyChatUpdate_t update) { chatBox.AddText("\n" + SteamFriends.GetFriendPersonaName((CSteamID)update.m_ulSteamIDUserChanged) + " made a change in the lobby. Change: " + update.m_rgfChatMemberStateChange); // Set global value global.player2 = (CSteamID)update.m_ulSteamIDMakingChange; }
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.AddText(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. }
/// <summary> /// Adds a chat message on a new row. Does nothing if the provided message is null or empty. /// </summary> /// <param name="message"> /// The message to add. /// </param> /// <param name="color"> /// The color of the message. /// </param> public void AddChat(string message, Color color) { if (message == null) { return; } _chat.AddText(message); _chat.Newline(); }
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 Write(string text, RichTextLabel label) { Ensure.That(text, nameof(text)).IsNotNull(); Ensure.That(label, nameof(label)).IsNotNull(); Color.Iter(label.PushColor); 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.IsSome || 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. }
private void print_To_Test_Console(String str) { testConsole.AddText($"{str}\n"); }