add codepoints for colored brackets around auto-translate text; minor fixes

This commit is contained in:
meli 2020-04-22 06:11:20 -07:00
parent 442fc9d137
commit 1832702a0a
6 changed files with 12 additions and 6 deletions

View file

@ -9,9 +9,11 @@ using Serilog;
// TODOs:
// - refactor integer handling now that we have multiple packed types
// - common construction/property design for subclasses
// - design for handling raw values vs resolved values, both for input and output
// - wrapper class(es) for handling of composite links in chat (item, map etc) and formatting operations
// - add italics payload
// Maybes:
// - convert parsing to custom structs for each payload? would make some code prettier and easier to work with
// but also wouldn't work out as well for things that are dynamically-sized
namespace Dalamud.Game.Chat.SeStringHandling
{
@ -200,8 +202,8 @@ namespace Dalamud.Game.Chat.SeStringHandling
Int16 = 0xF2,
Int16Packed = 0xF4, // seen in map links, seemingly 2 8-bit values packed into 2 bytes with only one marker
Int24Special = 0xF6, // unsure how different form Int24 - used for hq items that add 1 million, also used for normal 24-bit values in map links
Int24Packed = 0xFC, // used in map links- sometimes short+byte, sometimes... not??
Int24 = 0xFA,
Int24Packed = 0xFC, // used in map links- sometimes short+byte, sometimes... not??
Int32 = 0xFE
}

View file

@ -17,7 +17,9 @@ namespace Dalamud.Game.Chat.SeStringHandling.Payloads
{
get
{
this.text ??= Resolve();
// wrap the text in the colored brackets that is uses in-game, since those
// are not actually part of any of the payloads
this.text ??= $"\uE040 {Resolve()} \uE041";
return this.text;
}
}

View file

@ -54,6 +54,8 @@ namespace Dalamud.Game.Chat.SeStringHandling.Payloads
bytes.AddRange(Encoding.UTF8.GetBytes(this.playerName));
bytes.Add(END_BYTE);
// TODO: should these really be here? additional payloads should come in separately already...
// encoded names are followed by the name in plain text again
// use the payload parsing for consistency, as this is technically a new chunk
bytes.AddRange(

View file

@ -34,7 +34,7 @@ namespace Dalamud.Game.Chat.SeStringHandling.Payloads
{
get
{
return UIColor.UIForeground;
return (UIColor.UIForeground & 0xFFFFFF);
}
}

View file

@ -34,7 +34,7 @@ namespace Dalamud.Game.Chat.SeStringHandling.Payloads
{
get
{
return UIColor.UIGlow;
return (UIColor.UIGlow & 0xFFFFFF);
}
}

View file

@ -40,7 +40,7 @@ namespace Dalamud.Game.Chat.SeStringHandling
// TODO: temporary (probably)
else if (p.Type == PayloadType.AutoTranslateText)
{
sb.Append($"{{ {((AutoTranslatePayload)p).Text} }}");
sb.Append(((AutoTranslatePayload)p).Text);
}
}