more 'selectsaved'

If the saved game menu has more than 13 games, it won't be able to
use 'n' for "new game" and 'q' for "quit".  Switch to 'N' and 'Q'
instead of just using the next letters in sequence.  Only resort to
next-letters if there are more than 39 games.

tty and curses handle a list of many save files via menu pagination.
X11 does so with one long page possessing a scroll bar.  If there
are more than 52 entries, selection via mouse is needed beyond 'Z'.

Qt has one page without any scroll bar so won't provide access to
the full set of save files when there are too many to fit on the
screen.
This commit is contained in:
PatR
2024-10-12 15:03:54 -07:00
parent 35cf713988
commit 546c1101b0
3 changed files with 15 additions and 11 deletions

View File

@@ -1478,13 +1478,15 @@ restore_menu(
add_menu(tmpwin, &nul_glyphinfo, &any, 0, 0, ATR_NONE, clr,
menutext, MENU_ITEMFLAGS_SKIPMENUCOLORS);
}
clet = (k <= 'n' - 'a') ? 'n' : 0; /* new game */
clet = (k <= 'n' - 'a') ? 'n' /* new game */
: (k <= 26 + 'N' - 'A') ? 'N' : 0;
any.a_int = -1; /* not >= 0 */
add_menu(tmpwin, &nul_glyphinfo, &any, clet, 0, ATR_NONE, clr,
add_menu(tmpwin, &nul_glyphinfo, &any, clet, 'N', ATR_NONE, clr,
"Start a new character", MENU_ITEMFLAGS_NONE);
clet = (k + 1 <= 'q' - 'a') ? 'q' : 0; /* quit */
clet = (k + 1 <= 'q' - 'a' && clet == 'n') ? 'q' /* quit */
: (k + 1 <= 26 + 'Q' - 'A' && clet == 'N') ? 'Q' : 0;
any.a_int = -2;
add_menu(tmpwin, &nul_glyphinfo, &any, clet, 0, ATR_NONE, clr,
add_menu(tmpwin, &nul_glyphinfo, &any, clet, 'Q', ATR_NONE, clr,
"Never mind (quit)", MENU_ITEMFLAGS_SELECTED);
/* no prompt on end_menu, as we've done our own at the top */
end_menu(tmpwin, (char *) 0);