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;
                }
            }
        }
 public override void OnEnter()
 {
     availableMissions = MissionManager.ReturnAvailableMissions(BaseState.GetBase().name);
     BaseStateManager.OverviewMenuState.ButtonMission.isSelected = true;
 }
        public override void Update(GameTime gameTime)
        {
            if (BaseState.GetBase() != null)
            {
                availableMissions = MissionManager.ReturnAvailableMissions(BaseState.GetBase().name);
            }

            if (BaseStateManager.ButtonControl.Equals(ButtonControl.Mission) ||
                BaseStateManager.ButtonControl.Equals(ButtonControl.Response))
            {
                missionCursor.isActive  = true;
                missionCursor.isVisible = true;
            }

            else
            {
                missionCursor.isActive  = false;
                missionCursor.isVisible = false;
            }


            if (BaseStateManager.ButtonControl == ButtonControl.Mission)
            {
                //Moves button cursor right when pressing up.
                if (ControlManager.CheckPress(RebindableKeys.Up))
                {
                    missionCursorIndex--;
                }

                //Moves button cursor left when pressing down
                else if (ControlManager.CheckPress(RebindableKeys.Down))
                {
                    missionCursorIndex++;
                }

                if (MissionCursorIndex > availableMissions.Count)
                {
                    missionCursorIndex = 0;
                }

                else if (MissionCursorIndex < 0)
                {
                    missionCursorIndex = availableMissions.Count;
                }

                for (int i = 0; i < availableMissions.Count + 1; i++)
                {
                    String text = i != availableMissions.Count ? availableMissions[i].MissionName : "Back";

                    if (ControlManager.IsMouseOverText(FontManager.GetFontStatic(14), text,
                                                       new Vector2(Game1.ScreenSize.X / 2,
                                                                   Game1.ScreenSize.Y / 2 - 40 + (20 * (i + (i == availableMissions.Count ? 1 : 0)))
                                                                   + FindTextBoxWithText(text).TextBoxRect.Height)))
                    {
                        if (ControlManager.IsMouseMoving())
                        {
                            missionCursorIndex = i;
                        }
                    }
                }

                if (availableMissions.Count > 0 && missionCursorIndex != availableMissions.Count)
                {
                    selectedMission = availableMissions[MissionCursorIndex];
                }
            }

            else if (BaseStateManager.ButtonControl == ButtonControl.Response)
            {
                //Moves button cursor right when pressing up.
                if (ControlManager.CheckPress(RebindableKeys.Up))
                {
                    responseCursorIndex--;
                }

                //Moves button cursor left when pressing down
                else if (ControlManager.CheckPress(RebindableKeys.Down))
                {
                    responseCursorIndex++;
                }

                if (MissionManager.MissionResponseBuffer.Count <= 0)
                {
                    if (ControlManager.IsMouseOverArea(new Rectangle(
                                                           BaseStateManager.ResponseRectangles[0].X - (int)FontManager.GetFontStatic(14).MeasureString(selectedMission.PosResponse).X / 2,
                                                           BaseStateManager.ResponseRectangles[0].Y + BaseStateManager.ResponseRectangles[0].Height / 2,
                                                           (int)FontManager.GetFontStatic(14).MeasureString(selectedMission.PosResponse).X,
                                                           (int)FontManager.GetFontStatic(14).MeasureString(selectedMission.PosResponse).Y)))
                    {
                        responseCursorIndex = 0;
                    }

                    else if (ControlManager.IsMouseOverArea(new Rectangle(
                                                                BaseStateManager.ResponseRectangles[1].X - (int)FontManager.GetFontStatic(14).MeasureString(selectedMission.NegResponse).X / 2,
                                                                BaseStateManager.ResponseRectangles[1].Y + BaseStateManager.ResponseRectangles[1].Height / 2,
                                                                (int)FontManager.GetFontStatic(14).MeasureString(selectedMission.NegResponse).X,
                                                                (int)FontManager.GetFontStatic(14).MeasureString(selectedMission.NegResponse).Y)))
                    {
                        responseCursorIndex = 1;
                    }

                    if (responseCursorIndex > 1)
                    {
                        responseCursorIndex = 0;
                    }

                    else if (responseCursorIndex < 0)
                    {
                        responseCursorIndex = 1;
                    }
                }

                else
                {
                    for (int i = 0; i < MissionManager.MissionResponseBuffer.Count; i++)
                    {
                        if (ControlManager.IsMouseOverArea(new Rectangle(
                                                               BaseStateManager.ResponseRectangles[i].X - (int)FontManager.GetFontStatic(14).MeasureString(MissionManager.MissionResponseBuffer[i]).X / 2,
                                                               BaseStateManager.ResponseRectangles[i].Y + BaseStateManager.ResponseRectangles[i].Height / 2,
                                                               (int)FontManager.GetFontStatic(14).MeasureString(MissionManager.MissionResponseBuffer[i]).X,
                                                               (int)FontManager.GetFontStatic(14).MeasureString(MissionManager.MissionResponseBuffer[i]).Y)))
                        {
                            responseCursorIndex = i;
                        }
                    }

                    if (responseCursorIndex > MissionManager.MissionResponseBuffer.Count - 1)
                    {
                        responseCursorIndex = 0;
                    }

                    else if (responseCursorIndex < 0)
                    {
                        responseCursorIndex = MissionManager.MissionResponseBuffer.Count - 1;
                    }
                }
            }

            if (BaseStateManager.ButtonControl != ButtonControl.Response &&
                ControlManager.CheckPress(RebindableKeys.Pause))
            {
                SkipMissionText();
            }
            else
            {
                base.Update(gameTime);
            }
        }