public void DisplayMissionFailedText()
        {
            BaseStateManager.TextBoxes.Clear();

            List <Mission> failedMissions = MissionManager.ReturnFailedMissions(BaseState.GetBase().name);

            String[] temp = failedMissions[0].FailedText.Split('#');

            SetPortraitFromText(temp[0]);

            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]);
                }
            }

            MissionManager.MarkFailedMissionAsDead(failedMissions[0].MissionID);

            BaseStateManager.ButtonControl = ButtonControl.Confirm;
        }
Example #2
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();
                }
            }
        }