]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Glowy lights - light fixtures now actually glow (#23428)
authordeathride58 <deathride58@users.noreply.github.com>
Wed, 3 Jan 2024 08:46:11 +0000 (03:46 -0500)
committerGitHub <noreply@github.com>
Wed, 3 Jan 2024 08:46:11 +0000 (19:46 +1100)
* glowy lights - makes light fixtures actually physically glow when active

* serviced the lights

* ya sure

17 files changed:
Content.Client/Light/Visualizers/PoweredLightVisualizerSystem.cs
Content.Shared/Light/SharedPoweredLightVisuals.cs
Resources/Prototypes/Entities/Structures/Lighting/base_lighting.yml
Resources/Prototypes/Entities/Structures/Wallmounts/service_light.yml
Resources/Prototypes/Recipes/Construction/structures.yml
Resources/Textures/Structures/Wallmounts/Lighting/light_small.rsi/base.png [moved from Resources/Textures/Structures/Wallmounts/Lighting/light_small.rsi/off.png with 100% similarity]
Resources/Textures/Structures/Wallmounts/Lighting/light_small.rsi/glow.png [new file with mode: 0644]
Resources/Textures/Structures/Wallmounts/Lighting/light_small.rsi/meta.json
Resources/Textures/Structures/Wallmounts/Lighting/light_small.rsi/on.png [deleted file]
Resources/Textures/Structures/Wallmounts/Lighting/light_tube.rsi/base.png [moved from Resources/Textures/Structures/Wallmounts/Lighting/light_tube.rsi/off.png with 100% similarity]
Resources/Textures/Structures/Wallmounts/Lighting/light_tube.rsi/glow.png [new file with mode: 0644]
Resources/Textures/Structures/Wallmounts/Lighting/light_tube.rsi/meta.json
Resources/Textures/Structures/Wallmounts/Lighting/light_tube.rsi/on.png [deleted file]
Resources/Textures/Structures/Wallmounts/service_light.rsi/base.png [moved from Resources/Textures/Structures/Wallmounts/service_light.rsi/off.png with 100% similarity]
Resources/Textures/Structures/Wallmounts/service_light.rsi/glow.png [new file with mode: 0644]
Resources/Textures/Structures/Wallmounts/service_light.rsi/meta.json
Resources/Textures/Structures/Wallmounts/service_light.rsi/on.png [deleted file]

index e7fcf7e219fc48ef3eefa7a08a206ad53b8e3dc1..db703128a305b16ea6a20ca741aded366c156f87 100644 (file)
@@ -30,6 +30,9 @@ public sealed class PoweredLightVisualizerSystem : VisualizerSystem<PoweredLight
         if (comp.SpriteStateMap.TryGetValue(state, out var spriteState))
             args.Sprite.LayerSetState(PoweredLightLayers.Base, spriteState);
 
+        if (args.Sprite.LayerExists(PoweredLightLayers.Glow))
+            args.Sprite.LayerSetVisible(PoweredLightLayers.Glow, state == PoweredLightState.On);
+
         SetBlinkingAnimation(
             uid,
             state == PoweredLightState.On
index 6b954a8bf6e047639b46d7db9ce3df08147738f2..90c15bb37334ac58aa3f3c1a1eb43d51369ba834 100644 (file)
@@ -21,6 +21,7 @@ namespace Content.Shared.Light
 
     public enum PoweredLightLayers : byte
     {
-        Base
+        Base,
+        Glow
     }
 }
index a146e9ddcff47f3be4094c2af5916603819adba0..667c5a139e034b2c27926bc3670d3dfe484d00df 100644 (file)
     sprite: Structures/Wallmounts/Lighting/light_tube.rsi
     drawdepth: WallMountedItems
     layers:
-    - state: on
-      map: ["enum.PoweredLightLayers.Base"]
-    state: on
+    - map: ["enum.PoweredLightLayers.Base"]
+      state: base
+    - map: ["enum.PoweredLightLayers.Glow"]
+      state: glow
+      shader: unshaded
+    state: base
   - type: PointLight
     radius: 10
     energy: 0.8
   - type: PoweredLightVisuals
     blinkingSound:
       path: "/Audio/Machines/light_tube_on.ogg"
+    spriteStateMap:
+      empty: empty
+      off: base
+      on: base
+      broken: broken
+      burned: burned
 
 - type: entity
   id: Poweredlight
   parent: PoweredlightEmpty
   components:
   - type: Sprite
-    state: off
+    state: base
   - type: PointLight
     enabled: true
   - type: PoweredLight
         path: /Audio/Ambience/Objects/light_hum.ogg
     - type: Sprite
       sprite: Structures/Wallmounts/Lighting/light_small.rsi
-      state: on
+      state: base
     - type: PointLight
       energy: 1.0
       radius: 6
     range: 200
   - type: Appearance
   - type: PoweredLightVisuals
+    spriteStateMap:
+      empty: empty
+      off: base
+      on: base
+      broken: broken
+      burned: burned
   - type: DeviceLinkSink
     ports:
       - On
   parent: PoweredSmallLightEmpty
   components:
   - type: Sprite
-    state: off
+    state: base
   - type: PointLight
     enabled: true
   - type: PoweredLight
index 80b92b94fdb9b686921cf7d768efe41bfa8fd2a0..903b9a700529e04f9ec510739072364f846a4fc7 100644 (file)
@@ -8,9 +8,12 @@
     sprite: Structures/Wallmounts/service_light.rsi
     drawdepth: WallMountedItems
     layers:
-    - state: off
-      map: ["enum.PoweredLightLayers.Base"]
-    state: off
+    - map: ["enum.PoweredLightLayers.Base"]
+      state: base
+    - map: ["enum.PoweredLightLayers.Glow"]
+      state: glow
+      shader: unshaded
+    state: base
   - type: PointLight
     radius: 1
     energy: 1
index 75c3efcffb3e8f4231424d9b3746133d391dbe27..c9c7a8fe455ea8ab16b60cdef05011a7873dbd79 100644 (file)
   description: A wall light fixture. Use light tubes.
   icon:
     sprite: Structures/Wallmounts/Lighting/light_tube.rsi
-    state: off
+    state: base
   objectType: Structure
   placementMode: SnapgridCenter
   canRotate: true
   description: A wall light fixture. Use light bulbs.
   icon:
     sprite: Structures/Wallmounts/Lighting/light_small.rsi
-    state: off
+    state: base
   objectType: Structure
   placementMode: SnapgridCenter
   canRotate: true
diff --git a/Resources/Textures/Structures/Wallmounts/Lighting/light_small.rsi/glow.png b/Resources/Textures/Structures/Wallmounts/Lighting/light_small.rsi/glow.png
new file mode 100644 (file)
index 0000000..0bfe0a7
Binary files /dev/null and b/Resources/Textures/Structures/Wallmounts/Lighting/light_small.rsi/glow.png differ
index 5b49fd2cea093e9fe622b8cbe04549d5beabc3ed..09378e1ebd488676015e0d1292fd5be0fcf3744b 100644 (file)
@@ -1 +1 @@
-{"version": 1, "size": {"x": 32, "y": 32}, "license": "CC-BY-SA-3.0", "copyright": "https://github.com/discordia-space/CEV-Eris/blob/2b969adc2dfd3e9621bf3597c5cbffeb3ac8c9f0/icons/obj/lighting.dmi", "states": [{"name": "broken", "directions": 4}, {"name": "burned", "directions": 4}, {"name": "empty", "directions": 4}, {"name": "off", "directions": 4}, {"name": "on", "directions": 4}]}
+{"version": 1, "size": {"x": 32, "y": 32}, "license": "CC-BY-SA-3.0", "copyright": "https://github.com/discordia-space/CEV-Eris/blob/2b969adc2dfd3e9621bf3597c5cbffeb3ac8c9f0/icons/obj/lighting.dmi", "states": [{"name": "broken", "directions": 4}, {"name": "burned", "directions": 4}, {"name": "empty", "directions": 4}, {"name": "base", "directions": 4}, {"name": "glow", "directions": 4}]}
diff --git a/Resources/Textures/Structures/Wallmounts/Lighting/light_small.rsi/on.png b/Resources/Textures/Structures/Wallmounts/Lighting/light_small.rsi/on.png
deleted file mode 100644 (file)
index 01b6e79..0000000
Binary files a/Resources/Textures/Structures/Wallmounts/Lighting/light_small.rsi/on.png and /dev/null differ
diff --git a/Resources/Textures/Structures/Wallmounts/Lighting/light_tube.rsi/glow.png b/Resources/Textures/Structures/Wallmounts/Lighting/light_tube.rsi/glow.png
new file mode 100644 (file)
index 0000000..edffdfe
Binary files /dev/null and b/Resources/Textures/Structures/Wallmounts/Lighting/light_tube.rsi/glow.png differ
index d7e5ae46ad14ced120c74974bbf2cbea0d3e81e4..2f3dc61b2329d801fade1c216fafa97bd63df9d4 100644 (file)
@@ -62,7 +62,7 @@
       ]
     },
     {
-      "name": "off",
+      "name": "base",
       "directions": 4,
       "delays": [
         [
       ]
     },
     {
-      "name": "on",
-      "directions": 4,
-      "delays": [
-        [
-          1
-        ],
-        [
-          1
-        ],
-        [
-          1
-        ],
-        [
-          1
-        ]
-      ]
+      "name": "glow",
+      "directions": 4
     }
   ]
 }
