コード例 #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)
        {
            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();
        }
コード例 #2
0
ファイル: Class1.cs プロジェクト: KamtarGaming/smapi-mod-dump
        /// <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();
        }