Porting update_icon improvements. Part 1.
This commit is contained in:
@@ -35,9 +35,9 @@ GLOBAL_LIST_INIT(rod_recipes, list ( \
|
||||
. = ..()
|
||||
. += GLOB.rod_recipes
|
||||
|
||||
/obj/item/stack/rods/update_icon()
|
||||
/obj/item/stack/rods/update_icon_state()
|
||||
var/amount = get_amount()
|
||||
if((amount <= 5) && (amount > 0))
|
||||
if(amount <= 5)
|
||||
icon_state = "rods-[amount]"
|
||||
else
|
||||
icon_state = "rods"
|
||||
@@ -77,8 +77,9 @@ GLOBAL_LIST_INIT(rod_recipes, list ( \
|
||||
is_cyborg = 1
|
||||
cost = 250
|
||||
|
||||
/obj/item/stack/rods/cyborg/update_icon()
|
||||
return
|
||||
/obj/item/stack/rods/cyborg/ComponentInitialize()
|
||||
. = ..()
|
||||
AddElement(/datum/element/update_icon_blocker)
|
||||
|
||||
/obj/item/stack/rods/ten
|
||||
amount = 10
|
||||
|
||||
@@ -77,16 +77,15 @@
|
||||
else
|
||||
w_class = full_w_class
|
||||
|
||||
/obj/item/stack/update_icon()
|
||||
/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)))
|
||||
icon_state = "[initial(icon_state)]_2"
|
||||
else
|
||||
icon_state = "[initial(icon_state)]_3"
|
||||
..()
|
||||
|
||||
|
||||
/obj/item/stack/Destroy()
|
||||
|
||||
Reference in New Issue
Block a user