Ejemplo n.º 1
0
 private void GameLoop_GameLaunched(object sender, StardewModdingAPI.Events.GameLaunchedEventArgs e)
 {
     ObjectManager.loadInItems();
     //Adds in recipes to the mod.
     VanillaRecipeBook = new VanillaRecipeBook();
     CraftingRecipeBook.CraftingRecipesByGroup = new Dictionary <string, CraftingRecipeBook>();
 }
Ejemplo n.º 2
0
        public override void Entry(IModHelper helper)
        {
            ModHelper  = helper;
            ModMonitor = this.Monitor;
            Manifest   = this.ModManifest;
            Configs    = new ConfigManager();

            this.createDirectories();
            this.initailizeComponents();
            Serializer    = new Serializer();
            playerInfo    = new PlayerInfo();
            CustomObjects = new Dictionary <Guid, CustomObject>();
            CustomItems   = new Dictionary <Guid, Item>();

            //Loads in textures to be used by the mod.
            this.loadInTextures();

            //Loads in objects to be use by the mod.
            ObjectGroups  = new Dictionary <string, MultiTiledObject>();
            ObjectManager = new ObjectManager(Manifest);
            ObjectsToDraw = new Dictionary <GameLocation, MultiTiledObject>();

            //Adds in event handling for the mod.
            ModHelper.Events.GameLoop.SaveLoaded += this.GameLoop_SaveLoaded;
            ModHelper.Events.GameLoop.SaveLoaded += CraftingRecipeBook.AfterLoad_LoadRecipeBooks;
            ModHelper.Events.GameLoop.Saving     += CraftingRecipeBook.BeforeSave_SaveRecipeBooks;

            ModHelper.Events.GameLoop.TimeChanged     += this.GameLoop_TimeChanged;
            ModHelper.Events.GameLoop.UpdateTicked    += this.GameLoop_UpdateTicked;
            ModHelper.Events.GameLoop.ReturnedToTitle += this.GameLoop_ReturnedToTitle;

            ModHelper.Events.Player.Warped       += ObjectManager.resources.OnPlayerLocationChanged;
            ModHelper.Events.GameLoop.DayStarted += ObjectManager.resources.DailyResourceSpawn;
            ModHelper.Events.Input.ButtonPressed += this.Input_ButtonPressed;
            ModHelper.Events.Input.ButtonPressed += ObjectInteractionHacks.Input_CheckForObjectInteraction;

            ModHelper.Events.GameLoop.DayEnding    += Serializer.DayEnding_CleanUpFilesForDeletion;
            ModHelper.Events.Display.RenderedWorld += ObjectInteractionHacks.Render_RenderCustomObjectsHeldInMachines;
            //ModHelper.Events.Display.Rendered += MenuHacks.EndOfDay_OnMenuChanged;
            //ModHelper.Events.GameLoop.Saved += MenuHacks.EndOfDay_CleanupForNewDay;
            ModHelper.Events.Multiplayer.ModMessageReceived += MultiplayerUtilities.GetModMessage;
            ModHelper.Events.Input.ButtonPressed            += ObjectInteractionHacks.ResetNormalToolsColorOnLeftClick;

            ModHelper.Events.Input.ButtonPressed += this.Input_ButtonPressed1;

            ModHelper.Events.Display.MenuChanged += MenuHacks.RecreateFarmhandInventory;

            ObjectManager.loadInItems();
            //Adds in recipes to the mod.
            VanillaRecipeBook = new VanillaRecipeBook();
            CraftingRecipeBook.CraftingRecipesByGroup = new Dictionary <string, CraftingRecipeBook>();
        }