SubscribeLocalEvent<AttachedClothingComponent, InteractHandEvent>(OnInteractHand);
SubscribeLocalEvent<AttachedClothingComponent, GotUnequippedEvent>(OnAttachedUnequip);
SubscribeLocalEvent<AttachedClothingComponent, ComponentRemove>(OnRemoveAttached);
+ SubscribeLocalEvent<AttachedClothingComponent, BeingUnequippedAttemptEvent>(OnAttachedUnequipAttempt);
SubscribeLocalEvent<ToggleableClothingComponent, InventoryRelayedEvent<GetVerbsEvent<EquipmentVerb>>>(GetRelayedVerbs);
SubscribeLocalEvent<ToggleableClothingComponent, GetVerbsEvent<EquipmentVerb>>(OnGetVerbs);
QueueDel(component.ClothingUid.Value);
}
+ private void OnAttachedUnequipAttempt(EntityUid uid, AttachedClothingComponent component, BeingUnequippedAttemptEvent args)
+ {
+ args.Cancel();
+ }
+
private void OnRemoveAttached(EntityUid uid, AttachedClothingComponent component, ComponentRemove args)
{
// if the attached component is being removed (maybe entity is being deleted?) we will just remove the
var parent = Transform(target).ParentUid;
if (component.Container.ContainedEntity == null)
- _inventorySystem.TryUnequip(user, parent, component.Slot);
+ _inventorySystem.TryUnequip(user, parent, component.Slot, force: true);
else if (_inventorySystem.TryGetSlotEntity(parent, component.Slot, out var existing))
{
_popupSystem.PopupClient(Loc.GetString("toggleable-clothing-remove-first", ("entity", existing)),