diff --git a/Content.Client/Lobby/UI/HumanoidProfileEditor.Appearance.cs b/Content.Client/Lobby/UI/HumanoidProfileEditor.Appearance.cs index 6434aa5be99..6d92a109457 100644 --- a/Content.Client/Lobby/UI/HumanoidProfileEditor.Appearance.cs +++ b/Content.Client/Lobby/UI/HumanoidProfileEditor.Appearance.cs @@ -9,6 +9,8 @@ using Content.Shared.Preferences; using Robust.Client.UserInterface.Controls; using Robust.Shared.Enums; using Robust.Shared.Prototypes; +using Content.Client._CD.Records.UI; // DeltaV +using Content.Shared._DV.Body.Systems; // DeltaV namespace Content.Client.Lobby.UI; @@ -193,6 +195,7 @@ public sealed partial class HumanoidProfileEditor RefreshLoadouts(); UpdateSexControls(); // update sex for new species UpdateSpeciesGuidebookIcon(); + UpdateHeightControls(); // DeltaV ReloadPreview(); } @@ -204,23 +207,22 @@ public sealed partial class HumanoidProfileEditor ReloadProfilePreview(); } - private void UpdateHeightControls() { if (Profile == null) - { return; - } - var species = _species.Find(x => x.ID == Profile.Species); - if (species != null) - _defaultHeight = species.DefaultHeight; + var prototype = _prototypeManager.Index(Profile.Species); + _defaultHeight = prototype.DefaultHeight; - var prototype = _prototypeManager.Index(Profile.Species); var sliderPercent = (Profile.Height - prototype.MinHeight) / (prototype.MaxHeight - prototype.MinHeight); CDHeightSlider.Value = sliderPercent; - CDHeight.Text = Profile.Height.ToString(CultureInfo.InvariantCulture); + + var scaleReference = _defaultHeight * prototype.BaseScale.Y; + var newHeight = MathF.Round(MathHelper.Lerp(prototype.MinHeight, prototype.MaxHeight, sliderPercent), 2); + CDHeightLabel.Text = UnitConversion.GetMetricAndImperialDisplayFromScale(scaleReference * newHeight); + CDPullSpeedReductionLabel.Text = SmallCharacterSystem.GetPullSpeedPenaltyDisplayFromScale(newHeight); } // End CD - Character Records diff --git a/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml b/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml index 06a33cd01b1..e0c9f1544aa 100644 --- a/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml +++ b/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml @@ -73,9 +73,13 @@