mirror of
https://github.com/space-wizards/space-station-14.git
synced 2026-06-09 10:06:43 +02:00
5168b5f3d4
* IoC source gen compatibility Can be merged before or after https://github.com/space-wizards/RobustToolbox/pull/6549 doesn't really matter. * Missed a spot
49 lines
1.2 KiB
C#
49 lines
1.2 KiB
C#
using Content.Client.Power.Components;
|
|
using Content.Client.UserInterface.Controls;
|
|
using Robust.Client.AutoGenerated;
|
|
using Robust.Client.UserInterface.Controls;
|
|
using Robust.Client.UserInterface.XAML;
|
|
using Robust.Shared.Timing;
|
|
|
|
namespace Content.Client.Atmos.UI;
|
|
|
|
[GenerateTypedNameReferences]
|
|
public sealed partial class GasThermomachineWindow : FancyWindow
|
|
{
|
|
[Dependency] private IEntityManager _entManager = default!;
|
|
|
|
public FloatSpinBox TemperatureSpinbox;
|
|
|
|
public EntityUid Entity;
|
|
|
|
public GasThermomachineWindow()
|
|
{
|
|
IoCManager.InjectDependencies(this);
|
|
RobustXamlLoader.Load(this);
|
|
|
|
SpinboxHBox.AddChild(
|
|
TemperatureSpinbox = new FloatSpinBox(.1f, 2) { MinWidth = 150, HorizontalExpand = true }
|
|
);
|
|
}
|
|
|
|
public void SetActive(bool active)
|
|
{
|
|
ToggleStatusButton.Pressed = active;
|
|
}
|
|
|
|
public void SetTemperature(float temperature)
|
|
{
|
|
TemperatureSpinbox.Value = temperature;
|
|
}
|
|
|
|
protected override void FrameUpdate(FrameEventArgs args)
|
|
{
|
|
base.FrameUpdate(args);
|
|
|
|
if (_entManager.TryGetComponent(Entity, out ApcPowerReceiverComponent? receiver))
|
|
{
|
|
SetActive(!receiver.PowerDisabled);
|
|
}
|
|
}
|
|
}
|