spray painter rework (#23287)

* refactor and add Department to PaintableAirlock, move it to server dir since its in namespace

* add departments to doors, cleanup

* add style -> departments mapping

* AirlockDepartmentsPrototype

* update shared spray stuff to have department

* name file the same as the class name

* department optional

* refactor spray painter system + send department

* fixy

* client

* no need to rewrite ActivateableUi

* pro ops

* the reckoning

* hiss

* .

* :trollface:

* add standard atmos colors to palette

* Update Content.Shared/SprayPainter/SharedSprayPainterSystem.cs

---------

Co-authored-by: deltanedas <@deltanedas:kde.org>
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
This commit is contained in:
deltanedas
2024-02-01 22:30:46 +00:00
committed by GitHub
parent e36844de47
commit c49c78bafa
15 changed files with 424 additions and 306 deletions

View File

@@ -14,29 +14,31 @@ public sealed class SprayPainterSystem : SharedSprayPainterSystem
public List<SprayPainterEntry> Entries { get; private set; } = new();
public override void Initialize()
protected override void CacheStyles()
{
base.Initialize();
base.CacheStyles();
foreach (string style in Styles)
Entries.Clear();
foreach (var style in Styles)
{
var name = style.Name;
string? iconPath = Groups
.FindAll(x => x.StylePaths.ContainsKey(style))?
.MaxBy(x => x.IconPriority)?.StylePaths[style];
.FindAll(x => x.StylePaths.ContainsKey(name))?
.MaxBy(x => x.IconPriority)?.StylePaths[name];
if (iconPath == null)
{
Entries.Add(new SprayPainterEntry(style, null));
Entries.Add(new SprayPainterEntry(name, null));
continue;
}
RSIResource doorRsi = _resourceCache.GetResource<RSIResource>(SpriteSpecifierSerializer.TextureRoot / new ResPath(iconPath));
if (!doorRsi.RSI.TryGetState("closed", out var icon))
{
Entries.Add(new SprayPainterEntry(style, null));
Entries.Add(new SprayPainterEntry(name, null));
continue;
}
Entries.Add(new SprayPainterEntry(style, icon.Frame0));
Entries.Add(new SprayPainterEntry(name, icon.Frame0));
}
}
}