mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-27 15:01:04 +01:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user