コード例 #1
0
        public void DisplayFailedMissions(SpriteBatch spriteBatch)
        {
            spriteBatch.DrawString(Game.fontManager.GetFont(16), "Failed missions", new Vector2(MissionScreenState.GetRightRectangle.X + MissionScreenState.GetRightRectangle.Width / 2, 30) + Game.fontManager.FontOffset,
                                   txtColor, 0, Game.fontManager.GetFont(16).MeasureString("Failed missions") / 2, 1.0f, SpriteEffects.None, 0.5f);

            if (MissionManager.ReturnFailedDeadMissions().Count > 0)
            {
                int missionCount = 0;

                for (int n = 0; n < MissionManager.ReturnFailedDeadMissions().Count; n++)
                {
                    missionCount++;
                    if (n < MissionManager.ReturnFailedDeadMissions().Count)
                    {
                        spriteBatch.DrawString(Game.fontManager.GetFont(16), MissionManager.ReturnFailedDeadMissions()[n].MissionName, new Vector2(MissionScreenState.GetRightRectangle.X + edgePadding, 93 + n * 23) + Game.fontManager.FontOffset, txtColor);
                    }
                }

                if (layer == 2)
                {
                    spriteBatch.DrawString(Game.fontManager.GetFont(16), "Back", new Vector2(MissionScreenState.GetRightRectangle.X + edgePadding, 93 + missionCount * 23) + Game.fontManager.FontOffset, txtColor);
                }
            }

            else
            {
                spriteBatch.DrawString(Game.fontManager.GetFont(16), "No failed missions", new Vector2(MissionScreenState.GetRightRectangle.X + edgePadding, 93) + Game.fontManager.FontOffset, txtColor);
            }
        }
コード例 #2
0
        private void OnPressCursorLevel1()
        {
            if (cursorLevel1Position == 0 && MissionManager.ReturnActiveMissions().Count > 0)
            {
                cursorLevel          = 2;
                cursorLevel2Position = 0;
                elapsedSinceKey      = 0;
            }

            else if (cursorLevel1Position == 1 && MissionManager.ReturnCompletedDeadMissions().Count > 0)
            {
                cursorLevel          = 2;
                cursorLevel2Position = 0;
                elapsedSinceKey      = 0;
            }

            else if (cursorLevel1Position == 2 && MissionManager.ReturnFailedDeadMissions().Count > 0)
            {
                cursorLevel          = 2;
                cursorLevel2Position = 0;
                elapsedSinceKey      = 0;
            }

            else if (cursorLevel1Position == 3)
            {
                Game.stateManager.ChangeState("OverworldState");
                cursorLevel1Position = 0;
                elapsedSinceKey      = 0;
            }
        }
コード例 #3
0
 public void DisplayFailedMissionInfo(SpriteBatch spriteBatch)
 {
     if (layer == 2)
     {
         if (MissionManager.ReturnFailedDeadMissions().Count > 0)
         {
             if (var2 <= MissionManager.ReturnFailedDeadMissions().Count - 1)
             {
                 MissionManager.ReturnFailedDeadMissions()[var2].DisplayMissionInfo(spriteBatch, Game.fontManager.GetFont(16));
             }
         }
     }
 }
コード例 #4
0
        private void CheckMouseCursorLevel2()
        {
            List <Mission> missions;

            switch (cursorLevel1Position)
            {
            case 0:
                missions = MissionManager.ReturnActiveMissions();
                break;

            case 1:
                missions = MissionManager.ReturnCompletedDeadMissions();
                break;

            case 2:
                missions = MissionManager.ReturnFailedDeadMissions();
                break;

            default:
                missions = new List <Mission>();
                break;
            }

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

                if (ControlManager.IsMouseOverText(FontManager.GetFontStatic(14), text,
                                                   new Vector2(MissionScreenState.GetRightRectangle.X + Game1.ScreenSize.X / 16,
                                                               93 + i * 23) + Game.fontManager.FontOffset, Vector2.Zero, false))
                {
                    cursorLevel2Position = i;

                    if (ControlManager.IsLeftMouseButtonClicked() &&
                        i == missions.Count)
                    {
                        cursorLevel     = 1;
                        elapsedSinceKey = 0;
                    }
                }
            }
        }
