diff --git a/code/_globalvars/lists/objects.dm b/code/_globalvars/lists/objects.dm index 14c752613bf..b5ba352bab1 100644 --- a/code/_globalvars/lists/objects.dm +++ b/code/_globalvars/lists/objects.dm @@ -13,6 +13,7 @@ GLOBAL_LIST_EMPTY(deliverybeacontags) //list of all tags associated with d GLOBAL_LIST_EMPTY(nuke_list) GLOBAL_LIST_EMPTY(alarmdisplay) //list of all machines or programs that can display station alerts GLOBAL_LIST_EMPTY(singularities) //list of all singularities on the station (actually technically all engines) +GLOBAL_LIST_EMPTY(vending_cache) GLOBAL_LIST(chemical_reactions_list) //list of all /datum/chemical_reaction datums. Used during chemical reactions GLOBAL_LIST(chemical_reagents_list) //list of all /datum/reagent datums indexed by reagent id. Used by chemistry stuff diff --git a/code/modules/vending/_vending.dm b/code/modules/vending/_vending.dm index dfc4d25fb94..3c2c6f59d10 100644 --- a/code/modules/vending/_vending.dm +++ b/code/modules/vending/_vending.dm @@ -21,7 +21,6 @@ IF YOU MODIFY THE PRODUCTS LIST OF A MACHINE, MAKE SURE TO UPDATE ITS RESUPPLY C var/product_path = null var/amount = 0 var/max_amount = 0 - var/display_color = "blue" var/custom_price var/custom_premium_price @@ -166,6 +165,15 @@ IF YOU MODIFY THE PRODUCTS LIST OF A MACHINE, MAKE SURE TO UPDATE ITS RESUPPLY C if (dump_amount >= 16) return +/obj/machinery/vending/proc/GetIconForProduct(datum/data/vending_product/P) + if(GLOB.vending_cache[P.product_path]) + return GLOB.vending_cache[P.product_path] + + var/product = new P.product_path() + GLOB.vending_cache[P.product_path] = icon2base64(getFlatIcon(product, no_anim = TRUE)) + qdel(product) + return GLOB.vending_cache[P.product_path] + /obj/machinery/vending/proc/build_inventory(list/productlist, list/recordlist, start_empty = FALSE) for(var/typepath in productlist) var/amount = productlist[typepath] @@ -179,7 +187,6 @@ IF YOU MODIFY THE PRODUCTS LIST OF A MACHINE, MAKE SURE TO UPDATE ITS RESUPPLY C if(!start_empty) R.amount = amount R.max_amount = amount - R.display_color = pick("#ff8080","#80ff80","#8080ff") R.custom_price = initial(temp.custom_price) R.custom_premium_price = initial(temp.custom_premium_price) recordlist += R @@ -335,7 +342,7 @@ IF YOU MODIFY THE PRODUCTS LIST OF A MACHINE, MAKE SURE TO UPDATE ITS RESUPPLY C var/list/display_records = product_records + coin_records if(extended_inventory) display_records = product_records + coin_records + hidden_records - dat += "
| [sanitize(R.name)] ([price_listed]) | " if(R.amount > 0 && ((C && C.registered_account && onstation) || (!onstation && isliving(user)))) - dat += "Vend " + dat += "[R.amount] Vend | " else - dat += "Not Available " - dat += "[sanitize(R.name)] ([price_listed]):" - dat += " [R.amount]" - dat += "" - dat += "" + dat += "Not Available | " + dat += "