Update Lumina and use MacroStringParser (#2033)

No longer requires hook and main thread requirements on compiling macro
strings.

Needs lookup table fixing on Lumina; using reflection to fix for the
time being.
This commit is contained in:
srkizer 2024-09-15 02:23:24 +09:00 committed by GitHub
parent 4b4227d127
commit 1f74293de4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 40 additions and 123 deletions

View file

@ -37,17 +37,19 @@ public class DalamudLinkPayload : Payload
/// <inheritdoc/>
protected override byte[] EncodeImpl()
{
return new Lumina.Text.SeStringBuilder()
.BeginMacro(MacroCode.Link)
.AppendIntExpression((int)EmbeddedInfoType.DalamudLink - 1)
.AppendUIntExpression(this.CommandId)
.AppendIntExpression(this.Extra1)
.AppendIntExpression(this.Extra2)
.BeginStringExpression()
.Append(JsonConvert.SerializeObject(new[] { this.Plugin, this.ExtraString }))
.EndExpression()
.EndMacro()
.ToArray();
var ssb = Lumina.Text.SeStringBuilder.SharedPool.Get();
var res = ssb.BeginMacro(MacroCode.Link)
.AppendIntExpression((int)EmbeddedInfoType.DalamudLink - 1)
.AppendUIntExpression(this.CommandId)
.AppendIntExpression(this.Extra1)
.AppendIntExpression(this.Extra2)
.BeginStringExpression()
.Append(JsonConvert.SerializeObject(new[] { this.Plugin, this.ExtraString }))
.EndExpression()
.EndMacro()
.ToArray();
Lumina.Text.SeStringBuilder.SharedPool.Return(ssb);
return res;
}
/// <inheritdoc/>