コード例 #5
0
        private void CheckKeysCursorLevel2()
        {
            if (cursorLevel1Position == 0)
            {
                if (ControlManager.CheckPress(RebindableKeys.Down) && elapsedSinceKey > 100)
                {
                    cursorLevel2Position += 1;

                    if (cursorLevel2Position > MissionManager.ReturnActiveMissions().Count)
                    {
                        cursorLevel2Position = 0;
                    }

                    elapsedSinceKey = 0;
                }

                if (ControlManager.CheckPress(RebindableKeys.Up) && elapsedSinceKey > 100)
                {
                    cursorLevel2Position -= 1;
                    if (cursorLevel2Position < 0)
                    {
                        cursorLevel2Position = MissionManager.ReturnActiveMissions().Count;
                    }

                    elapsedSinceKey = 0;
                }

                if ((ControlManager.CheckPress(RebindableKeys.Action1) || ControlManager.CheckKeyPress(Keys.Enter)) &&
                    elapsedSinceKey > 100)
                {
                    int missionCount = MissionManager.ReturnActiveMissions().Count;

                    if (missionCount > 0 &&
                        cursorLevel2Position == missionCount)
                    {
                        cursorLevel = 1;
                    }

                    elapsedSinceKey = 0;
                }

                if (ControlManager.CheckPress(RebindableKeys.Action2) && elapsedSinceKey > 100)
                {
                    cursorLevel     = 1;
                    elapsedSinceKey = 0;
                }
            }

            else if (cursorLevel1Position == 1)
            {
                if (ControlManager.CheckPress(RebindableKeys.Down) && elapsedSinceKey > 100)
                {
                    cursorLevel2Position += 1;
                    if (cursorLevel2Position > MissionManager.ReturnCompletedDeadMissions().Count)
                    {
                        cursorLevel2Position = 0;
                    }

                    elapsedSinceKey = 0;
                }

                if (ControlManager.CheckPress(RebindableKeys.Up) && elapsedSinceKey > 100)
                {
                    cursorLevel2Position -= 1;
                    if (cursorLevel2Position < 0)
                    {
                        cursorLevel2Position = MissionManager.ReturnCompletedDeadMissions().Count;
                    }

                    elapsedSinceKey = 0;
                }

                if ((ControlManager.CheckPress(RebindableKeys.Action1) || ControlManager.CheckKeyPress(Keys.Enter)) &&
                    elapsedSinceKey > 100)
                {
                    int missionCount = MissionManager.ReturnCompletedDeadMissions().Count;

                    if (missionCount > 0 &&
                        cursorLevel2Position == missionCount)
                    {
                        cursorLevel = 1;
                    }

                    elapsedSinceKey = 0;
                }

                if (ControlManager.CheckPress(RebindableKeys.Action2) && elapsedSinceKey > 100)
                {
                    cursorLevel     = 1;
                    elapsedSinceKey = 0;
                }
            }

            else if (cursorLevel1Position == 2)
            {
                if (ControlManager.CheckPress(RebindableKeys.Down) && elapsedSinceKey > 100)
                {
                    cursorLevel2Position += 1;
                    if (cursorLevel2Position > MissionManager.ReturnFailedDeadMissions().Count)
                    {
                        cursorLevel2Position = 0;
                    }

                    elapsedSinceKey = 0;
                }

                if (ControlManager.CheckPress(RebindableKeys.Up) && elapsedSinceKey > 100)
                {
                    cursorLevel2Position -= 1;
                    if (cursorLevel2Position < 0)
                    {
                        cursorLevel2Position = MissionManager.ReturnFailedDeadMissions().Count;
                    }

                    elapsedSinceKey = 0;
                }

                if ((ControlManager.CheckPress(RebindableKeys.Action1) || ControlManager.CheckKeyPress(Keys.Enter)) &&
                    elapsedSinceKey > 100)
                {
                    int missionCount = MissionManager.ReturnFailedDeadMissions().Count;

                    if (missionCount > 0 &&
                        cursorLevel2Position == missionCount)
                    {
                        cursorLevel = 1;
                    }

                    elapsedSinceKey = 0;
                }

                if (ControlManager.CheckPress(RebindableKeys.Action2) && elapsedSinceKey > 100)
                {
                    cursorLevel     = 1;
                    elapsedSinceKey = 0;
                }
            }
        }