Example #1
0
        private void OnReturnedToTitle(object sender, ReturnedToTitleEventArgs args)
        {
            ModEntry.Log("GameEvents_AfterReturnToTitle", StardewModdingAPI.LogLevel.Trace);

            isDeepWoodsGameRunning            = false;
            hasRequestedInitMessageFromServer = false;
        }
Example #2
0
 /* OnReturnedToTitle
  * Returning to title and loading new save causes NPCs to load in the wrong save.
  * So this clears out the children list/copies dictionary on return to title.
  * (Children exist in the save data and NPCs don't,
  *  so this won't cause people to lose their children when reloading from save.)
  */
 private void OnReturnedToTitle(object sender, ReturnedToTitleEventArgs e)
 {
     copies           = new Dictionary <string, NPC>();
     children         = new List <Child>();
     children_parents = new Dictionary <string, string>();
     updateNeeded     = true;
 }
Example #3
0
 /// <summary>Raised after the game returns to the title screen.</summary>
 /// <param name="sender">The event sender.</param>
 /// <param name="e">The event arguments.</param>
 private void OnReturnedToTitle(object sender, ReturnedToTitleEventArgs e)
 {
     Conditions.Reset();
     IsBloodMoon = false;
     ExpireTime  = 0;
     CropList.Clear();
 }
Example #4
0
 /// <summary>Raised after a game has exited a game/save to the title screen.  Here we unhook our gameplay events.</summary>
 /// <param name="sender">The event sender.</param>
 /// <param name="e">The event arguments.</param>
 private void OnReturnedToTitle(object sender, ReturnedToTitleEventArgs e)
 {
     if (Debug)
     {
         MyHelper.Events.Input.ButtonPressed -= Input_ButtonPressed;
     }
 }
Example #5
0
 /// <summary>Raised after the game returns to the title screen.</summary>
 private void OnReturnedToTitle(object sender, ReturnedToTitleEventArgs e)
 {
     // Reset stuff
     modSaveData = null;
     furnaces.Clear();
     furnaces.Clear();
 }
Example #6
0
 private void OnReturnedToTitle(object sender, ReturnedToTitleEventArgs e) //Prevent weird graphical bugs when the player returns to title screen with umbrella equipped
 {
     drawUmbrella      = false;
     drawRegularFarmer = true;
     fullRedraw        = true;
     redrawFarmer();
 }
Example #7
0
        private void OnReturnedToTitle(object sender, ReturnedToTitleEventArgs e)
        {
            Helper.Events.GameLoop.UpdateTicked -= OnUpdateTicked;
            Helper.Events.Input.ButtonPressed   -= OnButtonPressed;

            SpeechHandlerPolly.stop();
        }
Example #8
0
 /// <summary>Raised after the game returns to the title screen.</summary>
 /// <param name="sender">The event sender.</param>
 /// <param name="e">The event arguments.</param>
 private void OnReturnedToTitle(object sender, ReturnedToTitleEventArgs e)
 {
     foreach (IEventSubscriber subscriber in this.subscribers)
     {
         subscriber.Unsubscribe();
     }
 }
Example #9
0
        private void OnReturnedToTitle(object sender, ReturnedToTitleEventArgs e)
        {
            // Unhook into the 1 second tick
            Helper.Events.GameLoop.OneSecondUpdateTicked -= this.OnOneSecondUpdateTicked;

            cachedRequestedSong = null;
            waitingForEventToFinishToResumeCachedSong = false;
        }
Example #10
0
 /// <summary>Raised after a game has exited a game/save to the title screen.  Here we unhook our gameplay events.</summary>
 /// <param name="sender">The event sender.</param>
 /// <param name="e">The event arguments.</param>
 private void OnReturnedToTitle(object sender, ReturnedToTitleEventArgs e)
 {
     MyHelper.Events.Input.ButtonPressed -= Input_ButtonPressed;
     if (!Config.UseHarmony)
     {
         MyHelper.Events.Player.Warped -= Player_Warped;
     }
 }
 private static void GameLoop_ReturnedToTitle(object sender, ReturnedToTitleEventArgs e)
 {
     // Local co-op farmhands should not clear custom area-bundle data
     if (!Context.IsSplitScreen || Context.IsMainPlayer)
     {
         BundleManager.Clear();
     }
 }
Example #12
0
        /// <summary>Event that is called when the game returns to the title.</summary>
        /// <param name="sender">The object</param>
        /// <param name="e">The Returned To Titles Event argument</param>
        private void OnReturnedToTitle(object sender, ReturnedToTitleEventArgs e)
        {
            //Set the menu to null since it's a per save type of thing
            Menu = null;

            //Clear the favorites list as it's per save
            PlayerLoader.Favorites.Clear();
        }
