public override void Entry(IModHelper helper) { instance = this; Log.Monitor = Monitor; helper.Events.GameLoop.GameLaunched += onGameLaunched; helper.Events.Display.MenuChanged += onMenuChanged; helper.Events.Input.ButtonPressed += onButtonPressed; BugNetTool.Texture = helper.Content.Load <Texture2D>("assets/bugnet.png"); var tilesheet = helper.Content.Load <Texture2D>("assets/critters.png"); Action <string, int, Func <int, int, Critter> > register = (name, index, releaseFunc) => RegisterCritter(name, tilesheet, new Rectangle(index % 4 * 16, index / 4 * 16, 16, 16), () => helper.Translation.Get("critter." + name), releaseFunc); register("SummerButterflyBlue", 0, (x, y) => Critters.MakeButterfly(x, y, 128)); register("SummerButterflyGreen", 1, (x, y) => Critters.MakeButterfly(x, y, 148)); register("SummerButterflyRed", 2, (x, y) => Critters.MakeButterfly(x, y, 132)); register("SummerButterflyPink", 3, (x, y) => Critters.MakeButterfly(x, y, 152)); register("SummerButterflyYellow", 4, (x, y) => Critters.MakeButterfly(x, y, 136)); register("SummerButterflyOrange", 5, (x, y) => Critters.MakeButterfly(x, y, 156)); register("SpringButterflyPalePink", 6, (x, y) => Critters.MakeButterfly(x, y, 160)); register("SpringButterflyMagenta", 7, (x, y) => Critters.MakeButterfly(x, y, 180)); register("SpringButterflyWhite", 8, (x, y) => Critters.MakeButterfly(x, y, 163)); register("SpringButterflyYellow", 9, (x, y) => Critters.MakeButterfly(x, y, 183)); register("SpringButterflyPurple", 10, (x, y) => Critters.MakeButterfly(x, y, 166)); register("SpringButterflyPink", 11, (x, y) => Critters.MakeButterfly(x, y, 186)); register("BrownBird", 12, (x, y) => Critters.MakeBird(x, y, Birdie.brownBird)); register("BlueBird", 13, (x, y) => Critters.MakeBird(x, y, Birdie.blueBird)); register("GreenFrog", 14, (x, y) => Critters.MakeFrog(x, y, false)); register("OliveFrog", 15, (x, y) => Critters.MakeFrog(x, y, false)); register("Firefly", 16, (x, y) => Critters.MakeFirefly(x, y)); register("Squirrel", 17, (x, y) => Critters.MakeSquirrel(x, y)); register("GrayRabbit", 18, (x, y) => Critters.MakeRabbit(x, y, false)); register("WhiteRabbit", 19, (x, y) => Critters.MakeRabbit(x, y, true)); register("WoodPecker", 20, (x, y) => Critters.MakeWoodpecker(x, y)); register("Seagull", 21, (x, y) => Critters.MakeSeagull(x, y)); register("Owl", 22, (x, y) => Critters.MakeOwl(x, y)); register("Crow", 23, (x, y) => Critters.MakeCrow(x, y)); register("Cloud", 24, (x, y) => Critters.MakeCloud(x, y)); register("BlueParrot", 25, (x, y) => Critters.MakeParrot(x, y, false)); register("GreenParrot", 26, (x, y) => Critters.MakeParrot(x, y, true)); register("Monkey", 27, (x, y) => Critters.MakeMonkey(x, y)); register("OrangeIslandButterfly", 28, (x, y) => Critters.MakeButterfly(x, y, 364, true)); register("PinkIslandButterfly", 29, (x, y) => Critters.MakeButterfly(x, y, 368, true)); register("PurpleBird", 30, (x, y) => Critters.MakeBird(x, y, 115 /*Birdie.greenBird*/)); register("RedBird", 31, (x, y) => Critters.MakeBird(x, y, 120 /*Birdie.redBird*/)); register("SunsetTropicalButterfly", 32, (x, y) => Critters.MakeButterfly(x, y, 372, true)); register("TropicalButterfly", 33, (x, y) => Critters.MakeButterfly(x, y, 376, true)); //register("Marsupial", 34, (x, y) => Critters.MakeMarsupial(x, y)); }
public override void Entry(IModHelper helper) { instance = this; Log.Monitor = Monitor; helper.Events.Display.MenuChanged += onMenuChanged; helper.ConsoleCommands.Add("player_addcritter", "Adds a critter", addCritterCommand); BugNetTool.Texture = helper.Content.Load <Texture2D>("assets/bugnet.png"); var tilesheet = helper.Content.Load <Texture2D>("assets/critters.png"); Action <string, int, Func <int, int, Critter> > register = (name, index, releaseFunc) => RegisterCritter(name, tilesheet, new Rectangle(index % 4 * 16, index / 4 * 16, 16, 16), () => helper.Translation.Get("critter." + name), releaseFunc); register("SummerButterflyBlue", 0, (x, y) => Critters.MakeButterfly(x, y, 128)); register("SummerButterflyGreen", 1, (x, y) => Critters.MakeButterfly(x, y, 148)); register("SummerButterflyRed", 2, (x, y) => Critters.MakeButterfly(x, y, 132)); register("SummerButterflyPink", 3, (x, y) => Critters.MakeButterfly(x, y, 152)); register("SummerButterflyYellow", 4, (x, y) => Critters.MakeButterfly(x, y, 136)); register("SummerButterflyOrange", 5, (x, y) => Critters.MakeButterfly(x, y, 156)); register("SpringButterflyPalePink", 6, (x, y) => Critters.MakeButterfly(x, y, 160)); register("SpringButterflyMagenta", 7, (x, y) => Critters.MakeButterfly(x, y, 180)); register("SpringButterflyWhite", 8, (x, y) => Critters.MakeButterfly(x, y, 163)); register("SpringButterflyYellow", 9, (x, y) => Critters.MakeButterfly(x, y, 183)); register("SpringButterflyPurple", 10, (x, y) => Critters.MakeButterfly(x, y, 166)); register("SpringButterflyPink", 11, (x, y) => Critters.MakeButterfly(x, y, 186)); register("BrownBird", 12, (x, y) => Critters.MakeBird(x, y, false)); register("BlueBird", 13, (x, y) => Critters.MakeBird(x, y, true)); register("GreenFrog", 14, (x, y) => Critters.MakeFrog(x, y, false)); register("OliveFrog", 15, (x, y) => Critters.MakeFrog(x, y, false)); register("Firefly", 16, (x, y) => Critters.MakeFirefly(x, y)); register("Squirrel", 17, (x, y) => Critters.MakeSquirrel(x, y)); register("GrayRabbit", 18, (x, y) => Critters.MakeRabbit(x, y, false)); register("WhiteRabbit", 19, (x, y) => Critters.MakeRabbit(x, y, true)); register("WoodPecker", 20, (x, y) => Critters.MakeWoodpecker(x, y)); register("Seagull", 21, (x, y) => Critters.MakeSeagull(x, y)); register("Owl", 22, (x, y) => Critters.MakeOwl(x, y)); register("Crow", 23, (x, y) => Critters.MakeCrow(x, y)); register("Cloud", 24, (x, y) => Critters.MakeCloud(x, y)); }