Add NamePlateQuotedParts.OuterWrap

This commit is contained in:
nebel 2024-07-11 21:27:24 +09:00
parent bceca96998
commit a78296c603
No known key found for this signature in database

View file

@ -8,6 +8,12 @@ namespace Dalamud.Game.Gui.NamePlate;
/// <param name="field">The field type which should be set.</param>
public class NamePlateQuotedParts(NamePlateStringField field, bool isFreeCompany)
{
/// <summary>
/// Gets or sets the opening and closing SeStrings which will wrap the entire contents, which can be used to apply
/// colors or styling to the entire field.
/// </summary>
public (SeString, SeString)? OuterWrap { get; set; }
/// <summary>
/// Gets or sets the opening quote string which appears before the text and opening text-wrap.
/// </summary>
@ -39,6 +45,11 @@ public class NamePlateQuotedParts(NamePlateStringField field, bool isFreeCompany
return;
var sb = new SeStringBuilder();
if (this.OuterWrap is { Item1: var outerLeft })
{
sb.Append(outerLeft);
}
if (this.LeftQuote is not null)
{
sb.Append(this.LeftQuote);
@ -68,6 +79,11 @@ public class NamePlateQuotedParts(NamePlateStringField field, bool isFreeCompany
sb.Append(isFreeCompany ? "»" : "》");
}
if (this.OuterWrap is { Item2: var outerRight })
{
sb.Append(outerRight);
}
handler.SetField(field, sb.Build());
}