Example #13
0
 /// <summary>Raised after the game returns to the title screen.</summary>
 /// <param name="sender">The event sender.</param>
 /// <param name="e">The event arguments.</param>
 public void onReturnedToTitle(object sender, ReturnedToTitleEventArgs e)
 {
     // clear last save
     if (this.Config.ForgetLastFileOnTitle)
     {
         this.clearLastSave();
     }
 }
Example #14
0
 /// <summary>Raised after a game has exited a game/save to the title screen.  Here we unhook our gameplay events.</summary>
 /// <param name="sender">The event sender.</param>
 /// <param name="e">The event arguments.</param>
 private void OnReturnedToTitle(object sender, ReturnedToTitleEventArgs e)
 {
     MyHelper.Events.Input.ButtonPressed     -= Input_ButtonPressed;
     MyHelper.Events.Input.ButtonReleased    -= Input_ButtonReleased;
     MyHelper.Events.GameLoop.UpdateTicking  -= GameLoop_UpdateTicking;
     MyHelper.Events.GameLoop.UpdateTicked   -= GameLoop_UpdateTicked;
     MyHelper.Events.Player.InventoryChanged -= Player_InventoryChanged;
 }
Example #15
0
 internal void OnReturnToTitle(object sender, ReturnedToTitleEventArgs e)
 {
     if (Config.ShowVisualUpgrades)
     {
         Data = new ModData(); //Force Back to Defaults.
         Helper.Content.InvalidateCache("Buildings/Greenhouse");
     }
 }
Example #16
0
 private void ReturnedToTitle(object?sender, ReturnedToTitleEventArgs e)
 {
     if (GMCM?.HasGottenAPI == true)
     {
         GMCM.Unregister();
         this.SetUpBasicConfig();
     }
 }
 private void DelistServer(object sender = null, ReturnedToTitleEventArgs e = null)
 {
     Monitor.Log("Delisting FarmHubServer");
     FarmHubMod.events.GameLoop.TimeChanged     -= Update;
     FarmHubMod.events.GameLoop.ReturnedToTitle -= DelistServer;
     Task.Run(() => farms.Child(Id).DeleteAsync());
     FarmHubMod.myServer = null;
 }
Example #18
0
 /// <summary>Raised after the game returns to the title screen.</summary>
 /// <param name="sender">The event sender.</param>
 /// <param name="e">The event data.</param>
 private void OnReturnedToTitle(object sender, ReturnedToTitleEventArgs e)
 {
     PrestigeSaveData.Instance.Read();
     SaveIsLoaded = false;
     Logger.LogInformation("Return To Title.");
     PerSaveOptions.ClearLoadedPerSaveOptionsFile();
     ExperienceHandler.ResetExperience();
 }
Example #19
0
        /// <summary>
        /// Clears save-specific data for villager reactions, sunscreen, and sunburn. Raised when the player returns to title screen.
        /// </summary>
        /// <param name="sender">The event sender.</param>
        /// <param name="e">The event arguments.</param>
        private void onReturnedToTitle(object sender, ReturnedToTitleEventArgs e)
        {
            //clear any previous data from other saves? Initialize zeros and all?
            IsSaveReady = false;

            Reacts    = null;
            Sunscreen = null;
            Burn      = null;
        }
        /// <summary>Tasks performed after the game returns to the title screen.</summary>
        private void ReturnedToTitle(object sender, ReturnedToTitleEventArgs e)
        {
            if (Context.IsMainPlayer != true)
            {
                return;
            }                                             //if the player using this mod is a multiplayer farmhand, don't do anything

            //clear data to avoid errors (e.g. when exiting to title and creating a new farm, "DayEnding" will fire before "DayStarted" and check this data)
            Utility.FarmDataList.Clear();
        }
Example #21
0
        private void OnReturnedToTitle(object sender, ReturnedToTitleEventArgs e)
        {
            // Unload if the main player quits.
            if (Context.ScreenId != 0)
            {
                return;
            }

            _modOptionsPageHandler?.Dispose();
            _modOptionsPageHandler = null;
        }
        /// <summary>
        /// Removes event subscriptions when the player returns to the title
        /// </summary>
        private void ReturnToTitleEventUnsubcriptions(object sender, ReturnedToTitleEventArgs args)
        {
            EventSubscriber.Instance.RemoveSubscriptions();

            // Re-add the first day event subscriptions
            SMAPI.Events.GameLoop.DayStarted      += FirstDayEventSubscriptions;
            SMAPI.Events.GameLoop.ReturnedToTitle -= ReturnToTitleEventUnsubcriptions;

            // If we exit to the menu, then we will need a new first day setup
            isFirstDay = true;
        }
