Files
tbd-station-14/Content.Client/HealthAnalyzer/UI/HealthAnalyzerBoundUserInterface.cs
Thomas 250628f805 New Health Analyzer UI (#30834)
* WIP: first prototype

* Change text slightly

* Allow names to wrap

* Add label for the scan mode

* Remove ugly text

* Readd bleeding message

* Update code

* Allow for the Health Analyzer UI to grow vertically
2024-08-27 16:57:36 +02:00

38 lines
983 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);
}
}
}