X11 had been ignoring add_menu(..., MENU_SELECTED) to specify a pre-selected menu entry. This adds support for that. Attempt to implement pre-selected entry for PICK_ONE menu sanely by returning the pre-selected entry instead of toggling it off if the user chooses it explicitly. Inner workings of menus are convoluted so I'm not sure it's 100% correct, although testing hasn't found any problems. (tty currently returns 0 for "nothing picked" when explicitly picking a pre-selected entry in a PICK_ONE menu, and the core jumps through hoops to handle it. That can't be cleaned up until all interfaces which support pre-selected entries achieve sanity.) Make "random" be chosen for <return> or <enter> during role selection and highlight it to reflect that. (Role selection for X11 uses its own code instead of nethack menus, so pre-selection isn't applicable.)
16 KiB
16 KiB