ToggleableLightVisualsComponent.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. using Content.Shared.Hands.Components;
  2. namespace Content.Client.Toggleable;
  3. /// <summary>
  4. /// Component that handles the toggling the visuals of some light emitting entity.
  5. /// </summary>
  6. /// <remarks>
  7. /// This will toggle the visibility of layers on an entity's sprite, the in-hand visuals, and the clothing/equipment
  8. /// visuals. This will modify the color of any attached point lights.
  9. /// </remarks>
  10. [RegisterComponent]
  11. public sealed partial class ToggleableLightVisualsComponent : Component
  12. {
  13. /// <summary>
  14. /// Sprite layer that will have its visibility toggled when this item is toggled.
  15. /// </summary>
  16. [DataField("spriteLayer")]
  17. public string? SpriteLayer = "light";
  18. /// <summary>
  19. /// Layers to add to the sprite of the player that is holding this entity (while the component is toggled on).
  20. /// </summary>
  21. [DataField("inhandVisuals")]
  22. public Dictionary<HandLocation, List<PrototypeLayerData>> InhandVisuals = new();
  23. /// <summary>
  24. /// Layers to add to the sprite of the player that is wearing this entity (while the component is toggled on).
  25. /// </summary>
  26. [DataField("clothingVisuals")]
  27. public Dictionary<string, List<PrototypeLayerData>> ClothingVisuals = new();
  28. }