v2/v3 clipboard support
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Numerics;
|
||||
|
||||
namespace CustomizePlus.Configuration.Data.Version2;
|
||||
|
||||
[Serializable]
|
||||
public struct V2BoneEditsContainer
|
||||
{
|
||||
public Vector3 Position { get; set; } = Vector3.Zero;
|
||||
public Vector3 Rotation { get; set; } = Vector3.Zero;
|
||||
public Vector3 Scale { get; set; } = Vector3.One;
|
||||
|
||||
public V2BoneEditsContainer()
|
||||
{
|
||||
}
|
||||
}
|
||||
14
CustomizePlus/Configuration/Data/Version2/Version2Profile.cs
Normal file
14
CustomizePlus/Configuration/Data/Version2/Version2Profile.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace CustomizePlus.Configuration.Data.Version2;
|
||||
|
||||
[Serializable]
|
||||
public class Version2Profile
|
||||
{
|
||||
public static Dictionary<string, bool> BoneVisibility = new();
|
||||
public string CharacterName { get; set; } = string.Empty;
|
||||
public string ScaleName { get; set; } = string.Empty;
|
||||
public bool BodyScaleEnabled { get; set; } = true;
|
||||
public Dictionary<string, V2BoneEditsContainer> Bones { get; set; } = new();
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
using CustomizePlus.Configuration.Data.Version2;
|
||||
using CustomizePlus.Configuration.Data.Version3;
|
||||
using CustomizePlus.Core.Data;
|
||||
using System.Numerics;
|
||||
|
||||
namespace CustomizePlus.Configuration.Helpers;
|
||||
|
||||
internal static class V2ProfileToV3Converter
|
||||
{
|
||||
public static Version3Profile Convert(Version2Profile v2Profile)
|
||||
{
|
||||
Version3Profile newProfile = new()
|
||||
{
|
||||
CharacterName = v2Profile.CharacterName,
|
||||
ProfileName = v2Profile.ScaleName,
|
||||
Enabled = v2Profile.BodyScaleEnabled
|
||||
};
|
||||
|
||||
foreach (var kvp in v2Profile.Bones)
|
||||
{
|
||||
var novelValues = kvp.Value.Position != Vector3.Zero
|
||||
|| kvp.Value.Rotation != Vector3.Zero
|
||||
|| kvp.Value.Scale != Vector3.One;
|
||||
|
||||
if (novelValues || kvp.Key == Constants.RootBoneName)
|
||||
{
|
||||
newProfile.Bones[kvp.Key] = new V3BoneTransform
|
||||
{
|
||||
Translation = kvp.Value.Position,
|
||||
Rotation = kvp.Value.Rotation,
|
||||
Scaling = kvp.Value.Scale
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
return newProfile;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user