コード例 #1
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();
                }
            }
        }