コード例 #1
0
 private void SkipMissionText()
 {
     MissionManager.MissionEventBuffer.Clear();
     BaseState.HideOverlay();
     BaseStateManager.ChangeMenuSubState("Overview");
     BaseStateManager.ActiveButton = BaseStateManager.AllButtons[BaseStateManager.ActiveButtonIndexY];
 }
コード例 #2
0
        protected MenuState(Game1 game, String name, BaseStateManager manager, BaseState baseState)
        {
            this.Game             = game;
            this.name             = name;
            this.BaseState        = baseState;
            this.BaseStateManager = manager;

            this.SpriteSheet = game.stateManager.planetState.SpriteSheet;
        }
コード例 #3
0
        public override void ButtonActions()
        {
            if (BaseStateManager.ButtonControl.Equals(ButtonControl.Menu) ||
                BaseStateManager.ButtonControl.Equals(ButtonControl.Second))
            {
                switch (BaseStateManager.ActiveButton.name)
                {
                case "Missions":
                {
                    BaseStateManager.MissionMenuState.DisplayAvailableMissions(MissionManager.ReturnAvailableMissions(BaseState.GetBase().name));
                    BaseStateManager.ChangeMenuSubState("Mission");
                    BaseStateManager.MissionMenuState.SelectMission();

                    break;
                }

                case "Rumors":
                {
                    BaseStateManager.RumorsMenuState.DisplayRumors();
                    break;
                }

                case "Buy/Sell":
                {
                    BaseStateManager.ChangeMenuSubState("Shop");

                    BaseStateManager.TextBoxes.Clear();
                    buttonBack.isVisible = false;
                    buttonShop.isVisible = false;
                    break;
                }

                case "Back":
                {
                    if (BaseStateManager.ActiveMenuState.Equals(BaseStateManager.OverviewMenuState))
                    {
                        if (StatsManager.gameMode != GameMode.Campaign)
                        {
                            Game.stateManager.ChangeState("OverworldState");
                        }
                        else
                        {
                            Game.stateManager.ChangeState("CampaignState");
                        }
                    }

                    break;
                }

                default:
                    break;
                }
            }
        }
コード例 #4
0
        public override void OnEnter()
        {
            foreach (MenuDisplayObject button in BaseStateManager.AllButtons)
            {
                button.isVisible = true;
            }

            BaseStateManager.ButtonControl = ButtonControl.Menu;

            CursorActions();

            MissionManager.CheckMissionLogic(Game);

            if (MissionManager.MissionStartBuffer.Count > 0)
            {
                BaseStateManager.ChangeMenuSubState("Mission");
                BaseStateManager.MissionMenuState.DisplayMissionStartBufferText();
                return;
            }

            if (MissionManager.MissionEventBuffer.Count > 0)
            {
                BaseStateManager.ChangeMenuSubState("Mission");
                BaseStateManager.MissionMenuState.MissionEvent();
                return;
            }

            if (BaseState.GetBase() != null)
            {
                if (MissionManager.ReturnCompletedMissions(BaseState.GetBase().name).Count <= 0 &&
                    MissionManager.ReturnFailedMissions(BaseState.GetBase().name).Count <= 0)
                {
                    CursorActions();
                }

                else if (MissionManager.ReturnCompletedMissions(BaseState.GetBase().name).Count > 0)
                {
                    BaseStateManager.ChangeMenuSubState("Mission");
                    BaseStateManager.MissionMenuState.DisplayMissionCompletedText();
                }

                else if (MissionManager.ReturnFailedMissions(BaseState.GetBase().name).Count > 0)
                {
                    BaseStateManager.ChangeMenuSubState("Mission");
                    BaseStateManager.MissionMenuState.DisplayMissionFailedText();
                }
            }
        }
コード例 #5
0
 public RumorsMenuState(Game1 game, String name, BaseStateManager manager, BaseState baseState) :
     base(game, name, manager, baseState)
 {
     configFileRumors = new ConfigFile();
     configFileRumors.Load("Data/rumordata.dat");
 }
コード例 #6
0
 public MissionMenuState(Game1 game, String name, BaseStateManager manager, BaseState baseState) :
     base(game, name, manager, baseState)
 {
 }
