Skip to content

Commit

Permalink
Add popup for health analyzer target (space-wizards#29803)
Browse files Browse the repository at this point in the history
* Add popup for health analyzer target

* addition

* fix showing popup to all
  • Loading branch information
lzk228 authored Jul 9, 2024
1 parent 74d9ac7 commit 061ec43
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Content.Server/Medical/HealthAnalyzerSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
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;
Expand All @@ -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()
{
Expand Down Expand Up @@ -85,6 +88,9 @@ private void OnAfterInteract(Entity<HealthAnalyzerComponent> uid, ref AfterInter
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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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!

0 comments on commit 061ec43

Please sign in to comment.