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
        private void Display_RenderingActiveMenu(object sender, RenderingActiveMenuEventArgs e)
        {
            // Ignore if player hasn't loaded a save yet
            if (!Context.IsWorldReady || Game1.activeClickableMenu == null)
            {
                return;
            }

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

            if (namingMenu == null)
            {
                return;
            }

            if (namingMenu.GetType() != typeof(StardewValley.Menus.NamingMenu))
            {
                return;
            }

            List <string>         loadedTypes           = this.Config.GetFarmAnimalTypes();
            BreedFarmAnimalConfig breedFarmAnimalConfig = new BreedFarmAnimalConfig(loadedTypes, this.BlueFarmAnimals);
            BreedFarmAnimal       breedFarmAnimal       = new BreedFarmAnimal(this.Player, breedFarmAnimalConfig);

            NameFarmAnimalMenu nameFarmAnimalMenu = new NameFarmAnimalMenu(namingMenu, breedFarmAnimal);

            nameFarmAnimalMenu.HandleChange();
        }
Пример #3
0
        private void HandleAfterFarmAnimalIsCreated()
        {
            // Continue the current event if there is one
            this.BreedFarmAnimal.Farmer.ContinueCurrentEvent();

            // Exit the active menu
            (new ActiveClickableMenu()).Exit();
            this.NamingMenu = (NamingMenu)null;
        }
Пример #4
0
        public void OpenCustomNamingMenu(NamingMenu.doneNamingBehavior doneNaming, string title, string defaultName = null)
        {
            // Launch the custom one
            NamingMenu BetterNamingMenu = new NamingMenu(doneNaming, title, defaultName);

            this.NamingMenu = BetterNamingMenu;

            Game1.activeClickableMenu = (IClickableMenu)this.NamingMenu;
        }
Пример #5
0
 public NameFarmAnimalMenu(StardewValley.Menus.NamingMenu namingMenu, BreedFarmAnimal breedFarmAnimal)
 {
     this.NamingMenu      = namingMenu;
     this.BreedFarmAnimal = breedFarmAnimal;
 }