diff --git a/CustomizePlus/Armatures/Services/ArmatureManager.cs b/CustomizePlus/Armatures/Services/ArmatureManager.cs
index 9601642..e0b6423 100644
--- a/CustomizePlus/Armatures/Services/ArmatureManager.cs
+++ b/CustomizePlus/Armatures/Services/ArmatureManager.cs
@@ -18,6 +18,7 @@ using CustomizePlus.Core.Extensions;
using CustomizePlus.GameData.Data;
using CustomizePlus.GameData.Services;
using CustomizePlus.GameData.Extensions;
+using FFXIVClientStructs.FFXIV.Client.Graphics.Scene;
namespace CustomizePlus.Armatures.Services;
@@ -345,6 +346,7 @@ public unsafe sealed class ArmatureManager : IDisposable
if (type is not TemplateChanged.Type.NewBone &&
type is not TemplateChanged.Type.DeletedBone &&
type is not TemplateChanged.Type.EditorCharacterChanged &&
+ type is not TemplateChanged.Type.EditorLimitLookupToOwnedChanged &&
type is not TemplateChanged.Type.EditorEnabled &&
type is not TemplateChanged.Type.EditorDisabled)
return;
@@ -390,6 +392,21 @@ public unsafe sealed class ArmatureManager : IDisposable
return;
}
+ if(type == TemplateChanged.Type.EditorLimitLookupToOwnedChanged)
+ {
+ var profile = (Profile)arg3!;
+
+ if (profile.Armatures.Count == 0)
+ return;
+
+ foreach (var armature in profile.Armatures)
+ armature.IsPendingProfileRebind = true;
+
+ _logger.Debug($"ArmatureManager.OnTemplateChange Editor profile limit lookup setting changed, armature rebind scheduled: {type}, profile: {profile.Name.Text.Incognify()}->{profile.Enabled}");
+
+ return;
+ }
+
if (type == TemplateChanged.Type.EditorEnabled ||
type == TemplateChanged.Type.EditorDisabled)
{
diff --git a/CustomizePlus/Profiles/Data/Profile.cs b/CustomizePlus/Profiles/Data/Profile.cs
index 0e889dc..9577359 100644
--- a/CustomizePlus/Profiles/Data/Profile.cs
+++ b/CustomizePlus/Profiles/Data/Profile.cs
@@ -5,6 +5,7 @@ using CustomizePlus.Armatures.Data;
using CustomizePlus.Core.Data;
using CustomizePlus.Core.Extensions;
using CustomizePlus.Core.Services;
+using CustomizePlus.Profiles.Enums;
using CustomizePlus.Templates;
using CustomizePlus.Templates.Data;
using Newtonsoft.Json;
@@ -46,11 +47,13 @@ public sealed class Profile : ISavable
public bool IsWriteProtected { get; internal set; }
+ public ProfileType ProfileType { get; set; }
+
///
- /// Specifies if this profile is not persistent (ex. was made via IPC calls) and should not be displayed in UI.
+ /// Tells us if this profile is not persistent (ex. was made via IPC calls) and should have specific treatement like not being shown in UI, etc.
/// WARNING, TEMPLATES FOR TEMPORARY PROFILES *ARE NOT* STORED IN TemplateManager
///
- public bool IsTemporary { get; set; }
+ public bool IsTemporary => ProfileType == ProfileType.Temporary;
///
/// Identificator specifying specific actor this profile applies to, only works for temporary profiles
diff --git a/CustomizePlus/Profiles/Enums/ProfileType.cs b/CustomizePlus/Profiles/Enums/ProfileType.cs
new file mode 100644
index 0000000..cf0567f
--- /dev/null
+++ b/CustomizePlus/Profiles/Enums/ProfileType.cs
@@ -0,0 +1,8 @@
+namespace CustomizePlus.Profiles.Enums;
+
+public enum ProfileType
+{
+ Normal,
+ Temporary,
+ Editor
+}
diff --git a/CustomizePlus/Profiles/ProfileManager.cs b/CustomizePlus/Profiles/ProfileManager.cs
index 90989fb..6e2a3e2 100644
--- a/CustomizePlus/Profiles/ProfileManager.cs
+++ b/CustomizePlus/Profiles/ProfileManager.cs
@@ -21,6 +21,7 @@ using CustomizePlus.Templates.Data;
using CustomizePlus.GameData.Data;
using CustomizePlus.GameData.Services;
using CustomizePlus.GameData.Extensions;
+using CustomizePlus.Profiles.Enums;
namespace CustomizePlus.Profiles;
@@ -378,7 +379,7 @@ public class ProfileManager : IDisposable
return;
profile.Enabled = true;
- profile.IsTemporary = true;
+ profile.ProfileType = ProfileType.Temporary;
profile.TemporaryActor = identifier;
profile.CharacterName = identifier.ToNameWithoutOwnerName();
profile.LimitLookupToOwnedObjects = false;
@@ -500,6 +501,10 @@ public class ProfileManager : IDisposable
private void SaveProfile(Profile profile)
{
+ //disallow saving special profiles
+ if (profile.ProfileType != ProfileType.Normal)
+ return;
+
profile.ModifiedDate = DateTimeOffset.UtcNow;
_saveService.QueueSave(profile);
}
diff --git a/CustomizePlus/Templates/Events/TemplateChanged.cs b/CustomizePlus/Templates/Events/TemplateChanged.cs
index d118bd3..0ac4702 100644
--- a/CustomizePlus/Templates/Events/TemplateChanged.cs
+++ b/CustomizePlus/Templates/Events/TemplateChanged.cs
@@ -20,6 +20,7 @@ public class TemplateChanged() : EventWrapper(), Enabled = false, Name = "Template editor profile" };
+ EditorProfile = new Profile() { Templates = new List(), Enabled = false, Name = "Template editor profile", ProfileType = ProfileType.Editor };
}
public void Dispose()
@@ -163,6 +166,18 @@ public class TemplateEditorManager : IDisposable
return true;
}
+ public bool SetLimitLookupToOwned(bool value)
+ {
+ if (!IsEditorActive || IsEditorPaused || value == EditorProfile.LimitLookupToOwnedObjects)
+ return false;
+
+ //_profileManager.SetLimitLookupToOwned(EditorProfile, value);
+ EditorProfile.LimitLookupToOwnedObjects = value;
+ _event.Invoke(TemplateChanged.Type.EditorLimitLookupToOwnedChanged, CurrentlyEditedTemplate, EditorProfile);
+
+ return true;
+ }
+
///
/// Resets changes in currently edited template to default values
///
diff --git a/CustomizePlus/UI/Windows/MainWindow/Tabs/Debug/StateMonitoringTab.cs b/CustomizePlus/UI/Windows/MainWindow/Tabs/Debug/StateMonitoringTab.cs
index ba5efcf..080f1d2 100644
--- a/CustomizePlus/UI/Windows/MainWindow/Tabs/Debug/StateMonitoringTab.cs
+++ b/CustomizePlus/UI/Windows/MainWindow/Tabs/Debug/StateMonitoringTab.cs
@@ -134,7 +134,7 @@ public class StateMonitoringTab
characterName = characterName.Incognify();
#endif
- var show = ImGui.CollapsingHeader($"[{(profile.Enabled ? "E" : "D")}] {name} on {characterName} [{(profile.IsTemporary ? "Temporary" : "Permanent")}] [{profile.UniqueId}]###{prefix}-profile-{profile.UniqueId}");
+ var show = ImGui.CollapsingHeader($"[{(profile.Enabled ? "E" : "D")}] {name} on {characterName} [{profile.ProfileType}] [{profile.UniqueId}]###{prefix}-profile-{profile.UniqueId}");
if (!show)
return;
diff --git a/CustomizePlus/UI/Windows/MainWindow/Tabs/Templates/BoneEditorPanel.cs b/CustomizePlus/UI/Windows/MainWindow/Tabs/Templates/BoneEditorPanel.cs
index 7e75736..1039d89 100644
--- a/CustomizePlus/UI/Windows/MainWindow/Tabs/Templates/BoneEditorPanel.cs
+++ b/CustomizePlus/UI/Windows/MainWindow/Tabs/Templates/BoneEditorPanel.cs
@@ -31,6 +31,14 @@ public class BoneEditorPanel
private bool _isShowLiveBones;
private bool _isMirrorModeEnabled;
+ private string? _newCharacterName;
+
+ private Dictionary _groupExpandedState = new();
+
+ private bool _openSavePopup;
+
+ private bool _isUnlocked = false;
+
public bool HasChanges => _editorManager.HasChanges;
public bool IsEditorActive => _editorManager.IsEditorActive;
public bool IsEditorPaused => _editorManager.IsEditorPaused;
@@ -41,18 +49,6 @@ public class BoneEditorPanel
public bool IsCharacterFound { get; private set; }
public string CharacterName { get; private set; }
- private ModelBone? _changedBone;
- private string? _changedBoneName;
- private BoneTransform? _changedBoneTransform;
-
- private string? _newCharacterName;
-
- private Dictionary _groupExpandedState = new();
-
- private bool _openSavePopup;
-
- private bool _isUnlocked = false;
-
public BoneEditorPanel(
TemplateFileSystemSelector templateFileSystemSelector,
TemplateEditorManager editorManager,
@@ -75,7 +71,7 @@ public class BoneEditorPanel
{
if (_editorManager.EnableEditor(template, CharacterName))
{
- _editorManager.EditorProfile.LimitLookupToOwnedObjects = _configuration.EditorConfiguration.LimitLookupToOwnedObjects;
+ _editorManager.SetLimitLookupToOwned(_configuration.EditorConfiguration.LimitLookupToOwnedObjects);
return true;
}
@@ -157,7 +153,7 @@ public class BoneEditorPanel
var enabled = _editorManager.EditorProfile.LimitLookupToOwnedObjects;
if (ImGui.Checkbox("##LimitLookupToOwnedObjects", ref enabled))
{
- _editorManager.EditorProfile.LimitLookupToOwnedObjects = enabled;
+ _editorManager.SetLimitLookupToOwned(enabled);
_configuration.EditorConfiguration.LimitLookupToOwnedObjects = enabled;
_configuration.Save();
@@ -376,26 +372,34 @@ public class BoneEditorPanel
#region ImGui helper functions
- public bool ResetBoneButton(string codename)
+ private bool ResetBoneButton(EditRowParams bone)
{
- var output = ImGuiComponents.IconButton(codename, FontAwesomeIcon.Recycle);
+ var output = ImGuiComponents.IconButton(bone.BoneCodeName, FontAwesomeIcon.Recycle);
CtrlHelper.AddHoverText(
- $"Reset '{BoneData.GetBoneDisplayName(codename)}' to default {_editingAttribute} values");
+ $"Reset '{BoneData.GetBoneDisplayName(bone.BoneCodeName)}' to default {_editingAttribute} values");
if (output)
- _editorManager.ResetBoneAttributeChanges(codename, _editingAttribute);
+ {
+ _editorManager.ResetBoneAttributeChanges(bone.BoneCodeName, _editingAttribute);
+ if (_isMirrorModeEnabled && bone.Basis?.TwinBone != null) //todo: put it inside manager
+ _editorManager.ResetBoneAttributeChanges(bone.Basis.TwinBone.BoneName, _editingAttribute);
+ }
return output;
}
- private bool RevertBoneButton(string codename)
+ private bool RevertBoneButton(EditRowParams bone)
{
- var output = ImGuiComponents.IconButton(codename, FontAwesomeIcon.ArrowCircleLeft);
+ var output = ImGuiComponents.IconButton(bone.BoneCodeName, FontAwesomeIcon.ArrowCircleLeft);
CtrlHelper.AddHoverText(
- $"Revert '{BoneData.GetBoneDisplayName(codename)}' to last saved {_editingAttribute} values");
+ $"Revert '{BoneData.GetBoneDisplayName(bone.BoneCodeName)}' to last saved {_editingAttribute} values");
if (output)
- _editorManager.RevertBoneAttributeChanges(codename, _editingAttribute);
+ {
+ _editorManager.RevertBoneAttributeChanges(bone.BoneCodeName, _editingAttribute);
+ if (_isMirrorModeEnabled && bone.Basis?.TwinBone != null) //todo: put it inside manager
+ _editorManager.RevertBoneAttributeChanges(bone.Basis.TwinBone.BoneName, _editingAttribute);
+ }
return output;
}
@@ -464,9 +468,9 @@ public class BoneEditorPanel
//----------------------------------
ImGui.Dummy(new Vector2(CtrlHelper.IconButtonWidth * 0.75f, 0));
ImGui.SameLine();
- ResetBoneButton(codename);
+ ResetBoneButton(bone);
ImGui.SameLine();
- RevertBoneButton(codename);
+ RevertBoneButton(bone);
//----------------------------------
ImGui.TableNextColumn();
diff --git a/README.md b/README.md
index 76e4031..7788405 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,7 @@
Customize+ is a Dalamud plugin designed to give you better control over your Final Fantasy XIV character appearance. Namely it allows you to apply character bone manipulations during gameplay.
## Installing
-After doing that add the following URL to the Dalamud Custom Plugin Repositories list:
+Add the following URL to the Dalamud Custom Plugin Repositories list:
`https://raw.githubusercontent.com/Aether-Tools/DalamudPlugins/main/repo.json`
Alternatively use the Collective repo Sea of Stars which you can get from here: