diff --git a/CustomizePlus/Api/CustomizePlusIpc.Profile.cs b/CustomizePlus/Api/CustomizePlusIpc.Profile.cs index 236adaa..a19de9d 100644 --- a/CustomizePlus/Api/CustomizePlusIpc.Profile.cs +++ b/CustomizePlus/Api/CustomizePlusIpc.Profile.cs @@ -5,21 +5,18 @@ using System.Linq; using ECommons.EzIpcManager; using Newtonsoft.Json; using CustomizePlus.Api.Data; -using CustomizePlus.GameData.Data; using CustomizePlus.Api.Enums; using CustomizePlus.Profiles.Exceptions; using CustomizePlus.Profiles.Data; using CustomizePlus.Core.Extensions; -using CustomizePlus.Profiles.Events; using CustomizePlus.Armatures.Data; using CustomizePlus.Armatures.Events; using CustomizePlus.GameData.Extensions; using Dalamud.Game.ClientState.Objects.Types; -using Penumbra.GameData.Actors; - -using IPCProfileDataTuple = (System.Guid UniqueId, string Name, string CharacterName, bool IsEnabled); using Penumbra.GameData.Interop; -//using OnUpdateTuple = (Dalamud.Game.ClientState.Objects.Types.Character Character, System.Guid? ProfileUniqueId, string? ProfileJson); + +//Virtual path is full path to the profile in the virtual folders created by user in the profile list UI +using IPCProfileDataTuple = (System.Guid UniqueId, string Name, string VirtualPath, string CharacterName, bool IsEnabled); namespace CustomizePlus.Api; @@ -37,6 +34,7 @@ public partial class CustomizePlusIpc /// /// Retrieve list of all user profiles + /// /!\ This might be somewhat heavy method to call, so please use with caution. /// /// [EzIPC("Profile.GetList")] @@ -44,7 +42,11 @@ public partial class CustomizePlusIpc { return _profileManager.Profiles .Where(x => x.ProfileType == ProfileType.Normal) - .Select(x => (x.UniqueId, x.Name.Text, x.CharacterName.Text, x.Enabled)) + .Select(x => + { + string path = _profileFileSystem.FindLeaf(x, out var leaf) ? leaf.FullName() : x.Name.Text; + return (x.UniqueId, x.Name.Text, path, x.CharacterName.Text, x.Enabled); + }) .ToList(); } @@ -285,7 +287,7 @@ public partial class CustomizePlusIpc type == ArmatureChanged.Type.Updated) { if (armature.Profile == null) - _logger.Fatal("INTEGRITY ERROR: Armature created/rebound and profile is null"); + _logger.Fatal("INTEGRITY ERROR: Armature created/updated and profile is null"); (Profile? activeProfile, Profile? oldProfile) = (null, null); if (type == ArmatureChanged.Type.Created) diff --git a/CustomizePlus/Api/CustomizePlusIpc.cs b/CustomizePlus/Api/CustomizePlusIpc.cs index 81451f8..33d0762 100644 --- a/CustomizePlus/Api/CustomizePlusIpc.cs +++ b/CustomizePlus/Api/CustomizePlusIpc.cs @@ -17,6 +17,7 @@ public partial class CustomizePlusIpc : IDisposable private readonly HookingService _hookingService; private readonly ProfileManager _profileManager; private readonly GameObjectService _gameObjectService; + private readonly ProfileFileSystem _profileFileSystem; private readonly ArmatureChanged _armatureChangedEvent; @@ -31,6 +32,7 @@ public partial class CustomizePlusIpc : IDisposable HookingService hookingService, ProfileManager profileManager, GameObjectService gameObjectService, + ProfileFileSystem profileFileSystem, ArmatureChanged armatureChangedEvent) { _pluginInterface = pluginInterface; @@ -38,6 +40,7 @@ public partial class CustomizePlusIpc : IDisposable _hookingService = hookingService; _profileManager = profileManager; _gameObjectService = gameObjectService; + _profileFileSystem = profileFileSystem; _armatureChangedEvent = armatureChangedEvent; diff --git a/CustomizePlus/UI/Windows/MainWindow/Tabs/Debug/IPCTestTab.cs b/CustomizePlus/UI/Windows/MainWindow/Tabs/Debug/IPCTestTab.cs index 9d45a80..d76cefd 100644 --- a/CustomizePlus/UI/Windows/MainWindow/Tabs/Debug/IPCTestTab.cs +++ b/CustomizePlus/UI/Windows/MainWindow/Tabs/Debug/IPCTestTab.cs @@ -16,7 +16,7 @@ using System; using System.Collections; using System.Collections.Generic; -using IPCProfileDataTuple = (System.Guid UniqueId, string Name, string CharacterName, bool IsEnabled); +using IPCProfileDataTuple = (System.Guid UniqueId, string Name, string VirtualPath, string CharacterName, bool IsEnabled); using OtterGui.Log; using CustomizePlus.Core.Extensions; @@ -223,7 +223,7 @@ public class IPCTestTab //: IDisposable if (ImGui.Button("Copy user profile list to clipboard")) { - ImGui.SetClipboardText(string.Join("\n", _getProfileListIpcFunc().Select(x => $"{x.UniqueId}, {x.Name}, {x.CharacterName}, {x.IsEnabled}"))); + ImGui.SetClipboardText(string.Join("\n", _getProfileListIpcFunc().Select(x => $"{x.UniqueId}, {x.Name}, {x.VirtualPath}, {x.CharacterName}, {x.IsEnabled}"))); _popupSystem.ShowPopup(PopupSystem.Messages.IPCCopiedToClipboard); }