]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Add popup for health analyzer target (#29803)
authorlzk <124214523+lzk228@users.noreply.github.com>
Tue, 9 Jul 2024 08:42:35 +0000 (10:42 +0200)
committerGitHub <noreply@github.com>
Tue, 9 Jul 2024 08:42:35 +0000 (04:42 -0400)
* Add popup for health analyzer target

* addition

* fix showing popup to all

Content.Server/Medical/HealthAnalyzerSystem.cs
Resources/Locale/en-US/medical/components/health-analyzer-component.ftl

index 7282ea197c988728775f29031054f801d39b60e0..c72cd2ddf6f69428eeb6697f87775556375472c7 100644 (file)
@@ -5,10 +5,12 @@ using Content.Server.PowerCell;
 using Content.Server.Temperature.Components;
 using Content.Shared.Damage;
 using Content.Shared.DoAfter;
+using Content.Shared.IdentityManagement;
 using Content.Shared.Interaction;
 using Content.Shared.Interaction.Events;
 using Content.Shared.MedicalScanner;
 using Content.Shared.Mobs.Components;
+using Content.Shared.Popups;
 using Content.Shared.PowerCell;
 using Robust.Server.GameObjects;
 using Robust.Shared.Audio.Systems;
@@ -27,6 +29,7 @@ public sealed class HealthAnalyzerSystem : EntitySystem
     [Dependency] private readonly SolutionContainerSystem _solutionContainerSystem = default!;
     [Dependency] private readonly UserInterfaceSystem _uiSystem = default!;
     [Dependency] private readonly TransformSystem _transformSystem = default!;
+    [Dependency] private readonly SharedPopupSystem _popupSystem = default!;
 
     public override void Initialize()
     {
@@ -85,6 +88,9 @@ public sealed class HealthAnalyzerSystem : EntitySystem
             NeedHand = true,
             BreakOnMove = true
         });
+
+        var msg = Loc.GetString("health-analyzer-popup-scan-target", ("user", Identity.Entity(args.User, EntityManager)));
+        _popupSystem.PopupEntity(msg, args.Target.Value, args.Target.Value, PopupType.Medium);
     }
 
     private void OnDoAfter(Entity<HealthAnalyzerComponent> uid, ref HealthAnalyzerDoAfterEvent args)
index 8460bcc27b0626029582fb82c1d68a8412728f2c..121e50b923e6c3e67ccfd2de11060bcd90e0f159 100644 (file)
@@ -14,3 +14,5 @@ health-analyzer-window-scan-mode-active = ACTIVE
 health-analyzer-window-scan-mode-inactive = INACTIVE
 
 health-analyzer-window-malnutrition = Severely malnourished
+
+health-analyzer-popup-scan-target = {CAPITALIZE(THE($user))} is trying to scan you!