/// <summary> /// Gets a list of all the product descriptors for a recipe. /// </summary> /// <param name="recipe">The recipe to describe.</param> /// <param name="result">The location where the products will be stored.</param> private static void GetResultDescriptions(ComplexRecipe recipe, IList <DescriptorWithSprite> result) { var results = recipe.results; int n = results.Length, nd; var text = CACHED_BUILDER; if (recipe.producedHEP > 0) { text.Clear().Append(HEP_TOOLTIP).Append(recipe.producedHEP.ToString()); string description = text.ToString(); result.Add(new DescriptorWithSprite(new Descriptor(description, description, Descriptor.DescriptorType.Requirement, false), RADBOLT_ICON)); } var desc = ListPool <Descriptor, SelectedRecipeQueueScreen> .Allocate(); for (int i = 0; i < n; i++) { var item = results[i]; var material = item.material; var prefab = Assets.GetPrefab(material); string amountText = GameUtil.GetFormattedByTag(material, item.amount), name = prefab.GetProperName(); var element = ElementLoader.GetElement(material); desc.Clear(); text.Clear().Append(RECIPE_PRODUCT).Replace("{0}", name).Replace("{1}", amountText); string description = text.ToString(); text.Clear().Append(RECIPE_TOOLTIP).Replace("{0}", name).Replace("{1}", amountText); result.Add(new DescriptorWithSprite(new Descriptor(description, text. ToString(), Descriptor.DescriptorType.Requirement), Def.GetUISprite( material, "ui"))); if (element != null) { DescriptorAllocPatches.GetMaterialDescriptors(element.attributeModifiers, desc); nd = desc.Count; for (int j = 0; j < nd; j++) { var descriptor = desc[j]; descriptor.IncreaseIndent(); result.Add(new DescriptorWithSprite(descriptor, null)); } } else { DescriptorAllocPatches.GetAllDescriptors(prefab, false, desc); nd = desc.Count; for (int j = 0; j < nd; j++) { var descriptor = desc[j]; if (descriptor.IsEffectDescriptor()) { descriptor.IncreaseIndent(); result.Add(new DescriptorWithSprite(descriptor, null)); } } } } desc.Recycle(); }