コード例 #1
0
        public override void Callback(string command, string[] args)
        {
            var message = "Listing farm animals\n";

            FarmAnimals.ReadCache();
            foreach (var category in FarmAnimals.GetCategories())
            {
                message += DescribeFarmAnimalCategory(category);
            }
            Monitor.Log(message, LogLevel.Info);
        }
コード例 #2
0
        public static void Postfix(ref StardewValley.Menus.PurchaseAnimalsMenu __instance,
                                   ref List <StardewValley.Object> stock)
        {
            var moddedMenu = new Decorators.PurchaseAnimalsMenu(__instance);
            var dictionary = FarmAnimals.GetCategories().Where(o => o.CanBePurchased())
                             .ToDictionary(o => o.Category, o => o.GetAnimalShopIconTexture());
            int iconHeight;

            moddedMenu.SetUpAnimalsToPurchase(stock, dictionary, out iconHeight);
            AdjustMenuHeight(ref moddedMenu, iconHeight);
            StardewValley.Menus.PurchaseAnimalsMenu.menuWidth = 640;
        }
コード例 #3
0
 public Dictionary <string, Texture2D> GetAnimalShopIcons()
 {
     return(FarmAnimals.GetCategories().Where(o => o.CanBePurchased())
            .ToDictionary(o => o.Category,
                          o => o.GetAnimalShopIconTexture()));
 }
コード例 #4
0
 public Dictionary <string, List <string> > GetFarmAnimalCategories()
 {
     return(FarmAnimals.GetCategories().ToDictionary(o => o.Category,
                                                     o =>
                                                     o.Types.Select(t => t.Type).ToList()));
 }