private void WriteChatMessage(StoredChatMessage message) { Logger.Debug($"{message.Channel}: {message.Message}"); if (IsFiltered(message.Channel)) { Logger.Debug($"Message filtered: {message.Channel}: {message.Message}"); return; } var color = Color.DarkGray; var messageText = message.Message; if (!string.IsNullOrEmpty(message.MessageWrap)) { messageText = string.Format(message.MessageWrap, messageText); } switch (message.Channel) { case ChatChannel.Server: color = Color.Orange; break; case ChatChannel.OOC: color = Color.LightSkyBlue; break; } _currentChatBox?.AddLine(messageText, message.Channel, color); }
private void _onChatMessage(MsgChatMessage msg) { // Log all incoming chat to repopulate when filter is un-toggled var storedMessage = new StoredChatMessage(msg); filteredHistory.Add(storedMessage); WriteChatMessage(storedMessage); // Local messages that have an entity attached get a speech bubble. if (msg.SenderEntity == default) { return; } switch (msg.Channel) { case ChatChannel.Local: case ChatChannel.Dead: AddSpeechBubble(msg, SpeechBubble.SpeechType.Say); break; case ChatChannel.Emotes: AddSpeechBubble(msg, SpeechBubble.SpeechType.Emote); break; } }
private void _onChatMessage(MsgChatMessage msg) { Logger.Debug($"{msg.Channel}: {msg.Message}"); // Log all incoming chat to repopulate when filter is un-toggled var storedMessage = new StoredChatMessage(msg); filteredHistory.Add(storedMessage); WriteChatMessage(storedMessage); // Local messages that have an entity attached get a speech bubble. if ((msg.Channel == ChatChannel.Local || msg.Channel == ChatChannel.Dead) && msg.SenderEntity != default) { AddSpeechBubble(msg); } }