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);

View File

@@ -59,4 +59,10 @@ The status window can't be resized while hitpointbar is active.
Toggling it off, resizing as desired, then toggling it back on is a
viable workaround.
When choosing a saved game to restore ('selectsaved' option), the
selection dialog does not provide any way to scroll if there are more
games than will fit on the screen. Access to "New game" and "Quit"
isn't affected because those both have distinct buttons rather than
rely on fake save file entries at the end of the list.
-----

View File

@@ -23,13 +23,9 @@
// ... as many buttons as needed
//----
//
// TODO?
// Character names are sorted alphabetically. It would be useful to
// be able to sort by role or by game start date or by save date.
// The core fetches character names from inside the files; it could
// obtain the information needed for alternate sorting. Simpler
// enhancement: instead of just showing the character name, show
// "name-role-race-gender-alignment".
// FIXME:
// If there are a lot of saved games available, the selection dialog
// needs vertical scrolling capability.
//
// Note:
// The code in this file is not used if the program is built without