Hide ugly float to string conversion results from players in the mixer UI (#15183)

This commit is contained in:
Dawid Bla
2023-04-09 03:34:27 +02:00
committed by GitHub
parent c35acd2e0c
commit 00f847186f
2 changed files with 3 additions and 3 deletions

View 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 // 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; 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; if (_window is not null) node = _window.NodeOneLastEdited ? node : 100.0f - node;

View File

@@ -75,10 +75,10 @@ namespace Content.Client.Atmos.UI
public void SetNodePercentages(float nodeOne) public void SetNodePercentages(float nodeOne)
{ {
nodeOne *= 100.0f; nodeOne *= 100.0f;
MixerNodeOneInput.Text = nodeOne.ToString(CultureInfo.InvariantCulture); MixerNodeOneInput.Text = nodeOne.ToString("0.##", CultureInfo.InvariantCulture);
float nodeTwo = 100.0f - nodeOne; float nodeTwo = 100.0f - nodeOne;
MixerNodeTwoInput.Text = nodeTwo.ToString(CultureInfo.InvariantCulture); MixerNodeTwoInput.Text = nodeTwo.ToString("0.##", CultureInfo.InvariantCulture);
} }
public void SetMixerStatus(bool enabled) public void SetMixerStatus(bool enabled)