]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Add species-specific code for ToggleableLightVisuals (#35482)
authorSparlight <twiksparlight@gmail.com>
Tue, 25 Feb 2025 17:00:37 +0000 (10:00 -0700)
committerGitHub <noreply@github.com>
Tue, 25 Feb 2025 17:00:37 +0000 (09:00 -0800)
Content.Client/Toggleable/ToggleableLightVisualsSystem.cs
Resources/Prototypes/Entities/Clothing/Head/eva-helmets.yml
Resources/Prototypes/Entities/Clothing/Head/hardsuit-helmets.yml
Resources/Prototypes/Entities/Clothing/OuterClothing/armor.yml

index 3507c786b997df2d174213e122428423bb62270d..a3d35ffeedd7168dfdee739a9dc43bb853a49e8d 100644 (file)
@@ -2,6 +2,7 @@ using Content.Client.Clothing;
 using Content.Client.Items.Systems;
 using Content.Shared.Clothing;
 using Content.Shared.Hands;
+using Content.Shared.Inventory;
 using Content.Shared.Item;
 using Content.Shared.Toggleable;
 using Robust.Client.GameObjects;
@@ -62,7 +63,16 @@ public sealed class ToggleableLightVisualsSystem : VisualizerSystem<ToggleableLi
             || !enabled)
             return;
 
-        if (!component.ClothingVisuals.TryGetValue(args.Slot, out var layers))
+        if (!TryComp(args.Equipee, out InventoryComponent? inventory))
+            return;
+        List<PrototypeLayerData>? layers = null;
+
+        // attempt to get species specific data
+        if (inventory.SpeciesId != null)
+            component.ClothingVisuals.TryGetValue($"{args.Slot}-{inventory.SpeciesId}", out layers);
+
+        // No species specific data.  Try to default to generic data.
+        if (layers == null && !component.ClothingVisuals.TryGetValue(args.Slot, out layers))
             return;
 
         var modulate = AppearanceSystem.TryGetData<Color>(uid, ToggleableLightVisuals.Color, out var color, appearance);
index 60a0e0be2873b614e7bc87beb5c2a7c6713f2489..3aec1f83c4fb029c431975f7aeaddb1c8035cda4 100644 (file)
     clothingVisuals:
       head:
       - state: equipped-head-light
+      head-vox:
+      - state: equipped-head-light-vox
   - type: Clothing
     clothingVisuals:
       head:
       - state: equipped-head
+      head-vox:
+      - state: equipped-head-vox
   - type: TemperatureProtection
     heatingCoefficient: 0.1
     coolingCoefficient: 0.1
index 68b5e356cbf99ed9873d69166b195e8742fae3fb..744729fa4130b22544c981b0bf1963f1f9425e8d 100644 (file)
       head:
       - state: equipped-head-light
         shader: unshaded
+      head-vox:
+      - state: equipped-head-light-vox
+        shader: unshaded
   - type: Clothing
     clothingVisuals:
       head:
       - state: equipped-head
       - state: equipped-head-unshaded
         shader: unshaded
+      head-vox:
+      - state: equipped-head-vox
+      - state: equipped-head-unshaded-vox
+        shader: unshaded
   - type: PointLight
     color: "#adffe6"
   - type: PressureProtection
       head:
       - state: equipped-head-light
         shader: unshaded
+      head-vox:
+      - state: equipped-head-light-vox
+        shader: unshaded
   - type: Clothing
     clothingVisuals:
       head:
       - state: equipped-head
       - state: equipped-head-unshaded
         shader: unshaded
+      head-vox:
+      - state: equipped-head-vox
+      - state: equipped-head-unshaded-vox
+        shader: unshaded
   - type: PointLight
     radius: 6
   - type: PressureProtection
       head:
       - state: equipped-head-light
         shader: unshaded
+      head-vox:
+      - state: equipped-head-light-vox
+        shader: unshaded
   - type: Clothing
     clothingVisuals:
       head:
       - state: equipped-head
       - state: equipped-head-unshaded
         shader: unshaded
+      head-vox:
+      - state: equipped-head-vox
+      - state: equipped-head-unshaded-vox
+        shader: unshaded
   - type: PointLight
     radius: 6
   - type: PressureProtection
index c28cca566952268d4dd3df51a9efd770496a01fa..539cec93289d2a25b93c109364679f659e160cee 100644 (file)
       outerClothing:
       - state: equipped-OUTERCLOTHING-light
         shader: unshaded
+      outerClothing-vox:
+      - state: equipped-OUTERCLOTHING-light-vox
+        shader: unshaded
   - type: Appearance
   - type: HandheldLight
     addPrefix: false