예제 #1
0
        protected void MoveCursor(bool up)
        {
            CurrentItem.Deselect();
            for (int i = 0; i < items.Count; i++)
            {
                if (up)
                {
                    cursor--;
                    if (cursor < 0)
                    {
                        cursor = items.Count - 1;
                    }
                }
                else
                {
                    cursor++;
                    if (cursor >= items.Count)
                    {
                        cursor = 0;
                    }
                }

                CurrentItem = items[cursor];
                if (CurrentItem.Enabled)
                {
                    CurrentItem.Select();
                    UpdateHelpText();
                    break;
                }
            }
            PlaySound(sndBrowse);
        }
예제 #2
0
        public override void Close()
        {
            base.Close();
            Back.Hide();
            helpVis.Hide();
            for (int i = 0; i < Items.Count; i++)
            {
                Items[i].Hide();
            }

            CurrentItem?.Deselect();

            isOpen = false;
        }
예제 #3
0
 protected void SetCursor(int i)
 {
     if (i >= 0 && i < items.Count)
     {
         MainMenuItem newItem = items[i];
         if (newItem.Enabled)
         {
             CurrentItem.Deselect();
             cursor      = i;
             CurrentItem = newItem;
             CurrentItem.Select();
             UpdateHelpText();
         }
     }
 }
예제 #4
0
        protected void SetCursor(int i)
        {
            if (i >= 0 && i < Items.Count)
            {
                MainMenuItem newItem = Items[i];
                if (newItem.Enabled)
                {
                    CurrentItem?.Deselect();
                    cursor      = i;
                    CurrentItem = newItem;
                    CurrentItem.Select();
                    UpdateHelpText();
                }

                CursorChanged?.Invoke(this);
            }
        }
예제 #5
0
        protected void MoveCursor(bool up)
        {
            //We do not have any items so we can not change the selected item.
            if ((Items?.Count ?? 0) <= 0)
            {
                return;
            }

            CurrentItem?.Deselect();


            for (int i = 0; i < Items.Count; i++)
            {
                if (up)
                {
                    cursor--;
                    if (cursor < 0)
                    {
                        cursor = Items.Count - 1;
                    }
                }
                else
                {
                    cursor++;
                    if (cursor >= Items.Count)
                    {
                        cursor = 0;
                    }
                }

                CurrentItem = Items[cursor];
                if (CurrentItem.Enabled)
                {
                    CurrentItem.Select();
                    UpdateHelpText();
                    break;
                }
            }
            PlaySound(sndBrowse);
            CursorChanged?.Invoke(this);
        }