1
0

FlatpackComponent.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. using Content.Shared.Tools;
  2. using Robust.Shared.Audio;
  3. using Robust.Shared.GameStates;
  4. using Robust.Shared.Prototypes;
  5. using Robust.Shared.Serialization;
  6. namespace Content.Shared.Construction.Components;
  7. /// <summary>
  8. /// This is used for an object that can instantly create a machine upon having a tool applied to it.
  9. /// </summary>
  10. [RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
  11. [Access(typeof(SharedFlatpackSystem))]
  12. public sealed partial class FlatpackComponent : Component
  13. {
  14. /// <summary>
  15. /// The tool quality that, upon used to interact with this object, will create the <see cref="Entity"/>
  16. /// </summary>
  17. [DataField, ViewVariables(VVAccess.ReadWrite), AutoNetworkedField]
  18. public ProtoId<ToolQualityPrototype> QualityNeeded = "Pulsing";
  19. /// <summary>
  20. /// The entity that is spawned when this object is unpacked.
  21. /// </summary>
  22. [DataField, ViewVariables(VVAccess.ReadWrite), AutoNetworkedField]
  23. public EntProtoId? Entity;
  24. /// <summary>
  25. /// Sound effect played upon the object being unpacked.
  26. /// </summary>
  27. [DataField, ViewVariables(VVAccess.ReadWrite), AutoNetworkedField]
  28. public SoundSpecifier UnpackSound = new SoundPathSpecifier("/Audio/Effects/unwrap.ogg");
  29. /// <summary>
  30. /// A dictionary relating a machine board sprite state to a color used for the overlay.
  31. /// Kinda shitty but it gets the job done.
  32. /// </summary>
  33. [DataField]
  34. public Dictionary<string, Color> BoardColors = new();
  35. }
  36. [Serializable, NetSerializable]
  37. public enum FlatpackVisuals : byte
  38. {
  39. Machine
  40. }
  41. public enum FlatpackVisualLayers : byte
  42. {
  43. Overlay
  44. }