예제 #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)
        {
            helper.Events.GameLoop.SaveLoaded      += this.GameLoop_SaveLoaded;
            helper.Events.GameLoop.ReturnedToTitle += this.GameLoop_ReturnedToTitle;
            helper.Events.GameLoop.DayEnding       += this.GameLoop_DayEnding;
            helper.Events.GameLoop.DayStarted      += this.GameLoop_DayStarted;
            helper.Events.GameLoop.GameLaunched    += this.GameLoop_GameLaunched;

            this.DialogueDriver   = new DialogueDriver(helper.Events);
            this.HintDriver       = new HintDriver(helper.Events);
            this.StuffDriver      = new StuffDriver(helper.Events, helper.Data, this.Monitor);
            this.contentLoader    = new ContentLoader(helper.Content, helper.DirectoryPath, "assets", this.Monitor);
            this.companionManager = new CompanionManager(this.DialogueDriver, this.HintDriver, this.Monitor);
        }
예제 #2
0
        private void GameLoop_GameLaunched(object sender, GameLaunchedEventArgs e)
        {
            // Setup third party mod compatibility bridge
            TPMC.Setup(this.Helper.ModRegistry);

            // Mod's services and drivers
            this.SpecialEvents    = new SpecialModEvents();
            this.DialogueDriver   = new DialogueDriver(this.Helper.Events);
            this.HintDriver       = new HintDriver(this.Helper.Events);
            this.StuffDriver      = new StuffDriver(this.Helper.Data, this.Monitor);
            this.contentLoader    = new ContentLoader(this.Helper.Content, this.Helper.ContentPacks, this.ModManifest.UniqueID, "assets", this.Helper.DirectoryPath, this.Monitor);
            this.companionHud     = new CompanionDisplay(this.config, this.contentLoader);
            this.companionManager = new CompanionManager(this.DialogueDriver, this.HintDriver, this.companionHud, this.config, this.Monitor);
            this.StuffDriver.RegisterEvents(this.Helper.Events);

            // Harmony
            HarmonyInstance harmony = HarmonyInstance.Create("Purrplingcat.NpcAdventure");

            Patches.SpouseReturnHomePatch.Setup(harmony);
            Patches.CompanionSayHiPatch.Setup(harmony, this.companionManager);
            Patches.GameLocationDrawPatch.Setup(harmony, this.SpecialEvents);
        }