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
+9 -7
View File
@@ -76,7 +76,7 @@
var/list/temp = SSmaterials.rigid_stack_recipes.Copy()
recipes += temp
update_weight()
update_icon()
update_appearance()
/** Sets the amount of materials per unit for this stack.
*
@@ -125,13 +125,15 @@
/obj/item/stack/update_icon_state()
if(novariants)
return
return ..()
if(amount <= (max_amount * (1/3)))
icon_state = initial(icon_state)
else if (amount <= (max_amount * (2/3)))
return ..()
if (amount <= (max_amount * (2/3)))
icon_state = "[initial(icon_state)]_2"
else
icon_state = "[initial(icon_state)]_3"
return ..()
icon_state = "[initial(icon_state)]_3"
return ..()
/obj/item/stack/examine(mob/user)
. = ..()
@@ -364,7 +366,7 @@
return TRUE
if(length(mats_per_unit))
update_custom_materials()
update_icon()
update_appearance()
update_weight()
return TRUE
@@ -402,7 +404,7 @@
amount += _amount
if(length(mats_per_unit))
update_custom_materials()
update_icon()
update_appearance()
update_weight()
/** Checks whether this stack can merge itself into another stack.