コード例 #1
0
 public override Boolean Activate()
 {
     PopupHandler.DisplayMessage(text.ToArray());
     return(true);
 }
コード例 #2
0
        public override void OnFailed()
        {
            base.OnFailed();

            PopupHandler.DisplayPortraitMessage(PortraitID.RebelTroopLeader, "[Mineral researcher] Too bad. Fly back to Lavis Station and talk to me to try again.");
        }
コード例 #3
0
        public override void Update(PlayTime playTime)
        {
            base.Update(playTime);

            // Updates player direction and speed
            if (!HasAnyShipArrived())
            {
                game.player.Direction.SetDirection(new Vector2(
                                                       Destination.position.X - game.player.position.X,
                                                       Destination.position.Y - game.player.position.Y));

                if (ControlManager.CheckPress(RebindableKeys.Pause) &&
                    GameStateManager.currentState.Equals("OverworldState"))
                {
                    PopupHandler.DisplaySelectionMenu("Do you want to skip travel?",
                                                      new List <string>()
                    {
                        "Yes", "No"
                    },
                                                      new List <System.Action>()
                    {
                        delegate
                        {
                            SkipForward();
                        },
                        delegate {}
                    });
                }
            }
            game.player.speed = speed;

            // Displays timed messages
            if (timedMessages.Keys.Count > 0 &&
                StatsManager.PlayTime.HasOverworldTimePassed(nextMessageTime))
            {
                if (portraits.Count > 0)
                {
                    if (realTime)
                    {
                        PopupHandler.DisplayRealtimePortraitMessage(GetNextMessageDuration(), portraits[0].ToArray(),
                                                                    portraitTriggers[0], timedMessages.Keys.First());
                    }
                    else
                    {
                        realTimeSwitchIndex++;
                        PopupHandler.DisplayPortraitMessage(portraits[0], portraitTriggers[0], timedMessages.Keys.First());
                        if (useRealTimeSwitch &&
                            realTimeSwitchIndex >= activateRealTimeSwitchIndex)
                        {
                            realTime = true;
                        }
                    }

                    portraits.RemoveAt(0);
                    portraitTriggers.RemoveAt(0);
                }
                else
                {
                    if (realTime)
                    {
                        PopupHandler.DisplayRealtimeMessage(GetNextMessageDuration(), timedMessages.Keys.First());
                    }
                    else
                    {
                        realTimeSwitchIndex++;
                        PopupHandler.DisplayMessage(timedMessages.Keys.First());
                        if (useRealTimeSwitch &&
                            realTimeSwitchIndex >= activateRealTimeSwitchIndex)
                        {
                            realTime = true;
                        }
                    }
                }

                timedMessages.Remove(timedMessages.Keys.First());

                if (timedMessages.Keys.Count > 0)
                {
                    nextMessageTime = GetNextMessageStartTime();
                }
            }
        }
コード例 #4
0
 private void SkipForward()
 {
     PopupHandler.SkipRealTimeMessages();
     ObjectiveIndex     = 6;
     freighter.position = rebelShips[0].position + SkipWaitFreighterOffset;
 }
コード例 #5
0
ファイル: Menu.cs プロジェクト: LinkPact/The-Sun-Will-Go-Out
        protected virtual void DefaultOnPressActions()
        {
            Popup.delayTimer = PressDelay;

            switch (menuOptions[cursorIndex])
            {
            case "Help":
                game.stateManager.ChangeState("HelpScreenState");
                DisplayMenuOnReturn(0);
                Hide();
                break;

            case "Ship Inventory":
                game.stateManager.ChangeState("ShipManagerState");
                DisplayMenuOnReturn(1);
                Hide();
                break;

            case "Mission Screen":
                game.stateManager.ChangeState("MissionScreenState");
                DisplayMenuOnReturn(2);
                Hide();
                break;

            case "Options":
                game.stateManager.ChangeState("OptionsMenuState");
                game.menuBGController.SetBackdropPosition(new Vector2(-903, -101));
                DisplayMenuOnReturn(3);
                Hide();
                break;

            case "Save":
                game.Save();
                PopupHandler.DisplayMessage("The game has been saved!");
                break;

            case "Exit Game":
                if (GameStateManager.currentState.Equals("OverworldState"))
                {
                    PopupHandler.DisplaySelectionMenu("What do you want to do?",
                                                      new List <string> {
                        "Save and exit to menu", "Save and exit to desktop", "Cancel"
                    },
                                                      new List <System.Action>());
                }

                else if (GameStateManager.currentState.Equals("ShooterState"))
                {
                    PopupHandler.DisplaySelectionMenu("What do you want to do? You cannot save during combat.",
                                                      new List <string> {
                        "Exit to menu without saving", "Exit to desktop without saving", "Cancel"
                    },
                                                      new List <System.Action>());
                }
                break;

            case "Return To Game":
                Hide();
                break;

            // Shooter state only
            case "Restart Level":
                game.stateManager.shooterState.CurrentLevel.ResetLevel();
                game.stateManager.shooterState.Initialize();
                game.stateManager.shooterState.CurrentLevel.Initialize();
                Hide();
                break;

            case "Give Up Level":
                game.stateManager.shooterState.CurrentLevel.GiveUpLevel();
                Hide();
                break;

            case "Exit Level":
                game.stateManager.shooterState.CurrentLevel.LeaveLevel();
                Hide();
                break;
            }
        }
コード例 #6
0
        public override void OnFailed()
        {
            base.OnFailed();

            PopupHandler.DisplayMessage("You could not gain control of the Murt, return to the Alliance fleet outside Telmun to try again.");
        }