minor fixes

This commit is contained in:
2022-11-06 11:34:41 +01:00
parent e9d3c2c05b
commit ab85a08151
4 changed files with 10 additions and 6 deletions

View File

@@ -13,9 +13,9 @@ namespace Pilz.Dalamud.Nameplates.Tools
public NameplateChanges() public NameplateChanges()
{ {
changes.Add(NameplateElements.Title, new StringChangesProps()); changes.Add(NameplateElements.Title, new());
changes.Add(NameplateElements.Name, new StringChangesProps()); changes.Add(NameplateElements.Name, new());
changes.Add(NameplateElements.FreeCompany, new StringChangesProps()); changes.Add(NameplateElements.FreeCompany, new());
} }
/// <summary> /// <summary>

View File

@@ -33,8 +33,12 @@ namespace Pilz.Dalamud.Nameplates.Tools
if (fontIcon != null) if (fontIcon != null)
{ {
// Set new font icon as string change
var iconPayload = new IconPayload(fontIcon.Value); var iconPayload = new IconPayload(fontIcon.Value);
stringChange.Payloads.Insert(0, iconPayload); stringChange.Payloads.Insert(0, iconPayload);
// Use new status icon as status icon
statusIcon = newStatusIcon;
} }
} }

View File

@@ -17,11 +17,11 @@ namespace Pilz.Dalamud.Tools.Strings
/// <summary> /// <summary>
/// The changes that should be applied to the destination. /// The changes that should be applied to the destination.
/// </summary> /// </summary>
public StringChanges StringChanges { get; set; } public StringChanges StringChanges { get; set; } = new();
/// <summary> /// <summary>
/// Payloads to use as anchor where the changes should be applied to. /// Payloads to use as anchor where the changes should be applied to.
/// </summary> /// </summary>
public List<Payload> AnchorPayloads { get; set; } public List<Payload> AnchorPayloads { get; set; } = new();
/// <summary> /// <summary>
/// A single payload to use as anchor where the changes should be applied to. /// A single payload to use as anchor where the changes should be applied to.
/// This property will only be used if StringChange.ForceSingleAnchorPayload is true. /// This property will only be used if StringChange.ForceSingleAnchorPayload is true.

View File

@@ -13,7 +13,7 @@ namespace Pilz.Dalamud.Tools.Strings
{ {
public static void ApplyStringChanges(StringChangesProps props) public static void ApplyStringChanges(StringChangesProps props)
{ {
if (props.StringChanges.Any()) if (props.StringChanges != null && props.StringChanges.Any())
{ {
var seString = props.Destination; var seString = props.Destination;
List<StringPosition> stringPositionsOrdered = GetOrderedStringPositions(props); List<StringPosition> stringPositionsOrdered = GetOrderedStringPositions(props);