コード例 #1
0
    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);
    }
コード例 #2
0
    private void OnEntInserted(EntityUid uid, InventoryComponent component, EntInsertedIntoContainerMessage args)
    {
        if (!TryGetSlot(uid, args.Container.ID, out var slotDef, inventory: component))
        {
            return;
        }

        var equippedEvent = new DidEquipEvent(uid, args.Entity, slotDef);

        RaiseLocalEvent(uid, equippedEvent);

        var gotEquippedEvent = new GotEquippedEvent(uid, args.Entity, slotDef);

        RaiseLocalEvent(args.Entity, gotEquippedEvent);
    }
コード例 #3
0
 private void OnDidEquip(EntityUid uid, StrippableComponent component, DidEquipEvent args)
 {
     SendUpdate(uid, component);
 }