Added character info and priority to Profile.GetList IPC, bump of major IPC version, IPCCharacterProfile cleanup, some fixes which should hopefully fix temporary profiles for minions
This commit is contained in:
@@ -4,6 +4,8 @@ using CustomizePlus.Game.Services;
|
||||
using CustomizePlus.GameData.Extensions;
|
||||
using CustomizePlus.Profiles.Data;
|
||||
using CustomizePlus.Templates.Data;
|
||||
using Penumbra.GameData.Enums;
|
||||
using Penumbra.GameData.Structs;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -18,20 +20,24 @@ namespace CustomizePlus.Api.Data;
|
||||
/// </summary>
|
||||
public class IPCCharacterProfile
|
||||
{
|
||||
/// <summary>
|
||||
/// Used only for display purposes
|
||||
/// </summary>
|
||||
public string CharacterName { get; set; } = "Invalid";
|
||||
// public List<IPCCharacter> Characters { get; set; } = new();
|
||||
|
||||
public Dictionary<string, IPCBoneTransform> Bones { get; init; } = new();
|
||||
|
||||
public static IPCCharacterProfile FromFullProfile(Profile profile)
|
||||
{
|
||||
var ipcProfile = new IPCCharacterProfile
|
||||
var ipcProfile = new IPCCharacterProfile();
|
||||
|
||||
/* foreach (var character in profile.Characters)
|
||||
{
|
||||
CharacterName = profile.Characters.FirstOrDefault().ToNameWithoutOwnerName(),
|
||||
Bones = new Dictionary<string, IPCBoneTransform>()
|
||||
};
|
||||
//todo: unify with tuple?
|
||||
var ipcCharacter = new IPCCharacter();
|
||||
ipcCharacter.Name = character.ToNameWithoutOwnerName();
|
||||
ipcCharacter.CharacterType = (byte)character.Type;
|
||||
ipcCharacter.WorldId = character.Type == IdentifierType.Player || character.Type == IdentifierType.Owned ? character.HomeWorld.Id : WorldId.AnyWorld.Id;
|
||||
ipcCharacter.CharacterSubType = character.Type == IdentifierType.Retainer ? (ushort)character.Retainer : (ushort)0;
|
||||
ipcProfile.Characters.Add(ipcCharacter);
|
||||
}*/
|
||||
|
||||
foreach (var template in profile.Templates)
|
||||
{
|
||||
@@ -53,7 +59,6 @@ public class IPCCharacterProfile
|
||||
{
|
||||
var fullProfile = new Profile
|
||||
{
|
||||
Name = $"IPC profile for {profile.CharacterName}",
|
||||
//Character should be set manually
|
||||
CreationDate = DateTimeOffset.UtcNow,
|
||||
ModifiedDate = DateTimeOffset.UtcNow,
|
||||
@@ -63,9 +68,11 @@ public class IPCCharacterProfile
|
||||
ProfileType = isTemporary ? Profiles.Enums.ProfileType.Temporary : Profiles.Enums.ProfileType.Normal
|
||||
};
|
||||
|
||||
fullProfile.Name = $"IPC Profile {fullProfile.UniqueId}";
|
||||
|
||||
var template = new Template
|
||||
{
|
||||
Name = $"{fullProfile.Name}'s template",
|
||||
Name = $"{fullProfile.Name} - template",
|
||||
CreationDate = fullProfile.CreationDate,
|
||||
ModifiedDate = fullProfile.ModifiedDate,
|
||||
UniqueId = Guid.NewGuid(),
|
||||
@@ -137,3 +144,11 @@ public class IPCBoneTransform
|
||||
return rotVec;
|
||||
}
|
||||
}
|
||||
/*
|
||||
public class IPCCharacter
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public ushort WorldId { get; set; }
|
||||
public byte CharacterType { get; set; }
|
||||
public ushort CharacterSubType { get; set; }
|
||||
}*/
|
||||
Reference in New Issue
Block a user