mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-20 06:58:55 +03:00
# 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>
78 lines
2.6 KiB
C#
78 lines
2.6 KiB
C#
using Content.Client.UserInterface.Controls;
|
|
using Content.Shared.Damage;
|
|
using Content.Shared.IdentityManagement;
|
|
using Content.Shared.Medical;
|
|
using Robust.Client.AutoGenerated;
|
|
using Robust.Client.UserInterface.XAML;
|
|
using System.Text;
|
|
|
|
|
|
namespace Content.Client.Eye.PenLight.UI
|
|
{
|
|
[GenerateTypedNameReferences]
|
|
public sealed partial class PenLightWindow : FancyWindow
|
|
{
|
|
private readonly IEntityManager _entityManager;
|
|
private const int LightHeight = 150;
|
|
private const int LightWidth = 900;
|
|
|
|
public PenLightWindow()
|
|
{
|
|
RobustXamlLoader.Load(this);
|
|
|
|
var dependencies = IoCManager.Instance!;
|
|
_entityManager = dependencies.Resolve<IEntityManager>();
|
|
}
|
|
public void Diagnose(PenLightUserMessage msg)
|
|
{
|
|
var target = _entityManager.GetEntity(msg.TargetEntity);
|
|
|
|
if (target == null || !_entityManager.TryGetComponent<DamageableComponent>(target, out var damageable))
|
|
{
|
|
NoPatientDataText.Visible = true;
|
|
ExamDataLabel.Text = string.Empty;
|
|
return;
|
|
}
|
|
|
|
NoPatientDataText.Visible = false;
|
|
|
|
|
|
string entityName = Loc.GetString("pen-light-window-entity-unknown-text");
|
|
if (_entityManager.HasComponent<MetaDataComponent>(target.Value))
|
|
entityName = Identity.Name(target.Value, _entityManager);
|
|
|
|
var sb = new StringBuilder();
|
|
sb.AppendLine(Loc.GetString("pen-light-window-entity-eyes-text", ("entityName", entityName)));
|
|
|
|
// Check if Blind and return early if true
|
|
if (msg.Blind == true)
|
|
{
|
|
sb.AppendLine(Loc.GetString("pen-light-exam-blind-text"));
|
|
ExamDataLabel.Text = sb.ToString();
|
|
SetHeight = LightHeight;
|
|
SetWidth = LightWidth;
|
|
return;
|
|
}
|
|
// EyeDamage
|
|
if (msg.EyeDamage == true)
|
|
sb.AppendLine(Loc.GetString("pen-light-exam-eyedamage-text"));
|
|
|
|
// Drunk
|
|
if (msg.Drunk == true)
|
|
sb.AppendLine(Loc.GetString("pen-light-exam-drunk-text"));
|
|
|
|
// Hallucinating
|
|
if (msg.SeeingRainbows == true)
|
|
sb.AppendLine(Loc.GetString("pen-light-exam-hallucinating-text"));
|
|
|
|
// Healthy
|
|
if (msg.Healthy == true)
|
|
sb.AppendLine(Loc.GetString("pen-light-exam-healthy-text"));
|
|
|
|
ExamDataLabel.Text = sb.ToString();
|
|
|
|
SetHeight = LightHeight;
|
|
SetWidth = LightWidth;
|
|
}
|
|
}
|
|
} |