using Content.Shared.Decals; using Robust.Shared.Audio; using Robust.Shared.GameStates; using Robust.Shared.Prototypes; using Robust.Shared.Serialization; namespace Content.Shared.SprayPainter.Components; /// /// Denotes an object that can be used to alter the appearance of paintable objects (e.g. doors, gas canisters). /// [RegisterComponent, NetworkedComponent, AutoGenerateComponentState(true)] public sealed partial class SprayPainterComponent : Component { public const string DefaultPickedColor = "red"; public static readonly ProtoId DefaultDecal = "Arrows"; /// /// The sound to be played after painting the entities. /// [DataField] public SoundSpecifier SpraySound = new SoundPathSpecifier("/Audio/Effects/spray2.ogg"); /// /// The amount of time it takes to paint a pipe. /// [DataField] public TimeSpan PipeSprayTime = TimeSpan.FromSeconds(1); /// /// The cost of spray painting a pipe, in charges. /// [DataField] public int PipeChargeCost = 1; /// /// Pipe color chosen to spray with. /// [DataField, AutoNetworkedField] public string PickedColor = DefaultPickedColor; /// /// Pipe colors that can be selected. /// [DataField] public Dictionary ColorPalette = new(); /// /// Spray paintable object styles selected per object. /// [DataField, AutoNetworkedField] public Dictionary StylesByGroup = new(); /// /// The currently open tab of the painter /// (Are you selecting canister color?) /// [DataField, AutoNetworkedField] public int SelectedTab; /// /// Whether or not the painter should be painting or removing decals when clicked. /// [DataField, AutoNetworkedField] public DecalPaintMode DecalMode = DecalPaintMode.Off; /// /// The currently selected decal prototype. /// [DataField, AutoNetworkedField] public ProtoId SelectedDecal = DefaultDecal; /// /// The color in which to paint the decal. /// [DataField, AutoNetworkedField] public Color? SelectedDecalColor; /// /// The angle at which to paint the decal. /// [DataField, AutoNetworkedField] public int SelectedDecalAngle; /// /// The angle at which to paint the decal. /// [DataField, AutoNetworkedField] public bool SnapDecals = true; /// /// The cost of spray painting a decal, in charges. /// [DataField] public int DecalChargeCost = 1; /// /// How long does the painter leave items as freshly painted? /// [DataField] public TimeSpan FreshPaintDuration = TimeSpan.FromMinutes(15); /// /// The sound to play when swapping between decal modes. /// [DataField] public SoundSpecifier SoundSwitchDecalMode = new SoundPathSpecifier("/Audio/Machines/quickbeep.ogg", AudioParams.Default.WithVolume(1.5f)); } /// /// A set of operating modes for decal painting. /// [Serializable, NetSerializable] public enum DecalPaintMode : byte { /// /// Clicking on the floor does nothing. /// Off = 0, /// /// Clicking on the floor adds a decal at the requested spot (or snapped to the grid) /// Add = 1, /// /// Clicking on the floor removes all decals at the requested spot (or snapped to the grid) /// Remove = 2, }