diff --git a/code/modules/food/recipe_dump.dm b/code/modules/food/recipe_dump.dm index 45f4c3e4ae9..e2c2bd1b1eb 100644 --- a/code/modules/food/recipe_dump.dm +++ b/code/modules/food/recipe_dump.dm @@ -32,6 +32,7 @@ "Reagents" = R.reagents, "Fruit" = R.fruit, "Ingredients" = R.items, + "Coating" = R.coating, "Appliance" = R.appliance, "Image" = result_icon ) @@ -54,8 +55,11 @@ //Items needs further processing into human-readability. for(var/Rp in food_recipes) var/working_ing_list = list() + food_recipes[Rp]["has_coatable_items"] = FALSE for(var/I in food_recipes[Rp]["Ingredients"]) 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 if(ing.name in working_ing_list) @@ -64,6 +68,8 @@ else 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 //Reagents can be resolved to nicer names as well @@ -174,6 +180,20 @@ if(pretty_ing != "") html += "
  • Ingredients: [pretty_ing]
  • " + //Coating + if(!food_recipes[Rp]["has_coatable_items"]) + html += "
  • Coating: N/A, no coatable items
  • " + // 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 += "
  • Coating: Optionally, any coating
  • " + else if(isnull(food_recipes[Rp]["Coating"])) + html += "
  • Coating: Must be uncoated
  • " + else + var/coatingtype = food_recipes[Rp]["Coating"] + var/datum/reagent/coating = new coatingtype() + html += "
  • Coating: [coating.name]
  • " + //For each fruit var/pretty_fru = "" count = 0