Example #1
0
 /// <summary>Raised when <see cref="Game1.locations"/> changes.</summary>
 /// <param name="sender">The event sender.</param>
 /// <param name="e">The event arguments.</param>
 private static void OnLocationListChanged(object sender, NotifyCollectionChangedEventArgs e)
 {
     if (++LoadForNewGamePatch.TimesLocationsCleared == 2)
     {
         LoadForNewGamePatch.OnStageChanged(LoadStage.CreatedBasicInfo);
     }
 }
Example #2
0
        /// <summary>The method to call instead 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 Postfix()
        {
            if (LoadForNewGamePatch.IsCreating)
            {
                // clean up
                List <GameLocation> locations = Game1.locations;
                //locations.CollectionChanged -= LoadForNewGamePatch.OnLocationListChanged;

                // raise stage changed
                LoadForNewGamePatch.OnStageChanged(LoadStage.CreatedLocations);
            }
        }