[MIRROR] Makes light fixtures actually glow in the dark while on (And adds the necessary groundwork for other above lighting plane stuff) (#5687)

* Makes light fixtures actually glow in the dark while on (And adds the necessary groundwork for other above lighting plane stuff) (#35879)

* adds an above lighting layer, adds lighting overlays

* fixes wonkiness with broken and burned lights

* decreases overlay alpha a tad bit

* i gotta test this - removes new() override from mutable_appearance

* readds /mutable_appearance/New() for legacy behaviour

* Makes light fixtures actually glow in the dark while on (And adds the necessary groundwork for other above lighting plane stuff)
This commit is contained in:
CitadelStationBot
2018-02-24 06:08:23 -06:00
committed by Poojawa
parent 03cc105e90
commit 3c7520f1f1
5 changed files with 17 additions and 7 deletions

View File

@@ -79,6 +79,9 @@
#define LIGHTING_PLANE 15 #define LIGHTING_PLANE 15
#define LIGHTING_LAYER 15 #define LIGHTING_LAYER 15
#define ABOVE_LIGHTING_PLANE 16
#define ABOVE_LIGHTING_LAYER 16
//HUD layer defines //HUD layer defines
#define FULLSCREEN_PLANE 18 #define FULLSCREEN_PLANE 18

View File

@@ -10,9 +10,10 @@
// And yes this does have to be in the constructor, BYOND ignores it if you set it as a normal var // And yes this does have to be in the constructor, BYOND ignores it if you set it as a normal var
// Helper similar to image() // Helper similar to image()
/proc/mutable_appearance(icon, icon_state = "", layer = FLOAT_LAYER) /proc/mutable_appearance(icon, icon_state = "", layer = FLOAT_LAYER, plane = FLOAT_PLANE)
var/mutable_appearance/MA = new() var/mutable_appearance/MA = new()
MA.icon = icon MA.icon = icon
MA.icon_state = icon_state MA.icon_state = icon_state
MA.layer = layer MA.layer = layer
MA.plane = plane
return MA return MA

View File

@@ -183,8 +183,9 @@
/obj/machinery/light /obj/machinery/light
name = "light fixture" name = "light fixture"
icon = 'icons/obj/lighting.dmi' icon = 'icons/obj/lighting.dmi'
var/overlayicon = 'icons/obj/lighting_overlay.dmi'
var/base_state = "tube" // base description and icon_state var/base_state = "tube" // base description and icon_state
icon_state = "tube1" icon_state = "tube"
desc = "A lighting fixture." desc = "A lighting fixture."
anchored = TRUE anchored = TRUE
layer = WALL_OBJ_LAYER layer = WALL_OBJ_LAYER
@@ -231,7 +232,7 @@
// the smaller bulb light fixture // the smaller bulb light fixture
/obj/machinery/light/small /obj/machinery/light/small
icon_state = "bulb1" icon_state = "bulb"
base_state = "bulb" base_state = "bulb"
fitting = "bulb" fitting = "bulb"
brightness = 4 brightness = 4
@@ -293,12 +294,17 @@
return ..() return ..()
/obj/machinery/light/update_icon() /obj/machinery/light/update_icon()
cut_overlays()
switch(status) // set icon_states switch(status) // set icon_states
if(LIGHT_OK) if(LIGHT_OK)
if(emergency_mode) if(emergency_mode)
icon_state = "[base_state]_emergency" icon_state = "[base_state]_emergency"
else else
icon_state = "[base_state][on]" icon_state = "[base_state]"
if(on)
var/mutable_appearance/glowybit = mutable_appearance(overlayicon, base_state, ABOVE_LIGHTING_LAYER, ABOVE_LIGHTING_PLANE)
glowybit.alpha = CLAMP(light_power*250, 30, 200)
add_overlay(glowybit)
if(LIGHT_EMPTY) if(LIGHT_EMPTY)
icon_state = "[base_state]-empty" icon_state = "[base_state]-empty"
if(LIGHT_BURNED) if(LIGHT_BURNED)
@@ -793,7 +799,7 @@
name = "floor light" name = "floor light"
icon = 'icons/obj/lighting.dmi' icon = 'icons/obj/lighting.dmi'
base_state = "floor" // base description and icon_state base_state = "floor" // base description and icon_state
icon_state = "floor1" icon_state = "floor"
brightness = 4 brightness = 4
layer = 2.5 layer = 2.5
light_type = /obj/item/light/bulb light_type = /obj/item/light/bulb

Binary file not shown.

Before

Width:  |  Height:  |  Size: 84 KiB

After

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB