Esempio n. 1
0
 /// <summary>
 /// Raised after a game menu is opened, closed, or replaced.
 /// Here it invoke the MailController to show a custom mail when the it's a LetterViewerMenu, called from open the mailbox and there is CustomMails to be delivered
 /// </summary>
 /// <param name="sender">The event sender.</param>
 /// <param name="e">The event arguments.</param>
 private void OnMenuChanged(object sender, MenuChangedEventArgs e)
 {
     if (e.NewMenu is LetterViewerMenu && this.Helper.Reflection.GetField <string>(e.NewMenu, "mailTitle").GetValue() != null && MailController.HasCustomMail())
     {
         MailController.ShowLetter();
     }
 }
 public static bool mailbox_prefix(GameLocation __instance)
 {
     if (Game1.player.mailbox.Count > 0)
     {
         if (Game1.player.mailbox.First <string>() == null)
         {
             Game1.player.mailbox.RemoveAt(0);
             return(false);
         }
         else if (Game1.player.mailbox.First <string>().Contains(CustomMailId))
         {
             Game1.player.mailbox.RemoveAt(0);
             MailController.ShowLetter();
             return(false);
         }
     }
     return(true);
 }
Esempio n. 3
0
 public static bool mailbox(GameLocation __instance)
 {
     if (Game1.mailbox.Count > 0 && Game1.player.ActiveObject == null)
     {
         if (Game1.mailbox.First <string>() == null)
         {
             Game1.mailbox.RemoveAt(0);
             return(false);
         }
         else if (Game1.mailbox.First <string>().Contains(CustomMailId))
         {
             Game1.mailbox.RemoveAt(0);
             MailController.ShowLetter();
             return(false);
         }
         else
         {
             _events.Display.MenuChanged += OnMenuChanged;
         }
     }
     return(true);
 }