* 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
37 lines
982 B
C#
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);
|
|
}
|
|
}
|
|
}
|