/// <summary> /// Applied before RefreshResultDescriptors runs. /// </summary> internal static bool Prefix(SelectedRecipeQueueScreen __instance) { var products = ListPool <DescriptorWithSprite, SelectedRecipeQueueScreen> . Allocate(); var recipe = __instance.selectedRecipe; var parent = __instance.EffectsDescriptorPanel.gameObject; // AdditionalEffectsForRecipe is per fabricator var extraEffects = __instance.target.AdditionalEffectsForRecipe(recipe); int n = extraEffects.Count; GetResultDescriptions(recipe, products); for (int i = 0; i < n; i++) { products.Add(new DescriptorWithSprite(extraEffects[i], null)); } if (products.Count > 0) { parent.SetActive(true); RemoveAndAddRows(products, parent, __instance. recipeElementDescriptorPrefab, __instance.recipeEffectsDescriptorRows); } products.Recycle(); return(false); }
private void ToggleClicked(KToggle toggle) { if (!recipeMap.ContainsKey(toggle.gameObject)) { Debug.LogError("Recipe not found on recipe list."); } else { if ((Object)selectedToggle == (Object)toggle) { selectedToggle.isOn = false; selectedToggle = null; selectedRecipe = null; } else { selectedToggle = toggle; selectedToggle.isOn = true; selectedRecipe = recipeMap[toggle.gameObject]; selectedRecipeFabricatorMap[targetFab] = recipeToggles.IndexOf(toggle.gameObject); } RefreshIngredientAvailabilityVis(); if (toggle.isOn) { recipeScreen = (SelectedRecipeQueueScreen)DetailsScreen.Instance.SetSecondarySideScreen(recipeScreenPrefab, UI.UISIDESCREENS.FABRICATORSIDESCREEN.RECIPE_DETAILS); recipeScreen.SetRecipe(this, targetFab, selectedRecipe); } else { DetailsScreen.Instance.ClearSecondarySideScreen(); } } }
/// <summary> /// Applied before RefreshIngredientDescriptors runs. /// </summary> internal static bool Prefix(SelectedRecipeQueueScreen __instance) { var ingredients = ListPool <DescriptorWithSprite, SelectedRecipeQueueScreen> . Allocate(); var recipe = __instance.selectedRecipe; var parent = __instance.IngredientsDescriptorPanel.gameObject; GetIngredientDescriptions(recipe, __instance.target, ingredients); parent.SetActive(true); RemoveAndAddRows(ingredients, parent, __instance.recipeElementDescriptorPrefab, __instance.recipeIngredientDescriptorRows); ingredients.Recycle(); return(false); }