Thermomachine UI (#6833)
This commit is contained in:
41
Content.Client/Atmos/UI/GasThermomachineWindow.xaml.cs
Normal file
41
Content.Client/Atmos/UI/GasThermomachineWindow.xaml.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
using Robust.Client.AutoGenerated;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
using Robust.Client.UserInterface.CustomControls;
|
||||
using Robust.Client.UserInterface.XAML;
|
||||
|
||||
namespace Content.Client.Atmos.UI;
|
||||
|
||||
[GenerateTypedNameReferences]
|
||||
public sealed partial class GasThermomachineWindow : DefaultWindow
|
||||
{
|
||||
public bool Active = true;
|
||||
|
||||
public FloatSpinBox TemperatureSpinbox;
|
||||
|
||||
public GasThermomachineWindow()
|
||||
{
|
||||
RobustXamlLoader.Load(this);
|
||||
|
||||
SpinboxHBox.AddChild(
|
||||
TemperatureSpinbox = new FloatSpinBox(.1f, 2) { MaxWidth = 150, HorizontalExpand = true }
|
||||
);
|
||||
}
|
||||
|
||||
public void SetActive(bool active)
|
||||
{
|
||||
Active = active;
|
||||
if (active)
|
||||
{
|
||||
ToggleStatusButton.Text = Loc.GetString("comp-gas-thermomachine-ui-status-enabled");
|
||||
}
|
||||
else
|
||||
{
|
||||
ToggleStatusButton.Text = Loc.GetString("comp-gas-thermomachine-ui-status-disabled");
|
||||
}
|
||||
}
|
||||
|
||||
public void SetTemperature(float temperature)
|
||||
{
|
||||
TemperatureSpinbox.Value = temperature;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user