Example #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);
            }
        }
Example #2
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()
        {
            bool creating =
                (Game1.currentMinigame is Intro) || // creating save with intro
                (Game1.activeClickableMenu is TitleMenu menu && LoadContextPatch.Reflection.GetField <bool>(menu, "transitioningCharacterCreationMenu").GetValue());   // creating save, skipped intro

            if (creating)
            {
                LoadContextPatch.OnStageChanged(LoadStage.CreatedLocations);
            }
        }
Example #3
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);
        }
Example #4
0
 /*********
 ** Private methods
 *********/
 /// <summary>Called before <see cref="TitleMenu.createdNewCharacter"/>.</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_TitleMenu_CreatedNewCharacter()
 {
     LoadContextPatch.OnStageChanged(LoadStage.CreatedBasicInfo);
     return(true);
 }
Example #5
0
 /// <summary>Called 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_Game1_CleanupReturningToTitle()
 {
     LoadContextPatch.OnStageChanged(LoadStage.ReturningToTitle);
     return(true);
 }