mirror of
https://github.com/corvax-team/ss14-wl.git
synced 2026-06-09 10:06:46 +02:00
26 lines
834 B
C#
26 lines
834 B
C#
using Content.Server._WL.Security.Components;
|
|
using Content.Shared.Examine;
|
|
using Content.Shared.Inventory;
|
|
|
|
namespace Content.Server._WL.Security.Systems;
|
|
|
|
public sealed partial class SecurityBadgeSystem : EntitySystem
|
|
{
|
|
[Dependency] private InventorySystem _inventorySystem = default!;
|
|
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
|
|
SubscribeLocalEvent<InventoryComponent, ExaminedEvent>(OnExamine);
|
|
}
|
|
|
|
private void OnExamine(EntityUid ent, InventoryComponent comp, ExaminedEvent ev)
|
|
{
|
|
if (!_inventorySystem.TryGetInventoryEntity<SecurityBadgeComponent>((ent, comp), out var badgeEnt) || badgeEnt.Comp == null)
|
|
return;
|
|
|
|
ev.PushMarkup(Loc.GetString("security-badge-component-rank-description", ("loc", Loc.GetString(badgeEnt.Comp.RankLoc))), -2);
|
|
}
|
|
}
|