From db4cceb6655dc1253e2a1805f1808f3c34af0ed4 Mon Sep 17 00:00:00 2001 From: Cayde Dixon Date: Tue, 17 Oct 2023 17:54:33 +1100 Subject: [PATCH] Allow scales to be loaded via MCDF files --- CustomizePlus/Data/Profile/CharacterProfile.cs | 3 +++ CustomizePlus/Data/Profile/ProfileManager.cs | 2 ++ 2 files changed, 5 insertions(+) diff --git a/CustomizePlus/Data/Profile/CharacterProfile.cs b/CustomizePlus/Data/Profile/CharacterProfile.cs index e4bcb77..938775d 100644 --- a/CustomizePlus/Data/Profile/CharacterProfile.cs +++ b/CustomizePlus/Data/Profile/CharacterProfile.cs @@ -56,6 +56,7 @@ public CharacterProfile(CharacterProfile original) : this() public string CharacterName { get; set; } = "Default"; public string ProfileName { get; set; } = "Profile"; + public nint? Address { get; set; } = null; public bool OwnedOnly { get; set; } = false; public int ConfigVersion { get; set; } = Constants.ConfigurationVersion; public bool Enabled { get; set; } @@ -76,6 +77,8 @@ public CharacterProfile(CharacterProfile original) : this() /// public bool AppliesTo(Dalamud.Game.ClientState.Objects.Types.GameObject obj) { + if (Address != null && obj.Address == Address) return true; + //PluginLog.Verbose($"Checking on {obj.ObjectIndex} for scale {ProfileName}"); if (obj.Name.TextValue.IsNullOrEmpty() && (obj.ObjectIndex == 200 || obj.ObjectIndex == 201)) { diff --git a/CustomizePlus/Data/Profile/ProfileManager.cs b/CustomizePlus/Data/Profile/ProfileManager.cs index f19b544..1e3a5d0 100644 --- a/CustomizePlus/Data/Profile/ProfileManager.cs +++ b/CustomizePlus/Data/Profile/ProfileManager.cs @@ -263,6 +263,8 @@ public void StopEditing(CharacterProfile prof) public void AddTemporaryProfile(nint characterAddress, CharacterProfile prof) { + prof.Enabled = true; + prof.Address = characterAddress; var key = TempLocalProfiles.Keys.FirstOrDefault(f => f.Address == characterAddress); if (key != null) {