From cc8105bbade552885776e4c1a3fb07cad3c204d8 Mon Sep 17 00:00:00 2001 From: Fansana Date: Sun, 15 Dec 2024 23:23:41 +0100 Subject: [PATCH] actually fix sliders --- .../Lobby/UI/HumanoidProfileEditor.xaml.cs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs b/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs index e2782239bc7..48e7eaeb6b3 100644 --- a/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs +++ b/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs @@ -1365,14 +1365,16 @@ private void UpdateHeightWidthSliders() return; var species = _species.Find(x => x.ID == Profile?.Species) ?? _species.First(); - - HeightSlider.MinValue = species.MinHeight; - HeightSlider.MaxValue = species.MaxHeight; - HeightSlider.SetValueWithoutEvent(Profile?.Height ?? species.DefaultHeight); + var width1 = Profile?.Width ?? species.DefaultHeight; + var height1 = Profile?.Height ?? species.DefaultHeight; WidthSlider.MinValue = species.MinWidth; WidthSlider.MaxValue = species.MaxWidth; - WidthSlider.SetValueWithoutEvent(Profile?.Width ?? species.DefaultWidth); + WidthSlider.SetValueWithoutEvent(width1); + + HeightSlider.MinValue = species.MinHeight; + HeightSlider.MaxValue = species.MaxHeight; + HeightSlider.SetValueWithoutEvent(height1); var height = MathF.Round(species.AverageHeight * HeightSlider.Value); HeightLabel.Text = Loc.GetString("humanoid-profile-editor-height-label", ("height", (int) height)); @@ -1410,9 +1412,6 @@ private void UpdateDimensions(SliderUpdate updateType) if (ratio < 1 / sizeRatio || ratio > sizeRatio) heightValue = widthValue * (ratio < 1 / sizeRatio ? (1 / sizeRatio) : sizeRatio); - heightValue = Math.Clamp(heightValue, species.MinHeight, species.MaxHeight); - widthValue = Math.Clamp(widthValue, species.MinWidth, species.MaxWidth); - HeightSlider.Value = heightValue; WidthSlider.Value = widthValue;