コード例 #1
0
        private static void DoInvite(int which, NPC npc)
        {
            Monitor.Log($"Doing invite");

            if (!ModEntry.inCall)
            {
                Monitor.Log($"Not in call, exiting");
                return;
            }


            EventInvite ei = eventInvites[which];

            ModEntry.isInviting = true;

            (Game1.activeClickableMenu as DialogueBox).closeDialogue();
            Game1.player.currentLocation.lastQuestionKey = "";
            LocationRequest l = Game1.getLocationRequest(ei.location);

            Event e = new Event(CreateEventString(ei.nodes, npc))
            {
                exitLocation = new LocationRequest(Game1.player.currentLocation.Name, Game1.player.currentLocation.isStructure, Game1.player.currentLocation)
            };
            Vector2 exitPos = Game1.player.getTileLocation();

            e.onEventFinished += delegate()
            {
                Monitor.Log($"Event finished");
                ModEntry.isInviting = false;
                ModEntry.invitedNPC = null;
            };
            if (ei.forks != null)
            {
                Helper.Content.InvalidateCache($"Data/Events/{ei.location}");
            }

            ModEntry.invitedNPC = npc;

            EndCall();
            ModEntry.ClosePhone();
            Game1.warpFarmer(l, 0, 0, 0);
            l.Location.startEvent(e);
            Game1.player.positionBeforeEvent = exitPos;
        }
コード例 #2
0
 internal static void ReturnedToTitle(object sender, ReturnedToTitleEventArgs e)
 {
     ModEntry.ClosePhone();
 }