Add species-specific code for ToggleableLightVisuals (#35482)

This commit is contained in:
Sparlight
2025-02-25 10:00:37 -07:00
committed by GitHub
parent f165223a5e
commit 9f4a4b81ac
4 changed files with 39 additions and 1 deletions

View File

@@ -2,6 +2,7 @@ using Content.Client.Clothing;
using Content.Client.Items.Systems; using Content.Client.Items.Systems;
using Content.Shared.Clothing; using Content.Shared.Clothing;
using Content.Shared.Hands; using Content.Shared.Hands;
using Content.Shared.Inventory;
using Content.Shared.Item; using Content.Shared.Item;
using Content.Shared.Toggleable; using Content.Shared.Toggleable;
using Robust.Client.GameObjects; using Robust.Client.GameObjects;
@@ -62,7 +63,16 @@ public sealed class ToggleableLightVisualsSystem : VisualizerSystem<ToggleableLi
|| !enabled) || !enabled)
return; 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; return;
var modulate = AppearanceSystem.TryGetData<Color>(uid, ToggleableLightVisuals.Color, out var color, appearance); var modulate = AppearanceSystem.TryGetData<Color>(uid, ToggleableLightVisuals.Color, out var color, appearance);

View File

@@ -79,10 +79,14 @@
clothingVisuals: clothingVisuals:
head: head:
- state: equipped-head-light - state: equipped-head-light
head-vox:
- state: equipped-head-light-vox
- type: Clothing - type: Clothing
clothingVisuals: clothingVisuals:
head: head:
- state: equipped-head - state: equipped-head
head-vox:
- state: equipped-head-vox
- type: TemperatureProtection - type: TemperatureProtection
heatingCoefficient: 0.1 heatingCoefficient: 0.1
coolingCoefficient: 0.1 coolingCoefficient: 0.1

View File

@@ -48,12 +48,19 @@
head: head:
- state: equipped-head-light - state: equipped-head-light
shader: unshaded shader: unshaded
head-vox:
- state: equipped-head-light-vox
shader: unshaded
- type: Clothing - type: Clothing
clothingVisuals: clothingVisuals:
head: head:
- state: equipped-head - state: equipped-head
- state: equipped-head-unshaded - state: equipped-head-unshaded
shader: unshaded shader: unshaded
head-vox:
- state: equipped-head-vox
- state: equipped-head-unshaded-vox
shader: unshaded
- type: PointLight - type: PointLight
color: "#adffe6" color: "#adffe6"
- type: PressureProtection - type: PressureProtection
@@ -106,12 +113,19 @@
head: head:
- state: equipped-head-light - state: equipped-head-light
shader: unshaded shader: unshaded
head-vox:
- state: equipped-head-light-vox
shader: unshaded
- type: Clothing - type: Clothing
clothingVisuals: clothingVisuals:
head: head:
- state: equipped-head - state: equipped-head
- state: equipped-head-unshaded - state: equipped-head-unshaded
shader: unshaded shader: unshaded
head-vox:
- state: equipped-head-vox
- state: equipped-head-unshaded-vox
shader: unshaded
- type: PointLight - type: PointLight
radius: 6 radius: 6
- type: PressureProtection - type: PressureProtection
@@ -159,12 +173,19 @@
head: head:
- state: equipped-head-light - state: equipped-head-light
shader: unshaded shader: unshaded
head-vox:
- state: equipped-head-light-vox
shader: unshaded
- type: Clothing - type: Clothing
clothingVisuals: clothingVisuals:
head: head:
- state: equipped-head - state: equipped-head
- state: equipped-head-unshaded - state: equipped-head-unshaded
shader: unshaded shader: unshaded
head-vox:
- state: equipped-head-vox
- state: equipped-head-unshaded-vox
shader: unshaded
- type: PointLight - type: PointLight
radius: 6 radius: 6
- type: PressureProtection - type: PressureProtection

View File

@@ -140,6 +140,9 @@
outerClothing: outerClothing:
- state: equipped-OUTERCLOTHING-light - state: equipped-OUTERCLOTHING-light
shader: unshaded shader: unshaded
outerClothing-vox:
- state: equipped-OUTERCLOTHING-light-vox
shader: unshaded
- type: Appearance - type: Appearance
- type: HandheldLight - type: HandheldLight
addPrefix: false addPrefix: false