Skip to content

Commit

Permalink
Update BasePayload.cs
Browse files Browse the repository at this point in the history
properly handle StringExpression in payloads (this broke with reverting the ToString() change)
  • Loading branch information
pohky committed Apr 3, 2024
1 parent 77cc729 commit b927748
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Lumina/Text/Payloads/BasePayload.cs
Original file line number Diff line number Diff line change
Expand Up @@ -255,15 +255,17 @@ public override string ToString()
case MacroCodes.NonBreakingSpace:
return "<nbsp>";
case MacroCodes.SoftHyphen:
return "-";
return "<->";
case MacroCodes.Hyphen:
return "--";
return "<-->";
default:
{
if( Expressions.Count == 0 )
return $"<{code.ToString().ToLower()}>";

return $"<{code.ToString().ToLower()}({string.Join( ',', Expressions )})>";
return $"<{code.ToString().ToLower()}({string.Join( ',', Expressions.Select(
ex => ex is StringExpression se ? se.Value.ToMacroString() : ex.ToString()
) )})>";
}
}
}
Expand Down

0 comments on commit b927748

Please sign in to comment.