internal void SetRecipe(int index) { selectedIndex = -1; recipeInfo.RemoveAllChildren(); foreach (var item in recipeSlots) { item.selected = false; } var recipeslot = recipeSlots[index]; recipeslot.selected = false; recipeslot.selected = true; selectedIndex = index; Recipe recipe = Main.recipe[index]; for (int i = 0; i < Recipe.maxRequirements; i++) { if (recipe.requiredItem[i].type > 0) { UIIngredientSlot ingredient = new UIIngredientSlot(recipe.requiredItem[i].Clone()); ingredient.Left.Pixels = 200 + (i % 5 * 40); ingredient.Top.Pixels = (i / 5 * 40); OverrideForGroups(recipe, ingredient.item); // TODO, stack? recipeInfo.Append(ingredient); } } }
internal void SetRecipe(int index) { selectedIndex = -1; recipeInfo.RemoveAllChildren(); foreach (var item in recipeSlots) { item.selected = false; } var recipeslot = recipeSlots[index]; recipeslot.selected = false; recipeslot.selected = true; selectedIndex = index; Recipe recipe = Main.recipe[index]; for (int i = 0; i < Recipe.maxRequirements; i++) { if (recipe.requiredItem[i].type > 0) { UIIngredientSlot ingredient = new UIIngredientSlot(recipe.requiredItem[i].Clone()); ingredient.Left.Pixels = 200 + (i % 5 * 40); ingredient.Top.Pixels = (i / 5 * 40); string nameOverride; if (recipe.ProcessGroupsForText(recipe.requiredItem[i].type, out nameOverride)) { //Main.toolTip.name = name; } if (recipe.anyIronBar && recipe.requiredItem[i].type == 22) { nameOverride = Lang.misc[37].Value + " " + Lang.GetItemNameValue(22); } else if (recipe.anyWood && recipe.requiredItem[i].type == 9) { nameOverride = Lang.misc[37].Value + " " + Lang.GetItemNameValue(9); } else if (recipe.anySand && recipe.requiredItem[i].type == 169) { nameOverride = Lang.misc[37].Value + " " + Lang.GetItemNameValue(169); } else if (recipe.anyFragment && recipe.requiredItem[i].type == 3458) { nameOverride = Lang.misc[37].Value + " " + Lang.misc[51].Value; } else if (recipe.anyPressurePlate && recipe.requiredItem[i].type == 542) { nameOverride = Lang.misc[37].Value + " " + Lang.misc[38].Value; } if (nameOverride != "") { ingredient.item.SetNameOverride(nameOverride); } // TODO, stack? recipeInfo.Append(ingredient); } } }