switch italics to payloads instead of raw bytes - this is actually messier until the rest of chat there is moved to SeString, but this at least removes some random raw hex. Once more string support is in, the rest can probably be ported as well

This commit is contained in:
meli 2020-04-22 15:01:57 -07:00
parent 430d834074
commit 75aaebccc2

View file

@ -224,8 +224,16 @@ namespace Dalamud.Game {
}
private static string MakeItalics(string text) {
return Encoding.UTF8.GetString(new byte[] {0x02, 0x1A, 0x02, 0x02, 0x03}) + text +
Encoding.UTF8.GetString(new byte[] {0x02, 0x1A, 0x02, 0x01, 0x03});
// TODO: when the above code is switched to SeString, this can be a straight insertion of the
// italics payloads only, and be a lot cleaner
var italicString = new SeString(new List<Payload>(new Payload[]
{
EmphasisItalicPayload.ItalicsOn,
new TextPayload(text),
EmphasisItalicPayload.ItalicsOff
}));
return Encoding.UTF8.GetString(italicString.Encode());
}
}
}