diff --git a/MenuAPI/Menu.cs b/MenuAPI/Menu.cs index b79f18c..1fa4d15 100644 --- a/MenuAPI/Menu.cs +++ b/MenuAPI/Menu.cs @@ -699,10 +699,14 @@ public void GoUp() oldItem = MenuItems[CurrentIndex]; } - CurrentIndex--; if (CurrentIndex < 0) + if (CurrentIndex == 0) { CurrentIndex = Size - 1; } + else + { + CurrentIndex--; + } var currItem = GetCurrentMenuItem(); @@ -738,11 +742,15 @@ public void GoDown() oldItem = MenuItems[CurrentIndex]; } - CurrentIndex++; - if (CurrentIndex >= Size) + if (CurrentIndex > 0 && CurrentIndex >= Size - 1) { CurrentIndex = 0; } + else + { + CurrentIndex++; + } + var currItem = GetCurrentMenuItem(); if (currItem == null || !VisibleMenuItems.Contains(currItem)) {