Files
wwdpublic/Content.Client/Eye/PenLight/UI/PenLightBoundUserInterface.cs
SleepyScarecrow 04d01f687f Added Penlights (#567)
# Description

Added in penlights that spawn in Medical Staff PDAs.

---

# TODO

- [x] EyeCheck system
- [x] Add in the bloody pens.

---


<details><summary><h1>Media</h1></summary>
<p>


https://github.com/user-attachments/assets/dc746aa2-782e-4d86-b9ef-9e012343fb87


</p>
</details>

---

# Changelog

🆑 Tilkku
- add: Added Pen Lights
- add: Eye Examination

---------

Signed-off-by: SleepyScarecrow <136123749+SleepyScarecrow@users.noreply.github.com>
Co-authored-by: VMSolidus <evilexecutive@gmail.com>
2024-08-06 22:51:21 +01:00

48 lines
1.2 KiB
C#

using Content.Shared.Medical;
using JetBrains.Annotations;
using Robust.Client.GameObjects;
namespace Content.Client.Eye.PenLight.UI
{
[UsedImplicitly]
public sealed class PenLightBoundUserInterface : BoundUserInterface
{
[ViewVariables]
private PenLightWindow? _window;
public PenLightBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey) { }
protected override void Open()
{
base.Open();
_window = new PenLightWindow
{
Title = EntMan.GetComponent<MetaDataComponent>(Owner).EntityName,
};
_window.OnClose += Close;
_window.OpenCentered();
}
protected override void ReceiveMessage(BoundUserInterfaceMessage message)
{
if (_window == null
|| message is not PenLightUserMessage cast)
return;
_window.Diagnose(cast);
}
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
if (!disposing)
return;
if (_window != null)
_window.OnClose -= Close;
_window?.Dispose();
}
}
}