Add popup for health analyzer target (#29803)

* Add popup for health analyzer target

* addition

* fix showing popup to all
This commit is contained in:
lzk
2024-07-09 10:42:35 +02:00
committed by GitHub
parent 74d9ac7241
commit 061ec432ff
2 changed files with 8 additions and 0 deletions

View 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)