diff --git a/code/__DEFINES/layers.dm b/code/__DEFINES/layers.dm index b22768d494..9bf44a7fbd 100644 --- a/code/__DEFINES/layers.dm +++ b/code/__DEFINES/layers.dm @@ -79,6 +79,9 @@ #define LIGHTING_PLANE 15 #define LIGHTING_LAYER 15 +#define ABOVE_LIGHTING_PLANE 16 +#define ABOVE_LIGHTING_LAYER 16 + //HUD layer defines #define FULLSCREEN_PLANE 18 @@ -95,4 +98,4 @@ #define ABOVE_HUD_LAYER 20 #define SPLASHSCREEN_LAYER 21 -#define SPLASHSCREEN_PLANE 21 \ No newline at end of file +#define SPLASHSCREEN_PLANE 21 diff --git a/code/datums/mutable_appearance.dm b/code/datums/mutable_appearance.dm index 1cb3a97d9f..1b095c555d 100644 --- a/code/datums/mutable_appearance.dm +++ b/code/datums/mutable_appearance.dm @@ -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 // 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() MA.icon = icon MA.icon_state = icon_state MA.layer = layer - return MA \ No newline at end of file + MA.plane = plane + return MA diff --git a/code/modules/power/lighting.dm b/code/modules/power/lighting.dm index bf5ca084e9..a182e86074 100644 --- a/code/modules/power/lighting.dm +++ b/code/modules/power/lighting.dm @@ -183,8 +183,9 @@ /obj/machinery/light name = "light fixture" icon = 'icons/obj/lighting.dmi' + var/overlayicon = 'icons/obj/lighting_overlay.dmi' var/base_state = "tube" // base description and icon_state - icon_state = "tube1" + icon_state = "tube" desc = "A lighting fixture." anchored = TRUE layer = WALL_OBJ_LAYER @@ -231,7 +232,7 @@ // the smaller bulb light fixture /obj/machinery/light/small - icon_state = "bulb1" + icon_state = "bulb" base_state = "bulb" fitting = "bulb" brightness = 4 @@ -293,12 +294,17 @@ return ..() /obj/machinery/light/update_icon() + cut_overlays() switch(status) // set icon_states if(LIGHT_OK) if(emergency_mode) icon_state = "[base_state]_emergency" 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) icon_state = "[base_state]-empty" if(LIGHT_BURNED) @@ -793,7 +799,7 @@ name = "floor light" icon = 'icons/obj/lighting.dmi' base_state = "floor" // base description and icon_state - icon_state = "floor1" + icon_state = "floor" brightness = 4 layer = 2.5 light_type = /obj/item/light/bulb diff --git a/icons/obj/lighting.dmi b/icons/obj/lighting.dmi index a17ac1c22e..f1b5220b89 100644 Binary files a/icons/obj/lighting.dmi and b/icons/obj/lighting.dmi differ diff --git a/icons/obj/lighting_overlay.dmi b/icons/obj/lighting_overlay.dmi new file mode 100644 index 0000000000..c8c0ffbff0 Binary files /dev/null and b/icons/obj/lighting_overlay.dmi differ