More stack icons (#2654)

Top is a stack over 2/3 full, middle is between 1/3 and 2/3 full, bottom is under 1/3 full.

Also converted stacks to use Initialize().

affected stacks:

Ointment
Bandages
Steel Sheets
Plastic Sheets
Glass Sheets
Plasteel Sheets
Reinforced Glass Sheets
Leather
Wet Leather
Hide
Sprites from /tg/.
This commit is contained in:
Lohikar
2017-06-10 09:30:18 +03:00
committed by skull132
parent 51c9007508
commit 4cf407ea33
7 changed files with 47 additions and 8 deletions
+19 -3
View File
@@ -21,14 +21,19 @@
var/uses_charge = 0
var/list/charge_costs = null
var/list/datum/matter_synth/synths = null
var/icon_has_variants = FALSE
/obj/item/stack/New(var/loc, var/amount=null)
..()
/obj/item/stack/Initialize(mapload, amount)
. = ..()
if (!stacktype)
stacktype = type
if (amount)
src.amount = amount
return
if (icon_has_variants && !item_state)
item_state = icon_state
update_icon()
/obj/item/stack/Destroy()
if(uses_charge)
@@ -37,6 +42,17 @@
usr << browse(null, "window=stack")
return ..()
/obj/item/stack/update_icon()
if (!icon_has_variants)
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/examine(mob/user)
if(..(user, 1))
if(!uses_charge)