Example #1
0
        /// <summary>Raised after a game menu is opened, closed, or replaced.</summary>
        /// <param name="sender">The event sender.</param>
        /// <param name="e">The event arguments.</param>
        private void OnMenuChanged(object sender, MenuChangedEventArgs e)
        {
            if (Game1.activeClickableMenu is ShopMenu)
            {
                ShopMenu shop = (ShopMenu)Game1.activeClickableMenu;
                if (shop.portraitPerson != null && shop.portraitPerson.Name == "Pierre") // && Game1.dayOfMonth % 7 == )
                {
                    var ring = new GiantRing();

                    shop.itemPriceAndStock.Add(ring, new [] { this.config.cropRingPrice, int.MaxValue });
                    shop.forSale.Add(ring);
                }
            }
        }
Example #2
0
        /// <summary>Raised after a game menu is opened, closed, or replaced.</summary>
        /// <param name="sender">The event sender.</param>
        /// <param name="e">The event arguments.</param>
        private void OnMenuChanged(object sender, MenuChangedEventArgs e)
        {
            if (Game1.activeClickableMenu is ShopMenu)
            {
                ShopMenu shop = (ShopMenu)Game1.activeClickableMenu;
                if (shop.portraitPerson != null && shop.portraitPerson.Name == "Pierre") // && Game1.dayOfMonth % 7 == )
                {
                    var items   = this.Helper.Reflection.GetField <Dictionary <Item, int[]> >(shop, "itemPriceAndStock").GetValue();
                    var selling = this.Helper.Reflection.GetField <List <Item> >(shop, "forSale").GetValue();

                    var ring = new GiantRing();
                    items.Add(ring, new[] { this.config.cropRingPrice, int.MaxValue });
                    selling.Add(ring);
                }
            }
        }