Skip to content

Commit

Permalink
fix species specific sprites
Browse files Browse the repository at this point in the history
  • Loading branch information
TheShuEd committed Jul 16, 2024
1 parent 2ebe671 commit a515acb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 23 deletions.
26 changes: 9 additions & 17 deletions Content.Client/Clothing/ClientClothingSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -181,14 +181,6 @@ private void OnVisualsChanged(EntityUid uid, InventoryComponent component, Visua

private void OnDidUnequip(EntityUid uid, SpriteComponent component, DidUnequipEvent args)
{
// Hide jumpsuit mask layer.
if (args.Slot == Jumpsuit
&& TryComp(uid, out SpriteComponent? sprite)
&& sprite.LayerMapTryGet(HumanoidVisualLayers.StencilMask, out var maskLayer))
{
sprite.LayerSetVisible(maskLayer, false);
}

if (!TryComp(uid, out InventorySlotsComponent? inventorySlots))
return;

Expand Down Expand Up @@ -309,7 +301,7 @@ private void RenderEquipment(EntityUid equipee, EntityUid equipment, string slot
index = sprite.LayerMapReserveBlank(key);

if (sprite[index] is not Layer layer)
return;
continue;

// In case no RSI is given, use the item's base RSI as a default. This cuts down on a lot of unnecessary yaml entries.
if (layerData.RsiPath == null
Expand All @@ -320,17 +312,17 @@ private void RenderEquipment(EntityUid equipee, EntityUid equipment, string slot
layer.SetRsi(clothingSprite.BaseRSI);
}

// Another "temporary" fix for clothing stencil masks.
// Sprite layer redactor when
// Sprite "redactor" just a week away.
if (slot == Jumpsuit)
layerData.Shader ??= "StencilDraw";

sprite.LayerSetData(index, layerData);
layer.Offset += slotDef.Offset;

if (displacementData != null && clothingComponent.UseDisplacementMaps)
_displacement.TryAddDisplacement(displacementData, sprite, index, key, revealedLayers);
if (displacementData is null)
continue;

//Checking that the state is not tied to the current race. In this case we don't need to use the displacement maps.
if (layerData.State is not null && inventory.SpeciesId is not null && layerData.State.EndsWith(inventory.SpeciesId))
continue;

_displacement.TryAddDisplacement(displacementData, sprite, index, key, revealedLayers);
}

RaiseLocalEvent(equipment, new EquipmentVisualsUpdatedEvent(equipee, slot, revealedLayers), true);
Expand Down
6 changes: 0 additions & 6 deletions Content.Shared/Clothing/Components/ClothingComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,6 @@ public sealed partial class ClothingComponent : Component

[DataField, ViewVariables(VVAccess.ReadWrite)]
public TimeSpan UnequipDelay = TimeSpan.Zero;

/// <summary>
/// allows you to disable the use of displacement maps on some clothes
/// </summary>
[DataField]
public bool UseDisplacementMaps = true;
}

[Serializable, NetSerializable]
Expand Down

0 comments on commit a515acb

Please sign in to comment.