コード例 #1
0
ファイル: Game1Patcher.cs プロジェクト: kurumushi/SMAPI
        /// <summary>The method to call after <see cref="Game1.loadForNewGame"/>.</summary>
        /// <remarks>This method must be static for Harmony to work correctly. See the Harmony documentation before renaming arguments.</remarks>
        private static void After_LoadForNewGame()
        {
            Game1Patcher.IsInLoadForNewGame = false;

            if (Game1Patcher.IsCreating())
            {
                Game1Patcher.OnStageChanged(LoadStage.CreatedLocations);
            }
        }
コード例 #2
0
ファイル: Game1Patcher.cs プロジェクト: kurumushi/SMAPI
        /*********
        ** Private methods
        *********/
        /// <summary>The method to call before <see cref="Game1.AddModNPCs"/>.</summary>
        /// <returns>Returns whether to execute the original method.</returns>
        /// <remarks>This method must be static for Harmony to work correctly. See the Harmony documentation before renaming arguments.</remarks>
        private static bool Before_AddModNpcs()
        {
            // When this method is called from Game1.loadForNewGame, it happens right after adding the vanilla
            // locations but before initializing them.
            if (Game1Patcher.IsInLoadForNewGame)
            {
                Game1Patcher.OnStageChanged(Game1Patcher.IsCreating()
                    ? LoadStage.CreatedInitialLocations
                    : LoadStage.SaveAddedLocations
                                            );
            }

            return(true);
        }
コード例 #3
0
ファイル: Game1Patcher.cs プロジェクト: kurumushi/SMAPI
 /// <summary>The method to call before <see cref="Game1.CleanupReturningToTitle"/>.</summary>
 /// <returns>Returns whether to execute the original method.</returns>
 /// <remarks>This method must be static for Harmony to work correctly. See the Harmony documentation before renaming arguments.</remarks>
 private static bool Before_CleanupReturningToTitle()
 {
     Game1Patcher.OnStageChanged(LoadStage.ReturningToTitle);
     return(true);
 }