Example #23
0
 /// <summary>Raised after a game has exited a game/save to the title screen.  Here we unhook our gameplay events.</summary>
 /// <param name="sender">The event sender.</param>
 /// <param name="e">The event arguments.</param>
 private void OnReturnedToTitle(object sender, ReturnedToTitleEventArgs e)
 {
     MyHelper.Events.Input.ButtonPressed   -= Input_ButtonPressed;
     MyHelper.Events.Input.ButtonReleased  -= Input_ButtonReleased;
     MyHelper.Events.Display.RenderedWorld -= Display_OnRenderedWorld;
     if (!Config.UseHarmony)
     {
         MyHelper.Events.Player.InventoryChanged -= Player_InventoryChanged;
         MyHelper.Events.World.ObjectListChanged -= World_ObjectListChanged;
     }
 }
Example #24
0
        /// <summary>Raised after the player returns to the title screen.</summary>
        /// <param name="sender">The event sender.</param>
        /// <param name="e">The event data.</param>
        private void OnReturnedToTitle(object sender, ReturnedToTitleEventArgs e)
        {
            Helper.Events.GameLoop.DayStarted -= OnDayStarted;
            Helper.Events.Player.Warped       -= OnWarped;
            Helper.Events.GameLoop.DayEnding  -= OnDayEnding;

            if (currentlyInPajamas)
            {
                ChangeIntoRegularClothes();
            }
        }
Example #25
0
 private void TitleReturn(object sender, ReturnedToTitleEventArgs e)
 {
     if (GameState.Current.Activated)
     {
         foreach (var bundle in Bundles.List)
         {
             bundle.Perk?.Disable();
         }
     }
     GameState.Current = null;
     Invalidate();
 }
Example #26
0
 /// <summary>Raised after the game returns to the title screen.</summary>
 /// <param name="sender">The event sender.</param>
 /// <param name="e">The event data.</param>
 private void OnReturnedToTitle(object sender, ReturnedToTitleEventArgs e)
 {
     this.IsReady                             = false;
     this.PlayerData                          = null;
     this.Characters                          = null;
     this.HasEnteredEvent                     = false;
     this.HasRecentlyCompletedQuest           = false;
     this.CurrentNumberOfCompletedBundles     = 0;
     this.CurrentNumberOfCompletedDailyQuests = 0;
     this.CurrentUniqueItemsShipped           = 0;
     this.DaysAfterCompletingLastDailyQuest   = 0;
 }
        /// <summary>Raised after the game returns to the title screen.</summary>
        /// <param name="sender">The event sender.</param>
        /// <param name="e">The event arguments.</param>
        private void OnReturnedToTitle(object sender, ReturnedToTitleEventArgs e)
        {
            // reset state
            m_previousLoadMenu = null;
            m_farmers.Clear();

            // load per-save configs
            m_farmerConfigs.Clear();
            ReadLocalConfigs(m_farmerConfigs);

            // restore load-menu patcher
            m_events.GameLoop.UpdateTicked += OnUpdateTicked_PatchLoadMenu;
        }
        /// <summary>Event to handle the Load Menu if the player returns to the title</summary>
        /// <param name="sender">The object</param>
        /// <param name="e">The returned to title event argument</param>
        private void OnReturnedToTitle(object sender, ReturnedToTitleEventArgs e)
        {
            //Reset the state
            PreviousLoadMenu = null;
            Farmers.Clear();

            //Load the per saves configs
            FarmerConfigsDictionary.Clear();
            ReadLocalConfigs();

            //Restore the load-menu patcher
            Entry.Helper.Events.GameLoop.UpdateTicked += OnUpdateTickedPatchLoadMenu;
        }
Example #29
0
        /// <summary>Raised after the player returns to the title screen.</summary>
        /// <param name="sender">The event sender.</param>
        /// <param name="e">The event data.</param>
        private void OnReturnedToTitle(object sender, ReturnedToTitleEventArgs e)
        {
            m_shouldProcessRules = false;
            ClearPictureEventRegistration();

            // if there are pending screenshots, cancel them
            if (m_ssActions.Count > 0)
            {
                m_ssActions.Clear();
            }

            m_ssCntDwnTicks = 0;
        }
Example #30
0
        /// <summary>
        /// Raised after the game returns to the title screen.
        /// </summary>
        /// <param name="sender">The event sender.</param>
        /// <param name="e">The event arguments.</param>
        private void Title(object sender, ReturnedToTitleEventArgs e)
        {
            if (ModEntry.perScreen.Value.SpecialOrdersCompleted.Count != 0)
            {
                ModEntry.perScreen.Value.SpecialOrdersCompleted.Clear();
                this.Monitor.Log("Clearing Special Order data, ready for new save");
            }

            if (ModEntry.perScreen.Value.QuestsCompleted.Count != 0)
            {
                ModEntry.perScreen.Value.QuestsCompleted.Clear();
                this.Monitor.Log("Clearing Quest data, ready for new save");
            }
        }