From: Pasi Kallinen Date: Wed, 16 Dec 2015 19:42:37 +0000 (+0200) Subject: Add option to have autodescribe on by default X-Git-Tag: NetHack-3.6.1_RC01~1171 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=929be769ecc1a8cef4b6fdc3d33778ba8226fa08;p=nethack Add option to have autodescribe on by default --- diff --git a/dat/opthelp b/dat/opthelp index cffc7b12e..aae263a39 100644 --- a/dat/opthelp +++ b/dat/opthelp @@ -2,6 +2,7 @@ Boolean options not under specific compile flags (with default values in []): (You can learn which options exist in your version by checking your current option setting, which is reached via the 'O' cmd.) +autodescribe describe the terrain under cursor [FALSE] autodig dig if moving and wielding digging tool [FALSE] autoopen walking into a door attempts to open it [TRUE] autopickup automatically pick up objects you move over [TRUE] diff --git a/doc/Guidebook.mn b/doc/Guidebook.mn index 0db6dc0e2..f5b4d48c9 100644 --- a/doc/Guidebook.mn +++ b/doc/Guidebook.mn @@ -1970,6 +1970,9 @@ The default is to randomly pick an appropriate alignment. If you prefix a `!' or ``no'' to the value, you can exclude that alignment from being picked randomly. Cannot be set with the `O' command. Persistent. +.lp autodescribe +Automatically describe the terrain under cursor when asked to get a location +on the map. .lp autodig Automatically dig if you are wielding a digging tool and moving into a place that can be dug (default false). Persistent. diff --git a/doc/Guidebook.tex b/doc/Guidebook.tex index ad025f1a7..bd9ba3f6b 100644 --- a/doc/Guidebook.tex +++ b/doc/Guidebook.tex @@ -2377,6 +2377,10 @@ If you prefix `{\tt !}' or ``{\tt no}'' to the value, you can exclude that alignment from being picked randomly. Cannot be set with the `{\tt O}' command. Persistent. %.lp +\item[\ib{autodescribe}] +Automatically describe the terrain under cursor when asked to get a location +on the map. +%.lp \item[\ib{autodig}] Automatically dig if you are wielding a digging tool and moving into a place that can be dug (default false). Persistent. diff --git a/include/flag.h b/include/flag.h index b39a1f064..e8d696662 100644 --- a/include/flag.h +++ b/include/flag.h @@ -212,6 +212,7 @@ struct instance_flags { boolean use_status_hilites; /* use color in status line */ boolean use_background_glyph; /* use background glyph when appropriate */ boolean hilite_pile; /* mark piles of objects with a hilite */ + boolean autodescribe; /* autodescribe mode in getpos() */ #if 0 boolean DECgraphics; /* use DEC VT-xxx extended character set */ boolean IBMgraphics; /* use IBM extended character set */ diff --git a/src/do_name.c b/src/do_name.c index 9eebe0b51..3d8669be0 100644 --- a/src/do_name.c +++ b/src/do_name.c @@ -80,7 +80,6 @@ const char *goal; int cx, cy, i, c; int sidx, tx, ty; boolean msg_given = TRUE; /* clear message window by default */ - boolean auto_msg = FALSE; boolean show_goal_msg = FALSE; static const char pick_chars[] = ".,;:"; const char *cp; @@ -108,7 +107,7 @@ const char *goal; curs(WIN_MAP, cx, cy); flush_screen(0); show_goal_msg = FALSE; - } else if (auto_msg && !msg_given && !hilite_state) { + } else if (iflags.autodescribe && !msg_given && !hilite_state) { coord cc; int sym = 0; char tmpbuf[BUFSZ]; @@ -132,7 +131,7 @@ const char *goal; flush_screen(0); } - if (auto_msg) + if (iflags.autodescribe) msg_given = FALSE; if (c == '\033') { @@ -205,11 +204,11 @@ const char *goal; } goto nxtc; } else if (c == '#') { - auto_msg = !auto_msg; + iflags.autodescribe = !iflags.autodescribe; pline("Automatic description %sis %s.", flags.verbose ? "of features under cursor " : "", - auto_msg ? "on" : "off"); - if (!auto_msg) + iflags.autodescribe ? "on" : "off"); + if (!iflags.autodescribe) show_goal_msg = TRUE; msg_given = TRUE; goto nxtc; diff --git a/src/options.c b/src/options.c index e48194503..d978ad033 100644 --- a/src/options.c +++ b/src/options.c @@ -75,6 +75,7 @@ static struct Bool_Opt { #else { "asksavedisk", (boolean *) 0, FALSE, SET_IN_FILE }, #endif + { "autodescribe", &iflags.autodescribe, FALSE, SET_IN_GAME }, { "autodig", &flags.autodig, FALSE, SET_IN_GAME }, { "autoopen", &flags.autoopen, TRUE, SET_IN_GAME }, { "autopickup", &flags.pickup, TRUE, SET_IN_GAME },