From 442cdcb2ecea7a2a45ead621ef2adf6ac45df960 Mon Sep 17 00:00:00 2001 From: Pilzinsel64 Date: Wed, 5 Apr 2023 10:01:01 +0200 Subject: [PATCH] slightly simpler usage for NameplateChanges and NameplateProps --- Pilz.Dalamud/Nameplates/Tools/NameplateChanges.cs | 8 ++++++++ Pilz.Dalamud/Nameplates/Tools/NameplateChangesProps.cs | 9 +++++++++ 2 files changed, 17 insertions(+) diff --git a/Pilz.Dalamud/Nameplates/Tools/NameplateChanges.cs b/Pilz.Dalamud/Nameplates/Tools/NameplateChanges.cs index b33c372..3accdbb 100644 --- a/Pilz.Dalamud/Nameplates/Tools/NameplateChanges.cs +++ b/Pilz.Dalamud/Nameplates/Tools/NameplateChanges.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Pilz.Dalamud.Nameplates.EventArgs; using Pilz.Dalamud.Tools.Strings; namespace Pilz.Dalamud.Nameplates.Tools @@ -18,6 +19,13 @@ namespace Pilz.Dalamud.Nameplates.Tools changes.Add(NameplateElements.FreeCompany, new()); } + public NameplateChanges(AddonNamePlate_SetPlayerNameManagedEventArgs eventArgs) : this() + { + GetProps(NameplateElements.Title).Destination = eventArgs.Title; + GetProps(NameplateElements.Name).Destination = eventArgs.Name; + GetProps(NameplateElements.FreeCompany).Destination = eventArgs.FreeCompany; + } + /// /// Gets the properties with the changes of an element of your choice where you can add your payloads to a change and setup some options. /// diff --git a/Pilz.Dalamud/Nameplates/Tools/NameplateChangesProps.cs b/Pilz.Dalamud/Nameplates/Tools/NameplateChangesProps.cs index 56f7017..201bcf5 100644 --- a/Pilz.Dalamud/Nameplates/Tools/NameplateChangesProps.cs +++ b/Pilz.Dalamud/Nameplates/Tools/NameplateChangesProps.cs @@ -12,5 +12,14 @@ namespace Pilz.Dalamud.Nameplates.Tools /// All the changes to the nameplate that should be made. /// public NameplateChanges Changes { get; set; } + + public NameplateChangesProps() + { + } + + public NameplateChangesProps(NameplateChanges changes) : this() + { + Changes = changes; + } } }