tweaks to a few command flags

The #twoweapon command was flagged as autocomplete back when using
an extended command was the only way to execute it.  Take that off
since simple 'X' suffices.  Do the same for wizard mode commands
that can be invoked with control characters.  Probably ought to do
the same for #overview too but this change doesn't.

I started to add the autocomplete flag for #exploremode but that
would require an extra letter for #enhance so I decided not to.

There are some wizard mode commands that can't be executed under
X11 because they aren't flagged to autocomplete and its extended
command selection widget only offers autocomplete commands as
choices.  I haven't attempted to change that.

Always require paranoid confirmation for #panic rather than just
when it has been enabled for #quit.
This commit is contained in:
PatR
2021-04-11 14:13:52 -07:00
parent 7aa62b27de
commit 7856f5a5d8
2 changed files with 24 additions and 11 deletions
+5 -1
View File
@@ -1,4 +1,4 @@
NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.498 $ $NHDT-Date: 1617388018 2021/04/02 18:26:58 $ NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.503 $ $NHDT-Date: 1618175625 2021/04/11 21:13:45 $
General Fixes and Modified Features General Fixes and Modified Features
----------------------------------- -----------------------------------
@@ -445,6 +445,10 @@ for menustyle:full, the 'A' menu choice to auto-select everything now only
using travel to move one step diagonally where that step was blocked by being using travel to move one step diagonally where that step was blocked by being
too narrow to squeeze through stopped travel instead of considering too narrow to squeeze through stopped travel instead of considering
alternate routes to the destination alternate routes to the destination
turn off input autocompletion for '#twoweapon' since simple 'X' invokes it;
likewise for #wizdetect (^E), #wizgenesis (^G), #wizidentify (^I),
#wizlevelport (^V), #wizmap (^F), and #wizwish (^W); probably ought
to do so for #overview (^O) too but that one still autocompletes
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
+19 -10
View File
@@ -1,4 +1,4 @@
/* NetHack 3.7 cmd.c $NHDT-Date: 1613721260 2021/02/19 07:54:20 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.457 $ */ /* NetHack 3.7 cmd.c $NHDT-Date: 1618175625 2021/04/11 21:13:45 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.463 $ */
/* 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. */
@@ -1140,7 +1140,7 @@ wiz_panic(void)
u.uen = u.uenmax = 1000; u.uen = u.uenmax = 1000;
return 0; return 0;
} }
if (paranoid_query(ParanoidQuit, if (paranoid_query(TRUE,
"Do you want to call panic() and end your game?")) "Do you want to call panic() and end your game?"))
panic("Crash test."); panic("Crash test.");
return 0; return 0;
@@ -1786,7 +1786,11 @@ doterrain(void)
return 0; /* no time elapses */ return 0; /* no time elapses */
} }
/* ordered by command name */ /* extcmdlist: full command list, ordered by command name;
commands with no keystroke or with only a meta keystroke generally
need to be flagged as autocomplete and ones with a regular keystroke
or control keystroke generally should not be; there are a few exceptions
such as ^O/#overview and C/N/#name */
struct ext_func_tab extcmdlist[] = { struct ext_func_tab extcmdlist[] = {
{ '#', "#", "perform an extended command", { '#', "#", "perform an extended command",
doextcmd, IFBURIED | GENERALCMD, NULL }, doextcmd, IFBURIED | GENERALCMD, NULL },
@@ -1826,6 +1830,8 @@ struct ext_func_tab extcmdlist[] = {
doengrave, 0, NULL }, doengrave, 0, NULL },
{ M('e'), "enhance", "advance or check weapon and spell skills", { M('e'), "enhance", "advance or check weapon and spell skills",
enhance_weapon_skill, IFBURIED | AUTOCOMPLETE, NULL }, enhance_weapon_skill, IFBURIED | AUTOCOMPLETE, NULL },
/* #exploremode should be flagged AUTOCOMPETE but that would negatively
impact frequently used #enhance by making #e become ambiguous */
{ M('X'), "exploremode", "enter explore (discovery) mode", { M('X'), "exploremode", "enter explore (discovery) mode",
enter_explore_mode, IFBURIED | GENERALCMD, NULL }, enter_explore_mode, IFBURIED | GENERALCMD, NULL },
{ 'f', "fire", "fire ammunition from quiver", { 'f', "fire", "fire ammunition from quiver",
@@ -1876,8 +1882,11 @@ struct ext_func_tab extcmdlist[] = {
doopen, 0, NULL }, doopen, 0, NULL },
{ 'O', "options", "show option settings, possibly change them", { 'O', "options", "show option settings, possibly change them",
doset, IFBURIED | GENERALCMD, NULL }, doset, IFBURIED | GENERALCMD, NULL },
/* #overview used to need autocomplete and has retained that even
after being assigned to ^O [old wizard mode ^O is now #wizwhere] */
{ C('o'), "overview", "show a summary of the explored dungeon", { C('o'), "overview", "show a summary of the explored dungeon",
dooverview, IFBURIED | AUTOCOMPLETE, NULL }, dooverview, IFBURIED | AUTOCOMPLETE, NULL },
/* [should #panic actually autocomplete?] */
{ '\0', "panic", "test panic routine (fatal to game)", { '\0', "panic", "test panic routine (fatal to game)",
wiz_panic, IFBURIED | AUTOCOMPLETE | WIZMODECMD, NULL }, wiz_panic, IFBURIED | AUTOCOMPLETE | WIZMODECMD, NULL },
{ 'p', "pay", "pay your shopping bill", { 'p', "pay", "pay your shopping bill",
@@ -1978,7 +1987,7 @@ struct ext_func_tab extcmdlist[] = {
{ M('t'), "turn", "turn undead away", { M('t'), "turn", "turn undead away",
doturn, IFBURIED | AUTOCOMPLETE, NULL }, doturn, IFBURIED | AUTOCOMPLETE, NULL },
{ 'X', "twoweapon", "toggle two-weapon combat", { 'X', "twoweapon", "toggle two-weapon combat",
dotwoweapon, AUTOCOMPLETE, NULL }, dotwoweapon, 0, NULL },
{ M('u'), "untrap", "untrap something", { M('u'), "untrap", "untrap something",
dountrap, AUTOCOMPLETE, NULL }, dountrap, AUTOCOMPLETE, NULL },
{ '<', "up", "go up a staircase", { '<', "up", "go up a staircase",
@@ -2011,17 +2020,17 @@ struct ext_func_tab extcmdlist[] = {
wiz_debug_cmd_bury, IFBURIED | AUTOCOMPLETE | WIZMODECMD, NULL }, wiz_debug_cmd_bury, IFBURIED | AUTOCOMPLETE | WIZMODECMD, NULL },
#endif #endif
{ C('e'), "wizdetect", "reveal hidden things within a small radius", { C('e'), "wizdetect", "reveal hidden things within a small radius",
wiz_detect, IFBURIED | AUTOCOMPLETE | WIZMODECMD, NULL }, wiz_detect, IFBURIED | WIZMODECMD, NULL },
{ '\0', "wizfliplevel", "flip the level", { '\0', "wizfliplevel", "flip the level",
wiz_flip_level, IFBURIED | WIZMODECMD, NULL }, wiz_flip_level, IFBURIED | WIZMODECMD, NULL },
{ C('g'), "wizgenesis", "create a monster", { C('g'), "wizgenesis", "create a monster",
wiz_genesis, IFBURIED | AUTOCOMPLETE | WIZMODECMD, NULL }, wiz_genesis, IFBURIED | WIZMODECMD, NULL },
{ C('i'), "wizidentify", "identify all items in inventory", { C('i'), "wizidentify", "identify all items in inventory",
wiz_identify, IFBURIED | AUTOCOMPLETE | WIZMODECMD, NULL }, wiz_identify, IFBURIED | WIZMODECMD, NULL },
{ '\0', "wizintrinsic", "set an intrinsic", { '\0', "wizintrinsic", "set an intrinsic",
wiz_intrinsic, IFBURIED | AUTOCOMPLETE | WIZMODECMD, NULL }, wiz_intrinsic, IFBURIED | AUTOCOMPLETE | WIZMODECMD, NULL },
{ C('v'), "wizlevelport", "teleport to another level", { C('v'), "wizlevelport", "teleport to another level",
wiz_level_tele, IFBURIED | AUTOCOMPLETE | WIZMODECMD, NULL }, wiz_level_tele, IFBURIED | WIZMODECMD, NULL },
{ '\0', "wizloaddes", "load and execute a des-file lua script", { '\0', "wizloaddes", "load and execute a des-file lua script",
wiz_load_splua, IFBURIED | WIZMODECMD, NULL }, wiz_load_splua, IFBURIED | WIZMODECMD, NULL },
{ '\0', "wizloadlua", "load and execute a lua script", { '\0', "wizloadlua", "load and execute a lua script",
@@ -2029,7 +2038,7 @@ struct ext_func_tab extcmdlist[] = {
{ '\0', "wizmakemap", "recreate the current level", { '\0', "wizmakemap", "recreate the current level",
wiz_makemap, IFBURIED | WIZMODECMD, NULL }, wiz_makemap, IFBURIED | WIZMODECMD, NULL },
{ C('f'), "wizmap", "map the level", { C('f'), "wizmap", "map the level",
wiz_map, IFBURIED | AUTOCOMPLETE | WIZMODECMD, NULL }, wiz_map, IFBURIED | WIZMODECMD, NULL },
{ '\0', "wizrumorcheck", "verify rumor boundaries", { '\0', "wizrumorcheck", "verify rumor boundaries",
wiz_rumor_check, IFBURIED | AUTOCOMPLETE | WIZMODECMD, NULL }, wiz_rumor_check, IFBURIED | AUTOCOMPLETE | WIZMODECMD, NULL },
{ '\0', "wizseenv", "show map locations' seen vectors", { '\0', "wizseenv", "show map locations' seen vectors",
@@ -2039,7 +2048,7 @@ struct ext_func_tab extcmdlist[] = {
{ '\0', "wizwhere", "show locations of special levels", { '\0', "wizwhere", "show locations of special levels",
wiz_where, IFBURIED | AUTOCOMPLETE | WIZMODECMD, NULL }, wiz_where, IFBURIED | AUTOCOMPLETE | WIZMODECMD, NULL },
{ C('w'), "wizwish", "wish for something", { C('w'), "wizwish", "wish for something",
wiz_wish, IFBURIED | AUTOCOMPLETE | WIZMODECMD, NULL }, wiz_wish, IFBURIED | WIZMODECMD, NULL },
{ '\0', "wmode", "show wall modes", { '\0', "wmode", "show wall modes",
wiz_show_wmodes, IFBURIED | AUTOCOMPLETE | WIZMODECMD, NULL }, wiz_show_wmodes, IFBURIED | AUTOCOMPLETE | WIZMODECMD, NULL },
{ 'z', "zap", "zap a wand", { 'z', "zap", "zap a wand",