mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-09 07:09:41 -04:00
Fix %S no longer being converted to default text colour in GUI
This commit is contained in:
parent
51fc4f656b
commit
7d9192b315
@ -26,7 +26,8 @@ namespace MCGalaxy.Gui {
|
|||||||
public static void Format(string message, Action<char, string> output) {
|
public static void Format(string message, Action<char, string> output) {
|
||||||
int index = 0;
|
int index = 0;
|
||||||
char col = 'S';
|
char col = 'S';
|
||||||
message = Colors.Escape(message);
|
message = message.Replace("%S", "&f"); // We want %S to be treated specially when displayed to GUI
|
||||||
|
message = Colors.Escape(message); // Need to Replace first, otherwise it's mapped by Colors.Escape
|
||||||
|
|
||||||
while (index < message.Length)
|
while (index < message.Length)
|
||||||
OutputPart(ref col, ref index, message, output);
|
OutputPart(ref col, ref index, message, output);
|
||||||
|
@ -213,7 +213,7 @@ namespace MCGalaxy {
|
|||||||
while (len > 0 && chars[i] == '&') { len -= 2; i += 2; }
|
while (len > 0 && chars[i] == '&') { len -= 2; i += 2; }
|
||||||
|
|
||||||
// Starts with "http" ?
|
// Starts with "http" ?
|
||||||
if (len < prefixLen) return false;
|
if (len < prefixLen) return false;
|
||||||
if (chars[i] != 'h' || chars[i + 1] != 't' || chars[i + 2] != 't' || chars[i + 3] != 'p') return false;
|
if (chars[i] != 'h' || chars[i + 1] != 't' || chars[i + 2] != 't' || chars[i + 3] != 'p') return false;
|
||||||
len -= 4; i += 4;
|
len -= 4; i += 4;
|
||||||
|
|
||||||
@ -228,7 +228,7 @@ namespace MCGalaxy {
|
|||||||
char c = chars[i];
|
char c = chars[i];
|
||||||
bool validCode = c == '%' && i < chars.Length - 1;
|
bool validCode = c == '%' && i < chars.Length - 1;
|
||||||
|
|
||||||
if (!validCode) continue;
|
if (!validCode) continue;
|
||||||
char color = chars[i + 1];
|
char color = chars[i + 1];
|
||||||
if (!Map(ref color)) continue;
|
if (!Map(ref color)) continue;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user