Пример #1
0
        private static void SpecificCharactersPageControls(ActionKey key)
        {
            bool bChangeMatrix = false;

            if (GameMenuHandler.charTabList.Count > 2 && key.actionIndentifierString.Equals(Game1.cameraMoveDownString) && -GameMenuHandler.characterTabVerticalModifier <= GameMenuHandler.charTabList[GameMenuHandler.charTabList.Count - 2].tabLocation.Y - 25)
            {
                GameMenuHandler.characterTabVerticalModifier -= 4.2f;
                bChangeMatrix = true;
            }

            if (GameMenuHandler.charTabList.Count > 2 && key.actionIndentifierString.Equals(Game1.cameraMoveUpString) && GameMenuHandler.characterTabVerticalModifier < 0)
            {
                GameMenuHandler.characterTabVerticalModifier += 4.2f;
                bChangeMatrix = true;
            }

            if (GameMenuHandler.CharacterTabContainsMouse())
            {
                if (!KeyboardMouseUtility.AnyButtonsPressed() && key.actionIndentifierString.Equals(Game1.confirmString))
                {
                    var selectedTab = GameMenuHandler.selectedCharacterTab();
                    if (!selectedTab.Equals(default(GameMenuHandler.CharacterTabdisplay)))
                    {
                        GameMenuHandler.selectedCharacterContext = new CharacterContextMenu(GameMenuHandler.characterTabVerticalModifier, new Point(100, 50), new Point(100, 150), selectedTab);
                    }
                }
            }

            if (GameMenuHandler.charTabList.Count > 2 && KeyboardMouseUtility.ScrollingDown() && -GameMenuHandler.characterTabVerticalModifier <= GameMenuHandler.charTabList[GameMenuHandler.charTabList.Count - 2].tabLocation.Y - 25)
            {
                GameMenuHandler.characterTabVerticalModifier -= 4.2f * 4;
                bChangeMatrix = true;
            }

            if (GameMenuHandler.charTabList.Count > 2 && KeyboardMouseUtility.ScrollingUp() && GameMenuHandler.characterTabVerticalModifier < 0)
            {
                GameMenuHandler.characterTabVerticalModifier += 4.2f * 4;
                bChangeMatrix = true;
            }

            if (bChangeMatrix)
            {
                GameMenuHandler.characterTabAdjustedMatrix = Matrix.CreateTranslation(new Vector3(0, GameMenuHandler.characterTabVerticalModifier, 1));
            }
        }