1
0

GetEyePvsScaleEvent.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233
  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.UpdatePvsScale"/> is called.
  7. /// Should be subscribed to by any systems that want to modify an entity's eye PVS scale,
  8. /// so that they do not override each other. Keep in mind that this should be done serverside;
  9. /// the client may set a new PVS scale, but the server won't provide the data if it isn't done on the server.
  10. /// </summary>
  11. /// <param name="Scale">
  12. /// The total scale to apply.
  13. /// </param>
  14. /// <remarks>
  15. /// Note that in most cases <see cref="Scale"/> should be incremented or decremented by subscribers, not set.
  16. /// Otherwise, any offsets applied by previous subscribing systems will be overridden.
  17. /// </remarks>
  18. [ByRefEvent]
  19. public record struct GetEyePvsScaleEvent(float Scale);
  20. /// <summary>
  21. /// Raised on any equipped and in-hand items that may modify the eye offset.
  22. /// Pockets and suitstorage are excluded.
  23. /// </summary>
  24. [ByRefEvent]
  25. public sealed class GetEyePvsScaleRelayedEvent : EntityEventArgs, IInventoryRelayEvent
  26. {
  27. public SlotFlags TargetSlots { get; } = ~(SlotFlags.POCKET & SlotFlags.SUITSTORAGE);
  28. public float Scale;
  29. }