Hide ugly float to string conversion results from players in the mixer UI (#15183)
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user