/// <summary> /// Calls UnequippedHand on all components that implement the IUnequippedHand interface /// on an item. /// </summary> public void UnequippedHandInteraction(IEntity user, IEntity item, HandState hand) { var unequippedHandMessage = new UnequippedHandEvent(user, item, hand); RaiseLocalEvent(item.Uid, unequippedHandMessage); if (unequippedHandMessage.Handled) { return; } var comps = item.GetAllComponents <IUnequippedHand>().ToList(); foreach (var comp in comps) { comp.UnequippedHand(new UnequippedHandEventArgs(user, hand)); } }
/// <summary> /// Calls UnequippedHand on all components that implement the IUnequippedHand interface /// on an item. /// </summary> public void UnequippedHandInteraction(EntityUid user, EntityUid item, HandState hand) { var unequippedHandMessage = new UnequippedHandEvent(user, item, hand); RaiseLocalEvent(item, unequippedHandMessage); if (unequippedHandMessage.Handled) { return; } var comps = EntityManager.GetComponents <IUnequippedHand>(item).ToList(); foreach (var comp in comps) { comp.UnequippedHand(new UnequippedHandEventArgs(user, hand)); } }
// If the virtual pull gets removed from the hands for any reason, cancel the pull and delete it. private void HandlePullerUnequipped(EntityUid uid, HandVirtualPullComponent component, UnequippedHandEvent args) { MaybeDelete(component, args.User); }
// If the virtual item gets removed from the hands for any reason, cancel the pull and delete it. private void HandleItemUnequipped(EntityUid uid, HandVirtualItemComponent component, UnequippedHandEvent args) { Delete(component, args.User.Uid); }
private void OnHandUnequipped(EntityUid uid, ItemActionsComponent component, UnequippedHandEvent args) { component.UnequippedHand(); }