Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 11 additions & 12 deletions Content.Client/SprayPainter/SprayPainterSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ public sealed class SprayPainterSystem : SharedSprayPainterSystem
{
[Dependency] private readonly UserInterfaceSystem _ui = default!;

public List<SprayPainterDecalEntry> Decals = [];
public Dictionary<string, List<string>> PaintableGroupsByCategory = new();
public Dictionary<string, Dictionary<string, EntProtoId>> PaintableStylesByGroup = new();
public readonly List<SprayPainterDecalEntry> Decals = [];
public readonly Dictionary<string, List<string>> PaintableGroupsByCategory = new();
public readonly Dictionary<string, Dictionary<string, EntProtoId>> PaintableStylesByGroup = new();

public override void Initialize()
{
Expand All @@ -50,7 +50,8 @@ protected override void UpdateUi(Entity<SprayPainterComponent> ent)

private void OnPrototypesReloaded(PrototypesReloadedEventArgs args)
{
if (!args.WasModified<PaintableGroupCategoryPrototype>() || !args.WasModified<PaintableGroupPrototype>() || !args.WasModified<DecalPrototype>())
if (!args.WasModified<PaintableGroupCategoryPrototype>() || !args.WasModified<PaintableGroupPrototype>() ||
!args.WasModified<DecalPrototype>())
return;

CachePrototypes();
Expand Down Expand Up @@ -79,12 +80,10 @@ private void CachePrototypes()
Decals.Clear();
foreach (var decalPrototype in Proto.EnumeratePrototypes<DecalPrototype>().OrderBy(x => x.ID))
{
if (!decalPrototype.Tags.Contains("station")
&& !decalPrototype.Tags.Contains("markings")
|| decalPrototype.Tags.Contains("dirty"))
if (decalPrototype.Tags.Contains("dirty"))
continue;

Decals.Add(new SprayPainterDecalEntry(decalPrototype.ID, decalPrototype.Sprite));
if (decalPrototype.Tags.Contains("station") && decalPrototype.Tags.Contains("markings"))
Decals.Add(new SprayPainterDecalEntry(decalPrototype.ID, decalPrototype.Sprite));
}
}

Expand All @@ -110,15 +109,15 @@ protected override void FrameUpdate(FrameEventArgs args)

_lastPaintingDecals = _entity.Comp.DecalMode;

string modeLocString = _entity.Comp.DecalMode switch
var modeLocalization = _entity.Comp.DecalMode switch
{
DecalPaintMode.Add => "spray-painter-item-status-add",
DecalPaintMode.Remove => "spray-painter-item-status-remove",
_ => "spray-painter-item-status-off"
_ => "spray-painter-item-status-off",
};

_label.SetMarkupPermissive(Robust.Shared.Localization.Loc.GetString("spray-painter-item-status-label",
("mode", Robust.Shared.Localization.Loc.GetString(modeLocString))));
("mode", Robust.Shared.Localization.Loc.GetString(modeLocalization))));
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Resources/Prototypes/_Null/Decals/pipes.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
- type: decal
id: Pipes
tags: ["station"]
tags: ["station", "markings"]
sprite:
sprite: Decals/pipes.rsi
state: pipes
6 changes: 6 additions & 0 deletions Resources/Prototypes/_Null/Decals/spesos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- type: decal
id: speso
tags: ["station", "markings"]
sprite:
sprite: Decals/speso.rsi
state: speso
14 changes: 14 additions & 0 deletions Resources/Textures/Decals/speso.rsi/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"version": 1,
"license": "CC0-1.0",
"copyright": "Edited Speso Sprite",
"size": {
"x": 32,
"y": 32
},
"states": [
{
"name": "speso"
}
]
}
Binary file added Resources/Textures/Decals/speso.rsi/speso.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading