GasThermomachineWindow.xaml.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. using Robust.Client.AutoGenerated;
  2. using Robust.Client.UserInterface.Controls;
  3. using Robust.Client.UserInterface.CustomControls;
  4. using Robust.Client.UserInterface.XAML;
  5. namespace Content.Client.Atmos.UI;
  6. [GenerateTypedNameReferences]
  7. public sealed partial class GasThermomachineWindow : DefaultWindow
  8. {
  9. public bool Active = true;
  10. public FloatSpinBox TemperatureSpinbox;
  11. public GasThermomachineWindow()
  12. {
  13. RobustXamlLoader.Load(this);
  14. SpinboxHBox.AddChild(
  15. TemperatureSpinbox = new FloatSpinBox(.1f, 2) { MinWidth = 150, HorizontalExpand = true }
  16. );
  17. }
  18. public void SetActive(bool active)
  19. {
  20. Active = active;
  21. if (active)
  22. {
  23. ToggleStatusButton.Text = Loc.GetString("comp-gas-thermomachine-ui-status-enabled");
  24. ToggleStatusButton.Pressed = true;
  25. }
  26. else
  27. {
  28. ToggleStatusButton.Text = Loc.GetString("comp-gas-thermomachine-ui-status-disabled");
  29. ToggleStatusButton.Pressed = false;
  30. }
  31. }
  32. public void SetTemperature(float temperature)
  33. {
  34. TemperatureSpinbox.Value = temperature;
  35. }
  36. }