public ConfigManager() { this.vanillaMachineConfig = VanillaMachineRecipeConfig.InitializeConfig(); this.shops_blacksmithConfig = Shops_BlacksmithConfig.InitializeConfig(); this.furnitureConfig = FurnitureConfig.InitializeConfig(); this.machinesConfig = GlobalMachineConfig.InitializeConfig(); this.objectsConfig = ObjectsConfig.InitializeConfig(); this.miningDrillConfig = MiningDrillConfig.InitializeConfig(); }
/// <summary> /// Initializes the config for vanilla machine recipes. /// </summary> /// <returns></returns> public static VanillaMachineRecipeConfig InitializeConfig() { if (File.Exists(Path.Combine(ModCore.ModHelper.DirectoryPath, "Configs", "VanillaMachineRecipeConfig.json"))) { return(ModCore.ModHelper.Data.ReadJsonFile <VanillaMachineRecipeConfig>(Path.Combine("Configs", "VanillaMachineRecipeConfig.json"))); } else { VanillaMachineRecipeConfig Config = new VanillaMachineRecipeConfig(); ModCore.ModHelper.Data.WriteJsonFile <VanillaMachineRecipeConfig>(Path.Combine("Configs", "VanillaMachineRecipeConfig.json"), Config); return(Config); } }