public static string Format(string message, Player p, bool colors = true, bool tokens = true, bool emotes = true) { if (colors) { message = Colors.EscapeColors(message); } StringBuilder sb = new StringBuilder(message); if (colors) { ParseColors(p, sb); } if (tokens) { ChatTokens.Apply(sb, p); } if (!emotes) { return(sb.ToString()); } if (p.parseEmotes) { sb.Replace(":)", "(darksmile)"); sb.Replace(":D", "(smile)"); sb.Replace("<3", "(heart)"); } message = EmotesHandler.Replace(sb.ToString()); message = FullCP437Handler.Replace(message); return(message); }
string ConvertMessage(string message, bool colorParse) { if (colorParse) { message = Colors.EscapeColors(message); } StringBuilder sb = new StringBuilder(message); if (colorParse) { ParseColors(sb); } Chat.ApplyTokens(sb, this, colorParse); if (Server.parseSmiley && parseSmiley) { sb.Replace(":)", "(darksmile)"); sb.Replace(":D", "(smile)"); sb.Replace("<3", "(heart)"); } message = EmotesHandler.ReplaceEmoteKeywords(sb.ToString()); message = FullCP437Handler.Replace(message); return(message); }
static string ConvertMessage(string message, bool color) { if (String.IsNullOrEmpty(message.Trim())) { message = "."; } message = EmotesHandler.Replace(message); message = FullCP437Handler.Replace(message); message = ChatTokens.ApplyCustom(message); message = CP437Writer.ConvertToUnicode(message); if (color) { message = Colors.MinecraftToIrcColors(message.Replace("%S", ResetSignal)); } return(message); }