/// <summary>
        /// The mods entry point.
        /// </summary>>
        /// <param name="helper">SMAPI's mod helper</param>
        public override void Entry(IModHelper helper)
        {
            // Load the config
            Config = helper.ReadConfig <ModConfig>();

            // Initialize classes
            InitializeClasses();

            // Set up the events
            SetUpEvents();

            // Check for installed optional mods
            CheckIfOptionalModsAreInstalled();

            // If SpaceCore installed then register the extended tilesheets
            if (IsSpaceCoreInstalled)
            {
                RegisterSpaceCoreSheets();
            }

            // Initialize the LoadSaveMenu Patcher
            MenuPatcher.Init();

            // Initialize and Patch with Harmony
            HarmonyHelper.InitializeAndPatch();

            // Add the ContentLoader class to the AssetLoader List
            helper.Content.AssetLoaders.Add(new ContentLoader(this, PackHelper));
        }
Exemple #2
0
        /// <summary>The mods entry point.</summary>>
        /// <param name="helper">SMAPI's mod helper</param>
        public override void Entry(IModHelper helper)
        {
            //Load the config
            Config = helper.ReadConfig <ModConfig>();

            //Initialize classes
            PackHelper   = new ContentPackHelper(this);
            Dresser      = new DresserHandler(this, Config);
            PlayerLoader = new CharacterLoader(this, PackHelper, Dresser);
            MenuPatcher  = new SaveLoadMenuPatcher(this, PlayerLoader);

            //Set up the events
            helper.Events.Input.ButtonPressed      += OnButtonPressed;
            helper.Events.GameLoop.GameLaunched    += OnGameLaunched;
            helper.Events.GameLoop.SaveLoaded      += OnSaveLoaded;
            helper.Events.GameLoop.ReturnedToTitle += OnReturnedToTitle;

            //Check if SpaceCore is Installed
            IsSpaceCoreInstalled = Helper.ModRegistry.IsLoaded("spacechase0.SpaceCore");
            Monitor.Log($"Space Core Installed: {IsSpaceCoreInstalled}", LogLevel.Trace);

            //Check if Customize Anywhere is installed
            IsCustomizeAnywhereInstalled = Helper.ModRegistry.IsLoaded("Cherry.CustomizeAnywhere");
            Monitor.Log($"Customize AnyWhere Installed: {IsCustomizeAnywhereInstalled}", LogLevel.Trace);

            //if it's installed then register the extended tilesheets
            if (IsSpaceCoreInstalled)
            {
                Monitor.Log("Reflecting into SpaceCore", LogLevel.Trace);
                SpaceCoreHackery();
            }

            //Initialized the LoadSaveMenu Patcher
            MenuPatcher.Init();

            //Conduct the Harmony Patch
            Harmony = HarmonyInstance.Create(this.ModManifest.UniqueID);
            CommenceHarmonyPatch();

            //Add the ContentLoader class to the AssetLoader List
            helper.Content.AssetLoaders.Add(new ContentLoader(this, PackHelper));
        }