コード例 #1
0
        private void OnRenderingActiveMenu(object sender, RenderingActiveMenuEventArgs e)
        {
            // Ignore if player hasn't loaded a save yet
            if (!Context.IsWorldReady || Game1.activeClickableMenu == null)
            {
                return;
            }

            if (!(Game1.activeClickableMenu is StardewValley.Menus.NamingMenu))
            {
                return;
            }

            StardewValley.Menus.NamingMenu namingMenu = Game1.activeClickableMenu as StardewValley.Menus.NamingMenu;

            if (namingMenu.GetType() == typeof(StardewValley.Menus.NamingMenu))
            {
                Player player = new Player(Game1.player, this.Helper);

                // Set up everything else
                BlueConfig    blueConfig      = new BlueConfig(player.HasSeenEvent(BlueVariation.EVENT_ID));
                BlueVariation blueFarmAnimals = new BlueVariation(blueConfig);

                Dictionary <string, List <string> > farmAnimals = this.Config.GetFarmAnimalTypes();
                BreedFarmAnimalConfig breedFarmAnimalConfig     = new BreedFarmAnimalConfig(farmAnimals, blueFarmAnimals, this.Config.RandomizeNewbornFromCategory, this.Config.RandomizeHatchlingFromCategory, this.Config.IgnoreParentProduceCheck);
                BreedFarmAnimal       breedFarmAnimal           = new BreedFarmAnimal(player, breedFarmAnimalConfig);

                NameFarmAnimalMenu nameFarmAnimalMenu = new NameFarmAnimalMenu(namingMenu, breedFarmAnimal);

                nameFarmAnimalMenu.HandleChange();
            }
        }
コード例 #2
0
        public Stock(StockConfig stockConfig)
        {
            this.BlueFarmAnimals = stockConfig.BlueFarmAnimals;
            this.VoidFarmAnimals = stockConfig.VoidFarmAnimals;

            // Use the lists because the meat indices can't be relied upon (ex. mutton)
            this.FarmAnimalsForPurchase = stockConfig.FarmAnimalsForPurchase;
        }
コード例 #3
0
 public BreedFarmAnimal(Player farmer, BreedFarmAnimalConfig breedFarmAnimalConfig)
 {
     this.Farmer = farmer;
     this.AvailableFarmAnimals           = breedFarmAnimalConfig.AvailableFarmAnimals;
     this.BlueFarmAnimals                = breedFarmAnimalConfig.BlueFarmAnimals;
     this.FarmAnimalsData                = breedFarmAnimalConfig.FarmAnimalsData;
     this.RandomizeNewbornFromCategory   = breedFarmAnimalConfig.RandomizeNewbornFromCategory;
     this.RandomizeHatchlingFromCategory = breedFarmAnimalConfig.RandomizeHatchlingFromCategory;
     this.IgnoreParentProduceCheck       = breedFarmAnimalConfig.IgnoreParentProduceCheck;
 }
コード例 #4
0
        public BreedFarmAnimalConfig(Dictionary <string, List <string> > availableFarmAnimals, BlueVariation blueFarmAnimals, bool randomizeNewbornFromCategory = false, bool randomizeHatchlingFromCategory = false, bool ignoreParentProduceCheck = false)
        {
            this.AvailableFarmAnimals = availableFarmAnimals;
            this.BlueFarmAnimals      = blueFarmAnimals;
            this.FarmAnimalsData      = new FarmAnimalsData();

            // Default these to false for backwards compatibility
            this.RandomizeNewbornFromCategory   = randomizeNewbornFromCategory;
            this.RandomizeHatchlingFromCategory = randomizeHatchlingFromCategory;
            this.IgnoreParentProduceCheck       = ignoreParentProduceCheck;
        }
