Пример #1
0
        public void UpdateMenu(InputManager input, TypingManager typingManager, List <MessagePopup> popups, ContentManager content, Camera cam, GameTime gt, List <TowerConstruct> schematics, List <Tower> towers, PlayerStats userData)
        {
            m_dropMenu.UpdateMenu(input);

            // Open a tower from the menu
            OpenTower(schematics, towers);

            // Update the general buttons
            m_backButton.UpdateMe(input);
            m_saveButton.UpdateMe(input);
            m_newTowerButton.UpdateMe(input);

            // Update the controls
            m_controls.UpdateControls(input, typingManager, popups, m_construct, m_tower, content, cam, gt);

            // Create new tower
            CreateNewTower(content);

            // Update the construct
            m_construct.UpdateConstruct(gt);

            // Saving mechanics
            SaveTower(popups, content, schematics, towers);

            // Handle menus and menu options
            PartMenuHandler(input, userData);
        }
        public void UpdateMenu(PlayerStats userData, InputManager input)
        {
            m_backButton.UpdateMe(input);

            for (int i = 0; i < m_achievemenyRows.Count; i++)
            {
                for (int k = 0; k < m_achievemenyRows[i].Buttons.Count; k++)
                {
                    m_achievemenyRows[i].Buttons[k].UpdateMe(input);

                    HandleLockedAchievements(userData, i, k);
                }
            }
        }
Пример #3
0
        public void UpdateMenu(InputManager input)
        {
            m_dropButton.UpdateMe(input);

            if (m_dropButton.IsPressed && !m_hasDropped)
            {
                m_hasDropped = true;
            }
            else if (m_dropButton.IsPressed && m_hasDropped)
            {
                m_hasDropped = false;
            }

            // If the menu has dropped/been activated
            if (m_hasDropped)
            {
                // Update each button
                for (int i = 0; i < m_selectionButtons.Count; i++)
                {
                    m_selectionButtons[i].UpdateMe(input);
                }

                // Scroll through menu options
                if (m_scrollRect.Contains(input.Mouse.X, input.Mouse.Y))
                {
                    if (input.Mouse.ScrollWheelValue > m_scroll)
                    {
                        m_min--;
                    }
                    else if (input.Mouse.ScrollWheelValue < m_scroll)
                    {
                        m_min++;
                    }

                    // Lock the scrolling mechanism, so that when there are 5 or more buttons, only 5 will show
                    if (m_min < 0)
                    {
                        m_min = 0;
                    }
                    else if (m_selectionButtons.Count < 5)
                    {
                        m_min = 0;
                    }
                    else if (m_min > m_selectionButtons.Count - 5)
                    {
                        m_min = m_selectionButtons.Count - 5;
                    }
                }

                m_max = m_min + 5;

                if (m_hasDropped)
                {
                    // Set the "Clickableness" of the button
                    for (int i = 0; i < m_selectionButtons.Count; i++)
                    {
                        if (i >= m_min && i < m_max)
                        {
                            m_selectionButtons[i].IsClickable = true;
                        }
                        else
                        {
                            m_selectionButtons[i].IsClickable = false;
                        }
                    }
                }
            }

            m_scroll = input.Mouse.ScrollWheelValue;
        }