mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
Merge pull request #715 from CHOMPStationBot/upstream-merge-9233
[MIRROR] [MIRROR] Makes the recipe dump take coatings into account
This commit is contained in:
@@ -34,6 +34,7 @@
|
|||||||
"Catalysts" = list(),
|
"Catalysts" = list(),
|
||||||
"Fruit" = R.fruit,
|
"Fruit" = R.fruit,
|
||||||
"Ingredients" = R.items,
|
"Ingredients" = R.items,
|
||||||
|
"Coating" = R.coating,
|
||||||
"Appliance" = R.appliance,
|
"Appliance" = R.appliance,
|
||||||
"Image" = result_icon
|
"Image" = result_icon
|
||||||
)
|
)
|
||||||
@@ -57,8 +58,11 @@
|
|||||||
//Items needs further processing into human-readability.
|
//Items needs further processing into human-readability.
|
||||||
for(var/Rp in food_recipes)
|
for(var/Rp in food_recipes)
|
||||||
var/working_ing_list = list()
|
var/working_ing_list = list()
|
||||||
|
food_recipes[Rp]["has_coatable_items"] = FALSE
|
||||||
for(var/I in food_recipes[Rp]["Ingredients"])
|
for(var/I in food_recipes[Rp]["Ingredients"])
|
||||||
var/atom/ing = new I()
|
var/atom/ing = new I()
|
||||||
|
if(istype(ing, /obj/item/weapon/reagent_containers/food/snacks)) // only subtypes of this have a coating variable and are checked for it (fruit are a subtype of this, so there's a check for them too later)
|
||||||
|
food_recipes[Rp]["has_coatable_items"] = TRUE
|
||||||
|
|
||||||
//So now we add something like "Bread" = 3
|
//So now we add something like "Bread" = 3
|
||||||
if(ing.name in working_ing_list)
|
if(ing.name in working_ing_list)
|
||||||
@@ -67,6 +71,8 @@
|
|||||||
else
|
else
|
||||||
working_ing_list[ing.name] = 1
|
working_ing_list[ing.name] = 1
|
||||||
|
|
||||||
|
if(LAZYLEN(food_recipes[Rp]["Fruit"]))
|
||||||
|
food_recipes[Rp]["has_coatable_items"] = TRUE
|
||||||
food_recipes[Rp]["Ingredients"] = working_ing_list
|
food_recipes[Rp]["Ingredients"] = working_ing_list
|
||||||
|
|
||||||
//Reagents can be resolved to nicer names as well
|
//Reagents can be resolved to nicer names as well
|
||||||
@@ -195,6 +201,20 @@
|
|||||||
if(pretty_ing != "")
|
if(pretty_ing != "")
|
||||||
html += "<li><b>Ingredients:</b> [pretty_ing]</li>"
|
html += "<li><b>Ingredients:</b> [pretty_ing]</li>"
|
||||||
|
|
||||||
|
//Coating
|
||||||
|
if(!food_recipes[Rp]["has_coatable_items"])
|
||||||
|
html += "<span class = \"coating coating_not_applicable\"><li><b>Coating:</b> N/A, no coatable items</li></span>"
|
||||||
|
// css can be used to style or hide these depending on the class. This has two classes
|
||||||
|
// coating and coating_not_applicable, which can each have styles applied.
|
||||||
|
else if(food_recipes[Rp]["Coating"] == -1)
|
||||||
|
html += "<span class = \"coating coating_any_coating\"><li><b>Coating:</b> Optionally, any coating</li></span>"
|
||||||
|
else if(isnull(food_recipes[Rp]["Coating"]))
|
||||||
|
html += "<span class = \"coating coating_uncoated\"><li><b>Coating:</b> Must be uncoated</li></span>"
|
||||||
|
else
|
||||||
|
var/coatingtype = food_recipes[Rp]["Coating"]
|
||||||
|
var/datum/reagent/coating = new coatingtype()
|
||||||
|
html += "<span class = \"coating coating_specific_coating\"><li><b>Coating:</b> [coating.name]</li></span>"
|
||||||
|
|
||||||
//For each fruit
|
//For each fruit
|
||||||
var/pretty_fru = ""
|
var/pretty_fru = ""
|
||||||
count = 0
|
count = 0
|
||||||
|
|||||||
Reference in New Issue
Block a user