mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-29 16:18:01 +01:00
* reverts Adds Neon Carpet (#55782), it appears to have been causing massive amounts of maptick (#56496) It appears to have been causing massive amounts of maptick, this'll need a testmerge so we can test my hypothesis * Reverts Adds Neon Carpet (#55782) Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
This commit is contained in:
co-authored by
LemonInTheDark
parent
acfe254041
commit
70024ef6ad
+55
-52
@@ -197,7 +197,6 @@
|
||||
/obj/machinery/power/apc/Destroy()
|
||||
GLOB.apcs_list -= src
|
||||
|
||||
UnregisterSignal(src, COMSIG_ATOM_UPDATE_ICON)
|
||||
if(malfai && operating)
|
||||
malfai.malf_picker.processing_time = clamp(malfai.malf_picker.processing_time - 10,0,1000)
|
||||
area.power_light = FALSE
|
||||
@@ -229,7 +228,6 @@
|
||||
|
||||
/obj/machinery/power/apc/Initialize(mapload)
|
||||
. = ..()
|
||||
RegisterSignal(src, COMSIG_ATOM_UPDATE_ICON, .proc/check_updates)
|
||||
if(!mapload)
|
||||
return
|
||||
has_electronics = APC_ELECTRONICS_SECURED
|
||||
@@ -294,11 +292,55 @@
|
||||
// update the APC icon to show the three base states
|
||||
// also add overlays for indicator lights
|
||||
/obj/machinery/power/apc/update_icon()
|
||||
. = ..()
|
||||
if(!.)
|
||||
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
|
||||
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)
|
||||
|
||||
if(update & 2)
|
||||
SSvis_overlays.remove_vis_overlay(src, managed_vis_overlays)
|
||||
if(!(machine_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]", layer, EMISSIVE_PLANE, dir)
|
||||
SSvis_overlays.add_vis_overlay(src, icon, "apco3-[charging]", layer, plane, dir)
|
||||
SSvis_overlays.add_vis_overlay(src, icon, "apco3-[charging]", 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]", 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]", 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]", layer, EMISSIVE_PLANE, dir)
|
||||
|
||||
// And now, separately for cleanness, the lighting changing
|
||||
if(update_state & UPSTATE_ALLGOOD)
|
||||
switch(charging)
|
||||
@@ -318,49 +360,7 @@
|
||||
|
||||
icon_update_needed = FALSE
|
||||
|
||||
/obj/machinery/power/apc/update_icon_state()
|
||||
if(update_state & UPSTATE_ALLGOOD)
|
||||
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 & UPSTATE_ALLGOOD))
|
||||
return
|
||||
SSvis_overlays.add_vis_overlay(src, icon, "apcox-[locked]", layer, plane, dir)
|
||||
SSvis_overlays.add_vis_overlay(src, icon, "apcox-[locked]", layer, EMISSIVE_STRUCTURE_PLANE, dir)
|
||||
SSvis_overlays.add_vis_overlay(src, icon, "apco3-[charging]", layer, plane, dir)
|
||||
SSvis_overlays.add_vis_overlay(src, icon, "apco3-[charging]", layer, EMISSIVE_STRUCTURE_PLANE, dir)
|
||||
if(!operating)
|
||||
return
|
||||
SSvis_overlays.add_vis_overlay(src, icon, "apco0-[equipment]", layer, plane, dir)
|
||||
SSvis_overlays.add_vis_overlay(src, icon, "apco0-[equipment]", layer, EMISSIVE_STRUCTURE_PLANE, dir)
|
||||
SSvis_overlays.add_vis_overlay(src, icon, "apco1-[lighting]", layer, plane, dir)
|
||||
SSvis_overlays.add_vis_overlay(src, icon, "apco1-[lighting]", layer, EMISSIVE_STRUCTURE_PLANE, dir)
|
||||
SSvis_overlays.add_vis_overlay(src, icon, "apco2-[environ]", layer, plane, dir)
|
||||
SSvis_overlays.add_vis_overlay(src, icon, "apco2-[environ]", layer, EMISSIVE_STRUCTURE_PLANE, dir)
|
||||
|
||||
/obj/machinery/power/apc/proc/check_updates(obj/machinery/power/apc/self)
|
||||
SIGNAL_HANDLER
|
||||
/obj/machinery/power/apc/proc/check_updates()
|
||||
var/last_update_state = update_state
|
||||
var/last_update_overlay = update_overlay
|
||||
update_state = 0
|
||||
@@ -420,11 +420,14 @@
|
||||
update_overlay |= APC_UPOVERLAY_ENVIRON2
|
||||
|
||||
|
||||
. = NONE
|
||||
if(last_update_state == update_state)
|
||||
. |= COMSIG_ATOM_NO_UPDATE_ICON_STATE
|
||||
if((last_update_overlay == update_overlay) && (update_state & UPSTATE_ALLGOOD))
|
||||
. |= COMSIG_ATOM_NO_UPDATE_OVERLAYS
|
||||
var/results = 0
|
||||
if(last_update_state == update_state && last_update_overlay == update_overlay)
|
||||
return 0
|
||||
if(last_update_state != update_state)
|
||||
results += 1
|
||||
if(last_update_overlay != update_overlay)
|
||||
results += 2
|
||||
return results
|
||||
|
||||
// Used in process so it doesn't update the icon too much
|
||||
/obj/machinery/power/apc/proc/queue_icon_update()
|
||||
|
||||
@@ -400,6 +400,7 @@
|
||||
|
||||
/obj/machinery/light/update_overlays()
|
||||
. = ..()
|
||||
SSvis_overlays.remove_vis_overlay(src, managed_vis_overlays)
|
||||
if(on && status == LIGHT_OK)
|
||||
var/area/A = get_area(src)
|
||||
if(emergency_mode || (A?.fire))
|
||||
|
||||
Reference in New Issue
Block a user