/// <summary> /// Sets the current menu for the user to the desired menu. If menu option doesn't exist, nothing will change. /// </summary> /// <param name="menuId">The id assigned to the menu in the list.</param> public void GoTo(int optionId) { if (currentMenu.MenuOptionExists(optionId) && !rateLimited) { BeginRateLimit(); currentMenu = currentMenu.GetMenuByOptionId(optionId); currentMenu.Display(user); RefreshTimeOut(); } }
private void DrawMenuItem(int index) { IMenuItem menuItemToDraw = menuItems[index]; int? visibleIndex = menuItems.CalculateVisibleIndex(menuItemToDraw); if (visibleIndex.HasValue && visibleIndex.Value >= 0) { int left = itemsLocation.Left; int top = itemsLocation.Top + visibleIndex.Value; Console.SetCursorPosition(left, top); Size menuItemSize = new Size(InnerSize.Width, 1); bool isHighlighted = menuItemToDraw == menuItems.CurrentItem; menuItemToDraw.Display(menuItemSize, isHighlighted); } }
public void DisplayCurrentMenu() { currentMenu.oneTimeMessage = GetQueuedMessages(); currentMenu.Display(user); }