v2/v3 clipboard support

This commit is contained in:
RisaDev
2024-02-04 22:26:40 +03:00
parent 74fd503272
commit 695375d93c
6 changed files with 139 additions and 24 deletions

View File

@@ -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;
}
}