Chat now sends formatted messages to allow more complex messages.
This commit is contained in:
@@ -154,6 +154,20 @@ namespace Content.Client.Chat
|
||||
Contents.AddMessage(formatted);
|
||||
}
|
||||
|
||||
public void AddLine(FormattedMessage message, Color color)
|
||||
{
|
||||
if (Disposed)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var formatted = new FormattedMessage(3);
|
||||
formatted.PushColor(color);
|
||||
formatted.AddMessage(message);
|
||||
formatted.Pop();
|
||||
Contents.AddMessage(formatted);
|
||||
}
|
||||
|
||||
private void Input_OnTextEntered(LineEdit.LineEditEventArgs args)
|
||||
{
|
||||
// We set it there to true so it's set to false by TextSubmitted.Invoke if necessary
|
||||
|
||||
@@ -222,7 +222,7 @@ namespace Content.Client.Chat
|
||||
};
|
||||
}
|
||||
|
||||
_currentChatBox?.AddLine(messageText, message.Channel, color);
|
||||
_currentChatBox?.AddLine(FormattedMessage.FromMarkup(messageText), color);
|
||||
}
|
||||
|
||||
private void OnChatBoxTextSubmitted(ChatBox chatBox, string text)
|
||||
@@ -422,7 +422,7 @@ namespace Content.Client.Chat
|
||||
return;
|
||||
}
|
||||
|
||||
var messages = SplitMessage(msg.Message);
|
||||
var messages = SplitMessage(FormattedMessage.RemoveMarkup(msg.Message));
|
||||
|
||||
foreach (var message in messages)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user