1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 11:38:21 +02:00

StrRemoveColors

This commit is contained in:
Brian Fiete 2023-02-08 10:18:23 -05:00
parent 227b5f4982
commit b50d2becfc

View file

@ -705,6 +705,33 @@ namespace Beefy.gfx
return '\x02';
}
public static void StrRemoveColors(StringView theString, String str)
{
int len = theString.Length;
if (len == 0)
{
return;
}
for (var c in theString.DecodedChars)
{
int idx = @c.NextIndex;
if (c == (char32)'\x01')
{
@c.NextIndex = idx + 4;
continue;
}
else if (c == (char32)'\x02')
{
continue;
}
str.Append(c);
if (idx >= len)
break;
}
}
public void Draw(Graphics g, StringView theString, FontMetrics* fontMetrics = null)
{
if (mFTFont == null)