fix #K3357 - curses menu disappears
This fixes the disappearing menu, but not curses menu count entry failing to honor backspace/delete. Entering two or more digits to get a "Count:12" message, followed by non-digit which removes that, resulted in the menu for apply/loot in-out container operation vanishing while it was still waiting for a choice. (Typing a choice blindly did work.) The code intended to handle this. I don't understand why refresh() wasn't working. Reordering stuff didn't help until I changed that from refresh() to wrefresh(win). The original Count:123 display was limited to 25 characters and menus to half the main window, so they didn't overlap. I made the count display wider--because it is now also used for 'autodescribe' feedback when moving the cursor around the map--so made something that originally was impossible become possible. One line of the menu does get erased while "Count:" is displayed, but then gets put back by the wrefresh().
This commit is contained in:
@@ -754,6 +754,10 @@ curses: for vertical status, line up conditions in columns; usually two but
|
|||||||
curses: indent items in perm_invent window by one space
|
curses: indent items in perm_invent window by one space
|
||||||
curses: don't change the terminal's default colors
|
curses: don't change the terminal's default colors
|
||||||
curses: remove unnecessary special handling for dark gray
|
curses: remove unnecessary special handling for dark gray
|
||||||
|
curses: sometimes entering a count during menu selection caused the menu to
|
||||||
|
disappear (example was apply/loot in-out container menu with two or
|
||||||
|
more digits typed followed by non-digit); in-out menu was still active
|
||||||
|
but no longer displayed
|
||||||
macOS: Xcode project was failing to build if the path to the NetHack source
|
macOS: Xcode project was failing to build if the path to the NetHack source
|
||||||
tree contained a space; the issue was within some shell script code
|
tree contained a space; the issue was within some shell script code
|
||||||
contained within the project
|
contained within the project
|
||||||
|
|||||||
@@ -1497,12 +1497,15 @@ menu_get_selections(WINDOW *win, nhmenu *menu, int how)
|
|||||||
default:
|
default:
|
||||||
if (isdigit(curletter)) {
|
if (isdigit(curletter)) {
|
||||||
count = curses_get_count(curletter - '0');
|
count = curses_get_count(curletter - '0');
|
||||||
touchwin(win);
|
/* after count, we know some non-digit is already pending */
|
||||||
refresh();
|
|
||||||
curletter = getch();
|
curletter = getch();
|
||||||
if (count > 0) {
|
count_letter = (count > 0) ? curletter : '\0';
|
||||||
count_letter = curletter;
|
|
||||||
}
|
/* remove the count wind (erases last line of message wind) */
|
||||||
|
curses_count_window(NULL);
|
||||||
|
/* force redraw of the menu that is receiving the count */
|
||||||
|
touchwin(win);
|
||||||
|
wrefresh(win);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ curses_read_char(void)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (counting && !isdigit(ch)) { /* Dismiss count window if necissary */
|
if (counting && !isdigit(ch)) { /* dismiss count window if necessary */
|
||||||
curses_count_window(NULL);
|
curses_count_window(NULL);
|
||||||
curses_refresh_nethack_windows();
|
curses_refresh_nethack_windows();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user