Beispiel #1
0
 public override void Entry(IModHelper helper)
 {
     BitwiseJonMods.Common.Utility.InitLogging(this.Monitor);
     _config = helper.ReadConfig <ModConfig>();
     helper.Events.GameLoop.GameLaunched += this.OnGameLaunched;
 }
        public InstantBuildMenu(ModConfig config, BluePrint tractorBlueprint)
        {
            _config = config;

            this.magicalConstruction = true;
            Game1.player.forceCanMove();
            this.resetBounds();
            this.blueprints = new List <BluePrint>();

            this.blueprints.Add(new BluePrint("Coop"));
            this.blueprints.Add(new BluePrint("Barn"));
            this.blueprints.Add(new BluePrint("Well"));
            this.blueprints.Add(new BluePrint("Silo"));
            this.blueprints.Add(new BluePrint("Mill"));
            this.blueprints.Add(new BluePrint("Shed"));
            int buildingsConstructed = Game1.getFarm().getNumberBuildingsConstructed("Cabin");

            if (Game1.IsMasterGame && buildingsConstructed < MULTIPLAYER_LIMIT - 1)
            {
                this.blueprints.Add(new BluePrint("Stone Cabin"));
                this.blueprints.Add(new BluePrint("Plank Cabin"));
                this.blueprints.Add(new BluePrint("Log Cabin"));
            }
            if (Game1.getFarm().getNumberBuildingsConstructed("Stable") < buildingsConstructed + 1)
            {
                this.blueprints.Add(new BluePrint("Stable"));
            }
            this.blueprints.Add(new BluePrint("Slime Hutch"));
            //if (Game1.getFarm().isBuildingConstructed("Coop"))
            this.blueprints.Add(new BluePrint("Big Coop"));
            //if (Game1.getFarm().isBuildingConstructed("Big Coop"))
            this.blueprints.Add(new BluePrint("Deluxe Coop"));
            //if (Game1.getFarm().isBuildingConstructed("Barn"))
            this.blueprints.Add(new BluePrint("Big Barn"));
            //if (Game1.getFarm().isBuildingConstructed("Big Barn"))
            this.blueprints.Add(new BluePrint("Deluxe Barn"));
            this.blueprints.Add(new BluePrint("Shipping Bin"));

            if (tractorBlueprint != null)
            {
                this.blueprints.Add(tractorBlueprint);
            }

            if (_config.AllowMagicalBuildingsWithoutMagicInk || (!_config.AllowMagicalBuildingsWithoutMagicInk && Game1.player.hasMagicInk))
            {
                this.blueprints.Add(new BluePrint("Junimo Hut"));
                this.blueprints.Add(new BluePrint("Earth Obelisk"));
                this.blueprints.Add(new BluePrint("Water Obelisk"));
                this.blueprints.Add(new BluePrint("Gold Clock"));
            }

            ModifyBlueprints();


            this.setNewActiveBlueprint();
            if (!Game1.options.SnappyMenus)
            {
                return;
            }
            this.populateClickableComponentList();
            this.snapToDefaultClickableComponent();
        }