Ejemplo n.º 1
0
 private void UpdatePDAAppearance(PDAComponent pda)
 {
     if (TryComp(pda.Owner, out AppearanceComponent ? appearance))
     {
         appearance.SetData(PDAVisuals.IDCardInserted, pda.ContainedID != null);
     }
 }
Ejemplo n.º 2
0
        protected virtual void OnItemRemoved(EntityUid uid, PDAComponent pda, EntRemovedFromContainerMessage args)
        {
            if (args.Container.ID == pda.IdSlot.ID)
            {
                pda.ContainedID = null;
            }

            UpdatePDAAppearance(pda);
        }
Ejemplo n.º 3
0
        protected virtual void OnItemInserted(EntityUid uid, PDAComponent pda, EntInsertedIntoContainerMessage args)
        {
            if (args.Container.ID == PDAComponent.PDAIdSlotId)
            {
                pda.ContainedID = CompOrNull <IdCardComponent>(args.Entity);
            }

            UpdatePDAAppearance(pda);
        }
Ejemplo n.º 4
0
        protected virtual void OnComponentInit(EntityUid uid, PDAComponent pda, ComponentInit args)
        {
            if (pda.IdCard != null)
            {
                pda.IdSlot.StartingItem = pda.IdCard;
            }

            ItemSlotsSystem.AddItemSlot(uid, PDAComponent.PDAIdSlotId, pda.IdSlot);
            ItemSlotsSystem.AddItemSlot(uid, PDAComponent.PDAPenSlotId, pda.PenSlot);

            UpdatePDAAppearance(pda);
        }
Ejemplo n.º 5
0
        protected virtual void OnItemInserted(EntityUid uid, PDAComponent pda, EntInsertedIntoContainerMessage args)
        {
            if (!pda.Initialized)
            {
                return;
            }

            if (args.Container.ID == pda.IdSlot.ID)
            {
                pda.ContainedID = CompOrNull <IdCardComponent>(args.Entity);
            }

            UpdatePDAAppearance(pda);
        }
Ejemplo n.º 6
0
 private void OnComponentRemove(EntityUid uid, PDAComponent pda, ComponentRemove args)
 {
     ItemSlotsSystem.RemoveItemSlot(uid, pda.IdSlot);
     ItemSlotsSystem.RemoveItemSlot(uid, pda.PenSlot);
 }