public static List <RecipeDef> Postfix(List <RecipeDef> __result, ref List <RecipeDef> ___allRecipesCached, bool __state) { if (!__state) { return(__result); } var res = new List <RecipeDef>(); foreach (var r in __result) { if (Ad2.IsNewRecipe(r)) { continue; } res.Add(r); var newRList = Ad2.GetNewRecipesList(r); if (newRList == null) { continue; } foreach (var nr in newRList) { res.Add(nr); } } ___allRecipesCached = res; //Log.Message("___allRecipesCached = res"); return(res); }
public static void Prefix(ref Func <List <FloatMenuOption> > recipeOptionsMaker, BillStack __instance) { inDoListing = true; lastBillStack = __instance; if (!Ad2Mod.settings.useRightClickMenu) { return; } var list = recipeOptionsMaker(); recipeOptionsMaker = delegate { var newList = new List <FloatMenuOption>(); foreach (var opt in list) { var recipe = Ad2.GetRecipeByLabel(opt.Label); if (recipe == null || !Ad2.IsNewRecipe(recipe)) { newList.Add(opt); } } return(newList); }; }