Browse Source

Add char coloring

pull/8/head
Anton Tarasenko 4 years ago
parent
commit
f9f0b519b1
  1. 8
      sources/Commands/BroadcastListener_Commands.uc

8
sources/Commands/BroadcastListener_Commands.uc

@ -27,6 +27,7 @@ static function bool HandleText(
out string message,
optional name messageType)
{
local Text messageAsText;
local APlayer callerPlayer;
local Parser parser;
local Commands commandFeature;
@ -39,8 +40,13 @@ static function bool HandleText(
if (!commandFeature.useChatInput) return true;
// We are only interested in messages that start with "!"
parser = __().text.ParseString(message);
if (!parser.Match(P("!")).Ok()) {
if (!parser.Match(P("!")).Ok())
{
parser.FreeSelf();
// Convert color tags into colors
messageAsText = __().text.FromFormattedString(message);
message = messageAsText.ToColoredString(,, __().color.White);
messageAsText.FreeSelf();
return true;
}
// Extract `APlayer` from the `sender`

Loading…
Cancel
Save