[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:
committed by
Poojawa
parent
03cc105e90
commit
3c7520f1f1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user