diff --git a/Content.Client/Atmos/EntitySystems/GasCanisterAppearanceSystem.cs b/Content.Client/Atmos/EntitySystems/GasCanisterAppearanceSystem.cs
new file mode 100644
index 0000000000..f16774ce24
--- /dev/null
+++ b/Content.Client/Atmos/EntitySystems/GasCanisterAppearanceSystem.cs
@@ -0,0 +1,28 @@
+using Content.Shared.Atmos.Piping.Unary.Components;
+using Content.Shared.SprayPainter.Prototypes;
+using Robust.Client.GameObjects;
+using Robust.Shared.Prototypes;
+
+namespace Content.Client.Atmos.EntitySystems;
+
+///
+/// Used to change the appearance of gas canisters.
+///
+public sealed class GasCanisterAppearanceSystem : VisualizerSystem
+{
+ [Dependency] private readonly IPrototypeManager _prototypeManager = default!;
+
+ protected override void OnAppearanceChange(EntityUid uid, GasCanisterComponent component, ref AppearanceChangeEvent args)
+ {
+ if (!AppearanceSystem.TryGetData(uid, PaintableVisuals.Prototype, out var protoName, args.Component) || args.Sprite is not { } old)
+ return;
+
+ if (!_prototypeManager.HasIndex(protoName))
+ return;
+
+ // Create the given prototype and get its first layer.
+ var tempUid = Spawn(protoName);
+ SpriteSystem.LayerSetRsiState(uid, 0, SpriteSystem.LayerGetRsiState(tempUid, 0));
+ QueueDel(tempUid);
+ }
+}
diff --git a/Content.Client/Doors/DoorSystem.cs b/Content.Client/Doors/DoorSystem.cs
index cb17cfaf21..3d9a3e2a9a 100644
--- a/Content.Client/Doors/DoorSystem.cs
+++ b/Content.Client/Doors/DoorSystem.cs
@@ -1,16 +1,17 @@
using Content.Shared.Doors.Components;
using Content.Shared.Doors.Systems;
+using Content.Shared.SprayPainter.Prototypes;
using Robust.Client.Animations;
using Robust.Client.GameObjects;
-using Robust.Client.ResourceManagement;
-using Robust.Shared.Serialization.TypeSerializers.Implementations;
+using Robust.Shared.Prototypes;
namespace Content.Client.Doors;
public sealed class DoorSystem : SharedDoorSystem
{
[Dependency] private readonly AnimationPlayerSystem _animationSystem = default!;
- [Dependency] private readonly IResourceCache _resourceCache = default!;
+ [Dependency] private readonly IComponentFactory _componentFactory = default!;
+ [Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly SpriteSystem _sprite = default!;
public override void Initialize()
@@ -85,8 +86,8 @@ public sealed class DoorSystem : SharedDoorSystem
if (!AppearanceSystem.TryGetData(entity, DoorVisuals.State, out var state, args.Component))
state = DoorState.Closed;
- if (AppearanceSystem.TryGetData(entity, DoorVisuals.BaseRSI, out var baseRsi, args.Component))
- UpdateSpriteLayers((entity.Owner, args.Sprite), baseRsi);
+ if (AppearanceSystem.TryGetData(entity, PaintableVisuals.Prototype, out var prototype, args.Component))
+ UpdateSpriteLayers((entity.Owner, args.Sprite), prototype);
if (_animationSystem.HasRunningAnimation(entity, DoorComponent.AnimationKey))
_animationSystem.Stop(entity.Owner, DoorComponent.AnimationKey);
@@ -139,14 +140,14 @@ public sealed class DoorSystem : SharedDoorSystem
}
}
- private void UpdateSpriteLayers(Entity sprite, string baseRsi)
+ private void UpdateSpriteLayers(Entity sprite, string targetProto)
{
- if (!_resourceCache.TryGetResource(SpriteSpecifierSerializer.TextureRoot / baseRsi, out var res))
- {
- Log.Error("Unable to load RSI '{0}'. Trace:\n{1}", baseRsi, Environment.StackTrace);
+ if (!_prototypeManager.TryIndex(targetProto, out var target))
return;
- }
- _sprite.SetBaseRsi(sprite.AsNullable(), res.RSI);
+ if (!target.TryGetComponent(out SpriteComponent? targetSprite, _componentFactory))
+ return;
+
+ _sprite.SetBaseRsi(sprite.AsNullable(), targetSprite.BaseRSI);
}
}
diff --git a/Content.Client/SprayPainter/SprayPainterSystem.cs b/Content.Client/SprayPainter/SprayPainterSystem.cs
index 6a1d27e98b..8f7d7f0362 100644
--- a/Content.Client/SprayPainter/SprayPainterSystem.cs
+++ b/Content.Client/SprayPainter/SprayPainterSystem.cs
@@ -1,56 +1,129 @@
-using Content.Shared.SprayPainter;
-using Robust.Client.Graphics;
-using Robust.Client.ResourceManagement;
-using Robust.Shared.Serialization.TypeSerializers.Implementations;
-using Robust.Shared.Utility;
using System.Linq;
-using Robust.Shared.Graphics;
+using Content.Client.Items;
+using Content.Client.Message;
+using Content.Client.Stylesheets;
+using Content.Shared.Decals;
+using Content.Shared.SprayPainter;
+using Content.Shared.SprayPainter.Components;
+using Content.Shared.SprayPainter.Prototypes;
+using Robust.Client.GameObjects;
+using Robust.Client.UserInterface;
+using Robust.Client.UserInterface.Controls;
+using Robust.Shared.Prototypes;
+using Robust.Shared.Timing;
+using Robust.Shared.Utility;
namespace Content.Client.SprayPainter;
+///
+/// Client-side spray painter functions. Caches information for spray painter windows and updates the UI to reflect component state.
+///
public sealed class SprayPainterSystem : SharedSprayPainterSystem
{
- [Dependency] private readonly IResourceCache _resourceCache = default!;
+ [Dependency] private readonly UserInterfaceSystem _ui = default!;
- public List Entries { get; private set; } = new();
+ public List Decals = [];
+ public Dictionary> PaintableGroupsByCategory = new();
+ public Dictionary> PaintableStylesByGroup = new();
- protected override void CacheStyles()
+ public override void Initialize()
{
- base.CacheStyles();
+ base.Initialize();
- Entries.Clear();
- foreach (var style in Styles)
+ Subs.ItemStatus(ent => new StatusControl(ent));
+ SubscribeLocalEvent(OnStateUpdate);
+ SubscribeLocalEvent(OnPrototypesReloaded);
+
+ CachePrototypes();
+ }
+
+ private void OnStateUpdate(Entity ent, ref AfterAutoHandleStateEvent args)
+ {
+ UpdateUi(ent);
+ }
+
+ protected override void UpdateUi(Entity ent)
+ {
+ if (_ui.TryGetOpenUi(ent.Owner, SprayPainterUiKey.Key, out var bui))
+ bui.Update();
+ }
+
+ private void OnPrototypesReloaded(PrototypesReloadedEventArgs args)
+ {
+ if (!args.WasModified() || !args.WasModified() || !args.WasModified())
+ return;
+
+ CachePrototypes();
+ }
+
+ private void CachePrototypes()
+ {
+ PaintableGroupsByCategory.Clear();
+ PaintableStylesByGroup.Clear();
+ foreach (var category in Proto.EnumeratePrototypes().OrderBy(x => x.ID))
{
- var name = style.Name;
- string? iconPath = Groups
- .FindAll(x => x.StylePaths.ContainsKey(name))?
- .MaxBy(x => x.IconPriority)?.StylePaths[name];
- if (iconPath == null)
+ var groupList = new List();
+ foreach (var groupId in category.Groups)
{
- Entries.Add(new SprayPainterEntry(name, null));
- continue;
+ if (!Proto.TryIndex(groupId, out var group))
+ continue;
+
+ groupList.Add(groupId);
+ PaintableStylesByGroup[groupId] = group.Styles;
}
- RSIResource doorRsi = _resourceCache.GetResource(SpriteSpecifierSerializer.TextureRoot / new ResPath(iconPath));
- if (!doorRsi.RSI.TryGetState("closed", out var icon))
- {
- Entries.Add(new SprayPainterEntry(name, null));
- continue;
- }
+ if (groupList.Count > 0)
+ PaintableGroupsByCategory[category.ID] = groupList;
+ }
- Entries.Add(new SprayPainterEntry(name, icon.Frame0));
+ Decals.Clear();
+ foreach (var decalPrototype in Proto.EnumeratePrototypes().OrderBy(x => x.ID))
+ {
+ if (!decalPrototype.Tags.Contains("station")
+ && !decalPrototype.Tags.Contains("markings")
+ || decalPrototype.Tags.Contains("dirty"))
+ continue;
+
+ Decals.Add(new SprayPainterDecalEntry(decalPrototype.ID, decalPrototype.Sprite));
+ }
+ }
+
+ private sealed class StatusControl : Control
+ {
+ private readonly RichTextLabel _label;
+ private readonly Entity _entity;
+ private DecalPaintMode? _lastPaintingDecals = null;
+
+ public StatusControl(Entity ent)
+ {
+ _entity = ent;
+ _label = new RichTextLabel { StyleClasses = { StyleNano.StyleClassItemStatus } };
+ AddChild(_label);
+ }
+
+ protected override void FrameUpdate(FrameEventArgs args)
+ {
+ base.FrameUpdate(args);
+
+ if (_entity.Comp.DecalMode == _lastPaintingDecals)
+ return;
+
+ _lastPaintingDecals = _entity.Comp.DecalMode;
+
+ string modeLocString = _entity.Comp.DecalMode switch
+ {
+ DecalPaintMode.Add => "spray-painter-item-status-add",
+ DecalPaintMode.Remove => "spray-painter-item-status-remove",
+ _ => "spray-painter-item-status-off"
+ };
+
+ _label.SetMarkupPermissive(Robust.Shared.Localization.Loc.GetString("spray-painter-item-status-label",
+ ("mode", Robust.Shared.Localization.Loc.GetString(modeLocString))));
}
}
}
-public sealed class SprayPainterEntry
-{
- public string Name;
- public Texture? Icon;
-
- public SprayPainterEntry(string name, Texture? icon)
- {
- Name = name;
- Icon = icon;
- }
-}
+///
+/// A spray paintable decal, mapped by ID.
+///
+public sealed record SprayPainterDecalEntry(string Name, SpriteSpecifier Sprite);
diff --git a/Content.Client/SprayPainter/UI/SprayPainterBoundUserInterface.cs b/Content.Client/SprayPainter/UI/SprayPainterBoundUserInterface.cs
index 7d6a6cf2a5..701ec80bac 100644
--- a/Content.Client/SprayPainter/UI/SprayPainterBoundUserInterface.cs
+++ b/Content.Client/SprayPainter/UI/SprayPainterBoundUserInterface.cs
@@ -1,42 +1,96 @@
+using Content.Shared.Decals;
using Content.Shared.SprayPainter;
using Content.Shared.SprayPainter.Components;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
+using Robust.Shared.Prototypes;
namespace Content.Client.SprayPainter.UI;
-public sealed class SprayPainterBoundUserInterface : BoundUserInterface
+///
+/// A BUI for a spray painter. Allows selecting pipe colours, decals, and paintable object types sorted by category.
+///
+public sealed class SprayPainterBoundUserInterface(EntityUid owner, Enum uiKey) : BoundUserInterface(owner, uiKey)
{
[ViewVariables]
private SprayPainterWindow? _window;
- public SprayPainterBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
- {
- }
-
protected override void Open()
{
base.Open();
- _window = this.CreateWindow();
-
- _window.OnSpritePicked = OnSpritePicked;
- _window.OnColorPicked = OnColorPicked;
-
- if (EntMan.TryGetComponent(Owner, out SprayPainterComponent? comp))
+ if (_window == null)
{
- _window.Populate(EntMan.System().Entries, comp.Index, comp.PickedColor, comp.ColorPalette);
+ _window = this.CreateWindow();
+
+ _window.OnSpritePicked += OnSpritePicked;
+ _window.OnSetPipeColor += OnSetPipeColor;
+ _window.OnTabChanged += OnTabChanged;
+ _window.OnDecalChanged += OnDecalChanged;
+ _window.OnDecalColorChanged += OnDecalColorChanged;
+ _window.OnDecalAngleChanged += OnDecalAngleChanged;
+ _window.OnDecalSnapChanged += OnDecalSnapChanged;
}
+
+ var sprayPainter = EntMan.System();
+ _window.PopulateCategories(sprayPainter.PaintableStylesByGroup, sprayPainter.PaintableGroupsByCategory, sprayPainter.Decals);
+ Update();
+
+ if (EntMan.TryGetComponent(Owner, out SprayPainterComponent? sprayPainterComp))
+ _window.SetSelectedTab(sprayPainterComp.SelectedTab);
}
- private void OnSpritePicked(ItemList.ItemListSelectedEventArgs args)
+ public override void Update()
{
- SendMessage(new SprayPainterSpritePickedMessage(args.ItemIndex));
+ if (_window == null)
+ return;
+
+ if (!EntMan.TryGetComponent(Owner, out SprayPainterComponent? sprayPainter))
+ return;
+
+ _window.PopulateColors(sprayPainter.ColorPalette);
+ if (sprayPainter.PickedColor != null)
+ _window.SelectColor(sprayPainter.PickedColor);
+ _window.SetSelectedStyles(sprayPainter.StylesByGroup);
+ _window.SetSelectedDecal(sprayPainter.SelectedDecal);
+ _window.SetDecalAngle(sprayPainter.SelectedDecalAngle);
+ _window.SetDecalColor(sprayPainter.SelectedDecalColor);
+ _window.SetDecalSnap(sprayPainter.SnapDecals);
}
- private void OnColorPicked(ItemList.ItemListSelectedEventArgs args)
+ private void OnDecalSnapChanged(bool snap)
+ {
+ SendPredictedMessage(new SprayPainterSetDecalSnapMessage(snap));
+ }
+
+ private void OnDecalAngleChanged(int angle)
+ {
+ SendPredictedMessage(new SprayPainterSetDecalAngleMessage(angle));
+ }
+
+ private void OnDecalColorChanged(Color? color)
+ {
+ SendPredictedMessage(new SprayPainterSetDecalColorMessage(color));
+ }
+
+ private void OnDecalChanged(ProtoId protoId)
+ {
+ SendPredictedMessage(new SprayPainterSetDecalMessage(protoId));
+ }
+
+ private void OnTabChanged(int index, bool isSelectedTabWithDecals)
+ {
+ SendPredictedMessage(new SprayPainterTabChangedMessage(index, isSelectedTabWithDecals));
+ }
+
+ private void OnSpritePicked(string group, string style)
+ {
+ SendPredictedMessage(new SprayPainterSetPaintableStyleMessage(group, style));
+ }
+
+ private void OnSetPipeColor(ItemList.ItemListSelectedEventArgs args)
{
var key = _window?.IndexToColorKey(args.ItemIndex);
- SendMessage(new SprayPainterColorPickedMessage(key));
+ SendPredictedMessage(new SprayPainterSetPipeColorMessage(key));
}
}
diff --git a/Content.Client/SprayPainter/UI/SprayPainterDecals.xaml b/Content.Client/SprayPainter/UI/SprayPainterDecals.xaml
new file mode 100644
index 0000000000..0d5c8e4f16
--- /dev/null
+++ b/Content.Client/SprayPainter/UI/SprayPainterDecals.xaml
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Content.Client/SprayPainter/UI/SprayPainterDecals.xaml.cs b/Content.Client/SprayPainter/UI/SprayPainterDecals.xaml.cs
new file mode 100644
index 0000000000..64d1f78d3c
--- /dev/null
+++ b/Content.Client/SprayPainter/UI/SprayPainterDecals.xaml.cs
@@ -0,0 +1,174 @@
+using System.Numerics;
+using Content.Client.Stylesheets;
+using Content.Shared.Decals;
+using Robust.Client.AutoGenerated;
+using Robust.Client.GameObjects;
+using Robust.Client.Graphics;
+using Robust.Client.UserInterface;
+using Robust.Client.UserInterface.Controls;
+using Robust.Client.UserInterface.XAML;
+using Robust.Shared.Prototypes;
+
+namespace Content.Client.SprayPainter.UI;
+
+///
+/// Used to control decal painting parameters for the spray painter.
+///
+[GenerateTypedNameReferences]
+public sealed partial class SprayPainterDecals : Control
+{
+ public Action>? OnDecalSelected;
+ public Action? OnColorChanged;
+ public Action? OnAngleChanged;
+ public Action? OnSnapChanged;
+
+ private SpriteSystem? _sprite;
+ private string _selectedDecal = string.Empty;
+ private List _decals = [];
+
+ public SprayPainterDecals()
+ {
+ RobustXamlLoader.Load(this);
+
+ AddAngleButton.OnButtonUp += _ => AngleSpinBox.Value += 90;
+ SubAngleButton.OnButtonUp += _ => AngleSpinBox.Value -= 90;
+ SetZeroAngleButton.OnButtonUp += _ => AngleSpinBox.Value = 0;
+ AngleSpinBox.ValueChanged += args => OnAngleChanged?.Invoke(args.Value);
+
+ UseCustomColorCheckBox.OnPressed += UseCustomColorCheckBoxOnOnPressed;
+ SnapToTileCheckBox.OnPressed += SnapToTileCheckBoxOnOnPressed;
+ ColorSelector.OnColorChanged += OnColorSelected;
+ }
+
+ private void UseCustomColorCheckBoxOnOnPressed(BaseButton.ButtonEventArgs _)
+ {
+ OnColorChanged?.Invoke(UseCustomColorCheckBox.Pressed ? ColorSelector.Color : null);
+ UpdateColorButtons(UseCustomColorCheckBox.Pressed);
+ }
+
+ private void SnapToTileCheckBoxOnOnPressed(BaseButton.ButtonEventArgs _)
+ {
+ OnSnapChanged?.Invoke(SnapToTileCheckBox.Pressed);
+ }
+
+ ///
+ /// Updates the decal list.
+ ///
+ public void PopulateDecals(List decals, SpriteSystem sprite)
+ {
+ _sprite ??= sprite;
+
+ _decals = decals;
+ DecalsGrid.Children.Clear();
+
+ foreach (var decal in decals)
+ {
+ var button = new TextureButton()
+ {
+ TextureNormal = sprite.Frame0(decal.Sprite),
+ Name = decal.Name,
+ ToolTip = decal.Name,
+ Scale = new Vector2(2, 2),
+ };
+ button.OnPressed += DecalButtonOnPressed;
+
+ if (UseCustomColorCheckBox.Pressed)
+ {
+ button.Modulate = ColorSelector.Color;
+ }
+
+ if (_selectedDecal == decal.Name)
+ {
+ var panelContainer = new PanelContainer()
+ {
+ PanelOverride = new StyleBoxFlat()
+ {
+ BackgroundColor = StyleNano.ButtonColorDefault,
+ },
+ Children =
+ {
+ button,
+ },
+ };
+ DecalsGrid.AddChild(panelContainer);
+ }
+ else
+ {
+ DecalsGrid.AddChild(button);
+ }
+ }
+ }
+
+ private void OnColorSelected(Color color)
+ {
+ if (!UseCustomColorCheckBox.Pressed)
+ return;
+
+ OnColorChanged?.Invoke(color);
+
+ UpdateColorButtons(UseCustomColorCheckBox.Pressed);
+ }
+
+ private void UpdateColorButtons(bool apply)
+ {
+ Color modulateColor = apply ? ColorSelector.Color : Color.White;
+ foreach (var button in DecalsGrid.Children)
+ {
+ switch (button)
+ {
+ case TextureButton:
+ button.Modulate = modulateColor;
+ break;
+ case PanelContainer panelContainer:
+ {
+ foreach (TextureButton textureButton in panelContainer.Children)
+ textureButton.Modulate = modulateColor;
+
+ break;
+ }
+ }
+ }
+ }
+
+ private void DecalButtonOnPressed(BaseButton.ButtonEventArgs obj)
+ {
+ if (obj.Button.Name is not { } name)
+ return;
+
+ _selectedDecal = name;
+ OnDecalSelected?.Invoke(_selectedDecal);
+
+ if (_sprite is null)
+ return;
+
+ PopulateDecals(_decals, _sprite);
+ }
+
+ public void SetSelectedDecal(string name)
+ {
+ _selectedDecal = name;
+
+ if (_sprite is null)
+ return;
+
+ PopulateDecals(_decals, _sprite);
+ }
+
+ public void SetAngle(int degrees)
+ {
+ AngleSpinBox.OverrideValue(degrees);
+ }
+
+ public void SetColor(Color? color)
+ {
+ UseCustomColorCheckBox.Pressed = color != null;
+ if (color != null)
+ ColorSelector.Color = color.Value;
+ UpdateColorButtons(UseCustomColorCheckBox.Pressed);
+ }
+
+ public void SetSnap(bool snap)
+ {
+ SnapToTileCheckBox.Pressed = snap;
+ }
+}
diff --git a/Content.Client/SprayPainter/UI/SprayPainterGroup.xaml b/Content.Client/SprayPainter/UI/SprayPainterGroup.xaml
new file mode 100644
index 0000000000..aeb0d07158
--- /dev/null
+++ b/Content.Client/SprayPainter/UI/SprayPainterGroup.xaml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
diff --git a/Content.Client/SprayPainter/UI/SprayPainterGroup.xaml.cs b/Content.Client/SprayPainter/UI/SprayPainterGroup.xaml.cs
new file mode 100644
index 0000000000..fe2f5a87af
--- /dev/null
+++ b/Content.Client/SprayPainter/UI/SprayPainterGroup.xaml.cs
@@ -0,0 +1,66 @@
+using Content.Client.UserInterface.Controls;
+using Robust.Client.AutoGenerated;
+using Robust.Client.UserInterface.Controls;
+using Robust.Client.UserInterface.XAML;
+
+namespace Content.Client.SprayPainter.UI;
+
+///
+/// Used to display a group of paintable styles in the spray painter menu.
+/// (e.g. each type of paintable locker or plastic crate)
+///
+[GenerateTypedNameReferences]
+public sealed partial class SprayPainterGroup : BoxContainer
+{
+ public event Action? OnButtonPressed;
+
+ public SprayPainterGroup()
+ {
+ RobustXamlLoader.Load(this);
+
+ StyleList.GenerateItem = GenerateItems;
+ }
+
+ public void PopulateList(List spriteList)
+ {
+ StyleList.PopulateList(spriteList);
+ }
+
+ public void SelectItemByStyle(string key)
+ {
+ foreach (var elem in StyleList.Data)
+ {
+ if (elem is not SpriteListData spriteElem)
+ continue;
+
+ if (spriteElem.Style == key)
+ {
+ StyleList.Select(spriteElem);
+ break;
+ }
+ }
+ }
+
+ private void GenerateItems(ListData data, ListContainerButton button)
+ {
+ if (data is not SpriteListData spriteListData)
+ return;
+
+ var box = new BoxContainer() { Orientation = LayoutOrientation.Horizontal };
+ var protoView = new EntityPrototypeView();
+ protoView.SetPrototype(spriteListData.Prototype);
+ var label = new Label()
+ {
+ Text = Loc.GetString($"spray-painter-style-{spriteListData.Group.ToLower()}-{spriteListData.Style.ToLower()}")
+ };
+
+ box.AddChild(protoView);
+ box.AddChild(label);
+ button.AddChild(box);
+ button.AddStyleClass(ListContainer.StyleClassListContainerButton);
+ button.OnPressed += _ => OnButtonPressed?.Invoke(spriteListData);
+
+ if (spriteListData.SelectedIndex == button.Index)
+ button.Pressed = true;
+ }
+}
diff --git a/Content.Client/SprayPainter/UI/SprayPainterWindow.xaml b/Content.Client/SprayPainter/UI/SprayPainterWindow.xaml
index 13e500c46c..46facb5d32 100644
--- a/Content.Client/SprayPainter/UI/SprayPainterWindow.xaml
+++ b/Content.Client/SprayPainter/UI/SprayPainterWindow.xaml
@@ -1,34 +1,6 @@
-
-
-
-
-
-
-
-
-
-
+ MinSize="520 300"
+ SetSize="520 700"
+ Title="{Loc 'spray-painter-window-title'}">
+
diff --git a/Content.Client/SprayPainter/UI/SprayPainterWindow.xaml.cs b/Content.Client/SprayPainter/UI/SprayPainterWindow.xaml.cs
index 4e7bdd8973..eb1218ad67 100644
--- a/Content.Client/SprayPainter/UI/SprayPainterWindow.xaml.cs
+++ b/Content.Client/SprayPainter/UI/SprayPainterWindow.xaml.cs
@@ -1,12 +1,19 @@
+using System.Linq;
+using Content.Client.UserInterface.Controls;
+using Content.Shared.Decals;
using Robust.Client.AutoGenerated;
using Robust.Client.GameObjects;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.CustomControls;
using Robust.Client.UserInterface.XAML;
+using Robust.Shared.Prototypes;
using Robust.Shared.Utility;
namespace Content.Client.SprayPainter.UI;
+///
+/// A window to select spray painter settings by object type, as well as pipe colours and decals.
+///
[GenerateTypedNameReferences]
public sealed partial class SprayPainterWindow : DefaultWindow
{
@@ -15,13 +22,33 @@ public sealed partial class SprayPainterWindow : DefaultWindow
private readonly SpriteSystem _spriteSystem;
- public Action? OnSpritePicked;
- public Action? OnColorPicked;
+ // Events
+ public event Action? OnSpritePicked;
+ public event Action? OnTabChanged;
+ public event Action>? OnDecalChanged;
+ public event Action? OnSetPipeColor;
+ public event Action? OnDecalColorChanged;
+ public event Action? OnDecalAngleChanged;
+ public event Action? OnDecalSnapChanged;
+
+ // Pipe color data
+ private ItemList _colorList = default!;
public Dictionary ItemColorIndex = new();
- private Dictionary currentPalette = new();
- private const string colorLocKeyPrefix = "pipe-painter-color-";
- private List CurrentEntries = new List();
+ private Dictionary _currentPalette = new();
+ private const string ColorLocKeyPrefix = "pipe-painter-color-";
+
+ // Paintable objects
+ private Dictionary> _currentStylesByGroup = new();
+ private Dictionary> _currentGroupsByCategory = new();
+
+ // Tab controls
+ private Dictionary _paintableControls = new();
+ private BoxContainer? _pipeControl;
+
+ // Decals
+ private List _currentDecals = [];
+ private SprayPainterDecals? _sprayPainterDecals;
private readonly SpriteSpecifier _colorEntryIconTexture = new SpriteSpecifier.Rsi(
new ResPath("Structures/Piping/Atmospherics/pipe.rsi"),
@@ -32,13 +59,14 @@ public sealed partial class SprayPainterWindow : DefaultWindow
RobustXamlLoader.Load(this);
IoCManager.InjectDependencies(this);
_spriteSystem = _sysMan.GetEntitySystem();
+ Tabs.OnTabChanged += (index) => OnTabChanged?.Invoke(index, _sprayPainterDecals?.GetPositionInParent() == index);
}
private string GetColorLocString(string? colorKey)
{
if (string.IsNullOrEmpty(colorKey))
return Loc.GetString("pipe-painter-no-color-selected");
- var locKey = colorLocKeyPrefix + colorKey;
+ var locKey = ColorLocKeyPrefix + colorKey;
if (!_loc.TryGetString(locKey, out var locString))
locString = colorKey;
@@ -48,51 +76,229 @@ public sealed partial class SprayPainterWindow : DefaultWindow
public string? IndexToColorKey(int index)
{
- return (string?) ColorList[index].Metadata;
+ return _colorList[index].Text;
}
- public void Populate(List entries, int selectedStyle, string? selectedColorKey, Dictionary palette)
+ private void OnStyleSelected(ListData data)
{
- // Only clear if the entries change. Otherwise the list would "jump" after selecting an item
- if (!CurrentEntries.Equals(entries))
+ if (data is SpriteListData listData)
+ OnSpritePicked?.Invoke(listData.Group, listData.Style);
+ }
+
+ ///
+ /// Wrapper to allow for selecting/deselecting the event to avoid loops
+ ///
+ private void OnColorPicked(ItemList.ItemListSelectedEventArgs args)
+ {
+ OnSetPipeColor?.Invoke(args);
+ }
+
+ ///
+ /// Setup function for the window.
+ ///
+ /// Each group, mapped by name to the set of named styles by their associated entity prototype.
+ /// The set of categories and the groups associated with them.
+ /// A list of each decal.
+ public void PopulateCategories(Dictionary> stylesByGroup, Dictionary> groupsByCategory, List decals)
+ {
+ bool tabsCleared = false;
+ var lastTab = Tabs.CurrentTab;
+
+ if (!_currentGroupsByCategory.Equals(groupsByCategory))
{
- CurrentEntries = entries;
- SpriteList.Clear();
- foreach (var entry in entries)
+ // Destroy all existing tabs
+ tabsCleared = true;
+ _paintableControls.Clear();
+ _pipeControl = null;
+ _sprayPainterDecals = null;
+ Tabs.RemoveAllChildren();
+ }
+
+ // Only clear if the entries change. Otherwise the list would "jump" after selecting an item
+ if (tabsCleared || !_currentStylesByGroup.Equals(stylesByGroup))
+ {
+ _currentStylesByGroup = stylesByGroup;
+
+ var tabIndex = 0;
+ foreach (var (categoryName, categoryGroups) in groupsByCategory.OrderBy(c => c.Key))
{
- SpriteList.AddItem(entry.Name, entry.Icon);
+ if (categoryGroups.Count <= 0)
+ continue;
+
+ // Repopulating controls:
+ // ensure that categories with multiple groups have separate subtabs
+ // but single-group categories do not.
+ if (tabsCleared)
+ {
+ TabContainer? subTabs = null;
+ if (categoryGroups.Count > 1)
+ subTabs = new();
+
+ foreach (var group in categoryGroups)
+ {
+ if (!stylesByGroup.TryGetValue(group, out var styles))
+ continue;
+
+ var groupControl = new SprayPainterGroup();
+ groupControl.OnButtonPressed += OnStyleSelected;
+ _paintableControls[group] = groupControl;
+ if (categoryGroups.Count > 1)
+ {
+ if (subTabs != null)
+ {
+ subTabs?.AddChild(groupControl);
+ var subTabLocalization = Loc.GetString("spray-painter-tab-group-" + group.ToLower());
+ TabContainer.SetTabTitle(groupControl, subTabLocalization);
+ }
+ }
+ else
+ {
+ Tabs.AddChild(groupControl);
+ }
+ }
+
+ if (subTabs != null)
+ Tabs.AddChild(subTabs);
+
+ var tabLocalization = Loc.GetString("spray-painter-tab-category-" + categoryName.ToLower());
+ Tabs.SetTabTitle(tabIndex, tabLocalization);
+ tabIndex++;
+ }
+
+ // Finally, populate all groups with new data.
+ foreach (var group in categoryGroups)
+ {
+ if (!stylesByGroup.TryGetValue(group, out var styles) ||
+ !_paintableControls.TryGetValue(group, out var control))
+ continue;
+
+ var dataList = styles
+ .Select(e => new SpriteListData(group, e.Key, e.Value, 0))
+ .OrderBy(d => Loc.GetString($"spray-painter-style-{group.ToLower()}-{d.Style.ToLower()}"))
+ .ToList();
+ control.PopulateList(dataList);
+ }
}
}
- if (!currentPalette.Equals(palette))
- {
- currentPalette = palette;
- ItemColorIndex.Clear();
- ColorList.Clear();
+ PopulateColors(_currentPalette);
+ if (!_currentDecals.Equals(decals))
+ {
+ _currentDecals = decals;
+
+ if (_sprayPainterDecals is null)
+ {
+ _sprayPainterDecals = new SprayPainterDecals();
+
+ _sprayPainterDecals.OnDecalSelected += id => OnDecalChanged?.Invoke(id);
+ _sprayPainterDecals.OnColorChanged += color => OnDecalColorChanged?.Invoke(color);
+ _sprayPainterDecals.OnAngleChanged += angle => OnDecalAngleChanged?.Invoke(angle);
+ _sprayPainterDecals.OnSnapChanged += snap => OnDecalSnapChanged?.Invoke(snap);
+
+ Tabs.AddChild(_sprayPainterDecals);
+ TabContainer.SetTabTitle(_sprayPainterDecals, Loc.GetString("spray-painter-tab-category-decals"));
+ }
+
+ _sprayPainterDecals.PopulateDecals(decals, _spriteSystem);
+ }
+
+ if (tabsCleared)
+ SetSelectedTab(lastTab);
+ }
+
+ public void PopulateColors(Dictionary palette)
+ {
+ // Create pipe tab controls if they don't exist
+ bool tabCreated = false;
+ if (_pipeControl == null)
+ {
+ _pipeControl = new BoxContainer() { Orientation = BoxContainer.LayoutOrientation.Vertical };
+
+ var label = new Label() { Text = Loc.GetString("spray-painter-selected-color") };
+
+ _colorList = new ItemList() { VerticalExpand = true };
+ _colorList.OnItemSelected += OnColorPicked;
+
+ _pipeControl.AddChild(label);
+ _pipeControl.AddChild(_colorList);
+
+ Tabs.AddChild(_pipeControl);
+ TabContainer.SetTabTitle(_pipeControl, Loc.GetString("spray-painter-tab-category-pipes"));
+ tabCreated = true;
+ }
+
+ // Populate the tab if needed (new tab/new data)
+ if (tabCreated || !_currentPalette.Equals(palette))
+ {
+ _currentPalette = palette;
+ ItemColorIndex.Clear();
+ _colorList.Clear();
+
+ int index = 0;
foreach (var color in palette)
{
var locString = GetColorLocString(color.Key);
- var item = ColorList.AddItem(locString, _spriteSystem.Frame0(_colorEntryIconTexture));
+ var item = _colorList.AddItem(locString, _spriteSystem.Frame0(_colorEntryIconTexture), metadata: color.Key);
item.IconModulate = color.Value;
- item.Metadata = color.Key;
- ItemColorIndex.Add(color.Key, ColorList.IndexOf(item));
+ ItemColorIndex.Add(color.Key, index);
+ index++;
}
}
-
- // Disable event so we don't send a new event for pre-selectedStyle entry and end up in a loop
-
- if (selectedColorKey != null)
- {
- var index = ItemColorIndex[selectedColorKey];
- ColorList.OnItemSelected -= OnColorPicked;
- ColorList[index].Selected = true;
- ColorList.OnItemSelected += OnColorPicked;
- }
-
- SpriteList.OnItemSelected -= OnSpritePicked;
- SpriteList[selectedStyle].Selected = true;
- SpriteList.OnItemSelected += OnSpritePicked;
}
+
+ # region Setters
+ public void SetSelectedStyles(Dictionary selectedStyles)
+ {
+ foreach (var (group, style) in selectedStyles)
+ {
+ if (!_paintableControls.TryGetValue(group, out var control))
+ continue;
+
+ control.SelectItemByStyle(style);
+ }
+ }
+
+ public void SelectColor(string color)
+ {
+ if (_colorList != null && ItemColorIndex.TryGetValue(color, out var colorIdx))
+ {
+ _colorList.OnItemSelected -= OnColorPicked;
+ _colorList[colorIdx].Selected = true;
+ _colorList.OnItemSelected += OnColorPicked;
+ }
+ }
+
+ public void SetSelectedTab(int tab)
+ {
+ Tabs.CurrentTab = int.Min(tab, Tabs.ChildCount - 1);
+ }
+
+ public void SetSelectedDecal(string decal)
+ {
+ if (_sprayPainterDecals != null)
+ _sprayPainterDecals.SetSelectedDecal(decal);
+ }
+
+ public void SetDecalAngle(int angle)
+ {
+ if (_sprayPainterDecals != null)
+ _sprayPainterDecals.SetAngle(angle);
+ }
+
+ public void SetDecalColor(Color? color)
+ {
+ if (_sprayPainterDecals != null)
+ _sprayPainterDecals.SetColor(color);
+ }
+
+ public void SetDecalSnap(bool snap)
+ {
+ if (_sprayPainterDecals != null)
+ _sprayPainterDecals.SetSnap(snap);
+ }
+ # endregion
}
+
+public record SpriteListData(string Group, string Style, EntProtoId Prototype, int SelectedIndex) : ListData;
diff --git a/Content.Client/Storage/Visualizers/EntityStorageVisualizerSystem.cs b/Content.Client/Storage/Visualizers/EntityStorageVisualizerSystem.cs
index e6e53ae87a..c10a24ac32 100644
--- a/Content.Client/Storage/Visualizers/EntityStorageVisualizerSystem.cs
+++ b/Content.Client/Storage/Visualizers/EntityStorageVisualizerSystem.cs
@@ -1,10 +1,15 @@
+using Content.Shared.SprayPainter.Prototypes;
using Content.Shared.Storage;
using Robust.Client.GameObjects;
+using Robust.Shared.Prototypes;
namespace Content.Client.Storage.Visualizers;
public sealed class EntityStorageVisualizerSystem : VisualizerSystem
{
+ [Dependency] private readonly IPrototypeManager _prototypeManager = default!;
+ [Dependency] private readonly IComponentFactory _componentFactory = default!;
+
public override void Initialize()
{
base.Initialize();
@@ -26,12 +31,34 @@ public sealed class EntityStorageVisualizerSystem : VisualizerSystem(uid, StorageVisuals.Open, out var open, args.Component))
+ || !AppearanceSystem.TryGetData(uid, StorageVisuals.Open, out var open, args.Component))
return;
+ var forceRedrawBase = false;
+ if (AppearanceSystem.TryGetData(uid, PaintableVisuals.Prototype, out var prototype, args.Component))
+ {
+ if (_prototypeManager.TryIndex(prototype, out var proto))
+ {
+ if (proto.TryGetComponent(out SpriteComponent? sprite, _componentFactory))
+ {
+ SpriteSystem.SetBaseRsi((uid, args.Sprite), sprite.BaseRSI);
+ }
+ if (proto.TryGetComponent(out EntityStorageVisualsComponent? visuals, _componentFactory))
+ {
+ comp.StateBaseOpen = visuals.StateBaseOpen;
+ comp.StateBaseClosed = visuals.StateBaseClosed;
+ comp.StateDoorOpen = visuals.StateDoorOpen;
+ comp.StateDoorClosed = visuals.StateDoorClosed;
+ forceRedrawBase = true;
+ }
+ }
+ }
+
// Open/Closed state for the storage entity.
if (SpriteSystem.LayerMapTryGet((uid, args.Sprite), StorageVisualLayers.Door, out _, false))
{
@@ -52,6 +79,8 @@ public sealed class EntityStorageVisualizerSystem : VisualizerSystem
-/// Handles spraying pipes using a spray painter.
-/// Airlocks are handled in shared.
+/// Handles spraying pipes and decals using a spray painter.
+/// Other paintable objects are handled in shared.
///
public sealed class SprayPainterSystem : SharedSprayPainterSystem
{
[Dependency] private readonly AtmosPipeColorSystem _pipeColor = default!;
+ [Dependency] private readonly PopupSystem _popup = default!;
+ [Dependency] private readonly DecalSystem _decals = default!;
+ [Dependency] private readonly AudioSystem _audio = default!;
+ [Dependency] private readonly ChargesSystem _charges = default!;
+ [Dependency] private readonly TransformSystem _transform = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent(OnPipeDoAfter);
-
+ SubscribeLocalEvent(OnFloorAfterInteract);
SubscribeLocalEvent(OnPipeInteract);
+ SubscribeLocalEvent(OnCanisterPainted);
+ }
+
+ ///
+ /// Handles drawing decals when a spray painter is used to interact with the floor.
+ /// Spray painter must have decal painting enabled and enough charges of paint to paint on the floor.
+ ///
+ private void OnFloorAfterInteract(Entity ent, ref AfterInteractEvent args)
+ {
+ if (args.Handled || !args.CanReach || args.Target != null)
+ return;
+
+ // Includes both off and all other don't cares
+ if (ent.Comp.DecalMode != DecalPaintMode.Add && ent.Comp.DecalMode != DecalPaintMode.Remove)
+ return;
+
+ args.Handled = true;
+ if (TryComp(ent, out LimitedChargesComponent? charges) && charges.LastCharges < ent.Comp.DecalChargeCost)
+ {
+ _popup.PopupEntity(Loc.GetString("spray-painter-interact-no-charges"), args.User, args.User);
+ return;
+ }
+
+ var position = args.ClickLocation;
+ if (ent.Comp.SnapDecals)
+ position = position.SnapToGrid(EntityManager);
+
+ if (ent.Comp.DecalMode == DecalPaintMode.Add)
+ {
+ // Offset painting for adding decals
+ position = position.Offset(new(-0.5f));
+
+ if (!_decals.TryAddDecal(ent.Comp.SelectedDecal, position, out _, ent.Comp.SelectedDecalColor, Angle.FromDegrees(ent.Comp.SelectedDecalAngle), 0, false))
+ return;
+ }
+ else
+ {
+ var gridUid = _transform.GetGrid(args.ClickLocation);
+ if (gridUid is not { } grid || !TryComp(grid, out var decalGridComp))
+ {
+ _popup.PopupEntity(Loc.GetString("spray-painter-interact-nothing-to-remove"), args.User, args.User);
+ return;
+ }
+
+ var decals = _decals.GetDecalsInRange(grid, position.Position, validDelegate: IsDecalRemovable);
+ if (decals.Count <= 0)
+ {
+ _popup.PopupEntity(Loc.GetString("spray-painter-interact-nothing-to-remove"), args.User, args.User);
+ return;
+ }
+
+ foreach (var decal in decals)
+ {
+ _decals.RemoveDecal(grid, decal.Index, decalGridComp);
+ }
+ }
+
+ _audio.PlayPvs(ent.Comp.SpraySound, ent);
+
+ _charges.TryUseCharges((ent, charges), ent.Comp.DecalChargeCost);
+
+ AdminLogger.Add(LogType.CrayonDraw, LogImpact.Low, $"{EntityManager.ToPrettyString(args.User):user} painted a {ent.Comp.SelectedDecal}");
+ }
+
+ ///
+ /// Handles drawing decals when a spray painter is used to interact with the floor.
+ /// Spray painter must have decal painting enabled and enough charges of paint to paint on the floor.
+ ///
+ private bool IsDecalRemovable(Decal decal)
+ {
+ if (!Proto.TryIndex(decal.Id, out var decalProto))
+ return false;
+
+ return (decalProto.Tags.Contains("station")
+ || decalProto.Tags.Contains("markings"))
+ && !decalProto.Tags.Contains("dirty");
+ }
+
+ ///
+ /// Event handler when gas canisters are painted.
+ /// The canister's color should not change when it's destroyed.
+ ///
+ private void OnCanisterPainted(Entity ent, ref EntityPaintedEvent args)
+ {
+ var dummy = Spawn(args.Prototype);
+
+ var destructibleComp = EnsureComp(dummy);
+ CopyComp(dummy, ent, destructibleComp);
+
+ Del(dummy);
}
private void OnPipeDoAfter(Entity ent, ref SprayPainterPipeDoAfterEvent args)
@@ -29,14 +136,17 @@ public sealed class SprayPainterSystem : SharedSprayPainterSystem
if (args.Handled || args.Cancelled)
return;
- if (args.Args.Target is not {} target)
+ if (args.Args.Target is not { } target)
return;
if (!TryComp(target, out var color))
return;
- Audio.PlayPvs(ent.Comp.SpraySound, ent);
+ if (TryComp(ent, out var charges) &&
+ !_charges.TryUseCharges((ent, charges), ent.Comp.PipeChargeCost))
+ return;
+ Audio.PlayPvs(ent.Comp.SpraySound, ent);
_pipeColor.SetColor(target, color, args.Color);
args.Handled = true;
@@ -47,13 +157,28 @@ public sealed class SprayPainterSystem : SharedSprayPainterSystem
if (args.Handled)
return;
- if (!TryComp(args.Used, out var painter) || painter.PickedColor is not {} colorName)
+ if (!TryComp(args.Used, out var painter) ||
+ painter.PickedColor is not { } colorName)
return;
if (!painter.ColorPalette.TryGetValue(colorName, out var color))
return;
- var doAfterEventArgs = new DoAfterArgs(EntityManager, args.User, painter.PipeSprayTime, new SprayPainterPipeDoAfterEvent(color), args.Used, target: ent, used: args.Used)
+ if (TryComp(args.Used, out var charges)
+ && charges.LastCharges < painter.PipeChargeCost)
+ {
+ var msg = Loc.GetString("spray-painter-interact-no-charges");
+ _popup.PopupEntity(msg, args.User, args.User);
+ return;
+ }
+
+ var doAfterEventArgs = new DoAfterArgs(EntityManager,
+ args.User,
+ painter.PipeSprayTime,
+ new SprayPainterPipeDoAfterEvent(color),
+ args.Used,
+ target: ent,
+ used: args.Used)
{
BreakOnMove = true,
BreakOnDamage = true,
diff --git a/Content.Shared/Doors/Components/DoorComponent.cs b/Content.Shared/Doors/Components/DoorComponent.cs
index a8cb25782e..64b4ab1857 100644
--- a/Content.Shared/Doors/Components/DoorComponent.cs
+++ b/Content.Shared/Doors/Components/DoorComponent.cs
@@ -317,7 +317,6 @@ public enum DoorVisuals : byte
BoltLights,
EmergencyLights,
ClosedLights,
- BaseRSI,
}
public enum DoorVisualLayers : byte
diff --git a/Content.Shared/SprayPainter/Components/PaintableAirlockComponent.cs b/Content.Shared/SprayPainter/Components/PaintableAirlockComponent.cs
deleted file mode 100644
index fdd0aeeb7f..0000000000
--- a/Content.Shared/SprayPainter/Components/PaintableAirlockComponent.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-using Content.Shared.Roles;
-using Content.Shared.SprayPainter.Prototypes;
-using Robust.Shared.GameStates;
-using Robust.Shared.Prototypes;
-
-namespace Content.Shared.SprayPainter.Components;
-
-[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
-public sealed partial class PaintableAirlockComponent : Component
-{
- ///
- /// Group of styles this airlock can be painted with, e.g. glass, standard or external.
- ///
- [DataField(required: true), AutoNetworkedField]
- public ProtoId Group = string.Empty;
-
- ///
- /// Department this airlock is painted as, or none.
- /// Must be specified in prototypes for turf war to work.
- /// To better catch any mistakes, you need to explicitly state a non-styled airlock has a null department.
- ///
- [DataField(required: true), AutoNetworkedField]
- public ProtoId? Department;
-}
diff --git a/Content.Shared/SprayPainter/Components/PaintableComponent.cs b/Content.Shared/SprayPainter/Components/PaintableComponent.cs
new file mode 100644
index 0000000000..cfcb6a6c63
--- /dev/null
+++ b/Content.Shared/SprayPainter/Components/PaintableComponent.cs
@@ -0,0 +1,19 @@
+using Content.Shared.SprayPainter.Prototypes;
+using Robust.Shared.GameStates;
+using Robust.Shared.Prototypes;
+
+namespace Content.Shared.SprayPainter.Components;
+
+///
+/// Marks objects that can be painted with the spray painter.
+///
+[RegisterComponent, NetworkedComponent]
+public sealed partial class PaintableComponent : Component
+{
+ ///
+ /// Group of styles this airlock can be painted with, e.g. glass, standard or external.
+ /// Set to null to make an entity unpaintable.
+ ///
+ [DataField(required: true)]
+ public ProtoId? Group;
+}
diff --git a/Content.Shared/SprayPainter/Components/PaintedComponent.cs b/Content.Shared/SprayPainter/Components/PaintedComponent.cs
new file mode 100644
index 0000000000..83f0e6e692
--- /dev/null
+++ b/Content.Shared/SprayPainter/Components/PaintedComponent.cs
@@ -0,0 +1,18 @@
+using Robust.Shared.GameStates;
+using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
+
+namespace Content.Shared.SprayPainter.Components;
+
+///
+/// Used to mark an entity that has been repainted.
+///
+[RegisterComponent, NetworkedComponent]
+[AutoGenerateComponentState, AutoGenerateComponentPause]
+public sealed partial class PaintedComponent : Component
+{
+ ///
+ /// The time after which the entity is dried and does not appear as "freshly painted".
+ ///
+ [DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoNetworkedField, AutoPausedField]
+ public TimeSpan DryTime;
+}
diff --git a/Content.Shared/SprayPainter/Components/SprayPainterAmmo.cs b/Content.Shared/SprayPainter/Components/SprayPainterAmmo.cs
new file mode 100644
index 0000000000..d869c96d31
--- /dev/null
+++ b/Content.Shared/SprayPainter/Components/SprayPainterAmmo.cs
@@ -0,0 +1,17 @@
+using Robust.Shared.GameStates;
+
+namespace Content.Shared.SprayPainter.Components;
+
+///
+/// Items with this component can be used to recharge a spray painter.
+///
+[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
+[Access(typeof(SprayPainterAmmoSystem))]
+public sealed partial class SprayPainterAmmoComponent : Component
+{
+ ///
+ /// The value by which the charge in the spray painter will be recharged.
+ ///
+ [DataField, AutoNetworkedField]
+ public int Charges = 15;
+}
diff --git a/Content.Shared/SprayPainter/Components/SprayPainterComponent.cs b/Content.Shared/SprayPainter/Components/SprayPainterComponent.cs
index 0591cb2dcb..5485870766 100644
--- a/Content.Shared/SprayPainter/Components/SprayPainterComponent.cs
+++ b/Content.Shared/SprayPainter/Components/SprayPainterComponent.cs
@@ -1,26 +1,42 @@
-using Content.Shared.DoAfter;
+using Content.Shared.Decals;
using Robust.Shared.Audio;
using Robust.Shared.GameStates;
+using Robust.Shared.Prototypes;
namespace Content.Shared.SprayPainter.Components;
-[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
+///
+/// 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");
- [DataField]
- public TimeSpan AirlockSprayTime = TimeSpan.FromSeconds(3);
-
+ ///
+ /// 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;
+ public string PickedColor = DefaultPickedColor;
///
/// Pipe colors that can be selected.
@@ -29,9 +45,82 @@ public sealed partial class SprayPainterComponent : Component
public Dictionary ColorPalette = new();
///
- /// Airlock style index selected.
- /// After prototype reload this might not be the same style but it will never be out of bounds.
+ /// Spray paintable object styles selected per object.
///
[DataField, AutoNetworkedField]
- public int Index;
+ 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.
+///
+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,
}
diff --git a/Content.Shared/SprayPainter/Prototypes/AirlockDepartmentsPrototype.cs b/Content.Shared/SprayPainter/Prototypes/AirlockDepartmentsPrototype.cs
deleted file mode 100644
index 8f98a1a3c7..0000000000
--- a/Content.Shared/SprayPainter/Prototypes/AirlockDepartmentsPrototype.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-using Content.Shared.Roles;
-using Robust.Shared.Prototypes;
-
-namespace Content.Shared.SprayPainter.Prototypes;
-
-///
-/// Maps airlock style names to department ids.
-///
-[Prototype]
-public sealed partial class AirlockDepartmentsPrototype : IPrototype
-{
- [IdDataField]
- public string ID { get; private set; } = default!;
-
- ///
- /// Dictionary of style names to department ids.
- /// If a style does not have a department (e.g. external) it is set to null.
- ///
- [DataField(required: true)]
- public Dictionary> Departments = new();
-}
diff --git a/Content.Shared/SprayPainter/Prototypes/AirlockGroupPrototype.cs b/Content.Shared/SprayPainter/Prototypes/AirlockGroupPrototype.cs
deleted file mode 100644
index 24c28b8b7a..0000000000
--- a/Content.Shared/SprayPainter/Prototypes/AirlockGroupPrototype.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-using Robust.Shared.Prototypes;
-
-namespace Content.Shared.SprayPainter.Prototypes;
-
-[Prototype("AirlockGroup")]
-public sealed partial class AirlockGroupPrototype : IPrototype
-{
- [IdDataField]
- public string ID { get; private set; } = default!;
-
- [DataField("stylePaths")]
- public Dictionary StylePaths = default!;
-
- // The priority determines, which sprite is used when showing
- // the icon for a style in the SprayPainter UI. The highest priority
- // gets shown.
- [DataField("iconPriority")]
- public int IconPriority = 0;
-}
diff --git a/Content.Shared/SprayPainter/Prototypes/PaintableGroupCategoryPrototype.cs b/Content.Shared/SprayPainter/Prototypes/PaintableGroupCategoryPrototype.cs
new file mode 100644
index 0000000000..ba6423d94a
--- /dev/null
+++ b/Content.Shared/SprayPainter/Prototypes/PaintableGroupCategoryPrototype.cs
@@ -0,0 +1,19 @@
+using Robust.Shared.Prototypes;
+
+namespace Content.Shared.SprayPainter.Prototypes;
+
+///
+/// A category of spray paintable items (e.g. airlocks, crates)
+///
+[Prototype]
+public sealed partial class PaintableGroupCategoryPrototype : IPrototype
+{
+ [IdDataField]
+ public string ID { get; private set; } = default!;
+
+ ///
+ /// Each group that makes up this category.
+ ///
+ [DataField(required: true)]
+ public List> Groups = new();
+}
diff --git a/Content.Shared/SprayPainter/Prototypes/PaintableGroupPrototype.cs b/Content.Shared/SprayPainter/Prototypes/PaintableGroupPrototype.cs
new file mode 100644
index 0000000000..73944c4e6e
--- /dev/null
+++ b/Content.Shared/SprayPainter/Prototypes/PaintableGroupPrototype.cs
@@ -0,0 +1,53 @@
+using Robust.Shared.Prototypes;
+using Robust.Shared.Serialization;
+
+namespace Content.Shared.SprayPainter.Prototypes;
+
+///
+/// Contains a map of the objects from which the spray painter will take texture to paint another from the same group.
+///
+[Prototype]
+public sealed partial class PaintableGroupPrototype : IPrototype
+{
+ [IdDataField]
+ public string ID { get; private set; } = default!;
+
+ ///
+ /// The time required to paint an object from a given group, in seconds.
+ ///
+ [DataField]
+ public float Time = 2.0f;
+
+ ///
+ /// To number of charges needed to paint an object of this group.
+ ///
+ [DataField]
+ public int Cost = 1;
+
+ ///
+ /// The default style to start painting.
+ ///
+ [DataField(required: true)]
+ public string DefaultStyle = default!;
+
+ ///
+ /// Map from localization keys and entity identifiers displayed in the spray painter menu.
+ ///
+ [DataField(required: true)]
+ public Dictionary Styles = new();
+
+ ///
+ /// If multiple groups have the same key, the group with the highest IconPriority has its icon displayed.
+ ///
+ [DataField]
+ public int IconPriority;
+}
+
+[Serializable, NetSerializable]
+public enum PaintableVisuals
+{
+ ///
+ /// The prototype to base the object's visuals off.
+ ///
+ Prototype
+}
diff --git a/Content.Shared/SprayPainter/SharedSprayPainterSystem.cs b/Content.Shared/SprayPainter/SharedSprayPainterSystem.cs
index 1b58381675..0a766df348 100644
--- a/Content.Shared/SprayPainter/SharedSprayPainterSystem.cs
+++ b/Content.Shared/SprayPainter/SharedSprayPainterSystem.cs
@@ -1,100 +1,77 @@
using Content.Shared.Administration.Logs;
+using Content.Shared.Charges.Components;
+using Content.Shared.Charges.Systems;
using Content.Shared.Database;
using Content.Shared.DoAfter;
-using Content.Shared.Doors.Components;
+using Content.Shared.Examine;
using Content.Shared.Interaction;
using Content.Shared.Popups;
using Content.Shared.SprayPainter.Components;
using Content.Shared.SprayPainter.Prototypes;
+using Content.Shared.Verbs;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Prototypes;
+using Robust.Shared.Timing;
+using Robust.Shared.Utility;
using System.Linq;
namespace Content.Shared.SprayPainter;
///
-/// System for painting airlocks using a spray painter.
+/// System for painting paintable objects using a spray painter.
/// Pipes are handled serverside since AtmosPipeColorSystem is server only.
///
public abstract class SharedSprayPainterSystem : EntitySystem
{
+ [Dependency] private readonly IGameTiming _timing = default!;
[Dependency] protected readonly IPrototypeManager Proto = default!;
- [Dependency] private readonly ISharedAdminLogManager _adminLogger = default!;
+ [Dependency] protected readonly ISharedAdminLogManager AdminLogger = default!;
[Dependency] protected readonly SharedAppearanceSystem Appearance = default!;
[Dependency] protected readonly SharedAudioSystem Audio = default!;
+ [Dependency] protected readonly SharedChargesSystem Charges = default!;
[Dependency] protected readonly SharedDoAfterSystem DoAfter = default!;
- [Dependency] private readonly SharedPopupSystem _popup = default!;
-
- public List Styles { get; private set; } = new();
- public List Groups { get; private set; } = new();
-
- private static readonly ProtoId Departments = "Departments";
+ [Dependency] private readonly SharedPopupSystem _popup = default!;
public override void Initialize()
{
base.Initialize();
- CacheStyles();
-
SubscribeLocalEvent(OnMapInit);
- SubscribeLocalEvent(OnDoorDoAfter);
- Subs.BuiEvents(SprayPainterUiKey.Key, subs =>
- {
- subs.Event(OnSpritePicked);
- subs.Event(OnColorPicked);
- });
- SubscribeLocalEvent(OnAirlockInteract);
+ SubscribeLocalEvent(OnPainterDoAfter);
+ SubscribeLocalEvent>(OnPainterGetAltVerbs);
+ SubscribeLocalEvent(OnPaintableInteract);
+ SubscribeLocalEvent(OnPainedExamined);
- SubscribeLocalEvent(OnPrototypesReloaded);
+ Subs.BuiEvents(SprayPainterUiKey.Key,
+ subs =>
+ {
+ subs.Event(OnSetPaintable);
+ subs.Event(OnSetPipeColor);
+ subs.Event(OnTabChanged);
+ subs.Event(OnSetDecal);
+ subs.Event(OnSetDecalColor);
+ subs.Event(OnSetDecalAngle);
+ subs.Event(OnSetDecalSnap);
+ });
}
private void OnMapInit(Entity ent, ref MapInitEvent args)
{
- if (ent.Comp.ColorPalette.Count == 0)
- return;
+ bool stylesByGroupPopulated = false;
+ foreach (var groupProto in Proto.EnumeratePrototypes())
+ {
+ ent.Comp.StylesByGroup[groupProto.ID] = groupProto.DefaultStyle;
+ stylesByGroupPopulated = true;
+ }
+ if (stylesByGroupPopulated)
+ Dirty(ent);
- SetColor(ent, ent.Comp.ColorPalette.First().Key);
+ if (ent.Comp.ColorPalette.Count > 0)
+ SetPipeColor(ent, ent.Comp.ColorPalette.First().Key);
}
- private void OnDoorDoAfter(Entity ent, ref SprayPainterDoorDoAfterEvent args)
- {
- if (args.Handled || args.Cancelled)
- return;
-
- if (args.Args.Target is not {} target)
- return;
-
- if (!TryComp(target, out var airlock))
- return;
-
- airlock.Department = args.Department;
- Dirty(target, airlock);
-
- Audio.PlayPredicted(ent.Comp.SpraySound, ent, args.Args.User);
- Appearance.SetData(target, DoorVisuals.BaseRSI, args.Sprite);
- _adminLogger.Add(LogType.Action, LogImpact.Low, $"{ToPrettyString(args.Args.User):user} painted {ToPrettyString(args.Args.Target.Value):target}");
-
- args.Handled = true;
- }
-
- #region UI messages
-
- private void OnColorPicked(Entity ent, ref SprayPainterColorPickedMessage args)
- {
- SetColor(ent, args.Key);
- }
-
- private void OnSpritePicked(Entity ent, ref SprayPainterSpritePickedMessage args)
- {
- if (args.Index >= Styles.Count)
- return;
-
- ent.Comp.Index = args.Index;
- Dirty(ent, ent.Comp);
- }
-
- private void SetColor(Entity ent, string? paletteKey)
+ private void SetPipeColor(Entity ent, string? paletteKey)
{
if (paletteKey == null || paletteKey == ent.Comp.PickedColor)
return;
@@ -103,12 +80,98 @@ public abstract class SharedSprayPainterSystem : EntitySystem
return;
ent.Comp.PickedColor = paletteKey;
- Dirty(ent, ent.Comp);
+ Dirty(ent);
+ UpdateUi(ent);
}
- #endregion
+ #region Interaction
- private void OnAirlockInteract(Entity ent, ref InteractUsingEvent args)
+ private void OnPainterDoAfter(Entity ent, ref SprayPainterDoAfterEvent args)
+ {
+ if (args.Handled || args.Cancelled)
+ return;
+
+ if (args.Args.Target is not { } target)
+ return;
+
+ if (!HasComp(target))
+ return;
+
+ Appearance.SetData(target, PaintableVisuals.Prototype, args.Prototype);
+ Audio.PlayPredicted(ent.Comp.SpraySound, ent, args.Args.User);
+ Charges.TryUseCharges(new Entity(ent, EnsureComp(ent)), args.Cost);
+
+ var paintedComponent = EnsureComp(target);
+ paintedComponent.DryTime = _timing.CurTime + ent.Comp.FreshPaintDuration;
+ Dirty(target, paintedComponent);
+
+ var ev = new EntityPaintedEvent(
+ User: args.User,
+ Tool: ent,
+ Prototype: args.Prototype,
+ Group: args.Group);
+ RaiseLocalEvent(target, ref ev);
+
+ AdminLogger.Add(LogType.Action,
+ LogImpact.Low,
+ $"{ToPrettyString(args.Args.User):user} painted {ToPrettyString(args.Args.Target.Value):target}");
+
+ args.Handled = true;
+ }
+
+ private void OnPainterGetAltVerbs(Entity ent, ref GetVerbsEvent args)
+ {
+ if (!args.CanAccess || !args.CanInteract || !args.Using.HasValue)
+ return;
+
+ var user = args.User;
+
+ AlternativeVerb verb = new()
+ {
+ Text = Loc.GetString("spray-painter-verb-toggle-decals"),
+ Icon = new SpriteSpecifier.Texture(new ResPath("/Textures/Interface/VerbIcons/settings.svg.192dpi.png")),
+ Act = () => TogglePaintDecals(ent, user),
+ Impact = LogImpact.Low
+ };
+ args.Verbs.Add(verb);
+ }
+
+ ///
+ /// Toggles whether clicking on the floor paints a decal or not.
+ ///
+ private void TogglePaintDecals(Entity ent, EntityUid user)
+ {
+ if (!_timing.IsFirstTimePredicted)
+ return;
+
+ var pitch = 1.0f;
+ switch (ent.Comp.DecalMode)
+ {
+ case DecalPaintMode.Off:
+ default:
+ ent.Comp.DecalMode = DecalPaintMode.Add;
+ pitch = 1.0f;
+ break;
+ case DecalPaintMode.Add:
+ ent.Comp.DecalMode = DecalPaintMode.Remove;
+ pitch = 1.2f;
+ break;
+ case DecalPaintMode.Remove:
+ ent.Comp.DecalMode = DecalPaintMode.Off;
+ pitch = 0.8f;
+ break;
+ }
+ Dirty(ent);
+
+ // Make the machine beep.
+ Audio.PlayPredicted(ent.Comp.SoundSwitchDecalMode, ent, user, ent.Comp.SoundSwitchDecalMode.Params.WithPitchScale(pitch));
+ }
+
+ ///
+ /// Handles spray paint interactions with an object.
+ /// An object must belong to a spray paintable group to be painted, and the painter must have sufficient ammo to paint it.
+ ///
+ private void OnPaintableInteract(Entity ent, ref InteractUsingEvent args)
{
if (args.Handled)
return;
@@ -116,79 +179,140 @@ public abstract class SharedSprayPainterSystem : EntitySystem
if (!TryComp(args.Used, out var painter))
return;
- var group = Proto.Index(ent.Comp.Group);
+ if (ent.Comp.Group is not { } group
+ || !painter.StylesByGroup.TryGetValue(group, out var selectedStyle)
+ || !Proto.TryIndex(group, out PaintableGroupPrototype? targetGroup))
+ return;
- var style = Styles[painter.Index];
- if (!group.StylePaths.TryGetValue(style.Name, out var sprite))
+ // Valid paint target.
+ args.Handled = true;
+
+ if (TryComp(args.Used, out var charges)
+ && charges.LastCharges < targetGroup.Cost)
{
- string msg = Loc.GetString("spray-painter-style-not-available");
+ var msg = Loc.GetString("spray-painter-interact-no-charges");
_popup.PopupClient(msg, args.User, args.User);
return;
}
- var doAfterEventArgs = new DoAfterArgs(EntityManager, args.User, painter.AirlockSprayTime, new SprayPainterDoorDoAfterEvent(sprite, style.Department), args.Used, target: ent, used: args.Used)
+ if (!targetGroup.Styles.TryGetValue(selectedStyle, out var proto))
+ {
+ var msg = Loc.GetString("spray-painter-style-not-available");
+ _popup.PopupClient(msg, args.User, args.User);
+ return;
+ }
+
+ var doAfterEventArgs = new DoAfterArgs(EntityManager,
+ args.User,
+ targetGroup.Time,
+ new SprayPainterDoAfterEvent(proto, group, targetGroup.Cost),
+ args.Used,
+ target: ent,
+ used: args.Used)
{
BreakOnMove = true,
BreakOnDamage = true,
NeedHand = true,
};
- if (!DoAfter.TryStartDoAfter(doAfterEventArgs, out var id))
- return;
- args.Handled = true;
+ if (!DoAfter.TryStartDoAfter(doAfterEventArgs, out _))
+ return;
// Log the attempt
- _adminLogger.Add(LogType.Action, LogImpact.Low, $"{ToPrettyString(args.User):user} is painting {ToPrettyString(ent):target} to '{style.Name}' at {Transform(ent).Coordinates:targetlocation}");
+ AdminLogger.Add(LogType.Action,
+ LogImpact.Low,
+ $"{ToPrettyString(args.User):user} is painting {ToPrettyString(ent):target} to '{selectedStyle}' at {Transform(ent).Coordinates:targetlocation}");
}
- #region Style caching
-
- private void OnPrototypesReloaded(PrototypesReloadedEventArgs args)
+ ///
+ /// Prints out if an object has been painted recently.
+ ///
+ private void OnPainedExamined(Entity ent, ref ExaminedEvent args)
{
- if (!args.WasModified() && !args.WasModified())
+ // If the paint's dried, it isn't detectable.
+ if (_timing.CurTime > ent.Comp.DryTime)
return;
- Styles.Clear();
- Groups.Clear();
- CacheStyles();
-
- // style index might be invalid now so check them all
- var max = Styles.Count - 1;
- var query = AllEntityQuery();
- while (query.MoveNext(out var uid, out var comp))
- {
- if (comp.Index > max)
- {
- comp.Index = max;
- Dirty(uid, comp);
- }
- }
+ args.PushText(Loc.GetString("spray-painter-on-examined-painted-message"));
}
- protected virtual void CacheStyles()
- {
- // collect every style's name
- var names = new SortedSet();
- foreach (var group in Proto.EnumeratePrototypes())
- {
- Groups.Add(group);
- foreach (var style in group.StylePaths.Keys)
- {
- names.Add(style);
- }
- }
+ #endregion Interaction
- // get their department ids too for the final style list
- var departments = Proto.Index(Departments);
- Styles.Capacity = names.Count;
- foreach (var name in names)
- {
- departments.Departments.TryGetValue(name, out var department);
- Styles.Add(new AirlockStyle(name, department));
- }
+ #region UI
+
+ ///
+ /// Sets the style that a particular type of paintable object (e.g. lockers) should be painted in.
+ ///
+ private void OnSetPaintable(Entity ent, ref SprayPainterSetPaintableStyleMessage args)
+ {
+ if (!ent.Comp.StylesByGroup.ContainsKey(args.Group))
+ return;
+
+ ent.Comp.StylesByGroup[args.Group] = args.Style;
+ Dirty(ent);
+ UpdateUi(ent);
+ }
+
+ ///
+ /// Changes the color to paint pipes in.
+ ///
+ private void OnSetPipeColor(Entity ent, ref SprayPainterSetPipeColorMessage args)
+ {
+ SetPipeColor(ent, args.Key);
+ }
+
+ ///
+ /// Tracks the tab the spray painter was on.
+ ///
+ private void OnTabChanged(Entity ent, ref SprayPainterTabChangedMessage args)
+ {
+ ent.Comp.SelectedTab = args.Index;
+ Dirty(ent);
+ }
+
+ ///
+ /// Sets the decal prototype to paint.
+ ///
+ private void OnSetDecal(Entity ent, ref SprayPainterSetDecalMessage args)
+ {
+ ent.Comp.SelectedDecal = args.DecalPrototype;
+ Dirty(ent);
+ UpdateUi(ent);
+ }
+
+ ///
+ /// Sets the angle to paint decals at.
+ ///
+ private void OnSetDecalAngle(Entity ent, ref SprayPainterSetDecalAngleMessage args)
+ {
+ ent.Comp.SelectedDecalAngle = args.Angle;
+ Dirty(ent);
+ UpdateUi(ent);
+ }
+
+ ///
+ /// Enables or disables snap-to-grid when painting decals.
+ ///
+ private void OnSetDecalSnap(Entity ent, ref SprayPainterSetDecalSnapMessage args)
+ {
+ ent.Comp.SnapDecals = args.Snap;
+ Dirty(ent);
+ UpdateUi(ent);
+ }
+
+ ///
+ /// Sets the decal to paint on the ground.
+ ///
+ private void OnSetDecalColor(Entity ent, ref SprayPainterSetDecalColorMessage args)
+ {
+ ent.Comp.SelectedDecalColor = args.Color;
+ Dirty(ent);
+ UpdateUi(ent);
+ }
+
+ protected virtual void UpdateUi(Entity ent)
+ {
}
#endregion
}
-
-public record struct AirlockStyle(string Name, string? Department);
diff --git a/Content.Shared/SprayPainter/SprayPainterAmmoSystem.cs b/Content.Shared/SprayPainter/SprayPainterAmmoSystem.cs
new file mode 100644
index 0000000000..d43420efc5
--- /dev/null
+++ b/Content.Shared/SprayPainter/SprayPainterAmmoSystem.cs
@@ -0,0 +1,62 @@
+using Content.Shared.Charges.Components;
+using Content.Shared.Charges.Systems;
+using Content.Shared.Examine;
+using Content.Shared.Interaction;
+using Content.Shared.Popups;
+using Content.Shared.SprayPainter.Components;
+
+namespace Content.Shared.SprayPainter;
+
+///
+/// The system handles interactions with spray painter ammo.
+///
+public sealed class SprayPainterAmmoSystem : EntitySystem
+{
+ [Dependency] private readonly SharedChargesSystem _charges = default!;
+ [Dependency] private readonly SharedPopupSystem _popup = default!;
+
+ public override void Initialize()
+ {
+ base.Initialize();
+
+ SubscribeLocalEvent(OnExamine);
+ SubscribeLocalEvent(OnAfterInteract);
+ }
+
+ private void OnAfterInteract(Entity ent, ref AfterInteractEvent args)
+ {
+ if (args.Handled || !args.CanReach)
+ return;
+
+ if (args.Target is not { Valid: true } target ||
+ !HasComp(target) ||
+ !TryComp(target, out var charges))
+ return;
+
+ var user = args.User;
+ args.Handled = true;
+ var count = Math.Min(charges.MaxCharges - charges.LastCharges, ent.Comp.Charges);
+ if (count <= 0)
+ {
+ _popup.PopupClient(Loc.GetString("spray-painter-ammo-after-interact-full"), target, user);
+ return;
+ }
+
+ _popup.PopupClient(Loc.GetString("spray-painter-ammo-after-interact-refilled"), target, user);
+ _charges.AddCharges(target, count);
+ ent.Comp.Charges -= count;
+ Dirty(ent, ent.Comp);
+
+ if (ent.Comp.Charges <= 0)
+ PredictedQueueDel(ent.Owner);
+ }
+
+ private void OnExamine(Entity ent, ref ExaminedEvent args)
+ {
+ if (!args.IsInDetailsRange)
+ return;
+
+ var examineMessage = Loc.GetString("rcd-ammo-component-on-examine", ("charges", ent.Comp.Charges));
+ args.PushText(examineMessage);
+ }
+}
diff --git a/Content.Shared/SprayPainter/SprayPainterEvents.cs b/Content.Shared/SprayPainter/SprayPainterEvents.cs
index b88b054ad1..db9de9c278 100644
--- a/Content.Shared/SprayPainter/SprayPainterEvents.cs
+++ b/Content.Shared/SprayPainter/SprayPainterEvents.cs
@@ -1,4 +1,7 @@
+using Content.Shared.Decals;
using Content.Shared.DoAfter;
+using Content.Shared.SprayPainter.Prototypes;
+using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
namespace Content.Shared.SprayPainter;
@@ -10,46 +13,75 @@ public enum SprayPainterUiKey
}
[Serializable, NetSerializable]
-public sealed class SprayPainterSpritePickedMessage : BoundUserInterfaceMessage
+public sealed class SprayPainterSetDecalMessage(ProtoId protoId) : BoundUserInterfaceMessage
{
- public readonly int Index;
-
- public SprayPainterSpritePickedMessage(int index)
- {
- Index = index;
- }
+ public ProtoId DecalPrototype = protoId;
}
[Serializable, NetSerializable]
-public sealed class SprayPainterColorPickedMessage : BoundUserInterfaceMessage
+public sealed class SprayPainterSetDecalColorMessage(Color? color) : BoundUserInterfaceMessage
{
- public readonly string? Key;
-
- public SprayPainterColorPickedMessage(string? key)
- {
- Key = key;
- }
+ public Color? Color = color;
}
[Serializable, NetSerializable]
-public sealed partial class SprayPainterDoorDoAfterEvent : DoAfterEvent
+public sealed class SprayPainterSetDecalSnapMessage(bool snap) : BoundUserInterfaceMessage
+{
+ public bool Snap = snap;
+}
+
+[Serializable, NetSerializable]
+public sealed class SprayPainterSetDecalAngleMessage(int angle) : BoundUserInterfaceMessage
+{
+ public int Angle = angle;
+}
+
+[Serializable, NetSerializable]
+public sealed class SprayPainterTabChangedMessage(int index, bool isSelectedTabWithDecals) : BoundUserInterfaceMessage
+{
+ public readonly int Index = index;
+ public readonly bool IsSelectedTabWithDecals = isSelectedTabWithDecals;
+}
+
+[Serializable, NetSerializable]
+public sealed class SprayPainterSetPaintableStyleMessage(string group, string style) : BoundUserInterfaceMessage
+{
+ public readonly string Group = group;
+ public readonly string Style = style;
+}
+
+[Serializable, NetSerializable]
+public sealed class SprayPainterSetPipeColorMessage(string? key) : BoundUserInterfaceMessage
+{
+ public readonly string? Key = key;
+}
+
+[Serializable, NetSerializable]
+public sealed partial class SprayPainterDoAfterEvent : DoAfterEvent
{
///
- /// Base RSI path to set for the door sprite.
+ /// The prototype to use to repaint this object.
///
[DataField]
- public string Sprite;
+ public string Prototype;
///
- /// Department id to set for the door, if the style has one.
+ /// The group ID of the object being painted.
///
[DataField]
- public string? Department;
+ public string Group;
- public SprayPainterDoorDoAfterEvent(string sprite, string? department)
+ ///
+ /// The cost, in charges, to paint this object.
+ ///
+ [DataField]
+ public int Cost;
+
+ public SprayPainterDoAfterEvent(string prototype, string group, int cost)
{
- Sprite = sprite;
- Department = department;
+ Prototype = prototype;
+ Group = group;
+ Cost = cost;
}
public override DoAfterEvent Clone() => this;
@@ -71,3 +103,17 @@ public sealed partial class SprayPainterPipeDoAfterEvent : DoAfterEvent
public override DoAfterEvent Clone() => this;
}
+
+///
+/// An action raised on an entity when it is spray painted.
+///
+/// The entity painting this item.
+/// The entity used to paint this item.
+/// The prototype used to generate the new painted appearance.
+/// The group of the entity being painted (e.g. airlocks with glass, canisters).
+[ByRefEvent]
+public partial record struct EntityPaintedEvent(
+ EntityUid? User,
+ EntityUid Tool,
+ EntProtoId Prototype,
+ ProtoId Group);
diff --git a/Resources/Locale/en-US/engineer-painter/engineer-painter.ftl b/Resources/Locale/en-US/engineer-painter/engineer-painter.ftl
deleted file mode 100644
index d3d3ccc444..0000000000
--- a/Resources/Locale/en-US/engineer-painter/engineer-painter.ftl
+++ /dev/null
@@ -1,14 +0,0 @@
-spray-painter-window-title = Spray painter
-
-spray-painter-style-not-available = Cannot apply the selected style to this type of airlock
-spray-painter-selected-style = Selected style:
-
-spray-painter-selected-color = Selected color:
-spray-painter-color-red = red
-spray-painter-color-yellow = yellow
-spray-painter-color-brown = brown
-spray-painter-color-green = green
-spray-painter-color-cyan = cyan
-spray-painter-color-blue = blue
-spray-painter-color-white = white
-spray-painter-color-black = black
diff --git a/Resources/Locale/en-US/spray-painter/spray-painter.ftl b/Resources/Locale/en-US/spray-painter/spray-painter.ftl
new file mode 100644
index 0000000000..dc54c5c8b8
--- /dev/null
+++ b/Resources/Locale/en-US/spray-painter/spray-painter.ftl
@@ -0,0 +1,194 @@
+# Components
+spray-painter-ammo-on-examine = It holds {$charges} charges.
+spray-painter-ammo-after-interact-full = The spray painter is full!
+spray-painter-ammo-after-interact-refilled = You refill the spray painter.
+
+spray-painter-interact-no-charges = Not enough paint left.
+spray-painter-interact-nothing-to-remove = Nothing to remove!
+
+spray-painter-on-examined-painted-message = It seems to have been freshly painted.
+spray-painter-style-not-available = Cannot apply the selected style to this object.
+
+spray-painter-verb-toggle-decals = Toggle decal painting
+
+spray-painter-item-status-label = Decals: {$mode}
+spray-painter-item-status-add = [color=green]Add[/color]
+spray-painter-item-status-remove = [color=red]Remove[/color]
+spray-painter-item-status-off = [color=gray]Off[/color]
+
+# UI
+spray-painter-window-title = Spray Painter
+
+spray-painter-selected-style = Selected style:
+
+spray-painter-selected-decals = Selected decal:
+spray-painter-use-custom-color = Use custom color
+spray-painter-use-snap-to-tile = Snap to tile
+
+spray-painter-angle-rotation = Rotation:
+spray-painter-angle-rotation-90-sub = -90°
+spray-painter-angle-rotation-reset = 0°
+spray-painter-angle-rotation-90-add = +90°
+
+spray-painter-selected-color = Selected color:
+spray-painter-color-red = red
+spray-painter-color-yellow = yellow
+spray-painter-color-brown = brown
+spray-painter-color-green = green
+spray-painter-color-cyan = cyan
+spray-painter-color-blue = blue
+spray-painter-color-white = white
+spray-painter-color-black = black
+
+# Categories (tabs)
+spray-painter-tab-category-airlocks = Airlocks
+spray-painter-tab-category-canisters = Canisters
+spray-painter-tab-category-crates = Crates
+spray-painter-tab-category-lockers = Lockers
+spray-painter-tab-category-pipes = Pipes
+spray-painter-tab-category-decals = Decals
+
+# Groups (subtabs)
+spray-painter-tab-group-airlockstandard = Standard
+spray-painter-tab-group-airlockglass = Glass
+
+spray-painter-tab-group-cratesteel = Steel
+spray-painter-tab-group-crateplastic = Plastic
+spray-painter-tab-group-cratesecure = Secure
+
+spray-painter-tab-group-closet = Unlocked
+spray-painter-tab-group-locker = Secure
+spray-painter-tab-group-wallcloset = Unlocked (Wall)
+spray-painter-tab-group-walllocker = Secure (Wall)
+
+# Airlocks
+spray-painter-style-airlockstandard-atmospherics = Atmospheric
+spray-painter-style-airlockstandard-basic = Basic
+spray-painter-style-airlockstandard-cargo = Cargo
+spray-painter-style-airlockstandard-chemistry = Chemistry
+spray-painter-style-airlockstandard-command = Command
+spray-painter-style-airlockstandard-engineering = Engineering
+spray-painter-style-airlockstandard-freezer = Freezer
+spray-painter-style-airlockstandard-hydroponics = Hydroponics
+spray-painter-style-airlockstandard-maintenance = Maintenance
+spray-painter-style-airlockstandard-medical = Medical
+spray-painter-style-airlockstandard-salvage = Salvage
+spray-painter-style-airlockstandard-science = Science
+spray-painter-style-airlockstandard-security = Security
+spray-painter-style-airlockstandard-virology = Virology
+
+spray-painter-style-airlockglass-atmospherics = Atmospherics
+spray-painter-style-airlockglass-basic = Basic
+spray-painter-style-airlockglass-cargo = Cargo
+spray-painter-style-airlockglass-chemistry = Chemistry
+spray-painter-style-airlockglass-command = Command
+spray-painter-style-airlockglass-engineering = Engineering
+spray-painter-style-airlockglass-hydroponics = Hydroponics
+spray-painter-style-airlockglass-maintenance = Maintenance
+spray-painter-style-airlockglass-medical = Medical
+spray-painter-style-airlockglass-salvage = Salvage
+spray-painter-style-airlockglass-science = Science
+spray-painter-style-airlockglass-security = Security
+spray-painter-style-airlockglass-virology = Virology
+
+# Lockers
+spray-painter-style-locker-atmospherics = Atmospherics
+spray-painter-style-locker-basic = Basic
+spray-painter-style-locker-botanist = Botanist
+spray-painter-style-locker-brigmedic = Brigmedic
+spray-painter-style-locker-captain = Captain
+spray-painter-style-locker-ce = CE
+spray-painter-style-locker-chemical = Chemical
+spray-painter-style-locker-clown = Clown
+spray-painter-style-locker-cmo = CMO
+spray-painter-style-locker-doctor = Doctor
+spray-painter-style-locker-electrical = Electrical
+spray-painter-style-locker-engineer = Engineer
+spray-painter-style-locker-evac = Evac repair
+spray-painter-style-locker-hop = HOP
+spray-painter-style-locker-hos = HOS
+spray-painter-style-locker-medicine = Medicine
+spray-painter-style-locker-mime = Mime
+spray-painter-style-locker-paramedic = Paramedic
+spray-painter-style-locker-quartermaster = Quartermaster
+spray-painter-style-locker-rd = RD
+spray-painter-style-locker-representative = Representative
+spray-painter-style-locker-salvage = Salvage
+spray-painter-style-locker-scientist = Scientist
+spray-painter-style-locker-security = Security
+spray-painter-style-locker-welding = Welding
+
+spray-painter-style-closet-basic = Basic
+spray-painter-style-closet-biohazard = Biohazard
+spray-painter-style-closet-biohazard-science = Biohazard (science)
+spray-painter-style-closet-biohazard-virology = Biohazard (virology)
+spray-painter-style-closet-biohazard-security = Biohazard (security)
+spray-painter-style-closet-biohazard-janitor = Biohazard (janitor)
+spray-painter-style-closet-bomb = Bomb suit
+spray-painter-style-closet-bomb-janitor = Bomb suit (janitor)
+spray-painter-style-closet-chef = Chef
+spray-painter-style-closet-fire = Fire-safety
+spray-painter-style-closet-janitor = Janitor
+spray-painter-style-closet-legal = Lawyer
+spray-painter-style-closet-nitrogen = Internals (nitrogen)
+spray-painter-style-closet-oxygen = Internals (oxygen)
+spray-painter-style-closet-radiation = Radiation suit
+spray-painter-style-closet-tool = Tools
+
+spray-painter-style-wallcloset-atmospherics = Atmospherics
+spray-painter-style-wallcloset-basic = Basic
+spray-painter-style-wallcloset-black = Black
+spray-painter-style-wallcloset-blue = Blue
+spray-painter-style-wallcloset-fire = Fire-safety
+spray-painter-style-wallcloset-green = Green
+spray-painter-style-wallcloset-grey = Grey
+spray-painter-style-wallcloset-mixed = Mixed
+spray-painter-style-wallcloset-nitrogen = Internals (nitrogen)
+spray-painter-style-wallcloset-orange = Orange
+spray-painter-style-wallcloset-oxygen = Internals (oxygen)
+spray-painter-style-wallcloset-pink = Pink
+spray-painter-style-wallcloset-white = White
+spray-painter-style-wallcloset-yellow = Yellow
+
+spray-painter-style-walllocker-evac = Evac repair
+spray-painter-style-walllocker-medical = Medical
+
+# Crates
+spray-painter-style-cratesteel-basic = Basic
+spray-painter-style-cratesteel-electrical = Electrical
+spray-painter-style-cratesteel-engineering = Engineering
+spray-painter-style-cratesteel-radiation = Radiation
+spray-painter-style-cratesteel-science = Science
+spray-painter-style-cratesteel-surgery = Surgery
+
+spray-painter-style-crateplastic-basic = Basic
+spray-painter-style-crateplastic-chemistry = Chemistry
+spray-painter-style-crateplastic-command = Command
+spray-painter-style-crateplastic-hydroponics = Hydroponics
+spray-painter-style-crateplastic-medical = Medical
+spray-painter-style-crateplastic-oxygen = Oxygen
+
+spray-painter-style-cratesecure-basic = Basic
+spray-painter-style-cratesecure-chemistry = Chemistry
+spray-painter-style-cratesecure-command = Command
+spray-painter-style-cratesecure-engineering = Engineering
+spray-painter-style-cratesecure-hydroponics = Hydroponics
+spray-painter-style-cratesecure-medical = Medical
+spray-painter-style-cratesecure-plasma = Plasma
+spray-painter-style-cratesecure-private = Private
+spray-painter-style-cratesecure-science = Science
+spray-painter-style-cratesecure-secgear = Secgear
+spray-painter-style-cratesecure-weapon = Weapon
+
+# Canisters
+spray-painter-style-canisters-air = Air
+spray-painter-style-canisters-ammonia = Ammonia
+spray-painter-style-canisters-carbon-dioxide = Carbon dioxide
+spray-painter-style-canisters-frezon = Frezon
+spray-painter-style-canisters-nitrogen = Nitrogen
+spray-painter-style-canisters-nitrous-oxide = Nitrous oxide
+spray-painter-style-canisters-oxygen = Oxygen
+spray-painter-style-canisters-plasma = Plasma
+spray-painter-style-canisters-storage = Storage
+spray-painter-style-canisters-tritium = Tritium
+spray-painter-style-canisters-water-vapor = Water vapor
diff --git a/Resources/Prototypes/Catalog/VendingMachines/Inventories/youtool.yml b/Resources/Prototypes/Catalog/VendingMachines/Inventories/youtool.yml
index 2231c714ff..71beff3cf5 100644
--- a/Resources/Prototypes/Catalog/VendingMachines/Inventories/youtool.yml
+++ b/Resources/Prototypes/Catalog/VendingMachines/Inventories/youtool.yml
@@ -13,6 +13,7 @@
FlashlightLantern: 5
ClothingHandsGlovesColorYellowBudget: 3
SprayPainter: 3
+ SprayPainterAmmo: 5
# Some engineer forgot to take the multitool out the youtool when working on it, happens.
contrabandInventory:
Multitool: 1
diff --git a/Resources/Prototypes/Entities/Clothing/Belt/belts.yml b/Resources/Prototypes/Entities/Clothing/Belt/belts.yml
index 61fe2c90e4..29bbb9089d 100644
--- a/Resources/Prototypes/Entities/Clothing/Belt/belts.yml
+++ b/Resources/Prototypes/Entities/Clothing/Belt/belts.yml
@@ -35,6 +35,7 @@
components:
- StationMap
- SprayPainter
+ - SprayPainterAmmo
- NetworkConfigurator
- RCD
- RCDAmmo
@@ -119,6 +120,7 @@
components:
- StationMap
- SprayPainter
+ - SprayPainterAmmo
- NetworkConfigurator
- RCD
- RCDAmmo
diff --git a/Resources/Prototypes/Entities/Objects/Tools/spray_painter.yml b/Resources/Prototypes/Entities/Objects/Tools/spray_painter.yml
index 679c6f22fe..23d7b68d37 100644
--- a/Resources/Prototypes/Entities/Objects/Tools/spray_painter.yml
+++ b/Resources/Prototypes/Entities/Objects/Tools/spray_painter.yml
@@ -2,7 +2,7 @@
parent: BaseItem
id: SprayPainter
name: spray painter
- description: A spray painter for painting airlocks and pipes.
+ description: A spray painter for painting airlocks, pipes, and other items.
components:
- type: Sprite
sprite: Objects/Tools/spray_painter.rsi
@@ -32,6 +32,45 @@
mix: '#947507'
- type: StaticPrice
price: 40
+ - type: LimitedCharges
+ maxCharges: 15
+ lastCharges: 15
- type: PhysicalComposition
materialComposition:
Steel: 100
+
+- type: entity
+ parent: SprayPainter
+ id: SprayPainterRecharging
+ suffix: Admeme
+ components:
+ - type: AutoRecharge
+ rechargeDuration: 1
+
+- type: entity
+ parent: SprayPainter
+ id: SprayPainterEmpty
+ suffix: Empty
+ components:
+ - type: LimitedCharges
+ lastCharges: -1
+
+- type: entity
+ parent: BaseItem
+ id: SprayPainterAmmo
+ name: compressed paint
+ description: A cartridge of highly compressed paint, commonly used in spray painters.
+ components:
+ - type: SprayPainterAmmo
+ - type: Sprite
+ sprite: Objects/Tools/spray_painter.rsi
+ state: ammo
+ - type: Item
+ sprite: Objects/Tools/spray_painter.rsi
+ heldPrefix: ammo
+ - type: PhysicalComposition
+ materialComposition:
+ Steel: 10
+ Plastic: 10
+ - type: StaticPrice
+ price: 30
diff --git a/Resources/Prototypes/Entities/Structures/Doors/Airlocks/airlocks.yml b/Resources/Prototypes/Entities/Structures/Doors/Airlocks/airlocks.yml
index f61b97076f..67e46649ef 100644
--- a/Resources/Prototypes/Entities/Structures/Doors/Airlocks/airlocks.yml
+++ b/Resources/Prototypes/Entities/Structures/Doors/Airlocks/airlocks.yml
@@ -15,8 +15,6 @@
components:
- type: Sprite
sprite: Structures/Doors/Airlocks/Standard/engineering.rsi
- - type: PaintableAirlock
- department: Engineering
- type: Wires
layoutId: AirlockEngineering
@@ -35,8 +33,6 @@
components:
- type: Sprite
sprite: Structures/Doors/Airlocks/Standard/cargo.rsi
- - type: PaintableAirlock
- department: Cargo
- type: Wires
layoutId: AirlockCargo
@@ -67,8 +63,6 @@
components:
- type: Sprite
sprite: Structures/Doors/Airlocks/Standard/medical.rsi
- - type: PaintableAirlock
- department: Medical
- type: Wires
layoutId: AirlockMedical
@@ -95,8 +89,6 @@
components:
- type: Sprite
sprite: Structures/Doors/Airlocks/Standard/science.rsi
- - type: PaintableAirlock
- department: Science
- type: Wires
layoutId: AirlockScience
@@ -109,8 +101,6 @@
sprite: Structures/Doors/Airlocks/Standard/command.rsi
- type: WiresPanelSecurity
securityLevel: medSecurity
- - type: PaintableAirlock
- department: Command
- type: Wires
layoutId: AirlockCommand
@@ -121,8 +111,6 @@
components:
- type: Sprite
sprite: Structures/Doors/Airlocks/Standard/security.rsi
- - type: PaintableAirlock
- department: Security
- type: Wires
layoutId: AirlockSecurity
@@ -151,6 +139,8 @@
sprite: Structures/Doors/Airlocks/Standard/mining.rsi
- type: Wires
layoutId: AirlockCargo
+ - type: Paintable
+ group: null
- type: entity
parent: AirlockCommand # if you get centcom door somehow it counts as command, also inherit panel
@@ -167,6 +157,8 @@
components:
- type: Sprite
sprite: Structures/Doors/Airlocks/Standard/hatch.rsi
+ - type: Paintable
+ group: null
- type: entity
parent: Airlock
@@ -175,6 +167,8 @@
components:
- type: Sprite
sprite: Structures/Doors/Airlocks/Standard/hatch_maint.rsi
+ - type: Paintable
+ group: null
# Glass
- type: entity
@@ -184,8 +178,6 @@
components:
- type: Sprite
sprite: Structures/Doors/Airlocks/Glass/engineering.rsi
- - type: PaintableAirlock
- department: Engineering
- type: Wires
layoutId: AirlockEngineering
@@ -212,8 +204,6 @@
components:
- type: Sprite
sprite: Structures/Doors/Airlocks/Glass/cargo.rsi
- - type: PaintableAirlock
- department: Cargo
- type: Wires
layoutId: AirlockCargo
@@ -244,8 +234,6 @@
components:
- type: Sprite
sprite: Structures/Doors/Airlocks/Glass/medical.rsi
- - type: PaintableAirlock
- department: Medical
- type: Wires
layoutId: AirlockMedical
@@ -272,8 +260,6 @@
components:
- type: Sprite
sprite: Structures/Doors/Airlocks/Glass/science.rsi
- - type: PaintableAirlock
- department: Science
- type: Wires
layoutId: AirlockScience
@@ -284,8 +270,6 @@
components:
- type: Sprite
sprite: Structures/Doors/Airlocks/Glass/command.rsi
- - type: PaintableAirlock
- department: Command
- type: WiresPanelSecurity
securityLevel: medSecurity
- type: Wires
@@ -298,8 +282,6 @@
components:
- type: Sprite
sprite: Structures/Doors/Airlocks/Glass/security.rsi
- - type: PaintableAirlock
- department: Security
- type: Wires
layoutId: AirlockSecurity
@@ -318,6 +300,8 @@
components:
- type: Sprite
sprite: Structures/Doors/Airlocks/Glass/mining.rsi
+ - type: Paintable
+ group: null
- type: entity
parent: AirlockCommandGlass # see standard
@@ -342,6 +326,8 @@
components:
- type: Sprite
sprite: Structures/Doors/Airlocks/Standard/xeno.rsi
+ - type: Paintable
+ group: null
- type: entity
parent: AirlockGlass
@@ -350,3 +336,5 @@
components:
- type: Sprite
sprite: Structures/Doors/Airlocks/Glass/xeno.rsi
+ - type: Paintable
+ group: null
diff --git a/Resources/Prototypes/Entities/Structures/Doors/Airlocks/base_structureairlocks.yml b/Resources/Prototypes/Entities/Structures/Doors/Airlocks/base_structureairlocks.yml
index 3e70b5ccbe..437076b0a2 100644
--- a/Resources/Prototypes/Entities/Structures/Doors/Airlocks/base_structureairlocks.yml
+++ b/Resources/Prototypes/Entities/Structures/Doors/Airlocks/base_structureairlocks.yml
@@ -158,9 +158,8 @@
- board
- type: PlacementReplacement
key: walls
- - type: PaintableAirlock
- group: Standard
- department: Civilian
+ - type: Paintable
+ group: AirlockStandard
- type: StaticPrice
price: 150
- type: LightningTarget
@@ -220,8 +219,8 @@
- type: Construction
graph: Airlock
node: glassAirlock
- - type: PaintableAirlock
- group: Glass
+ - type: Paintable
+ group: AirlockGlass
- type: RadiationBlocker
resistance: 2
- type: Tag
diff --git a/Resources/Prototypes/Entities/Structures/Doors/Airlocks/clockwork.yml b/Resources/Prototypes/Entities/Structures/Doors/Airlocks/clockwork.yml
index f6eeb9ee37..123f1ef2c7 100644
--- a/Resources/Prototypes/Entities/Structures/Doors/Airlocks/clockwork.yml
+++ b/Resources/Prototypes/Entities/Structures/Doors/Airlocks/clockwork.yml
@@ -10,6 +10,8 @@
node: airlock
containers:
- board
+ - type: Paintable
+ group: null
- type: entity
parent: AirlockGlass
@@ -25,3 +27,5 @@
- board
- type: StaticPrice
price: 165
+ - type: Paintable
+ group: null
diff --git a/Resources/Prototypes/Entities/Structures/Doors/Airlocks/external.yml b/Resources/Prototypes/Entities/Structures/Doors/Airlocks/external.yml
index 7f5c019025..773065bea0 100644
--- a/Resources/Prototypes/Entities/Structures/Doors/Airlocks/external.yml
+++ b/Resources/Prototypes/Entities/Structures/Doors/Airlocks/external.yml
@@ -16,11 +16,10 @@
path: /Audio/Machines/airlock_deny.ogg
- type: Sprite
sprite: Structures/Doors/Airlocks/Standard/external.rsi
- - type: PaintableAirlock
- group: External
- department: null
- type: Wires
layoutId: AirlockExternal
+ - type: Paintable
+ group: null
- type: entity
parent: AirlockExternal
@@ -33,8 +32,6 @@
enabled: false
- type: Sprite
sprite: Structures/Doors/Airlocks/Glass/external.rsi
- - type: PaintableAirlock
- group: ExternalGlass
- type: Fixtures
fixtures:
fix1:
diff --git a/Resources/Prototypes/Entities/Structures/Doors/Airlocks/shuttle.yml b/Resources/Prototypes/Entities/Structures/Doors/Airlocks/shuttle.yml
index 3752821e46..cad40324c8 100644
--- a/Resources/Prototypes/Entities/Structures/Doors/Airlocks/shuttle.yml
+++ b/Resources/Prototypes/Entities/Structures/Doors/Airlocks/shuttle.yml
@@ -52,14 +52,13 @@
- type: Tag
tags:
- ForceNoFixRotations
- - type: PaintableAirlock
- group: Shuttle
- department: null
- type: Construction
graph: AirlockShuttle
node: airlock
- type: StaticPrice
price: 350
+ - type: Paintable
+ group: null
- type: entity
id: AirlockGlassShuttle
@@ -72,8 +71,6 @@
sprite: Structures/Doors/Airlocks/Glass/shuttle.rsi
- type: Occluder
enabled: false
- - type: PaintableAirlock
- group: ShuttleGlass
- type: Door
occludes: false
- type: Fixtures
diff --git a/Resources/Prototypes/Entities/Structures/Doors/airlock_groups.yml b/Resources/Prototypes/Entities/Structures/Doors/airlock_groups.yml
deleted file mode 100644
index 76b21acfcd..0000000000
--- a/Resources/Prototypes/Entities/Structures/Doors/airlock_groups.yml
+++ /dev/null
@@ -1,87 +0,0 @@
-- type: AirlockGroup
- id: Standard
- iconPriority: 100
- stylePaths:
- atmospherics: Structures/Doors/Airlocks/Standard/atmospherics.rsi
- basic: Structures/Doors/Airlocks/Standard/basic.rsi
- cargo: Structures/Doors/Airlocks/Standard/cargo.rsi
- chemistry: Structures/Doors/Airlocks/Standard/chemistry.rsi
- command: Structures/Doors/Airlocks/Standard/command.rsi
- engineering: Structures/Doors/Airlocks/Standard/engineering.rsi
- freezer: Structures/Doors/Airlocks/Standard/freezer.rsi
- hydroponics: Structures/Doors/Airlocks/Standard/hydroponics.rsi
- maintenance: Structures/Doors/Airlocks/Standard/maint.rsi
- medical: Structures/Doors/Airlocks/Standard/medical.rsi
- salvage: Structures/Doors/Airlocks/Standard/salvage.rsi
- science: Structures/Doors/Airlocks/Standard/science.rsi
- security: Structures/Doors/Airlocks/Standard/security.rsi
- virology: Structures/Doors/Airlocks/Standard/virology.rsi
-
-- type: AirlockGroup
- id: Glass
- iconPriority: 90
- stylePaths:
- atmospherics: Structures/Doors/Airlocks/Glass/atmospherics.rsi
- basic: Structures/Doors/Airlocks/Glass/basic.rsi
- cargo: Structures/Doors/Airlocks/Glass/cargo.rsi
- command: Structures/Doors/Airlocks/Glass/command.rsi
- chemistry: Structures/Doors/Airlocks/Glass/chemistry.rsi
- science: Structures/Doors/Airlocks/Glass/science.rsi
- engineering: Structures/Doors/Airlocks/Glass/engineering.rsi
- glass: Structures/Doors/Airlocks/Glass/glass.rsi
- hydroponics: Structures/Doors/Airlocks/Glass/hydroponics.rsi
- maintenance: Structures/Doors/Airlocks/Glass/maint.rsi
- medical: Structures/Doors/Airlocks/Glass/medical.rsi
- salvage: Structures/Doors/Airlocks/Glass/salvage.rsi
- security: Structures/Doors/Airlocks/Glass/security.rsi
- virology: Structures/Doors/Airlocks/Glass/virology.rsi
-
-- type: AirlockGroup
- id: Windoor
- iconPriority: 80
- stylePaths:
- basic: Structures/Doors/Airlocks/Glass/glass.rsi
-
-- type: AirlockGroup
- id: External
- iconPriority: 70
- stylePaths:
- external: Structures/Doors/Airlocks/Standard/external.rsi
-
-- type: AirlockGroup
- id: ExternalGlass
- iconPriority: 60
- stylePaths:
- external: Structures/Doors/Airlocks/Glass/external.rsi
-
-- type: AirlockGroup
- id: Shuttle
- iconPriority: 50
- stylePaths:
- shuttle: Structures/Doors/Airlocks/Standard/shuttle.rsi
-
-- type: AirlockGroup
- id: ShuttleGlass
- iconPriority: 40
- stylePaths:
- shuttle: Structures/Doors/Airlocks/Glass/shuttle.rsi
-
-# fun
-- type: airlockDepartments
- id: Departments
- departments:
- atmospherics: Engineering
- basic: Civilian
- cargo: Cargo
- chemistry: Medical
- command: Command
- engineering: Engineering
- freezer: Civilian
- glass: Civilian
- hydroponics: Civilian
- maintenance: Civilian
- medical: Medical
- salvage: Cargo
- science: Science
- security: Security
- virology: Medical
diff --git a/Resources/Prototypes/Entities/Structures/Storage/Canisters/gas_canisters.yml b/Resources/Prototypes/Entities/Structures/Storage/Canisters/gas_canisters.yml
index e7e1481c3e..0662094143 100644
--- a/Resources/Prototypes/Entities/Structures/Storage/Canisters/gas_canisters.yml
+++ b/Resources/Prototypes/Entities/Structures/Storage/Canisters/gas_canisters.yml
@@ -112,6 +112,8 @@
- type: GuideHelp
guides:
- GasCanisters
+ - type: Paintable
+ group: Canisters
- type: entity
parent: GasCanister
diff --git a/Resources/Prototypes/Entities/Structures/Storage/Closets/Lockers/base_structurelockers.yml b/Resources/Prototypes/Entities/Structures/Storage/Closets/Lockers/base_structurelockers.yml
index 8e2d1a6e54..a30ae00e96 100644
--- a/Resources/Prototypes/Entities/Structures/Storage/Closets/Lockers/base_structurelockers.yml
+++ b/Resources/Prototypes/Entities/Structures/Storage/Closets/Lockers/base_structurelockers.yml
@@ -54,6 +54,8 @@
node: done
containers:
- entity_storage
+ - type: Paintable
+ group: Locker
- type: entity
id: LockerBaseSecure
diff --git a/Resources/Prototypes/Entities/Structures/Storage/Closets/Lockers/lockers.yml b/Resources/Prototypes/Entities/Structures/Storage/Closets/Lockers/lockers.yml
index 6713a8303d..52f29168fd 100644
--- a/Resources/Prototypes/Entities/Structures/Storage/Closets/Lockers/lockers.yml
+++ b/Resources/Prototypes/Entities/Structures/Storage/Closets/Lockers/lockers.yml
@@ -17,6 +17,8 @@
path: /Audio/Effects/woodenclosetclose.ogg
openSound:
path: /Audio/Effects/woodenclosetopen.ogg
+ - type: Paintable
+ group: null # not shaped like other lockers
# Basic
- type: entity
@@ -190,6 +192,8 @@
node: done
containers:
- entity_storage
+ - type: Paintable
+ group: null
- type: entity
id: LockerFreezer
diff --git a/Resources/Prototypes/Entities/Structures/Storage/Closets/base_structureclosets.yml b/Resources/Prototypes/Entities/Structures/Storage/Closets/base_structureclosets.yml
index b47106acb8..c38a20a698 100644
--- a/Resources/Prototypes/Entities/Structures/Storage/Closets/base_structureclosets.yml
+++ b/Resources/Prototypes/Entities/Structures/Storage/Closets/base_structureclosets.yml
@@ -124,6 +124,8 @@
node: done
containers:
- entity_storage
+ - type: Paintable
+ group: Closet
#Wall Closet
- type: entity
@@ -205,6 +207,8 @@
node: done
containers:
- entity_storage
+ - type: Paintable
+ group: WallCloset
#Wall locker
- type: entity
@@ -228,6 +232,8 @@
- state: welded
visible: false
map: ["enum.WeldableLayers.BaseWelded"]
+ - type: Paintable
+ group: WallLocker
#Base suit storage unit
#I am terribly sorry for duplicating the closet almost-wholesale, but the game malds at me if I don't so here we are.
diff --git a/Resources/Prototypes/Entities/Structures/Storage/Crates/base_structurecrates.yml b/Resources/Prototypes/Entities/Structures/Storage/Crates/base_structurecrates.yml
index 55f4dee041..635cdee16e 100644
--- a/Resources/Prototypes/Entities/Structures/Storage/Crates/base_structurecrates.yml
+++ b/Resources/Prototypes/Entities/Structures/Storage/Crates/base_structurecrates.yml
@@ -154,3 +154,5 @@
- Energy
reflectProb: 0.2
spread: 90
+ - type: Paintable
+ group: CrateSecure
diff --git a/Resources/Prototypes/Entities/Structures/Storage/Crates/crates.yml b/Resources/Prototypes/Entities/Structures/Storage/Crates/crates.yml
index c4f8182870..70d79aa912 100644
--- a/Resources/Prototypes/Entities/Structures/Storage/Crates/crates.yml
+++ b/Resources/Prototypes/Entities/Structures/Storage/Crates/crates.yml
@@ -12,6 +12,8 @@
- Energy
reflectProb: 0.2
spread: 90
+ - type: Paintable
+ group: CrateSteel
- type: RadiationBlockingContainer
resistance: 2.5
@@ -31,6 +33,8 @@
- entity_storage
- type: StaticPrice
price: 100
+ - type: Paintable
+ group: CratePlastic
- type: entity
parent: CratePlastic
@@ -49,6 +53,8 @@
node: done
containers:
- entity_storage
+ - type: Paintable
+ group: null
- type: entity
parent: CratePlastic
@@ -840,6 +846,8 @@
sprite: Structures/Storage/Crates/labels.rsi
offset: "0.0,0.03125"
map: ["enum.PaperLabelVisuals.Layer"]
+ - type: Paintable
+ group: null
- type: entity
parent: CrateBaseSecure
@@ -866,6 +874,8 @@
map: ["enum.PaperLabelVisuals.Layer"]
- type: AccessReader
access: [["Janitor"]]
+ - type: Paintable
+ group: null
- type: entity
parent: CrateBaseWeldable
diff --git a/Resources/Prototypes/Paintables/airlock_groups.yml b/Resources/Prototypes/Paintables/airlock_groups.yml
new file mode 100644
index 0000000000..58b54b2dce
--- /dev/null
+++ b/Resources/Prototypes/Paintables/airlock_groups.yml
@@ -0,0 +1,40 @@
+- type: paintableGroup
+ id: AirlockStandard
+ time: 3
+ cost: 3
+ defaultStyle: basic
+ styles:
+ atmospherics: AirlockAtmospherics
+ basic: Airlock
+ cargo: AirlockCargo
+ chemistry: AirlockChemistry
+ command: AirlockCommand
+ engineering: AirlockEngineering
+ freezer: AirlockFreezer
+ hydroponics: AirlockHydroponics
+ maintenance: AirlockMaint
+ medical: AirlockMedical
+ salvage: AirlockSalvage
+ science: AirlockScience
+ security: AirlockSecurity
+ virology: AirlockVirology
+
+- type: paintableGroup
+ id: AirlockGlass
+ time: 3
+ cost: 3
+ defaultStyle: basic
+ styles:
+ atmospherics: AirlockAtmosphericsGlass
+ basic: AirlockGlass
+ cargo: AirlockCargoGlass
+ chemistry: AirlockChemistryGlass
+ command: AirlockCommandGlass
+ engineering: AirlockEngineeringGlass
+ hydroponics: AirlockHydroponicsGlass
+ maintenance: AirlockMaintGlass
+ medical: AirlockMedicalGlass
+ salvage: AirlockSalvageGlass
+ science: AirlockScienceGlass
+ security: AirlockSecurityGlass
+ virology: AirlockVirologyGlass
diff --git a/Resources/Prototypes/Paintables/canister_groups.yml b/Resources/Prototypes/Paintables/canister_groups.yml
new file mode 100644
index 0000000000..5485f07662
--- /dev/null
+++ b/Resources/Prototypes/Paintables/canister_groups.yml
@@ -0,0 +1,16 @@
+- type: paintableGroup
+ cost: 2
+ id: Canisters
+ defaultStyle: storage
+ styles:
+ air: AirCanister
+ ammonia: AmmoniaCanister
+ carbon-dioxide: CarbonDioxideCanister
+ frezon: FrezonCanister
+ nitrogen: NitrogenCanister
+ nitrous-oxide: NitrousOxideCanister
+ oxygen: OxygenCanister
+ plasma: PlasmaCanister
+ storage: StorageCanister
+ tritium: TritiumCanister
+ water-vapor: WaterVaporCanister
diff --git a/Resources/Prototypes/Paintables/categories.yml b/Resources/Prototypes/Paintables/categories.yml
new file mode 100644
index 0000000000..75998c31ba
--- /dev/null
+++ b/Resources/Prototypes/Paintables/categories.yml
@@ -0,0 +1,25 @@
+- type: paintableGroupCategory
+ id: Airlocks
+ groups:
+ - AirlockStandard
+ - AirlockGlass
+
+- type: paintableGroupCategory
+ id: Canisters
+ groups:
+ - Canisters
+
+- type: paintableGroupCategory
+ id: Crates
+ groups:
+ - CrateSteel
+ - CratePlastic
+ - CrateSecure
+
+- type: paintableGroupCategory
+ id: Lockers
+ groups:
+ - Locker
+ - Closet
+ - WallLocker
+ - WallCloset
diff --git a/Resources/Prototypes/Paintables/crate_groups.yml b/Resources/Prototypes/Paintables/crate_groups.yml
new file mode 100644
index 0000000000..117b1df12f
--- /dev/null
+++ b/Resources/Prototypes/Paintables/crate_groups.yml
@@ -0,0 +1,38 @@
+- type: paintableGroup
+ id: CrateSteel
+ cost: 2
+ defaultStyle: basic
+ styles:
+ basic: CrateGenericSteel
+ electrical: CrateElectrical
+ engineering: CrateEngineering
+ radiation: CrateRadiation
+ science: CrateScience
+ surgery: CrateSurgery
+
+- type: paintableGroup
+ id: CratePlastic
+ cost: 2
+ defaultStyle: basic
+ styles:
+ basic: CratePlastic
+ hydroponics: CrateHydroponics
+ medical: CrateMedical
+ oxygen: CrateInternals
+
+- type: paintableGroup
+ id: CrateSecure
+ cost: 2
+ defaultStyle: basic
+ styles:
+ basic: CrateSecure
+ chemistry: CrateChemistrySecure
+ command: CrateCommandSecure
+ engineering: CrateEngineeringSecure
+ hydroponics: CrateHydroSecure
+ medical: CrateMedicalSecure
+ plasma: CratePlasma
+ private: CratePrivateSecure
+ science: CrateScienceSecure
+ secgear: CrateSecgear
+ weapon: CrateWeaponSecure
diff --git a/Resources/Prototypes/Paintables/locker_groups.yml b/Resources/Prototypes/Paintables/locker_groups.yml
new file mode 100644
index 0000000000..b9bdf1c89f
--- /dev/null
+++ b/Resources/Prototypes/Paintables/locker_groups.yml
@@ -0,0 +1,80 @@
+- type: paintableGroup
+ id: Locker
+ cost: 2
+ defaultStyle: basic
+ styles:
+ atmospherics: LockerAtmospherics
+ basic: ClosetSteelBase
+ botanist: LockerBotanist
+ brigmedic: LockerBrigmedic
+ captain: LockerCaptain
+ ce: LockerChiefEngineer
+ chemical: LockerChemistry
+ clown: LockerClown
+ cmo: LockerChiefMedicalOfficer
+ doctor: LockerMedical
+ electrical: LockerElectricalSupplies
+ engineer: LockerEngineer
+ evac: LockerEvacRepair
+ hop: LockerHeadOfPersonnel
+ hos: LockerHeadOfSecurity
+ mime: LockerMime
+ medicine: LockerMedicine
+ paramedic: LockerParamedic
+ quartermaster: LockerQuarterMaster
+ rd: LockerResearchDirector
+ representative: LockerRepresentative
+ salvage: LockerSalvageSpecialist
+ scientist: LockerScientist
+ security: LockerSecurity
+ welding: LockerWeldingSupplies
+
+- type: paintableGroup
+ id: Closet
+ cost: 2
+ defaultStyle: basic
+ styles:
+ basic: ClosetSteelBase
+ biohazard: ClosetL3
+ biohazard-janitor: ClosetL3Janitor
+ biohazard-science: ClosetL3Science
+ biohazard-security: ClosetL3Security
+ biohazard-virology: ClosetL3Virology
+ bomb: ClosetBomb
+ bomb-janitor: ClosetJanitorBomb
+ chef: ClosetChef
+ fire: ClosetFire
+ janitor: ClosetJanitor
+ legal: ClosetLegal
+ nitrogen: ClosetEmergencyN2
+ oxygen: ClosetEmergency
+ radiation: ClosetRadiationSuit
+ tool: ClosetTool
+
+- type: paintableGroup
+ id: WallCloset
+ cost: 2
+ defaultStyle: basic
+ styles:
+ atmospherics: ClosetWallAtmospherics
+ basic: ClosetWall
+ black: ClosetWallBlack
+ blue: ClosetWallBlue
+ fire: ClosetWallFire
+ green: ClosetWallGreen
+ grey: ClosetWallGrey
+ mixed: ClosetWallMixed
+ nitrogen: ClosetWallEmergencyN2
+ orange: ClosetWallOrange
+ oxygen: ClosetWallEmergency
+ pink: ClosetWallPink
+ white: ClosetWallWhite
+ yellow: ClosetWallYellow
+
+- type: paintableGroup
+ id: WallLocker
+ cost: 2
+ defaultStyle: medical
+ styles:
+ evac: LockerWallEvacRepair
+ medical: LockerWallMedical
diff --git a/Resources/Prototypes/Recipes/Lathes/Packs/engineering.yml b/Resources/Prototypes/Recipes/Lathes/Packs/engineering.yml
index 3ecd39cc98..1f504e3ae4 100644
--- a/Resources/Prototypes/Recipes/Lathes/Packs/engineering.yml
+++ b/Resources/Prototypes/Recipes/Lathes/Packs/engineering.yml
@@ -12,6 +12,7 @@
- NetworkConfigurator
- Signaller
- SprayPainter
+ - SprayPainterAmmo
- FlashlightLantern
- HandheldGPSBasic
- TRayScanner
diff --git a/Resources/Prototypes/Recipes/Lathes/tools.yml b/Resources/Prototypes/Recipes/Lathes/tools.yml
index 8a8c88d1e6..f54da83d25 100644
--- a/Resources/Prototypes/Recipes/Lathes/tools.yml
+++ b/Resources/Prototypes/Recipes/Lathes/tools.yml
@@ -154,11 +154,19 @@
- type: latheRecipe
parent: BaseToolRecipe
id: SprayPainter
- result: SprayPainter
+ result: SprayPainterEmpty
materials:
Steel: 300
Plastic: 100
+- type: latheRecipe
+ parent: BaseToolRecipe
+ id: SprayPainterAmmo
+ result: SprayPainterAmmo
+ materials:
+ Steel: 150
+ Plastic: 50
+
- type: latheRecipe
parent: BaseToolRecipe
id: UtilityBelt
diff --git a/Resources/Textures/Objects/Tools/spray_painter.rsi/ammo-inhand-left.png b/Resources/Textures/Objects/Tools/spray_painter.rsi/ammo-inhand-left.png
new file mode 100644
index 0000000000..d81e805bb2
Binary files /dev/null and b/Resources/Textures/Objects/Tools/spray_painter.rsi/ammo-inhand-left.png differ
diff --git a/Resources/Textures/Objects/Tools/spray_painter.rsi/ammo-inhand-right.png b/Resources/Textures/Objects/Tools/spray_painter.rsi/ammo-inhand-right.png
new file mode 100644
index 0000000000..b4083c87e1
Binary files /dev/null and b/Resources/Textures/Objects/Tools/spray_painter.rsi/ammo-inhand-right.png differ
diff --git a/Resources/Textures/Objects/Tools/spray_painter.rsi/ammo.png b/Resources/Textures/Objects/Tools/spray_painter.rsi/ammo.png
new file mode 100644
index 0000000000..ca64c2a758
Binary files /dev/null and b/Resources/Textures/Objects/Tools/spray_painter.rsi/ammo.png differ
diff --git a/Resources/Textures/Objects/Tools/spray_painter.rsi/meta.json b/Resources/Textures/Objects/Tools/spray_painter.rsi/meta.json
index 8a19107208..14af840638 100644
--- a/Resources/Textures/Objects/Tools/spray_painter.rsi/meta.json
+++ b/Resources/Textures/Objects/Tools/spray_painter.rsi/meta.json
@@ -1,22 +1,33 @@
{
- "copyright" : "Taken from https://github.com/tgstation/tgstation at commit a21274e56ae84b2c96e8b6beeca805df3d5402e8, Inhand sprites by onesch",
- "license" : "CC-BY-SA-3.0",
- "size" : {
- "x" : 32,
- "y" : 32
- },
- "states" : [
- {
- "name" : "spray_painter"
- },
- {
- "name": "inhand-left",
- "directions": 4
- },
- {
- "name": "inhand-right",
- "directions": 4
- }
- ],
- "version" : 1
+ "version": 1,
+ "license": "CC-BY-SA-3.0",
+ "copyright": "Taken from https://github.com/tgstation/tgstation at commit a21274e56ae84b2c96e8b6beeca805df3d5402e8, Inhand sprites by onesch, ammo by Paradoxmi (Discord).",
+ "size": {
+ "x": 32,
+ "y": 32
+ },
+ "states": [
+ {
+ "name": "spray_painter"
+ },
+ {
+ "name": "ammo"
+ },
+ {
+ "name": "inhand-left",
+ "directions": 4
+ },
+ {
+ "name": "inhand-right",
+ "directions": 4
+ },
+ {
+ "name": "ammo-inhand-left",
+ "directions": 4
+ },
+ {
+ "name": "ammo-inhand-right",
+ "directions": 4
+ }
+ ]
}