| | |
| | |
|
| | | private static Regex m_TextColorRegex = new Regex("<color=#[0-9a-zA-Z]+>(.*)</color>", RegexOptions.Singleline);
|
| | |
|
| | | public static string AppendStringColor(TextColType type, string msg, bool bright = false)
|
| | | public static string AppendColor(TextColType type, string msg, bool bright = false)
|
| | | {
|
| | | if (m_TextColorRegex.IsMatch(msg))
|
| | | {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public static string AppendStringColor(int itemColor, string msg, bool bright = false)
|
| | | public static string AppendColor(int itemColor, string msg, bool bright = false)
|
| | | {
|
| | | switch (itemColor)
|
| | | {
|
| | | case 0:
|
| | | case 1:
|
| | | return AppendStringColor(TextColType.White, msg, bright);
|
| | | return AppendColor(TextColType.White, msg, bright);
|
| | | case 2:
|
| | | return AppendStringColor(TextColType.Blue, msg, bright);
|
| | | return AppendColor(TextColType.Blue, msg, bright);
|
| | | case 3:
|
| | | return AppendStringColor(TextColType.Purple, msg, bright);
|
| | | return AppendColor(TextColType.Purple, msg, bright);
|
| | | case 4:
|
| | | return AppendStringColor(TextColType.Orange, msg, bright);
|
| | | return AppendColor(TextColType.Orange, msg, bright);
|
| | | case 5:
|
| | | return AppendStringColor(TextColType.Red, msg, bright);
|
| | | return AppendColor(TextColType.Red, msg, bright);
|
| | | case 6:
|
| | | return AppendStringColor(TextColType.Pink, msg, bright);
|
| | | return AppendColor(TextColType.Pink, msg, bright);
|
| | | }
|
| | | return msg;
|
| | | }
|