public void DisplayMissionCompletedText()
        {
            if (MissionManager.MissionEventBuffer.Count <= 0)
            {
                List <String> temp = new List <String>();

                Game.SaveOnEnterOverworld = true;

                BaseStateManager.TextBoxes.Clear();

                List <Mission> completedMissions = MissionManager.ReturnCompletedMissions(BaseState.GetBase().name);

                foreach (String str in completedMissions[0].CompletedText.Split('#'))
                {
                    temp.Add(str);
                }

                SetPortraitFromText(temp[0]);
                SetTextRectangle();

                if (HasReward(completedMissions[0]))
                {
                    if (HasRewardItem(completedMissions[0]))
                    {
                        if (ShipInventoryManager.HasAvailableSlot())
                        {
                            temp.Add(GetRewardText(completedMissions[0]));
                        }

                        else
                        {
                            temp.Add(GetNoEmptySlotText(completedMissions[0]));
                        }
                    }
                    else
                    {
                        temp.Add(GetRewardText(completedMissions[0]));
                    }
                }

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

                MissionManager.MarkCompletedMissionAsDead(completedMissions[0].MissionID);

                BaseStateManager.ButtonControl = ButtonControl.Confirm;

                for (int i = 1; i < temp.Count; i++)
                {
                    MissionManager.MissionEventBuffer.Add(temp[i]);
                }
            }
        }
Ejemplo n.º 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();
                }
            }
        }