]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Add hints towards flash protection to all items which provide it (#37267)
authorHelix-ctrl <kylemccann08@gmail.com>
Sun, 15 Jun 2025 22:38:36 +0000 (23:38 +0100)
committerGitHub <noreply@github.com>
Sun, 15 Jun 2025 22:38:36 +0000 (18:38 -0400)
* 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
Resources/Locale/en-US/flash/components/flash-immunity-component.ftl [new file with mode: 0644]

index f904678821f13c3e6383526bc19ce791b0414fc2..30c6491f62b6a272f1e4fb2934b733056f5d83c1 100644 (file)
@@ -45,7 +45,7 @@ namespace Content.Server.Flash
         public override void Initialize()
         {
             base.Initialize();
-
+            SubscribeLocalEvent<FlashImmunityComponent, ExaminedEvent>(OnExamine);
             SubscribeLocalEvent<FlashComponent, MeleeHitEvent>(OnFlashMeleeHit);
             // ran before toggling light for extra-bright lantern
             SubscribeLocalEvent<FlashComponent, UseInHandEvent>(OnFlashUseInHand, before: new[] { typeof(HandheldLightSystem) });
@@ -54,7 +54,13 @@ namespace Content.Server.Flash
             SubscribeLocalEvent<PermanentBlindnessComponent, FlashAttemptEvent>(OnPermanentBlindnessFlashAttempt);
             SubscribeLocalEvent<TemporaryBlindnessComponent, FlashAttemptEvent>(OnTemporaryBlindnessFlashAttempt);
         }
+        
+        private void OnExamine(Entity<FlashImmunityComponent> 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 (file)
index 0000000..72df36d
--- /dev/null
@@ -0,0 +1 @@
+flash-protection = It provides protection from [color=lightblue]bright flashes[/color].