keylist help (? i) fixes
I was implementing a routine to show all the key bindings when I discovered that we already have one. This fixes a few small problems: 'n' prefix for number entry was missing for number_pad mode. Meta+<direction> for running in number_pad mode was missing too. ^A was present but being suppressed by lack of #define for obsolete #if REDO. And ^C was shown as ^c while all other ^ characters appear in upper case. Once ^A appeared as the line before it, the inconsistency stood out. I also changed the slightly verbose "Shift-<direction>" and "Ctrl-<direction>" entries below the direction grid to use plus instead of minus signs. Plus emphasizes that two things are combined so seems more intuitive. (I left "M-c" alone.)
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.379 $ $NHDT-Date: 1607461111 2020/12/08 20:58:31 $
|
NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.380 $ $NHDT-Date: 1607471879 2020/12/08 23:57:59 $
|
||||||
|
|
||||||
General Fixes and Modified Features
|
General Fixes and Modified Features
|
||||||
-----------------------------------
|
-----------------------------------
|
||||||
@@ -320,6 +320,8 @@ when saving while punished or game ends while punished, handling for ball and
|
|||||||
chain might access freed memory with unpredictable consequences
|
chain might access freed memory with unpredictable consequences
|
||||||
brown pudding monster hitting another monster with decay attack corroded armor
|
brown pudding monster hitting another monster with decay attack corroded armor
|
||||||
instead of rotting it
|
instead of rotting it
|
||||||
|
<?> -> <full key bindings> omitted 'n' prefix and M-digit for number_pad mode,
|
||||||
|
and ^A/re-do was suppressed due lack of obsolete '#define REDO'
|
||||||
|
|
||||||
|
|
||||||
Fixes to 3.7.0-x Problems that Were Exposed Via git Repository
|
Fixes to 3.7.0-x Problems that Were Exposed Via git Repository
|
||||||
|
|||||||
38
src/cmd.c
38
src/cmd.c
@@ -1,4 +1,4 @@
|
|||||||
/* NetHack 3.7 cmd.c $NHDT-Date: 1607339290 2020/12/07 11:08:10 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.428 $ */
|
/* NetHack 3.7 cmd.c $NHDT-Date: 1607471879 2020/12/08 23:57:59 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.429 $ */
|
||||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/*-Copyright (c) Robert Patrick Rankin, 2013. */
|
/*-Copyright (c) Robert Patrick Rankin, 2013. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
@@ -2161,7 +2161,7 @@ dokeylist(VOID_ARGS)
|
|||||||
{
|
{
|
||||||
char buf[BUFSZ], buf2[BUFSZ];
|
char buf[BUFSZ], buf2[BUFSZ];
|
||||||
uchar key;
|
uchar key;
|
||||||
boolean keys_used[256] = {0};
|
boolean keys_used[256];
|
||||||
winid datawin;
|
winid datawin;
|
||||||
int i;
|
int i;
|
||||||
static const char
|
static const char
|
||||||
@@ -2186,12 +2186,14 @@ dokeylist(VOID_ARGS)
|
|||||||
"Prefix: run without picking up objects/fighting", FALSE },
|
"Prefix: run without picking up objects/fighting", FALSE },
|
||||||
{ NHKF_DOINV, "view inventory", TRUE },
|
{ NHKF_DOINV, "view inventory", TRUE },
|
||||||
{ NHKF_REQMENU, "Prefix: request a menu", FALSE },
|
{ NHKF_REQMENU, "Prefix: request a menu", FALSE },
|
||||||
#ifdef REDO
|
{ NHKF_COUNT,
|
||||||
|
"Prefix: for digits when prefixing a command with a count", TRUE },
|
||||||
{ NHKF_DOAGAIN , "re-do: perform the previous command again", FALSE },
|
{ NHKF_DOAGAIN , "re-do: perform the previous command again", FALSE },
|
||||||
#endif
|
|
||||||
{ 0, (const char *) 0, FALSE }
|
{ 0, (const char *) 0, FALSE }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
(void) memset((genericptr_t) keys_used, 0, sizeof keys_used);
|
||||||
|
|
||||||
datawin = create_nhwindow(NHW_TEXT);
|
datawin = create_nhwindow(NHW_TEXT);
|
||||||
putstr(datawin, 0, "");
|
putstr(datawin, 0, "");
|
||||||
putstr(datawin, 0, " Full Current Key Bindings List");
|
putstr(datawin, 0, " Full Current Key Bindings List");
|
||||||
@@ -2226,12 +2228,24 @@ dokeylist(VOID_ARGS)
|
|||||||
= keys_used[(uchar) C(g.Cmd.move_SE)] = TRUE;
|
= keys_used[(uchar) C(g.Cmd.move_SE)] = TRUE;
|
||||||
putstr(datawin, 0, "");
|
putstr(datawin, 0, "");
|
||||||
putstr(datawin, 0,
|
putstr(datawin, 0,
|
||||||
"Shift-<direction> will move in specified direction until you hit");
|
"Ctrl+<direction> will run in specified direction until something very");
|
||||||
putstr(datawin, 0, " a wall or run into something.");
|
Sprintf(buf, "%8s %s", "", "interesting is seen.");
|
||||||
putstr(datawin, 0,
|
putstr(datawin, 0, buf);
|
||||||
"Ctrl-<direction> will run in specified direction until something");
|
Strcpy(buf, "Shift");
|
||||||
putstr(datawin, 0, " very interesting is seen.");
|
} else {
|
||||||
|
/* num_pad */
|
||||||
|
keys_used[(uchar) M('1')] = keys_used[(uchar) M('2')]
|
||||||
|
= keys_used[(uchar) M('3')] = keys_used[(uchar) M('4')]
|
||||||
|
= keys_used[(uchar) M('6')] = keys_used[(uchar) M('7')]
|
||||||
|
= keys_used[(uchar) M('8')] = keys_used[(uchar) M('9')] = TRUE;
|
||||||
|
putstr(datawin, 0, "");
|
||||||
|
Strcpy(buf, "Meta");
|
||||||
}
|
}
|
||||||
|
Strcat(buf,
|
||||||
|
"+<direction> will run in specified direction until you encounter");
|
||||||
|
putstr(datawin, 0, buf);
|
||||||
|
Sprintf(buf, "%8s %s", "", "an obstacle.");
|
||||||
|
putstr(datawin, 0, buf);
|
||||||
|
|
||||||
putstr(datawin, 0, "");
|
putstr(datawin, 0, "");
|
||||||
putstr(datawin, 0, "Miscellaneous keys:");
|
putstr(datawin, 0, "Miscellaneous keys:");
|
||||||
@@ -2245,8 +2259,10 @@ dokeylist(VOID_ARGS)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifndef NO_SIGNAL
|
#ifndef NO_SIGNAL
|
||||||
putstr(datawin, 0, "^c break out of NetHack (SIGINT)");
|
|
||||||
keys_used[(uchar) C('c')] = TRUE;
|
keys_used[(uchar) C('c')] = TRUE;
|
||||||
|
Sprintf(buf, "%-8s %s", key2txt(C('c'), buf2),
|
||||||
|
"break out of NetHack (SIGINT)");
|
||||||
|
putstr(datawin, 0, buf);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
putstr(datawin, 0, "");
|
putstr(datawin, 0, "");
|
||||||
@@ -2778,7 +2794,7 @@ wiz_migrate_mons()
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
struct {
|
static struct {
|
||||||
int nhkf;
|
int nhkf;
|
||||||
char key;
|
char key;
|
||||||
const char *name;
|
const char *name;
|
||||||
|
|||||||
Reference in New Issue
Block a user