mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-01-03 06:13:40 +01:00
add codepoints for colored brackets around auto-translate text; minor fixes
This commit is contained in:
parent
442fc9d137
commit
1832702a0a
6 changed files with 12 additions and 6 deletions
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ namespace Dalamud.Game.Chat.SeStringHandling.Payloads
|
|||
{
|
||||
get
|
||||
{
|
||||
return UIColor.UIForeground;
|
||||
return (UIColor.UIForeground & 0xFFFFFF);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ namespace Dalamud.Game.Chat.SeStringHandling.Payloads
|
|||
{
|
||||
get
|
||||
{
|
||||
return UIColor.UIGlow;
|
||||
return (UIColor.UIGlow & 0xFFFFFF);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue