RandomSpriteComponent.cs 968 B

123456789101112131415161718192021222324252627
  1. using Robust.Shared.GameStates;
  2. namespace Content.Shared.Sprite;
  3. [RegisterComponent, NetworkedComponent]
  4. public sealed partial class RandomSpriteComponent : Component
  5. {
  6. /// <summary>
  7. /// Whether or not all groups from <see cref="Available"/> are used,
  8. /// or if only one is picked at random.
  9. /// </summary>
  10. [DataField("getAllGroups")]
  11. public bool GetAllGroups;
  12. /// <summary>
  13. /// Available colors based on group, parsed layer enum, state, and color.
  14. /// Stored as a list so we can have groups of random sprites (e.g. tech_base + tech_flare for holoparasite)
  15. /// </summary>
  16. [ViewVariables(VVAccess.ReadWrite), DataField("available")]
  17. public List<Dictionary<string, Dictionary<string, string?>>> Available = new();
  18. /// <summary>
  19. /// Selected colors
  20. /// </summary>
  21. [ViewVariables(VVAccess.ReadWrite), DataField("selected")]
  22. public Dictionary<string, (string State, Color? Color)> Selected = new();
  23. }