]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Examination verb for insuls (#42444)
authorInsoPL <lukasz.lindert@protonmail.com>
Tue, 20 Jan 2026 15:46:49 +0000 (16:46 +0100)
committerGitHub <noreply@github.com>
Tue, 20 Jan 2026 15:46:49 +0000 (15:46 +0000)
* feat

* only clothing

* fix

* Revert "fix"

This reverts commit 858c3f882718cd003391e0fde6b2711b31e6ab54.

* fix

* reversal

* removed double namespace

Content.Shared/Electrocution/InsulatedSystem.cs [new file with mode: 0644]
Resources/Locale/en-US/clothing/components/insulated-component.ftl [new file with mode: 0644]

diff --git a/Content.Shared/Electrocution/InsulatedSystem.cs b/Content.Shared/Electrocution/InsulatedSystem.cs
new file mode 100644 (file)
index 0000000..7cd4913
--- /dev/null
@@ -0,0 +1,33 @@
+using Content.Shared.Clothing.Components;
+using Content.Shared.Examine;
+using Content.Shared.Verbs;
+
+namespace Content.Shared.Electrocution;
+
+public sealed class InsulatedSystem : EntitySystem
+{
+    [Dependency] private readonly ExamineSystemShared _examine = default!;
+
+    /// <inheritdoc />
+    public override void Initialize()
+    {
+        base.Initialize();
+
+        SubscribeLocalEvent<InsulatedComponent, GetVerbsEvent<ExamineVerb>>(OnDetailedExamine);
+    }
+
+    private void OnDetailedExamine(EntityUid ent, InsulatedComponent component, ref GetVerbsEvent<ExamineVerb> args)
+    {
+        if (!HasComp<ClothingComponent>(ent))
+            return;
+
+        var iconTexture = "/Textures/Interface/VerbIcons/zap.svg.192dpi.png";
+
+        _examine.AddHoverExamineVerb(args,
+            component,
+            Loc.GetString("identity-block-examinable-verb-text"),
+            Loc.GetString("identity-block-examinable-verb-text-message"),
+            iconTexture
+        );
+    }
+}
diff --git a/Resources/Locale/en-US/clothing/components/insulated-component.ftl b/Resources/Locale/en-US/clothing/components/insulated-component.ftl
new file mode 100644 (file)
index 0000000..30c7e98
--- /dev/null
@@ -0,0 +1,2 @@
+identity-block-examinable-verb-text = Insulatated
+identity-block-examinable-verb-text-message = This item appears to be electrically insulated. It should protect the wearer from shocks.