/// <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) { ModHelper = this.Helper; ModMonitor = this.Monitor; Manifest = this.ModManifest; helper.Events.GameLoop.SaveLoaded += this.OnSaveLoaded; helper.Events.GameLoop.Saving += this.OnSaving; helper.Events.GameLoop.Saved += this.OnSaved; helper.Events.GameLoop.UpdateTicked += this.OnUpdateTicked; npcTracker = new NpcTracker(); assetPool = new AssetPool(); var assetManager = new AssetManager(); assetPool.addAssetManager(new KeyValuePair <string, AssetManager>("testNPC", assetManager)); this.initializeExamples(); this.initializeAssetPool(); assetPool.loadAllAssets(); }
/// <summary> /// Ran when loading the SMAPI. Used to initialize data. /// </summary> /// <param name="helper"></param> public override void Entry(IModHelper helper) { ModHelper = this.Helper; ModMonitor = this.Monitor; StardewModdingAPI.Events.SaveEvents.AfterLoad += SaveEvents_LoadChar; StardewModdingAPI.Events.SaveEvents.BeforeSave += SaveEvents_BeforeSave; StardewModdingAPI.Events.SaveEvents.AfterSave += SaveEvents_AfterSave; StardewModdingAPI.Events.PlayerEvents.Warped += LocationEvents_CurrentLocationChanged; StardewModdingAPI.Events.GameEvents.UpdateTick += GameEvents_UpdateTick; npcTracker = new NPCTracker(); assetPool = new AssetPool(); var assetManager = new AssetManager(); assetPool.addAssetManager(new KeyValuePair <string, AssetManager>("testNPC", assetManager)); initializeExamples(); initializeAssetPool(); assetPool.loadAllAssets(); }