Exemplo n.º 1
0
        /// <summary>
        ///     The mod entry point, called after the mod is first loaded.
        /// </summary>
        /// <param name="helper">
        ///     Provides simplified APIs for writing mods.
        /// </param>
        public override void Entry(IModHelper helper)
        {
            // Read the configuration file.
            ModEntry.config = helper.ReadConfig <ModConfig>();

            // Initialization.
            ClickToMoveManager.Init(ModEntry.config, this.Monitor, helper, this.Helper.Reflection);

            HarmonyInstance.DEBUG = true;

            // Add patches.
            HarmonyInstance harmony = HarmonyInstance.Create(this.ModManifest.UniqueID);

            BuildingsPatcher.Hook(harmony);
            CharactersPatcher.Hook(harmony);
            EventPatcher.Hook(harmony);
            FarmAnimalPatcher.Hook(harmony);
            FarmerPatcher.Hook(harmony, this.Monitor);
            FarmerSpritePatcher.Hook(harmony);
            GamePatcher.Hook(harmony);
            GameLocationPatcher.Hook(harmony);
            LocationsPatcher.Hook(harmony);
            MenusPatcher.Hook(harmony);
            MinigamesPatcher.Hook(harmony);
            ObjectsPatcher.Hook(harmony);
            ShedPatcher.Hook(harmony);
            ToolsPatcher.Hook(harmony);
            UtilityPatcher.Hook(harmony);

            // Hook events.
            helper.Events.Display.RenderedWorld += this.OnRenderedWorld;

            // Log info
            this.Monitor.VerboseLog("Initialized.");
        }
Exemplo n.º 2
0
        /*********
        ** Public methods
        *********/
        /// <summary>The mod entry point, called after the mod is first loaded.</summary>
        /// <param name="helper">Provides methods for interacting with the mod directory, such as read/writing a config file or custom JSON files.</param>
        public override void Entry(IModHelper helper)
        {
            // add patches
            var harmony = HarmonyInstance.Create(this.ModManifest.UniqueID);

            UtilityPatcher.Hook(harmony, this.Monitor);

            // hook events
            helper.Events.Player.Warped             += this.OnWarped;
            helper.Events.World.LocationListChanged += this.OnLocationListChanged;
        }