Skip to content

Commit

Permalink
use string manipulation instead of Regex
Browse files Browse the repository at this point in the history
what was I thinking??
  • Loading branch information
DEATHB4DEFEAT committed Feb 5, 2024
1 parent 9ab6799 commit 5dcb908
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions Content.Client/Preferences/UI/HumanoidProfileEditor.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,7 @@ public HumanoidProfileEditor(IClientPreferencesManager preferencesManager, IProt
prototype = _speciesList.Find(x => x.ID == Profile.Species) ?? _speciesList.First(); // Just in case

var value = Math.Clamp(args.Value, prototype.MinHeight, prototype.MaxHeight);
var stringValue = Regex.Replace(value.ToString(CultureInfo.InvariantCulture), @"\.([0-9][0-9]).*", ".$1"); // Hide the extra decimals
CHeightLabel.Text = Loc.GetString("humanoid-profile-editor-height-label", ("height", stringValue));
CHeightLabel.Text = Loc.GetString("humanoid-profile-editor-height-label", ("height", Profile.Height.ToString().Remove(4)));
SetProfileHeight(value);
};

Expand Down Expand Up @@ -1060,8 +1059,7 @@ private void UpdateHeightControls()
_heightSlider.MinValue = species.MinHeight;
_heightSlider.Value = Profile.Height;
_heightSlider.MaxValue = species.MaxHeight;
var stringValue = Regex.Replace(Profile.Height.ToString(CultureInfo.InvariantCulture), @"\.([0-9][0-9]).*", ".$1"); // Hide the extra decimals
CHeightLabel.Text = Loc.GetString("humanoid-profile-editor-height-label", ("height", stringValue));
CHeightLabel.Text = Loc.GetString("humanoid-profile-editor-height-label", ("height", Profile.Height.ToString().Remove(4)));
}
// Parkstation-HeightSlider End

Expand Down

0 comments on commit 5dcb908

Please sign in to comment.