More work on profile character assignment rewrite.

Added ability to apply profile to any currently logged in character
Functional UI for player character, retainers and mannequins
Almost completely switched to using ActorIdentifier instead of character name
Migration code for ActorIdentifier instead of character names
IPC is not functional for now (see todos)
This commit is contained in:
RisaDev
2024-10-07 01:11:20 +03:00
parent a7da74bb80
commit 2d40fff844
12 changed files with 292 additions and 165 deletions

View File

@@ -46,7 +46,7 @@ public partial class CustomizePlusIpc
.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);
return (x.UniqueId, x.Name.Text, path, x.Character.ToNameWithoutOwnerName(), x.Enabled); //todo: proper update to v5
})
.ToList();
}
@@ -134,7 +134,7 @@ public partial class CustomizePlusIpc
if (actor == null || !actor.Value.Valid || !actor.Value.IsCharacter)
return ((int)ErrorCode.InvalidCharacter, null);
var profile = _profileManager.GetProfileByCharacterName(actor.Value.Utf8Name.ToString(), true);
var profile = _profileManager.GetProfileByActor(actor.Value, true);
if (profile == null)
return ((int)ErrorCode.ProfileNotFound, null);

View File

@@ -1,5 +1,6 @@
using CustomizePlus.Configuration.Data.Version3;
using CustomizePlus.Core.Data;
using CustomizePlus.GameData.Extensions;
using CustomizePlus.Profiles.Data;
using CustomizePlus.Templates.Data;
using System;
@@ -23,7 +24,7 @@ public class IPCCharacterProfile
{
var ipcProfile = new IPCCharacterProfile
{
CharacterName = profile.CharacterName,
CharacterName = profile.Character.ToNameWithoutOwnerName(), //todo: proper update to v5
Bones = new Dictionary<string, IPCBoneTransform>()
};
@@ -48,7 +49,7 @@ public class IPCCharacterProfile
var fullProfile = new Profile
{
Name = $"{profile.CharacterName}'s IPC profile",
CharacterName = profile.CharacterName,
// CharacterName = profile.CharacterName, //todo: proper update to v5
CreationDate = DateTimeOffset.UtcNow,
ModifiedDate = DateTimeOffset.UtcNow,
Enabled = true,