Exemple #1
0
        /// <summary>Called 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_Game1_LoadForNewGame()
        {
            LoadContextPatch.IsInLoadForNewGame = false;

            if (LoadContextPatch.IsCreating())
            {
                LoadContextPatch.OnStageChanged(LoadStage.CreatedLocations);
            }
        }
Exemple #2
0
        /// <summary>Called 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_Game1_AddModNPCs()
        {
            // When this method is called from Game1.loadForNewGame, it happens right after adding the vanilla
            // locations but before initializing them.
            if (LoadContextPatch.IsInLoadForNewGame)
            {
                LoadContextPatch.OnStageChanged(LoadContextPatch.IsCreating()
                    ? LoadStage.CreatedInitialLocations
                    : LoadStage.SaveAddedLocations
                                                );
            }

            return(true);
        }