Strip someone through the examine button (#12409)

This commit is contained in:
rolfero
2022-11-06 17:33:17 +01:00
committed by GitHub
parent 50e77a97a7
commit 59349c37a0

View File

@@ -37,6 +37,7 @@ namespace Content.Server.Strip
base.Initialize();
SubscribeLocalEvent<StrippableComponent, GetVerbsEvent<Verb>>(AddStripVerb);
SubscribeLocalEvent<StrippableComponent, GetVerbsEvent<ExamineVerb>>(AddStripExamineVerb);
// BUI
SubscribeLocalEvent<StrippableComponent, StrippingSlotButtonPressed>(OnStripButtonPressed);
@@ -132,6 +133,25 @@ namespace Content.Server.Strip
args.Verbs.Add(verb);
}
private void AddStripExamineVerb(EntityUid uid, StrippableComponent component, GetVerbsEvent<ExamineVerb> args)
{
if (args.Hands == null || !args.CanAccess || !args.CanInteract || args.Target == args.User)
return;
if (!HasComp<ActorComponent>(args.User))
return;
ExamineVerb verb = new()
{
Text = Loc.GetString("strip-verb-get-data-text"),
IconTexture = "/Textures/Interface/VerbIcons/outfit.svg.192dpi.png",
Act = () => StartOpeningStripper(args.User, component, true),
Category = VerbCategory.Examine,
};
args.Verbs.Add(verb);
}
/// <summary>
/// Places item in user's active hand to an inventory slot.
/// </summary>