mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-31 21:03:43 +01:00
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:
parent
430d834074
commit
75aaebccc2
1 changed files with 10 additions and 2 deletions
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue