示例#1
0
        public override void OnPush()
        {
            base.OnPush();

            teleportCharge = teleportationTravel && TravelOptionsMod.Instance.TeleportCost;

            // Open to region map if travel UI showing, else check if there's an active destination and ask to resume
            TravelOptionsMod travelModInstance = TravelOptionsMod.Instance;

            travelModInstance.DisableJunctionMap();
            if (travelModInstance.GetTravelControlUI().isShowing)
            {
                OpenRegionPanel(GetPlayerRegion());
            }
            else if (!string.IsNullOrEmpty(travelModInstance.DestinationName))
            {
                Debug.Log("Active destination: " + travelModInstance.DestinationName);

                string resume = string.Format(MsgResume, travelModInstance.DestinationName);
                DaggerfallMessageBox resumeMsgBox = new DaggerfallMessageBox(uiManager, DaggerfallMessageBox.CommonMessageBoxButtons.YesNo, resume, uiManager.TopWindow);
                resumeMsgBox.OnButtonClick += (_sender, button) =>
                {
                    CloseWindow();
                    if (button == DaggerfallMessageBox.MessageBoxButtons.Yes)
                    {
                        CloseWindow();
                        travelModInstance.BeginTravel();
                    }
                };
                resumeMsgBox.Show();
            }
        }
        public override void OnPush()
        {
            // Check if there's an active destination
            TravelOptionsMod travelModInstance = TravelOptionsMod.Instance;

            if (!string.IsNullOrEmpty(travelModInstance.DestinationName) && !travelModInstance.GetTravelControlUI().isShowing) //&& travelMod.TravelUi != null
            {
                Debug.Log("Active destination: " + travelModInstance.DestinationName);

                string resume = string.Format(MsgResume, travelModInstance.DestinationName);
                DaggerfallMessageBox resumeMsgBox = new DaggerfallMessageBox(uiManager, DaggerfallMessageBox.CommonMessageBoxButtons.YesNo, resume, uiManager.TopWindow);
                resumeMsgBox.OnButtonClick += (_sender, button) =>
                {
                    CloseWindow();
                    if (button == DaggerfallMessageBox.MessageBoxButtons.Yes)
                    {
                        CloseWindow();
                        travelModInstance.BeginTravel();
                    }
                };
                resumeMsgBox.Show();
            }

            base.OnPush();
        }