From 546c1101b0d4a942fc39fa9ebb50516fbe620612 Mon Sep 17 00:00:00 2001 From: PatR Date: Sat, 12 Oct 2024 15:03:54 -0700 Subject: [PATCH] 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. --- src/restore.c | 10 ++++++---- win/Qt/Qt-issues.txt | 6 ++++++ win/Qt/qt_svsel.cpp | 10 +++------- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/restore.c b/src/restore.c index 434cd5aaa..fcf31f3fb 100644 --- a/src/restore.c +++ b/src/restore.c @@ -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); diff --git a/win/Qt/Qt-issues.txt b/win/Qt/Qt-issues.txt index a7418f984..1bac3106c 100644 --- a/win/Qt/Qt-issues.txt +++ b/win/Qt/Qt-issues.txt @@ -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. + ----- diff --git a/win/Qt/qt_svsel.cpp b/win/Qt/qt_svsel.cpp index ffe22a19c..882fabce7 100644 --- a/win/Qt/qt_svsel.cpp +++ b/win/Qt/qt_svsel.cpp @@ -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