@@ -1,51 +0,0 @@
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Client.GameObjects;
|
||||
|
||||
using static Content.Shared.MedicalScanner.SharedMedicalScannerComponent;
|
||||
|
||||
namespace Content.Client.MedicalScanner.UI
|
||||
{
|
||||
[UsedImplicitly]
|
||||
public sealed class MedicalScannerBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
private MedicalScannerWindow? _window;
|
||||
|
||||
public MedicalScannerBoundUserInterface(ClientUserInterfaceComponent owner, object uiKey) : base(owner, uiKey)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void Open()
|
||||
{
|
||||
base.Open();
|
||||
_window = new MedicalScannerWindow
|
||||
{
|
||||
Title = IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(Owner.Owner).EntityName,
|
||||
};
|
||||
_window.OnClose += Close;
|
||||
_window.ScanButton.OnPressed += _ => SendMessage(new ScanButtonPressedMessage());
|
||||
_window.OpenCentered();
|
||||
}
|
||||
|
||||
protected override void UpdateState(BoundUserInterfaceState state)
|
||||
{
|
||||
base.UpdateState(state);
|
||||
|
||||
if (state is not MedicalScannerBoundUserInterfaceState cast)
|
||||
return;
|
||||
|
||||
_window?.Populate(cast);
|
||||
}
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
base.Dispose(disposing);
|
||||
if (!disposing)
|
||||
return;
|
||||
|
||||
if (_window != null)
|
||||
_window.OnClose -= Close;
|
||||
|
||||
_window?.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
<DefaultWindow xmlns="https://spacestation14.io"
|
||||
MinSize="200 100"
|
||||
SetSize="200 100">
|
||||
<BoxContainer Orientation="Vertical">
|
||||
<Label Name="OccupantName"/>
|
||||
<Button Name="ScanButton"
|
||||
Disabled="True"
|
||||
Access="Public"
|
||||
Text="{Loc 'medical-scanner-window-save-button-text'}" />
|
||||
</BoxContainer>
|
||||
</DefaultWindow>
|
||||
@@ -1,22 +0,0 @@
|
||||
using Robust.Client.AutoGenerated;
|
||||
using Robust.Client.UserInterface.CustomControls;
|
||||
using Robust.Client.UserInterface.XAML;
|
||||
|
||||
using static Content.Shared.MedicalScanner.SharedMedicalScannerComponent;
|
||||
|
||||
namespace Content.Client.MedicalScanner.UI
|
||||
{
|
||||
[GenerateTypedNameReferences]
|
||||
public sealed partial class MedicalScannerWindow : DefaultWindow
|
||||
{
|
||||
public MedicalScannerWindow()
|
||||
{
|
||||
RobustXamlLoader.Load(this);
|
||||
}
|
||||
|
||||
public void Populate(MedicalScannerBoundUserInterfaceState state)
|
||||
{
|
||||
ScanButton.Disabled = !state.IsScannable;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user