mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-02-19 22:37:43 +01:00
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:
parent
4b4227d127
commit
1f74293de4
5 changed files with 40 additions and 123 deletions
|
|
@ -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/>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue