Material generators from Afterlight (#18387)

This commit is contained in:
Nemanja
2023-07-31 14:42:38 -04:00
committed by GitHub
parent b9af7d3668
commit 2d08f02d23
34 changed files with 639 additions and 29 deletions

View File

@@ -0,0 +1,42 @@
using Content.Shared.Power.Generator;
using JetBrains.Annotations;
using Robust.Client.GameObjects;
namespace Content.Client.Power.Generator;
[UsedImplicitly]
public sealed class SolidFuelGeneratorBoundUserInterface : BoundUserInterface
{
private GeneratorWindow? _window;
public SolidFuelGeneratorBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
{
}
protected override void Open()
{
base.Open();
_window = new GeneratorWindow(this, Owner);
_window.OpenCenteredLeft();
_window.OnClose += Close;
}
protected override void UpdateState(BoundUserInterfaceState state)
{
if (state is not SolidFuelGeneratorComponentBuiState msg)
return;
_window?.Update(msg);
}
protected override void Dispose(bool disposing)
{
_window?.Dispose();
}
public void SetTargetPower(int target)
{
SendMessage(new SetTargetPowerMessage(target));
}
}