Skip to content

Commit

Permalink
[MIRROR] Add emissives to air alarms, lights, and switches
Browse files Browse the repository at this point in the history
  • Loading branch information
SierraKomodo authored and SuhEugene committed Jan 7, 2024
1 parent efba12b commit c2700d7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 15 deletions.
5 changes: 4 additions & 1 deletion code/game/machinery/alarm.dm
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,10 @@
new_color = COLOR_SUN
if (2)
new_color = COLOR_RED_LIGHT
AddOverlays(overlay_image(icon, "alarm[icon_level]", plane = EFFECTS_ABOVE_LIGHTING_PLANE, layer = ABOVE_LIGHTING_LAYER))
AddOverlays(list(
emissive_appearance(icon, "alarm[icon_level]"),
image(icon, "alarm[icon_level]")
))

pixel_x = 0
pixel_y = 0
Expand Down
15 changes: 6 additions & 9 deletions code/game/machinery/lightswitch.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
var/on = 0
var/area/connected_area = null
var/other_area = null
var/image/overlay

/obj/machinery/light_switch/Initialize()
. = ..()
Expand All @@ -28,20 +27,18 @@
update_icon()

/obj/machinery/light_switch/on_update_icon()
if(!overlay)
overlay = image(icon, "light1-overlay")
overlay.plane = EFFECTS_ABOVE_LIGHTING_PLANE
overlay.layer = ABOVE_LIGHTING_LAYER

ClearOverlays()
if(inoperable())
icon_state = "light-p"
set_light(0)
else
icon_state = "light[on]"
overlay.icon_state = "light[on]-overlay"
AddOverlays(overlay)
set_light(2, 0.25, on ? "#82ff4c" : "#f86060")
var/color = on ? "#82ff4c" : "#f86060"
AddOverlays(list(
emissive_appearance(icon, "light[on]-overlay"),
overlay_image(icon, "light[on]-overlay", color)
))
set_light(2, 0.25, color)

/obj/machinery/light_switch/examine(mob/user, distance)
. = ..()
Expand Down
7 changes: 2 additions & 5 deletions code/modules/power/lighting.dm
Original file line number Diff line number Diff line change
Expand Up @@ -297,12 +297,9 @@
on = FALSE

if(istype(lightbulb, /obj/item/light))
var/image/I = image(icon, src, _state)
I.color = get_mode_color()
if (on)
I.plane = EFFECTS_ABOVE_LIGHTING_PLANE
I.layer = ABOVE_LIGHTING_LAYER
AddOverlays(I)
AddOverlays(emissive_appearance(icon, _state))
AddOverlays(overlay_image(icon, _state, color))

if(on)

Expand Down

0 comments on commit c2700d7

Please sign in to comment.