This commit is contained in:
@@ -59,6 +59,10 @@
|
||||
else
|
||||
icon_state = "[initial(icon_state)]-off"
|
||||
|
||||
/obj/machinery/smartfridge/update_overlays()
|
||||
. = ..()
|
||||
if(!stat)
|
||||
. += emissive_appearance(icon, "smartfridge-light-mask", alpha = src.alpha)
|
||||
|
||||
|
||||
/*******************
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
* almost guaranteed to be doing something wrong.
|
||||
*/
|
||||
/atom/movable/emissive_blocker
|
||||
name = ""
|
||||
plane = EMISSIVE_BLOCKER_PLANE
|
||||
layer = EMISSIVE_BLOCKER_LAYER
|
||||
name = "emissive blocker"
|
||||
plane = EMISSIVE_PLANE
|
||||
layer = FLOAT_LAYER
|
||||
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
|
||||
rad_flags = RAD_NO_CONTAMINATE | RAD_PROTECT_CONTENTS
|
||||
//Why?
|
||||
@@ -23,6 +23,8 @@
|
||||
verbs.Cut() //Cargo culting from lighting object, this maybe affects memory usage?
|
||||
|
||||
render_source = source
|
||||
color = GLOB.em_block_color
|
||||
|
||||
|
||||
/atom/movable/emissive_blocker/ex_act(severity)
|
||||
return FALSE
|
||||
|
||||
+60
-63
@@ -275,78 +275,75 @@
|
||||
|
||||
// update the APC icon to show the three base states
|
||||
// also add overlays for indicator lights
|
||||
/obj/machinery/power/apc/update_icon()
|
||||
var/update = check_updates() //returns 0 if no need to update icons.
|
||||
// 1 if we need to update the icon_state
|
||||
// 2 if we need to update the overlays
|
||||
if(!update)
|
||||
icon_update_needed = FALSE
|
||||
/obj/machinery/power/apc/update_appearance(updates=check_updates())
|
||||
icon_update_needed = FALSE
|
||||
if(!updates)
|
||||
return
|
||||
|
||||
if(update & 1) // Updating the icon state
|
||||
if(update_state & UPSTATE_ALLGOOD)
|
||||
icon_state = "apc0"
|
||||
else if(update_state & (UPSTATE_OPENED1|UPSTATE_OPENED2))
|
||||
var/basestate = "apc[ cell ? "2" : "1" ]"
|
||||
if(update_state & UPSTATE_OPENED1)
|
||||
if(update_state & (UPSTATE_MAINT|UPSTATE_BROKE))
|
||||
icon_state = "apcmaint" //disabled APC cannot hold cell
|
||||
else
|
||||
icon_state = basestate
|
||||
else if(update_state & UPSTATE_OPENED2)
|
||||
if (update_state & UPSTATE_BROKE || malfhack)
|
||||
icon_state = "[basestate]-b-nocover"
|
||||
else
|
||||
icon_state = "[basestate]-nocover"
|
||||
else if(update_state & UPSTATE_BROKE)
|
||||
icon_state = "apc-b"
|
||||
else if(update_state & UPSTATE_BLUESCREEN)
|
||||
icon_state = "apcemag"
|
||||
else if(update_state & UPSTATE_WIREEXP)
|
||||
icon_state = "apcewires"
|
||||
else if(update_state & UPSTATE_MAINT)
|
||||
icon_state = "apc0"
|
||||
|
||||
if(!(update_state & UPSTATE_ALLGOOD))
|
||||
SSvis_overlays.remove_vis_overlay(src, managed_vis_overlays)
|
||||
var/hijackerreturn
|
||||
if (hijacker)
|
||||
var/obj/item/implant/hijack/H = hijacker.getImplant(/obj/item/implant/hijack)
|
||||
hijackerreturn = H && !H.stealthmode
|
||||
if(update & 2)
|
||||
SSvis_overlays.remove_vis_overlay(src, managed_vis_overlays)
|
||||
if(!(stat & (BROKEN|MAINT)) && update_state & UPSTATE_ALLGOOD)
|
||||
SSvis_overlays.add_vis_overlay(src, icon, "apcox-[locked]", layer, plane, dir)
|
||||
SSvis_overlays.add_vis_overlay(src, icon, "apcox-[locked]", EMISSIVE_LAYER, EMISSIVE_PLANE, dir)
|
||||
SSvis_overlays.add_vis_overlay(src, icon, "apco3-[hijackerreturn ? "3" : charging]", layer, plane, dir)
|
||||
SSvis_overlays.add_vis_overlay(src, icon, "apco3-[hijackerreturn ? "3" : charging]", EMISSIVE_LAYER, EMISSIVE_PLANE, dir)
|
||||
if(operating)
|
||||
SSvis_overlays.add_vis_overlay(src, icon, "apco0-[equipment]", layer, plane, dir)
|
||||
SSvis_overlays.add_vis_overlay(src, icon, "apco0-[equipment]", EMISSIVE_LAYER, EMISSIVE_PLANE, dir)
|
||||
SSvis_overlays.add_vis_overlay(src, icon, "apco1-[lighting]", layer, plane, dir)
|
||||
SSvis_overlays.add_vis_overlay(src, icon, "apco1-[lighting]", EMISSIVE_LAYER, EMISSIVE_PLANE, dir)
|
||||
SSvis_overlays.add_vis_overlay(src, icon, "apco2-[environ]", layer, plane, dir)
|
||||
SSvis_overlays.add_vis_overlay(src, icon, "apco2-[environ]", EMISSIVE_LAYER, EMISSIVE_PLANE, dir)
|
||||
|
||||
. = ..()
|
||||
// And now, separately for cleanness, the lighting changing
|
||||
if(update_state & UPSTATE_ALLGOOD)
|
||||
if(!update_state)
|
||||
switch(charging)
|
||||
if(APC_NOT_CHARGING)
|
||||
light_color = LIGHT_COLOR_RED
|
||||
set_light_color(COLOR_SOFT_RED)
|
||||
if(APC_CHARGING)
|
||||
light_color = LIGHT_COLOR_BLUE
|
||||
set_light_color(LIGHT_COLOR_BLUE)
|
||||
if(APC_FULLY_CHARGED)
|
||||
light_color = LIGHT_COLOR_GREEN
|
||||
if (hijackerreturn)
|
||||
light_color = LIGHT_COLOR_YELLOW
|
||||
set_light_color(LIGHT_COLOR_GREEN)
|
||||
set_light(lon_range)
|
||||
else if(update_state & UPSTATE_BLUESCREEN)
|
||||
light_color = LIGHT_COLOR_BLUE
|
||||
set_light(lon_range)
|
||||
else
|
||||
set_light(0)
|
||||
return
|
||||
|
||||
icon_update_needed = FALSE
|
||||
if(update_state & UPSTATE_BLUESCREEN)
|
||||
set_light_color(LIGHT_COLOR_BLUE)
|
||||
set_light(lon_range)
|
||||
return
|
||||
|
||||
set_light(0)
|
||||
|
||||
// update the APC icon to show the three base states
|
||||
// also add overlays for indicator lights
|
||||
/obj/machinery/power/apc/update_icon_state()
|
||||
if(!update_state)
|
||||
icon_state = "apc0"
|
||||
return ..()
|
||||
if(update_state & (UPSTATE_OPENED1|UPSTATE_OPENED2))
|
||||
var/basestate = "apc[cell ? 2 : 1]"
|
||||
if(update_state & UPSTATE_OPENED1)
|
||||
icon_state = (update_state & (UPSTATE_MAINT|UPSTATE_BROKE)) ? "apcmaint" : basestate
|
||||
else if(update_state & UPSTATE_OPENED2)
|
||||
icon_state = "[basestate][((update_state & UPSTATE_BROKE) || malfhack) ? "-b" : null]-nocover"
|
||||
return ..()
|
||||
if(update_state & UPSTATE_BROKE)
|
||||
icon_state = "apc-b"
|
||||
return ..()
|
||||
if(update_state & UPSTATE_BLUESCREEN)
|
||||
icon_state = "apcemag"
|
||||
return ..()
|
||||
if(update_state & UPSTATE_WIREEXP)
|
||||
icon_state = "apcewires"
|
||||
return ..()
|
||||
if(update_state & UPSTATE_MAINT)
|
||||
icon_state = "apc0"
|
||||
return ..()
|
||||
|
||||
/obj/machinery/power/apc/update_overlays()
|
||||
. = ..()
|
||||
if((machine_stat & (BROKEN|MAINT)) || update_state)
|
||||
return
|
||||
|
||||
. += mutable_appearance(icon, "apcox-[locked]")
|
||||
. += emissive_appearance(icon, "apcox-[locked]")
|
||||
. += mutable_appearance(icon, "apco3-[charging]")
|
||||
. += emissive_appearance(icon, "apco3-[charging]")
|
||||
if(!operating)
|
||||
return
|
||||
|
||||
. += mutable_appearance(icon, "apco0-[equipment]")
|
||||
. += emissive_appearance(icon, "apco0-[equipment]")
|
||||
. += mutable_appearance(icon, "apco1-[lighting]")
|
||||
. += emissive_appearance(icon, "apco1-[lighting]")
|
||||
. += mutable_appearance(icon, "apco2-[environ]")
|
||||
. += emissive_appearance(icon, "apco2-[environ]")
|
||||
|
||||
/obj/machinery/power/apc/proc/check_updates()
|
||||
var/last_update_state = update_state
|
||||
|
||||
@@ -401,12 +401,15 @@
|
||||
//check for items in disposal - occupied light
|
||||
if(contents.len > 0)
|
||||
. += "dispover-full"
|
||||
. += emissive_appearance(icon, "dispover-full", alpha = src.alpha)
|
||||
|
||||
//charging and ready light
|
||||
if(pressure_charging)
|
||||
. += "dispover-charge"
|
||||
. += emissive_appearance(icon, "dispover-charge-glow", alpha = src.alpha)
|
||||
else if(full_pressure)
|
||||
. += "dispover-ready"
|
||||
. += emissive_appearance(icon, "dispover-ready-glow", alpha = src.alpha)
|
||||
|
||||
/obj/machinery/disposal/bin/proc/do_flush()
|
||||
set waitfor = FALSE
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
if((stat & (NOPOWER|MAINT|BROKEN)) || panel_open)
|
||||
return
|
||||
. += mutable_appearance(icon, "nanite_program_hub_on")
|
||||
. += mutable_appearance(icon, "nanite_program_hub_on", layer, EMISSIVE_PLANE)
|
||||
. += emissive_appearance(icon, "nanite_program_hub_on")
|
||||
|
||||
/obj/machinery/nanite_program_hub/attackby(obj/item/I, mob/user)
|
||||
if(istype(I, /obj/item/disk/nanite_program))
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
if((stat & (NOPOWER|MAINT|BROKEN)) || panel_open)
|
||||
return
|
||||
. += mutable_appearance(icon, "nanite_programmer_on")
|
||||
. += mutable_appearance(icon, "nanite_programmer_on", layer, EMISSIVE_PLANE)
|
||||
. += emissive_appearance(icon, "nanite_programmer_on")
|
||||
|
||||
/obj/machinery/nanite_programmer/attackby(obj/item/I, mob/user)
|
||||
if(istype(I, /obj/item/disk/nanite_program))
|
||||
|
||||
@@ -243,10 +243,8 @@ IF YOU MODIFY THE PRODUCTS LIST OF A MACHINE, MAKE SURE TO UPDATE ITS RESUPPLY C
|
||||
. = ..()
|
||||
if(!light_mask)
|
||||
return
|
||||
|
||||
SSvis_overlays.remove_vis_overlay(src, managed_vis_overlays)
|
||||
if(!(stat & BROKEN) && powered())
|
||||
SSvis_overlays.add_vis_overlay(src, icon, light_mask, EMISSIVE_LAYER, EMISSIVE_PLANE)
|
||||
. += emissive_appearance(icon, light_mask)
|
||||
|
||||
/obj/machinery/vending/obj_break(damage_flag)
|
||||
. = ..()
|
||||
|
||||
Reference in New Issue
Block a user