mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-13 12:14:16 +01:00
Add NamePlateQuotedParts.OuterWrap
This commit is contained in:
parent
bceca96998
commit
a78296c603
1 changed files with 16 additions and 0 deletions
|
|
@ -8,6 +8,12 @@ namespace Dalamud.Game.Gui.NamePlate;
|
||||||
/// <param name="field">The field type which should be set.</param>
|
/// <param name="field">The field type which should be set.</param>
|
||||||
public class NamePlateQuotedParts(NamePlateStringField field, bool isFreeCompany)
|
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>
|
/// <summary>
|
||||||
/// Gets or sets the opening quote string which appears before the text and opening text-wrap.
|
/// Gets or sets the opening quote string which appears before the text and opening text-wrap.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -39,6 +45,11 @@ public class NamePlateQuotedParts(NamePlateStringField field, bool isFreeCompany
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var sb = new SeStringBuilder();
|
var sb = new SeStringBuilder();
|
||||||
|
if (this.OuterWrap is { Item1: var outerLeft })
|
||||||
|
{
|
||||||
|
sb.Append(outerLeft);
|
||||||
|
}
|
||||||
|
|
||||||
if (this.LeftQuote is not null)
|
if (this.LeftQuote is not null)
|
||||||
{
|
{
|
||||||
sb.Append(this.LeftQuote);
|
sb.Append(this.LeftQuote);
|
||||||
|
|
@ -68,6 +79,11 @@ public class NamePlateQuotedParts(NamePlateStringField field, bool isFreeCompany
|
||||||
sb.Append(isFreeCompany ? "»" : "》");
|
sb.Append(isFreeCompany ? "»" : "》");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.OuterWrap is { Item2: var outerRight })
|
||||||
|
{
|
||||||
|
sb.Append(outerRight);
|
||||||
|
}
|
||||||
|
|
||||||
handler.SetField(field, sb.Build());
|
handler.SetField(field, sb.Build());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue