HumanoidSpritePrototypes.cs 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. using Robust.Shared.Prototypes;
  2. using Robust.Shared.Utility;
  3. namespace Content.Shared.Humanoid.Prototypes;
  4. /// <summary>
  5. /// Base sprites for a species (e.g., what replaces the empty tagged layer,
  6. /// or settings per layer)
  7. /// </summary>
  8. [Prototype("speciesBaseSprites")]
  9. public sealed partial class HumanoidSpeciesBaseSpritesPrototype : IPrototype
  10. {
  11. [IdDataField]
  12. public string ID { get; private set; } = default!;
  13. /// <summary>
  14. /// Sprites that this species will use on the given humanoid
  15. /// visual layer. If a key entry is empty, it is assumed that the
  16. /// visual layer will not be in use on this species, and will
  17. /// be ignored.
  18. /// </summary>
  19. [DataField("sprites", required: true)]
  20. public Dictionary<HumanoidVisualLayers, string> Sprites = new();
  21. }
  22. /// <summary>
  23. /// Humanoid species sprite layer. This is what defines the base layer of
  24. /// a humanoid species sprite, and also defines how markings can appear over
  25. /// that sprite (or at least, the layer this sprite is on).
  26. /// </summary>
  27. [Prototype("humanoidBaseSprite")]
  28. public sealed partial class HumanoidSpeciesSpriteLayer : IPrototype
  29. {
  30. [IdDataField]
  31. public string ID { get; private set; } = default!;
  32. /// <summary>
  33. /// The base sprite for this sprite layer. This is what
  34. /// will replace the empty layer tagged by the enum
  35. /// tied to this layer.
  36. ///
  37. /// If this is null, no sprite will be displayed, and the
  38. /// layer will be invisible until otherwise set.
  39. /// </summary>
  40. [DataField("baseSprite")]
  41. public SpriteSpecifier? BaseSprite { get; private set; }
  42. /// <summary>
  43. /// The alpha of this layer. Ensures that
  44. /// this layer will start with this percentage
  45. /// of alpha.
  46. /// </summary>
  47. [DataField("layerAlpha")]
  48. public float LayerAlpha { get; private set; } = 1.0f;
  49. /// <summary>
  50. /// If this sprite layer should allow markings or not.
  51. /// </summary>
  52. [DataField("allowsMarkings")]
  53. public bool AllowsMarkings { get; private set; } = true;
  54. /// <summary>
  55. /// If this layer should always match the
  56. /// skin tone in a character profile.
  57. /// </summary>
  58. [DataField("matchSkin")]
  59. public bool MatchSkin { get; private set; } = true;
  60. /// <summary>
  61. /// If any markings that go on this layer should
  62. /// match the skin tone of this part, including
  63. /// alpha.
  64. /// </summary>
  65. [DataField("markingsMatchSkin")]
  66. public bool MarkingsMatchSkin { get; private set; }
  67. }