Merge remote-tracking branch 'upstream/stable' into ed-27-05-2025-upstream-sync
# Conflicts: # .github/CODEOWNERS # Content.Client/Guidebook/Controls/GuideReagentReaction.xaml.cs # Content.IntegrationTests/Tests/Chemistry/TryAllReactionsTest.cs # Content.Server/Procedural/DungeonJob/DungeonJob.OreDunGen.cs # Resources/Prototypes/Entities/Effects/chemistry_effects.yml # Resources/Prototypes/Entities/Mobs/Customization/Markings/human_hair.yml # Resources/Prototypes/GameRules/meteorswarms.yml # Resources/Prototypes/Procedural/dungeon_configs.yml
This commit is contained in:
@@ -59,6 +59,7 @@ public sealed class ClientClothingSystem : ClothingSystem
|
||||
[Dependency] private readonly IResourceCache _cache = default!;
|
||||
[Dependency] private readonly InventorySystem _inventorySystem = default!;
|
||||
[Dependency] private readonly DisplacementMapSystem _displacement = default!;
|
||||
[Dependency] private readonly SpriteSystem _sprite = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -81,10 +82,10 @@ public sealed class ClientClothingSystem : ClothingSystem
|
||||
UpdateAllSlots(uid, component);
|
||||
|
||||
// No clothing equipped -> make sure the layer is hidden, though this should already be handled by on-unequip.
|
||||
if (args.Sprite.LayerMapTryGet(HumanoidVisualLayers.StencilMask, out var layer))
|
||||
if (_sprite.LayerMapTryGet((uid, args.Sprite), HumanoidVisualLayers.StencilMask, out var layer, false))
|
||||
{
|
||||
DebugTools.Assert(!args.Sprite[layer].Visible);
|
||||
args.Sprite.LayerSetVisible(layer, false);
|
||||
_sprite.LayerSetVisible((uid, args.Sprite), layer, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -199,9 +200,9 @@ public sealed class ClientClothingSystem : ClothingSystem
|
||||
RenderEquipment(uid, item, clothing.InSlot, component, null, clothing);
|
||||
}
|
||||
|
||||
private void OnDidUnequip(EntityUid uid, SpriteComponent component, DidUnequipEvent args)
|
||||
private void OnDidUnequip(Entity<SpriteComponent> entity, ref DidUnequipEvent args)
|
||||
{
|
||||
if (!TryComp(uid, out InventorySlotsComponent? inventorySlots))
|
||||
if (!TryComp(entity, out InventorySlotsComponent? inventorySlots))
|
||||
return;
|
||||
|
||||
if (!inventorySlots.VisualLayerKeys.TryGetValue(args.Slot, out var revealedLayers))
|
||||
@@ -211,7 +212,7 @@ public sealed class ClientClothingSystem : ClothingSystem
|
||||
// may eventually bloat the player with lots of invisible layers.
|
||||
foreach (var layer in revealedLayers)
|
||||
{
|
||||
component.RemoveLayer(layer);
|
||||
_sprite.RemoveLayer(entity.AsNullable(), layer);
|
||||
}
|
||||
revealedLayers.Clear();
|
||||
}
|
||||
@@ -254,7 +255,7 @@ public sealed class ClientClothingSystem : ClothingSystem
|
||||
{
|
||||
foreach (var key in revealedLayers)
|
||||
{
|
||||
sprite.RemoveLayer(key);
|
||||
_sprite.RemoveLayer((equipee, sprite), key);
|
||||
}
|
||||
revealedLayers.Clear();
|
||||
}
|
||||
@@ -275,7 +276,7 @@ public sealed class ClientClothingSystem : ClothingSystem
|
||||
|
||||
// temporary, until layer draw depths get added. Basically: a layer with the key "slot" is being used as a
|
||||
// bookmark to determine where in the list of layers we should insert the clothing layers.
|
||||
bool slotLayerExists = sprite.LayerMapTryGet(slot, out var index);
|
||||
var slotLayerExists = _sprite.LayerMapTryGet((equipee, sprite), slot, out var index, false);
|
||||
|
||||
// Select displacement maps
|
||||
var displacementData = inventory.Displacements.GetValueOrDefault(slot); //Default unsexed map
|
||||
@@ -309,16 +310,16 @@ public sealed class ClientClothingSystem : ClothingSystem
|
||||
{
|
||||
index++;
|
||||
// note that every insertion requires reshuffling & remapping all the existing layers.
|
||||
sprite.AddBlankLayer(index);
|
||||
sprite.LayerMapSet(key, index);
|
||||
_sprite.AddBlankLayer((equipee, sprite), index);
|
||||
_sprite.LayerMapSet((equipee, sprite), key, index);
|
||||
|
||||
if (layerData.Color != null)
|
||||
sprite.LayerSetColor(key, layerData.Color.Value);
|
||||
_sprite.LayerSetColor((equipee, sprite), key, layerData.Color.Value);
|
||||
if (layerData.Scale != null)
|
||||
sprite.LayerSetScale(key, layerData.Scale.Value);
|
||||
_sprite.LayerSetScale((equipee, sprite), key, layerData.Scale.Value);
|
||||
}
|
||||
else
|
||||
index = sprite.LayerMapReserveBlank(key);
|
||||
index = _sprite.LayerMapReserve((equipee, sprite), key);
|
||||
|
||||
if (sprite[index] is not Layer layer)
|
||||
continue;
|
||||
@@ -329,11 +330,11 @@ public sealed class ClientClothingSystem : ClothingSystem
|
||||
&& layer.RSI == null
|
||||
&& TryComp(equipment, out SpriteComponent? clothingSprite))
|
||||
{
|
||||
layer.SetRsi(clothingSprite.BaseRSI);
|
||||
_sprite.LayerSetRsi(layer, clothingSprite.BaseRSI);
|
||||
}
|
||||
|
||||
sprite.LayerSetData(index, layerData);
|
||||
layer.Offset += slotDef.Offset;
|
||||
_sprite.LayerSetData((equipee, sprite), index, layerData);
|
||||
_sprite.LayerSetOffset(layer, layer.Offset + slotDef.Offset);
|
||||
|
||||
if (displacementData is not null)
|
||||
{
|
||||
@@ -341,7 +342,7 @@ public sealed class ClientClothingSystem : ClothingSystem
|
||||
if (layerData.State is not null && inventory.SpeciesId is not null && layerData.State.EndsWith(inventory.SpeciesId))
|
||||
continue;
|
||||
|
||||
if (_displacement.TryAddDisplacement(displacementData, sprite, index, key, out var displacementKey))
|
||||
if (_displacement.TryAddDisplacement(displacementData, (equipee, sprite), index, key, out var displacementKey))
|
||||
{
|
||||
revealedLayers.Add(displacementKey);
|
||||
index++;
|
||||
|
||||
Reference in New Issue
Block a user