コード例 #1
0
        public static void Dump()
        {
            SL.LogWarning("[Dataminer] Starting full dump!");

            // setup tags
            for (int i = 1; i < 500; i++)
            {
                if (TagSourceManager.Instance.GetTag(i.ToString()) is Tag tag)
                {
                    ListManager.AddTagSource(tag, null);
                }
            }

            DM_Item.ParseAllItems();

            DM_StatusEffect.ParseAllEffects();

            DM_Recipe.ParseAllRecipes();

            DM_EnchantmentRecipe.ParseAllRecipes();

            SL.LogWarning("Saving early lists...");
            ListManager.SaveEarlyLists();

            SL.LogWarning("Finished prefab dumping.");
        }
コード例 #2
0
        public static DM_Recipe ParseRecipe(Recipe recipe, int id)
        {
            var recipeHolder = new DM_Recipe
            {
                Name          = recipe.Name,
                RecipeID      = id,
                StationType   = recipe.CraftingStationType,
                RequiredPType = recipe.RequiredPType,
            };

            foreach (RecipeIngredient ingredient in recipe.Ingredients)
            {
                if (ingredient.ActionType == RecipeIngredient.ActionTypes.AddSpecificIngredient)
                {
                    recipeHolder.Ingredients.Add(ingredient.AddedIngredient.Name);
                    //recipeHolder.Ingredients.Add(new Ingredient()
                    //{
                    //    Type = ingredient.ActionType,
                    //    Ingredient_ItemID = ingredient.AddedIngredient.ItemID
                    //});
                }
                else
                {
                    recipeHolder.Ingredients.Add(ingredient.AddedIngredientType.Tag.TagName);
                    //recipeHolder.Ingredients.Add(new Ingredient()
                    //{
                    //    Type = ingredient.ActionType,
                    //    Ingredient_Tag = ingredient.AddedIngredientType.Tag.TagName
                    //});
                }
            }

            foreach (ItemReferenceQuantity item in recipe.Results)
            {
                recipeHolder.Results.Add(new ItemQty
                {
                    ItemName = Serializer.SafeName(ResourcesPrefabManager.Instance.GetItemPrefab(item.ItemID).Name),
                    ItemID   = item.ItemID,
                    Quantity = item.Quantity
                });
            }

            return(recipeHolder);
        }