1
0

GetEyeOffsetEvent.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. using System.Numerics;
  2. using Content.Shared.Inventory;
  3. using Content.Shared.Movement.Systems;
  4. namespace Content.Shared.Camera;
  5. /// <summary>
  6. /// Raised directed by-ref when <see cref="SharedContentEyeSystem.UpdateEyeOffset"/> is called.
  7. /// Should be subscribed to by any systems that want to modify an entity's eye offset,
  8. /// so that they do not override each other.
  9. /// </summary>
  10. /// <param name="Offset">
  11. /// The total offset to apply.
  12. /// </param>
  13. /// <remarks>
  14. /// Note that in most cases <see cref="Offset"/> should be incremented or decremented by subscribers, not set.
  15. /// Otherwise, any offsets applied by previous subscribing systems will be overridden.
  16. /// </remarks>
  17. [ByRefEvent]
  18. public record struct GetEyeOffsetEvent(Vector2 Offset);
  19. /// <summary>
  20. /// Raised on any equipped and in-hand items that may modify the eye offset.
  21. /// Pockets and suitstorage are excluded.
  22. /// </summary>
  23. [ByRefEvent]
  24. public sealed class GetEyeOffsetRelayedEvent : EntityEventArgs, IInventoryRelayEvent
  25. {
  26. public SlotFlags TargetSlots { get; } = ~(SlotFlags.POCKET & SlotFlags.SUITSTORAGE);
  27. public Vector2 Offset;
  28. }