Files
tbd-station-14/Content.Client/HealthAnalyzer/UI/HealthAnalyzerBoundUserInterface.cs
metalgearsloth cbf329a82d Remove some BUI boilerplate (#28399)
* Remove some BUI boilerplate

- The disposals overrides got removed due to the helper method handling it.
- Replace window creation with CreateWindow helper.
- Fixed some stinky code which would cause exceptions.

* More

* moar

* weh

* done

* More BUIs

* More updates

* weh

* moar

* look who it is

* weh

* merge

* weh

* fixes
2024-07-20 15:40:16 +10:00

37 lines
982 B
C#

using Content.Shared.MedicalScanner;
using JetBrains.Annotations;
using Robust.Client.UserInterface;
namespace Content.Client.HealthAnalyzer.UI
{
[UsedImplicitly]
public sealed class HealthAnalyzerBoundUserInterface : BoundUserInterface
{
[ViewVariables]
private HealthAnalyzerWindow? _window;
public HealthAnalyzerBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
{
}
protected override void Open()
{
base.Open();
_window = this.CreateWindow<HealthAnalyzerWindow>();
_window.Title = EntMan.GetComponent<MetaDataComponent>(Owner).EntityName;
}
protected override void ReceiveMessage(BoundUserInterfaceMessage message)
{
if (_window == null)
return;
if (message is not HealthAnalyzerScannedUserMessage cast)
return;
_window.Populate(cast);
}
}
}