From ab85a08151c70454b50b84a4db8ab8d4f3bc8ce1 Mon Sep 17 00:00:00 2001 From: Pilzinsel64 Date: Sun, 6 Nov 2022 11:34:41 +0100 Subject: [PATCH] minor fixes --- Pilz.Dalamud/Nameplates/Tools/NameplateChanges.cs | 6 +++--- Pilz.Dalamud/Nameplates/Tools/NameplateUpdateFactory.cs | 4 ++++ Pilz.Dalamud/Tools/Strings/StringChangesProps.cs | 4 ++-- Pilz.Dalamud/Tools/Strings/StringUpdateFactory.cs | 2 +- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Pilz.Dalamud/Nameplates/Tools/NameplateChanges.cs b/Pilz.Dalamud/Nameplates/Tools/NameplateChanges.cs index da182b3..b33c372 100644 --- a/Pilz.Dalamud/Nameplates/Tools/NameplateChanges.cs +++ b/Pilz.Dalamud/Nameplates/Tools/NameplateChanges.cs @@ -13,9 +13,9 @@ namespace Pilz.Dalamud.Nameplates.Tools public NameplateChanges() { - changes.Add(NameplateElements.Title, new StringChangesProps()); - changes.Add(NameplateElements.Name, new StringChangesProps()); - changes.Add(NameplateElements.FreeCompany, new StringChangesProps()); + changes.Add(NameplateElements.Title, new()); + changes.Add(NameplateElements.Name, new()); + changes.Add(NameplateElements.FreeCompany, new()); } /// diff --git a/Pilz.Dalamud/Nameplates/Tools/NameplateUpdateFactory.cs b/Pilz.Dalamud/Nameplates/Tools/NameplateUpdateFactory.cs index 1aa26d4..b04f947 100644 --- a/Pilz.Dalamud/Nameplates/Tools/NameplateUpdateFactory.cs +++ b/Pilz.Dalamud/Nameplates/Tools/NameplateUpdateFactory.cs @@ -33,8 +33,12 @@ namespace Pilz.Dalamud.Nameplates.Tools if (fontIcon != null) { + // Set new font icon as string change var iconPayload = new IconPayload(fontIcon.Value); stringChange.Payloads.Insert(0, iconPayload); + + // Use new status icon as status icon + statusIcon = newStatusIcon; } } diff --git a/Pilz.Dalamud/Tools/Strings/StringChangesProps.cs b/Pilz.Dalamud/Tools/Strings/StringChangesProps.cs index 8a81bfb..d0cd253 100644 --- a/Pilz.Dalamud/Tools/Strings/StringChangesProps.cs +++ b/Pilz.Dalamud/Tools/Strings/StringChangesProps.cs @@ -17,11 +17,11 @@ namespace Pilz.Dalamud.Tools.Strings /// /// The changes that should be applied to the destination. /// - public StringChanges StringChanges { get; set; } + public StringChanges StringChanges { get; set; } = new(); /// /// Payloads to use as anchor where the changes should be applied to. /// - public List AnchorPayloads { get; set; } + public List AnchorPayloads { get; set; } = new(); /// /// 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. diff --git a/Pilz.Dalamud/Tools/Strings/StringUpdateFactory.cs b/Pilz.Dalamud/Tools/Strings/StringUpdateFactory.cs index f8ecd16..ab3423a 100644 --- a/Pilz.Dalamud/Tools/Strings/StringUpdateFactory.cs +++ b/Pilz.Dalamud/Tools/Strings/StringUpdateFactory.cs @@ -13,7 +13,7 @@ namespace Pilz.Dalamud.Tools.Strings { public static void ApplyStringChanges(StringChangesProps props) { - if (props.StringChanges.Any()) + if (props.StringChanges != null && props.StringChanges.Any()) { var seString = props.Destination; List stringPositionsOrdered = GetOrderedStringPositions(props);