Ejemplo n.º 1
0
        public static RecipeSelection Create(List <string> selectedValues)
        {
            List <Item> options = new List <Item>();

            foreach (Recipe recipe in Recipe.Recipes)
            {
                options.Add(new Item(recipe.GenericName, recipe, selectedValues.Contains(recipe.Key)));
            }

            RecipeSelection selection = new RecipeSelection(Common.Localize("SelectRecipes:ListTitle"), options, new AuxillaryColumn());

            return(selection);
        }
Ejemplo n.º 2
0
        public static RecipeSelection CreateWithFilter(List <string> filter)
        {
            List <Item> options = new List <Item>();

            foreach (Recipe recipe in Recipe.Recipes)
            {
                if (!GameUtils.IsInstalled(recipe.CodeVersion))
                {
                    continue;
                }

                if (filter.Contains(recipe.Key))
                {
                    options.Add(new Item(recipe.GenericName, recipe));
                }
            }

            RecipeSelection selection = new RecipeSelection(Common.Localize("SelectRecipes:ListTitle"), options, new AuxillaryColumn());

            return(selection);
        }
Ejemplo n.º 3
0
        public static RecipeSelection Create(Dictionary <string, string> selectedValues)
        {
            List <Item> options = new List <Item>();

            foreach (Recipe recipe in Recipe.Recipes)
            {
                string selected = null;
                if (selectedValues.ContainsKey(recipe.Key))
                {
                    selected = selectedValues[recipe.Key];
                }

                if (!GameUtils.IsInstalled(recipe.CodeVersion))
                {
                    continue;
                }

                options.Add(new Item(recipe.GenericName + (Cupcake.Settings.Debugging ? " (" + recipe.Key + ")" : ""), recipe, selected));
            }

            RecipeSelection selection = new RecipeSelection(Common.Localize("SelectRecipes:ListTitle"), options, new AuxillaryColumn());

            return(selection);
        }