Replace IClickAlert with events (#30728)
* Replace IAlertClick with events * whoop * eek!
This commit is contained in:
@@ -66,6 +66,7 @@ namespace Content.Shared.Cuffs
|
||||
SubscribeLocalEvent<CuffableComponent, RejuvenateEvent>(OnRejuvenate);
|
||||
SubscribeLocalEvent<CuffableComponent, ComponentInit>(OnStartup);
|
||||
SubscribeLocalEvent<CuffableComponent, AttemptStopPullingEvent>(HandleStopPull);
|
||||
SubscribeLocalEvent<CuffableComponent, RemoveCuffsAlertEvent>(OnRemoveCuffsAlert);
|
||||
SubscribeLocalEvent<CuffableComponent, UpdateCanMoveEvent>(HandleMoveAttempt);
|
||||
SubscribeLocalEvent<CuffableComponent, IsEquippingAttemptEvent>(OnEquipAttempt);
|
||||
SubscribeLocalEvent<CuffableComponent, IsUnequippingAttemptEvent>(OnUnequipAttempt);
|
||||
@@ -248,6 +249,14 @@ namespace Content.Shared.Cuffs
|
||||
args.Cancelled = true;
|
||||
}
|
||||
|
||||
private void OnRemoveCuffsAlert(Entity<CuffableComponent> ent, ref RemoveCuffsAlertEvent args)
|
||||
{
|
||||
if (args.Handled)
|
||||
return;
|
||||
TryUncuff(ent, ent, cuffable: ent.Comp);
|
||||
args.Handled = true;
|
||||
}
|
||||
|
||||
private void AddUncuffVerb(EntityUid uid, CuffableComponent component, GetVerbsEvent<Verb> args)
|
||||
{
|
||||
// Can the user access the cuffs, and is there even anything to uncuff?
|
||||
|
||||
Reference in New Issue
Block a user