Пример #1
0
        /// <summary>
        /// Detect if any buttons/relevant keybinds are being pressed.
        /// </summary>
        /// <param name="gameTime">Game time.</param>
        public override void Update(GameTime gameTime)
        {
            // If "escape" or "delete" was pressed, go back to the Song select
            while (InputManager.PressActions.Count > 0)
            {
                KeyValuePair <double, Keys> press = InputManager.PressActions.Dequeue();

                if (press.Value == Keys.Escape || press.Value == Keys.Delete)
                {
                    ScreenManager.RemoveScreen(true);
                }
            }

            // Were the retry or back buttons clicked?
            if (InputManager.IsLeftClick())
            {
                Point pos = InputManager.LastMouseClick.Key.Position;

                if (buttonBack.Hovered(pos))
                {
                    buttonBack.OnClick();
                }
                else if (buttonRetry.Hovered(pos))
                {
                    buttonRetry.OnClick(beatmap);
                }
            }
        }
Пример #2
0
        private void handleSingleClicks()
        {
            Point pos = InputManager.LastMouseClick.Key.Position;

            if (InputManager.IsLeftClick())
            {
                if (button_back.Hovered(pos))
                {
                    button_back.OnClick();
                }

                if (button_save.Hovered(pos))
                {
                    button_save.OnClick(this);
                }

                foreach (SettingsGroup settingsGroup in Groups)
                {
                    if (settingsGroup.Hovered(pos))
                    {
                        settingsGroup.OnClick(pos, false);
                    }
                }
            }
        }