diff --git a/Resources/Textures/Structures/Wallmounts/Lighting/light_tube.rsi/on.png b/Resources/Textures/Structures/Wallmounts/Lighting/light_tube.rsi/on.png
deleted file mode 100644 (file)
index 6b97589..0000000
Binary files a/Resources/Textures/Structures/Wallmounts/Lighting/light_tube.rsi/on.png and /dev/null differ
diff --git a/Resources/Textures/Structures/Wallmounts/service_light.rsi/glow.png b/Resources/Textures/Structures/Wallmounts/service_light.rsi/glow.png
new file mode 100644 (file)
index 0000000..5cb7b09
Binary files /dev/null and b/Resources/Textures/Structures/Wallmounts/service_light.rsi/glow.png differ
index cf91d5d1a5289fff8a97436d88563cba0818dd69..ceaa7a56eee5a3543a5d58b239af87a1fd1449a0 100644 (file)
             "directions": 4
         },
         {
-            "name": "off",
+            "name": "base",
             "directions": 4
         },
         {
-            "name": "on",
+            "name": "glow",
             "directions": 4,
             "delays": [
                 [
diff --git a/Resources/Textures/Structures/Wallmounts/service_light.rsi/on.png b/Resources/Textures/Structures/Wallmounts/service_light.rsi/on.png
deleted file mode 100644 (file)
index 3e52be4..0000000
Binary files a/Resources/Textures/Structures/Wallmounts/service_light.rsi/on.png and /dev/null differ