コード例 #5
0
        /// <param name="version">string</param>
        /// <param name="player">Paritee.StardewValleyAPI.Players</param>
        /// <param name="blueFarmAnimals">Paritee.StardewValleyAPI.FarmAnimals.Variations.BlueVariation</param>
        /// <returns>Returns Paritee.StardewValleyAPI.Players.Actions.BreedFarmAnimal</returns>
        public BreedFarmAnimal GetBreedFarmAnimal(string version, Player player, BlueVariation blueFarmAnimals)
        {
            if (!this.IsVersionSupported(version))
            {
                throw new NotSupportedException();
            }

            Dictionary <string, List <string> > farmAnimals = this.Config.GetFarmAnimalTypes();
            BreedFarmAnimalConfig breedFarmAnimalConfig     = new BreedFarmAnimalConfig(farmAnimals, blueFarmAnimals, this.Config.RandomizeNewbornFromCategory, this.Config.RandomizeHatchlingFromCategory, this.Config.IgnoreParentProduceCheck);

            return(new BreedFarmAnimal(player, breedFarmAnimalConfig));
        }
コード例 #6
0
        /// <param name="version">string</param>
        /// <param name="farm">StardewValley.Farm</param>
        /// <param name="blueFarmAnimals">Paritee.StardewValleyAPI.FarmAnimals.Variations.BlueVariation</param>
        /// <param name="voidFarmAnimals">Paritee.StardewValleyAPI.FarmAnimals.Variations.VoidVariation</param>
        /// <returns>Returns Paritee.StardewValleyAPI.Buidlings.AnimalShop</returns>
        public AnimalShop GetAnimalShop(string version, Farm farm, BlueVariation blueFarmAnimals, VoidVariation voidFarmAnimals)
        {
            if (!this.IsVersionSupported(version))
            {
                throw new NotSupportedException();
            }

            List <FarmAnimalForPurchase> farmAnimalsForPurchase = this.Config.GetFarmAnimalsForPurchase(farm);
            StockConfig stockConfig = new StockConfig(farmAnimalsForPurchase, blueFarmAnimals, voidFarmAnimals);
            Stock       stock       = new Stock(stockConfig);

            return(new AnimalShop(stock));
        }
コード例 #7
0
        private AnimalShop GetAnimalShop(Player player)
        {
            // Set up everything else
            BlueConfig    blueConfig      = new BlueConfig(player.HasSeenEvent(BlueVariation.EVENT_ID));
            BlueVariation blueFarmAnimals = new BlueVariation(blueConfig);

            VoidConfig    voidConfig      = new VoidConfig(this.Config.VoidFarmAnimalsInShop, player.HasCompletedQuest(VoidVariation.QUEST_ID));
            VoidVariation voidFarmAnimals = new VoidVariation(voidConfig);

            List <FarmAnimalForPurchase> farmAnimalsForPurchase = this.Config.GetFarmAnimalsForPurchase(Game1.getFarm());
            StockConfig stockConfig = new StockConfig(farmAnimalsForPurchase, blueFarmAnimals, voidFarmAnimals);
            Stock       stock       = new Stock(stockConfig);

            return(new AnimalShop(stock));
        }
コード例 #8
0
        private void OnSaveLoaded(object sender, SaveLoadedEventArgs e)
        {
            this.Player = new Player(Game1.player, this.Helper);

            // Set up everything else
            BlueConfig blueConfig = new BlueConfig(this.Player.HasSeenEvent(BlueVariation.EVENT_ID));

            this.BlueFarmAnimals = new BlueVariation(blueConfig);

            VoidConfig voidConfig = new VoidConfig(this.Config.VoidFarmAnimalsInShop, this.Player.HasCompletedQuest(VoidVariation.QUEST_ID));

            this.VoidFarmAnimals = new VoidVariation(voidConfig);

            List <FarmAnimalForPurchase> farmAnimalsForPurchase = this.Config.GetFarmAnimalsForPurchase(Game1.getFarm());
            StockConfig stockConfig = new StockConfig(farmAnimalsForPurchase, this.BlueFarmAnimals, this.VoidFarmAnimals);
            Stock       stock       = new Stock(stockConfig);

            this.AnimalShop = new AnimalShop(stock);
        }
コード例 #9
0
 public StockConfig(List <FarmAnimalForPurchase> farmAnimalsForPurchase, BlueVariation blueFarmAnimals, VoidVariation voidFarmAnimals)
 {
     this.FarmAnimalsForPurchase = farmAnimalsForPurchase;
     this.BlueFarmAnimals        = blueFarmAnimals;
     this.VoidFarmAnimals        = voidFarmAnimals;
 }