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
@@ -62,7 +62,7 @@
idle_threads = list()
if(looping_sound)
soundloop = new(list(src), enabled)
update_icon()
update_appearance()
/obj/item/modular_computer/Destroy()
kill_program(forced = TRUE)
@@ -168,21 +168,16 @@
. += get_modular_computer_parts_examine(user)
/obj/item/modular_computer/update_icon_state()
if(!enabled)
icon_state = icon_state_unpowered
else
icon_state = icon_state_powered
icon_state = enabled ? icon_state_powered : icon_state_unpowered
return ..()
/obj/item/modular_computer/update_overlays()
. = ..()
if(!display_overlays)
return
if(enabled)
if(active_program)
. += active_program.program_icon_state ? active_program.program_icon_state : icon_state_menu
else
. += icon_state_menu
if(enabled)
. += active_program?.program_icon_state || icon_state_menu
if(obj_integrity <= integrity_failure * max_integrity)
. += "bsod"
. += "broken"
@@ -217,7 +212,7 @@
if(looping_sound)
soundloop.start()
enabled = 1
update_icon()
update_appearance()
ui_interact(user)
return TRUE
else // Unpowered
@@ -353,7 +348,7 @@
var/mob/user = usr
if(user && istype(user))
ui_interact(user) // Re-open the UI on this computer. It should show the main screen now.
update_icon()
update_appearance()
// Returns 0 for No Signal, 1 for Low Signal and 2 for Good Signal. 3 is for wired connection (always-on)
/obj/item/modular_computer/proc/get_ntnet_status(specific_action = 0)
@@ -380,7 +375,7 @@
if(loud)
physical.visible_message("<span class='notice'>\The [src] shuts down.</span>")
enabled = 0
update_icon()
update_appearance()
/**
* Toggles the computer's flashlight, if it has one.