Makes vending machines use spritesheets over artisanal handwritten getflaticon memes (#43914)

About The Pull Request

Pretty much what it says on the tin.

Oh yeah I also removed the string concatenation nonsense in favor of multiline strings and a list.
Why It's Good For The Game

Removes many getFlatIcon calls during the round, also some runtimes from ephemeral items being created and immediately deleted when the vending machines are used.
Changelog

cl Naksu
tweak: vending machines now use spritesheets
/cl
This commit is contained in:
vuonojenmustaturska
2019-05-12 10:51:03 +12:00
committed by oranges
parent ff6b642b16
commit f5fdf4fa65
4 changed files with 46 additions and 17 deletions
+31
View File
@@ -663,6 +663,37 @@ GLOBAL_LIST_EMPTY(asset_datums)
Insert(initial(D.id), I)
return ..()
/datum/asset/spritesheet/vending
name = "vending"
/datum/asset/spritesheet/vending/register()
for (var/k in GLOB.vending_products)
var/atom/item = k
var/icon_file
var/icon_state
var/icon/I
if (!ispath(item, /atom))
continue
icon_file = initial(item.icon)
icon_state = initial(item.icon_state)
if(icon_state in icon_states(icon_file))
I = icon(icon_file, icon_state, SOUTH)
else
item = new item()
I = icon(item.icon, item.icon_state, SOUTH)
qdel(item)
var/imgid = replacetext(replacetext("[item]", "/obj/item/", ""), "/", "-")
Insert(imgid, I)
return ..()
/datum/asset/simple/genetics
assets = list(
"dna_discovered.png" = 'html/dna_discovered.png',