protected void NavigateThroughNextChoices(FMOD.FMODSound sndSelection, FMOD.FMODSound sndConfirm)
        {
            if (InputHelper.InputUpPressed())
            {
                ActionMenuCursor -= (ActionMenuCursor > 0) ? 1 : 0;

                sndSelection.Play();
            }
            else if (InputHelper.InputDownPressed())
            {
                ActionMenuCursor += (ActionMenuCursor < ListNextChoice.Count - 1) ? 1 : 0;

                sndSelection.Play();
            }
            else if (MouseHelper.MouseMoved())
            {
                int X = MenuX;
                int Y = MenuY;

                if (X + ActionMenuWidth >= Constants.Width)
                {
                    X = Constants.Width - ActionMenuWidth;
                }

                int MenuHeight = (ListNextChoice.Count) * PannelHeight + 6 * 2;
                if (Y + MenuHeight >= Constants.Height)
                {
                    Y = Constants.Height - MenuHeight;
                }

                if (MouseHelper.MouseStateCurrent.X >= X && MouseHelper.MouseStateCurrent.X < X + MinActionMenuWidth &&
                    MouseHelper.MouseStateCurrent.Y >= Y + 6 && MouseHelper.MouseStateCurrent.Y < Y + MenuHeight - 12)
                {
                    int NewValue = (MouseHelper.MouseStateCurrent.Y - Y - 6) / PannelHeight;
                    if (NewValue != ActionMenuCursor)
                    {
                        ActionMenuCursor = NewValue;

                        sndSelection.Play();
                    }
                }
            }
            else if (InputHelper.InputConfirmPressed())
            {
                AddToPanelListAndSelect(ListNextChoice[ActionMenuCursor]);
                sndConfirm.Play();
            }
        }
示例#2
0
        protected void NavigateThroughNextChoices(FMOD.FMODSound sndSelection, FMOD.FMODSound sndConfirm)
        {
            if (ActiveInputManager.InputUpPressed())
            {
                ActionMenuCursor -= (ActionMenuCursor > 0) ? 1 : 0;

                sndSelection.Play();
            }
            else if (ActiveInputManager.InputDownPressed())
            {
                ActionMenuCursor += (ActionMenuCursor < ListNextChoice.Count - 1) ? 1 : 0;

                sndSelection.Play();
            }
            else if (ActiveInputManager.InputMovePressed())
            {
                for (int C = 0; C < ListNextChoice.Count; C++)
                {
                    if (ActiveInputManager.IsInZone(FinalMenuX, FinalMenuY + 6 + C * PannelHeight, FinalMenuX + ActionMenuWidth, FinalMenuY + 6 + (C + 1) * PannelHeight))
                    {
                        if (ActionMenuCursor != C)
                        {
                            ActionMenuCursor = C;
                            sndSelection.Play();
                        }
                        break;
                    }
                }
            }
            else if (ActiveInputManager.InputConfirmPressed(FinalMenuX, FinalMenuY + 6 + ActionMenuCursor * PannelHeight,
                                                            FinalMenuX + ActionMenuWidth, FinalMenuY + 6 + (ActionMenuCursor + 1) * PannelHeight))
            {
                AddToPanelListAndSelect(ListNextChoice[ActionMenuCursor]);
                sndConfirm.Play();
            }
        }