ItemSlotEvents.cs 925 B

1234567891011121314151617181920212223242526272829303132
  1. using Robust.Shared.Serialization;
  2. namespace Content.Shared.Containers.ItemSlots;
  3. /// <summary>
  4. /// Used for various "eject this item" buttons.
  5. /// </summary>
  6. [Serializable, NetSerializable]
  7. public sealed class ItemSlotButtonPressedEvent : BoundUserInterfaceMessage
  8. {
  9. /// <summary>
  10. /// The name of the slot/container from which to insert or eject an item.
  11. /// </summary>
  12. public string SlotId;
  13. /// <summary>
  14. /// Whether to attempt to insert an item into the slot, if there is not already one inside.
  15. /// </summary>
  16. public bool TryInsert;
  17. /// <summary>
  18. /// Whether to attempt to eject the item from the slot, if it has one.
  19. /// </summary>
  20. public bool TryEject;
  21. public ItemSlotButtonPressedEvent(string slotId, bool tryEject = true, bool tryInsert = true)
  22. {
  23. SlotId = slotId;
  24. TryEject = tryEject;
  25. TryInsert = tryInsert;
  26. }
  27. }