curses askname()

Noticed when implementing restore-via-menu for curses a couple
of days ago:  The "Who are you?" prompt wouldn't let me cancel
out via <escape>.  I created a character named '\033' which was
displayed as "^[" during play and produced a save file shown by
'ls' as "501?.Z".

To fix this properly, we will need to replace use of wgetnstr()
with something of our own.  That's more work than I feel like
tackling.  This fakes ESC handling if the player is willing to
type <escape><return> rather than just <escape> when terminating
the prompt.
This commit is contained in:
PatR
2021-01-04 18:01:49 -08:00
parent eb91a031f9
commit 2a9a18fa2f
2 changed files with 39 additions and 10 deletions

View File

@@ -1,4 +1,4 @@
NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.418 $ $NHDT-Date: 1609642144 2021/01/03 02:49:04 $
NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.420 $ $NHDT-Date: 1609811543 2021/01/05 01:52:23 $
General Fixes and Modified Features
-----------------------------------
@@ -482,6 +482,11 @@ remove unused vision tables
curses: 'msg_window' option wasn't functional for curses unless the binary
also included tty support
curses: line input that doesn't take place on the bottom line of the message
window or in a popup doesn't support ESC to kill partial input or to
cancel; "Who are you?" prompt was willing to name a character "^[";
have askname() fake the usual ESC handling, but player has to type
<escape><return> for that to work
Qt: at Xp levels above 20 with 'showexp' On, the combined status field
"Level:NN/nnnnnnnn" was too big and truncated by a char at each end
Qt: searching a text window for something that wasn't found and then searching