mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-24 05:30:05 +01:00
update_appearance (#55468)
Creates update_name and update_desc Creates the wrapper proc update_appearance to batch update_name, update_desc, and update_icon together Less non-icon handling code in update_icon and friends Signal hooks for things that want to change names and descriptions 99%+ of the changes in this are just from switching everything over to update_appearance from update_icon
This commit is contained in:
@@ -59,10 +59,8 @@
|
||||
|
||||
|
||||
/obj/machinery/ntnet_relay/update_icon_state()
|
||||
if(is_operational)
|
||||
icon_state = "bus"
|
||||
else
|
||||
icon_state = "bus_off"
|
||||
icon_state = "bus[is_operational ? null : "_off"]"
|
||||
return ..()
|
||||
|
||||
/obj/machinery/ntnet_relay/process(delta_time)
|
||||
if(is_operational)
|
||||
@@ -70,7 +68,7 @@
|
||||
else
|
||||
use_power = IDLE_POWER_USE
|
||||
|
||||
update_icon()
|
||||
update_appearance()
|
||||
|
||||
if(dos_overload > 0)
|
||||
dos_overload = max(0, dos_overload - dos_dissipate * delta_time)
|
||||
@@ -78,12 +76,12 @@
|
||||
// If DoS traffic exceeded capacity, crash.
|
||||
if((dos_overload > dos_capacity) && !dos_failure)
|
||||
set_dos_failure(TRUE)
|
||||
update_icon()
|
||||
update_appearance()
|
||||
SSnetworks.add_log("Quantum relay switched from normal operation mode to overload recovery mode.")
|
||||
// If the DoS buffer reaches 0 again, restart.
|
||||
if((dos_overload == 0) && dos_failure)
|
||||
set_dos_failure(FALSE)
|
||||
update_icon()
|
||||
update_appearance()
|
||||
SSnetworks.add_log("Quantum relay switched from overload recovery mode to normal operation mode.")
|
||||
..()
|
||||
|
||||
@@ -109,13 +107,13 @@
|
||||
if("restart")
|
||||
dos_overload = 0
|
||||
set_dos_failure(FALSE)
|
||||
update_icon()
|
||||
update_appearance()
|
||||
SSnetworks.add_log("Quantum relay manually restarted from overload recovery mode to normal operation mode.")
|
||||
return TRUE
|
||||
if("toggle")
|
||||
set_relay_enabled(!relay_enabled)
|
||||
SSnetworks.add_log("Quantum relay manually [relay_enabled ? "enabled" : "disabled"].")
|
||||
update_icon()
|
||||
update_appearance()
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/ntnet_relay/Initialize()
|
||||
|
||||
Reference in New Issue
Block a user