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:
TemporalOroboros
2021-02-19 12:06:18 -03:00
committed by GitHub
parent dc4b7226d0
commit e4079c87b8
585 changed files with 4689 additions and 4133 deletions
+7 -9
View File
@@ -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()