Reapply "Merge pull request #253 from frosty-dev/CRAB17"

This reverts commit add7181afb.
This commit is contained in:
BIGZi0348
2025-01-28 20:59:44 +03:00
parent 48f5e15896
commit 5454018b40
2 changed files with 17 additions and 0 deletions

View File

@@ -1,5 +1,6 @@
using Content.Shared._White.Economy;
using Content.Shared.DoAfter;
using Content.Shared.Examine;
using Content.Shared.Interaction;
using Content.Shared.Interaction.Events;
using Content.Shared.Popups;
@@ -22,6 +23,7 @@ public abstract class SharedProtocolCRAB17System : EntitySystem
SubscribeLocalEvent<ProtocolCRAB17Component, UseInHandEvent>(OnUseInHand);
SubscribeLocalEvent<ProtocolCRAB17Component, ProtocolCRAB17DoAfterEvent>(OnDoAfter);
SubscribeLocalEvent<ProtocolCRAB17Component, InteractUsingEvent>(OnInteractUsing);
SubscribeLocalEvent<ProtocolCRAB17Component, ExaminedEvent>(OnExamine);
}
private void OnInteractUsing(EntityUid uid, ProtocolCRAB17Component component, InteractUsingEvent args)
@@ -66,6 +68,20 @@ public abstract class SharedProtocolCRAB17System : EntitySystem
args.Handled = true;
}
private void OnExamine(EntityUid uid, ProtocolCRAB17Component component, ExaminedEvent args)
{
if (!TryComp<ProtocolCRAB17Component>(uid, out var comp))
return;
if (!args.IsInDetailsRange)
return;
string bankID = component.BankAccountId != null ? ((int) component.BankAccountId).ToString() : "отсутствует";
var message = Loc.GetString("protocol-CRAB17-cardID", ("item", bankID));
args.PushMarkup(message);
}
public abstract void OnDoAfter(Entity<ProtocolCRAB17Component> ent, ref ProtocolCRAB17DoAfterEvent args);
}