]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Hide ugly float to string conversion results from players in the mixer UI (#15183)
authorDawid Bla <46636558+DawBla@users.noreply.github.com>
Sun, 9 Apr 2023 01:34:27 +0000 (03:34 +0200)
committerGitHub <noreply@github.com>
Sun, 9 Apr 2023 01:34:27 +0000 (18:34 -0700)
Content.Client/Atmos/UI/GasMixerBoundUserInteface.cs
Content.Client/Atmos/UI/GasMixerWindow.xaml.cs

index aca4835bf2b7da330ec145b885847eb799e2d76a..dc7a4dc903f425cb291915714bd883fa52a21d3a 100644 (file)
@@ -60,7 +60,7 @@ namespace Content.Client.Atmos.UI
             // We don't need to send both nodes because it's just 100.0f - node
             float node = float.TryParse(value, out var parsed) ? parsed : 1.0f;
 
-            node = Math.Clamp(node, 0, 100);
+            node = Math.Clamp(node, 0f, 100.0f);
 
             if (_window is not null) node = _window.NodeOneLastEdited ? node : 100.0f - node;
 
index 009f4d29beed79e397d81b0d3a55a483aa966075..f3f8293bc816737fdc1dcebd552ab3023f5aa5b3 100644 (file)
@@ -75,10 +75,10 @@ namespace Content.Client.Atmos.UI
         public void SetNodePercentages(float nodeOne)
         {
             nodeOne *= 100.0f;
-            MixerNodeOneInput.Text = nodeOne.ToString(CultureInfo.InvariantCulture);
+            MixerNodeOneInput.Text = nodeOne.ToString("0.##", CultureInfo.InvariantCulture);
 
             float nodeTwo = 100.0f - nodeOne;
-            MixerNodeTwoInput.Text = nodeTwo.ToString(CultureInfo.InvariantCulture);
+            MixerNodeTwoInput.Text = nodeTwo.ToString("0.##", CultureInfo.InvariantCulture);
         }
 
         public void SetMixerStatus(bool enabled)