Files
Bubberstation/code/modules/asset_cache/assets/vending.dm
SkyratBot 07c88ffb0a [MIRROR] Add new surgery tgui that provides a built in body zone selector and doesn't let you start surgeries if their body is covered. Replaces some stuff with balloon alerts [MDB IGNORE] (#11322)
* Add new surgery tgui (#64579)

* Move element to component, start UI, move assets into their own directory

* Complete UI

* Stop when another surgery is started

* Set your real zone since I forgot you actually need to start the surgery too

* Bring this back since I was just removing it as part of a cleanup for asset cache, but I can't prove it's not used anymore

* Remove unnecessary constructor I was using for something else

* Fix signal override

* Add new surgery tgui that provides a built in body zone selector and doesn't let you start surgeries if their body is covered. Replaces some stuff with balloon alerts

Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
2022-02-06 20:37:56 +00:00

37 lines
1.3 KiB
Plaintext

/datum/asset/spritesheet/vending
name = "vending"
/datum/asset/spritesheet/vending/create_spritesheets()
for (var/k in GLOB.vending_products)
var/atom/item = k
if (!ispath(item, /atom))
continue
var/icon_file
if (initial(item.greyscale_colors) && initial(item.greyscale_config))
icon_file = SSgreyscale.GetColoredIconByType(initial(item.greyscale_config), initial(item.greyscale_colors))
else
icon_file = initial(item.icon)
var/icon_state = initial(item.icon_state)
var/icon/I
var/icon_states_list = icon_states(icon_file)
if(icon_state in icon_states_list)
I = icon(icon_file, icon_state, SOUTH)
var/c = initial(item.color)
if (!isnull(c) && c != "#FFFFFF")
I.Blend(c, ICON_MULTIPLY)
else
var/icon_states_string
for (var/an_icon_state in icon_states_list)
if (!icon_states_string)
icon_states_string = "[json_encode(an_icon_state)](\ref[an_icon_state])"
else
icon_states_string += ", [json_encode(an_icon_state)](\ref[an_icon_state])"
stack_trace("[item] does not have a valid icon state, icon=[icon_file], icon_state=[json_encode(icon_state)](\ref[icon_state]), icon_states=[icon_states_string]")
I = icon('icons/turf/floors.dmi', "", SOUTH)
var/imgid = replacetext(replacetext("[item]", "/obj/item/", ""), "/", "-")
Insert(imgid, I)