Fix atmos UI decimal separator bug (#23009)

* Fix atmos UI inconsistent culture usage

* Remove the need to pass localization manager
This commit is contained in:
Kot
2024-01-05 09:18:09 +04:00
committed by GitHub
parent 920d7068e5
commit 3d911a64c7
14 changed files with 117 additions and 19 deletions

View File

@@ -45,7 +45,7 @@ namespace Content.Client.Atmos.UI
SetMaxPressureButton.OnPressed += _ =>
{
MixerPressureOutputInput.Text = Atmospherics.MaxOutputPressure.ToString(CultureInfo.InvariantCulture);
MixerPressureOutputInput.Text = Atmospherics.MaxOutputPressure.ToString(CultureInfo.CurrentCulture);
SetOutputPressureButton.Disabled = false;
};
@@ -69,16 +69,16 @@ namespace Content.Client.Atmos.UI
public void SetOutputPressure(float pressure)
{
MixerPressureOutputInput.Text = pressure.ToString(CultureInfo.InvariantCulture);
MixerPressureOutputInput.Text = pressure.ToString(CultureInfo.CurrentCulture);
}
public void SetNodePercentages(float nodeOne)
{
nodeOne *= 100.0f;
MixerNodeOneInput.Text = nodeOne.ToString("0.##", CultureInfo.InvariantCulture);
MixerNodeOneInput.Text = nodeOne.ToString("0.##", CultureInfo.CurrentCulture);
float nodeTwo = 100.0f - nodeOne;
MixerNodeTwoInput.Text = nodeTwo.ToString("0.##", CultureInfo.InvariantCulture);
MixerNodeTwoInput.Text = nodeTwo.ToString("0.##", CultureInfo.CurrentCulture);
}
public void SetMixerStatus(bool enabled)