From 1d4cf48c3176c7dea3ea2b0dfb67bb9b5a8b7e5c Mon Sep 17 00:00:00 2001 From: Helix-ctrl Date: Sun, 15 Jun 2025 23:38:36 +0100 Subject: [PATCH] Add hints towards flash protection to all items which provide it (#37267) * Update welding.yml * Update FlashSystem.cs Add subscriber event for flash immunity examine text * Create flash-immunity-component.ftl * Removed changed description text * change to use entity version * fixed mistake --- Content.Server/Flash/FlashSystem.cs | 8 +++++++- .../en-US/flash/components/flash-immunity-component.ftl | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 Resources/Locale/en-US/flash/components/flash-immunity-component.ftl diff --git a/Content.Server/Flash/FlashSystem.cs b/Content.Server/Flash/FlashSystem.cs index f904678821..30c6491f62 100644 --- a/Content.Server/Flash/FlashSystem.cs +++ b/Content.Server/Flash/FlashSystem.cs @@ -45,7 +45,7 @@ namespace Content.Server.Flash public override void Initialize() { base.Initialize(); - + SubscribeLocalEvent(OnExamine); SubscribeLocalEvent(OnFlashMeleeHit); // ran before toggling light for extra-bright lantern SubscribeLocalEvent(OnFlashUseInHand, before: new[] { typeof(HandheldLightSystem) }); @@ -54,7 +54,13 @@ namespace Content.Server.Flash SubscribeLocalEvent(OnPermanentBlindnessFlashAttempt); SubscribeLocalEvent(OnTemporaryBlindnessFlashAttempt); } + + private void OnExamine(Entity ent, ref ExaminedEvent args) + { + args.PushMarkup(Loc.GetString("flash-protection")); + } + private void OnFlashMeleeHit(EntityUid uid, FlashComponent comp, MeleeHitEvent args) { if (!args.IsHit || diff --git a/Resources/Locale/en-US/flash/components/flash-immunity-component.ftl b/Resources/Locale/en-US/flash/components/flash-immunity-component.ftl new file mode 100644 index 0000000000..72df36d2f4 --- /dev/null +++ b/Resources/Locale/en-US/flash/components/flash-immunity-component.ftl @@ -0,0 +1 @@ +flash-protection = It provides protection from [color=lightblue]bright flashes[/color].