diff --git a/Content.Client/Humanoid/HumanoidAppearanceSystem.cs b/Content.Client/Humanoid/HumanoidAppearanceSystem.cs index eb5dec8894..5599fa80b8 100644 --- a/Content.Client/Humanoid/HumanoidAppearanceSystem.cs +++ b/Content.Client/Humanoid/HumanoidAppearanceSystem.cs @@ -1,4 +1,5 @@ using System.Linq; // Corvax-Wega-Hair-Extended +using System.Numerics; // Corvax-Wega-Add using Content.Client.DisplacementMap; using Content.Shared.CCVar; using Content.Shared.Humanoid; @@ -44,10 +45,30 @@ public sealed class HumanoidAppearanceSystem : SharedHumanoidAppearanceSystem } } + // Corvax-Wega-Height-start + private float ConvertHeightToScale(float height) + { + const float minH = 140f, maxH = 300f; + const float minS = 0.65f, maxS = 1.5f; + + var t = MathF.Pow((height - minH) / (maxH - minH), 0.7f); + return Math.Clamp(minS + t * (maxS - minS), minS, maxS); + } + + private void ApplyHeightScale(Entity entity) + { + var humanoid = entity.Comp1; + + var scale = ConvertHeightToScale(humanoid.Height); + _sprite.SetScale(entity.Owner, new Vector2(scale, scale)); + } + // Corvax-Wega-Height-end + private void UpdateSprite(Entity entity) { UpdateLayers(entity); ApplyMarkingSet(entity); + ApplyHeightScale(entity); // Corvax-Wega-Height var humanoidAppearance = entity.Comp1; var sprite = entity.Comp2; @@ -226,6 +247,7 @@ public sealed class HumanoidAppearanceSystem : SharedHumanoidAppearanceSystem humanoid.SkinColor = profile.Appearance.SkinColor; humanoid.EyeColor = profile.Appearance.EyeColor; humanoid.Status = profile.Status; // Corvax-Wega + humanoid.Height = profile.Height; // Corvax-Wega-Height UpdateSprite((uid, humanoid, Comp(uid))); } diff --git a/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml b/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml index b38741ab66..56f6b5a90a 100644 --- a/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml +++ b/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml @@ -108,6 +108,17 @@ + + + + + + + +