private void OnGetActions(EntityUid uid, MaskComponent component, GetItemActionsEvent args) { if (component.ToggleAction != null && !args.InHands) { args.Actions.Add(component.ToggleAction); } }
private void OnHandEquipped(EntityUid uid, ActionsComponent component, DidEquipHandEvent args) { var ev = new GetItemActionsEvent(); RaiseLocalEvent(args.Equipped, ev, false); if (ev.Actions.Count == 0) { return; } AddActions(args.User, ev.Actions, args.Equipped, component); }
private void OnDidEquip(EntityUid uid, ActionsComponent component, DidEquipEvent args) { var ev = new GetItemActionsEvent(args.SlotFlags); RaiseLocalEvent(args.Equipment, ev, false); if (ev.Actions.Count == 0) { return; } AddActions(args.Equipee, ev.Actions, args.Equipment, component); }
private void OnGetActions(EntityUid uid, BlockingComponent component, GetItemActionsEvent args) { if (component.BlockingToggleAction == null && _proto.TryIndex(component.BlockingToggleActionId, out InstantActionPrototype? act)) { component.BlockingToggleAction = new(act); } if (component.BlockingToggleAction != null) { args.Actions.Add(component.BlockingToggleAction); } }
private void OnJetpackGetAction(EntityUid uid, JetpackComponent component, GetItemActionsEvent args) { args.Actions.Add(component.ToggleAction); }
private void OnGetActions(EntityUid uid, GasTankComponent component, GetItemActionsEvent args) { args.Actions.Add(component.ToggleAction); }
private void OnGetActions(EntityUid uid, StethoscopeComponent component, GetItemActionsEvent args) { args.Actions.Add(component.Action); }
private void OnGetActions(EntityUid uid, UnpoweredFlashlightComponent component, GetItemActionsEvent args) { args.Actions.Add(component.ToggleAction); }
private void OnGetActions(EntityUid uid, SharedMagbootsComponent component, GetItemActionsEvent args) { args.Actions.Add(component.ToggleAction); }