コード例 #7
0
        public void DisplayMissionAcceptText()
        {
            if (SelectedMission.AcceptText[0].ToLower().Equals("empty"))
            {
                MissionManager.MarkMissionAsActive(selectedMission.MissionID);
                BaseStateManager.ChangeMenuSubState("Overview");
                BaseStateManager.ActiveButton     = BaseStateManager.AllButtons[BaseStateManager.ActiveButtonIndexY];
                selectedMission.IntroductionText += "/ok";

                return;
            }
            if (selectedMission.RequiresAvailableSlot)
            {
                if (ShipInventoryManager.HasAvailableSlot())
                {
                    String[] temp = SelectedMission.AcceptText[selectedMission.AcceptIndex].Split('#');

                    SetPortraitFromText(temp[0]);

                    BaseStateManager.TextBoxes.Clear();

                    MissionManager.MarkMissionAsActive(selectedMission.MissionID);

                    SetTextRectangle();

                    BaseStateManager.TextBoxes.Add(TextUtils.CreateTextBox(BaseState.Game.fontManager.GetFont(14),
                                                                           tempRect, false, true, temp[0]));

                    if (temp.Length > 1)
                    {
                        for (int i = temp.Length - 1; i > 0; i--)
                        {
                            MissionManager.MissionEventBuffer.Insert(0, temp[i]);
                        }
                    }

                    missionCursorIndex = 0;

                    BaseStateManager.ButtonControl = ButtonControl.Confirm;

                    selectedMission.IntroductionText += "/ok";
                }

                else
                {
                    DisplayMissionAcceptFailedText();
                }
            }

            else
            {
                String[] temp = SelectedMission.AcceptText[selectedMission.AcceptIndex].Split('#');

                SetPortraitFromText(temp[0]);

                BaseStateManager.TextBoxes.Clear();

                MissionManager.MarkMissionAsActive(selectedMission.MissionID);

                SetTextRectangle();

                BaseStateManager.TextBoxes.Add(TextUtils.CreateTextBox(BaseState.Game.fontManager.GetFont(14),
                                                                       tempRect, false, true, temp[0]));

                if (temp.Length > 1)
                {
                    for (int i = temp.Length - 1; i > 0; i--)
                    {
                        MissionManager.MissionEventBuffer.Insert(0, temp[i]);
                    }
                }

                missionCursorIndex = 0;

                BaseStateManager.ButtonControl = ButtonControl.Confirm;

                selectedMission.IntroductionText += "/ok";
            }
        }
コード例 #8
0
        public override void ButtonActions()
        {
            //Actions for pressing Ok-key in "SELECTMISSION STATE"
            if (BaseStateManager.ButtonControl.Equals(ButtonControl.Mission))
            {
                BaseState.HideOverlay();

                if (missionCursorIndex == availableMissions.Count)
                {
                    BaseStateManager.TextBoxes.Clear();
                    BaseStateManager.ChangeMenuSubState("Overview");
                }

                else
                {
                    DisplayMissionIntroduction();
                }
            }

            //Actions for pressing Ok-key in "MISSION STATE"
            else if (BaseStateManager.ButtonControl.Equals(ButtonControl.Response))
            {
                if (BaseStateManager.HasTextBoxesFinishedScrolling())
                {
                    activeMission = MissionManager.GetActiveMission(BaseState.GetBase().name);

                    if (MissionManager.MissionResponseBuffer.Count > 0)
                    {
                        if (activeMission != null)
                        {
                            activeMission.MissionResponse = responseCursorIndex + 1;
                            activeMission.CurrentObjective.Update(StatsManager.PlayTime);
                            activeMission.MissionResponse = 0;
                            MissionEvent();
                        }
                    }

                    else
                    {
                        if (responseCursorIndex == 0)
                        {
                            DisplayMissionAcceptText();
                        }

                        else if (responseCursorIndex == 1)
                        {
                            BaseStateManager.ActiveButton = BaseStateManager.AllButtons[BaseStateManager.ActiveButtonIndexY];
                            BaseState.HideOverlay();
                            DisplayAvailableMissions(availableMissions);

                            SelectMission();
                        }
                    }
                }
                else
                {
                    FlushText();
                }
            }

            else if (BaseStateManager.ButtonControl.Equals(ButtonControl.Confirm))
            {
                if (TextFinishedScrolling())
                {
                    BaseState.HideOverlay();

                    if (selectedMission != null)
                    {
                        if (selectedMission.AcceptIndex + 1 < selectedMission.AcceptText.Count <string>())
                        {
                            selectedMission.AcceptIndex++;
                            DisplayMissionAcceptText();
                        }
                        else
                        {
                            BaseStateManager.ActiveButton = BaseStateManager.AllButtons[BaseStateManager.ActiveButtonIndexY];
                            BaseStateManager.ChangeMenuSubState("Overview");
                        }
                    }

                    else
                    {
                        BaseStateManager.ChangeMenuSubState("Overview");
                        BaseStateManager.ActiveButton = BaseStateManager.AllButtons[BaseStateManager.ActiveButtonIndexY];
                    }
                }
                else
                {
                    FlushText();
                }
            }
        }
コード例 #9
0
 public OverviewMenuState(Game1 game, String name, BaseStateManager manager, BaseState baseState) :
     base(game, name, manager, baseState)
 {
 }