Makes Eyepatches Flippable (#26277)

This commit is contained in:
Cojoke
2024-06-16 22:21:29 -05:00
committed by GitHub
parent f7aca6b15f
commit 390f8d19d1
10 changed files with 175 additions and 56 deletions

View File

@@ -1,5 +1,6 @@
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Numerics;
using Content.Client.Inventory;
using Content.Shared.Clothing;
using Content.Shared.Clothing.Components;
@@ -113,6 +114,7 @@ public sealed class ClientClothingSystem : ClothingSystem
i++;
}
item.MappedLayer = key;
args.Layers.Add((key, layer));
}
}
@@ -153,13 +155,9 @@ public sealed class ClientClothingSystem : ClothingSystem
// species specific
if (speciesId != null && rsi.TryGetState($"{state}-{speciesId}", out _))
{
state = $"{state}-{speciesId}";
}
else if (!rsi.TryGetState(state, out _))
{
return false;
}
var layer = new PrototypeLayerData();
layer.RsiPath = rsi.Path.ToString();
@@ -287,6 +285,8 @@ public sealed class ClientClothingSystem : ClothingSystem
if (layerData.Color != null)
sprite.LayerSetColor(key, layerData.Color.Value);
if (layerData.Scale != null)
sprite.LayerSetScale(key, layerData.Scale.Value);
}
else
index = sprite.LayerMapReserveBlank(key);