'travel' option

Change '!travel' to only prevent travel-by-mouse and leave '_' alone.
This commit is contained in:
PatR
2020-02-07 14:37:51 -08:00
parent 7ca4ae7c4b
commit 84daf75981
5 changed files with 31 additions and 25 deletions

View File

@@ -64,8 +64,9 @@ status_updates update the status lines [TRUE]
time display elapsed game time, in moves [FALSE]
tombstone print tombstone when you die [TRUE]
toptenwin print topten in a window rather than stdout [FALSE]
travel enable the command to travel to a map location via [TRUE]
a shortest-path algorithm, usually invoked by '_'.
travel enables travelling via mouse click if supported; [TRUE]
can be toggled off to prevent mouse clicks on the map from
attempting to move the hero; does not affect travel via '_'
use_darkgray use bold black instead of blue for black glyphs. [TRUE]
use_inverse display detected monsters in highlighted manner [FALSE]
verbose print more commentary during the game [TRUE]

View File

@@ -3771,9 +3771,11 @@ Setting this option makes the score list visible when a windowing version
of NetHack is started without a parent window, but it no longer leaves
the score list around after game end on a terminal or emulating window.
.lp travel
Allow the travel command (default on). Turning this option off will
prevent the game from attempting unintended moves if you make inadvertent
mouse clicks on the map window. Persistent.
Allow the travel command via mouse click (default on).
Turning this option off will prevent the game from attempting unintended
moves if you make inadvertent mouse clicks on the map window.
Does not affect traveling via the \(oq\f(CR_\fP\(cq (\(lq#travel\(rq) command.
Persistent.
." .lp travel_debug
." Display intended path during each step of travel (default off).
." Debug mode only.

View File

@@ -4064,9 +4064,11 @@ of {\it NetHack\/} is started without a parent window, but it no longer leaves
the score list around after game end on a terminal or emulating window.
%.lp
\item[\ib{travel}]
Allow the travel command (default on). Turning this option off will
prevent the game from attempting unintended moves if you make inadvertent
mouse clicks on the map window. Persistent.
Allow the travel command via mouse click (default on).
Turning this option off will prevent the game from attempting unintended
moves if you make inadvertent mouse clicks on the map window.
Does not affect traveling via the `{\tt \verb+_+}' (``{\tt \#travel}'')
command. Persistent.
% %.lp
% \item[ib{travel\verb+_+debug}]
% Display intended path during each step of travel (default off).

View File

@@ -142,6 +142,8 @@ new 'mention_decor' option; when On, describe dungeon features being stepped
on or floated/flown over even when they're not covered by objects
applying royal jelly on an egg kills, revives, or changes the egg
intelligent monsters pick up and rummage through containers
toggling 'travel' option Off now only inhibits travel by mouse click, not by
'_' command where choosing the destination provides a chance to cancel
Platform- and/or Interface-Specific New Features

View File

@@ -3162,15 +3162,12 @@ register char *cmd;
}
return;
case NHKF_TRAVEL:
if (flags.travelcmd) {
g.context.travel = 1;
g.context.travel1 = 1;
g.context.run = 8;
g.context.nopick = 1;
g.domove_attempting |= DOMOVE_RUSH;
break;
}
/*FALLTHRU*/
g.context.travel = 1;
g.context.travel1 = 1;
g.context.run = 8;
g.context.nopick = 1;
g.domove_attempting |= DOMOVE_RUSH;
break;
default:
if (movecmd(*cmd)) { /* ordinary movement */
g.context.run = 0; /* only matters here if it was 8 */
@@ -4302,14 +4299,16 @@ dotravel(VOID_ARGS)
static char cmd[2];
coord cc;
/* [FIXME? Supporting the ability to disable traveling via mouse
click makes some sense, depending upon overall mouse usage.
Disabling '_' on a user by user basis makes no sense at all since
even if it is typed by accident, aborting when picking a target
destination is trivial. Travel via mouse predates travel via '_',
and this use of OPTION=!travel is probably just a mistake....] */
if (!flags.travelcmd)
return 0;
/*
* Travelling used to be a no-op if user toggled 'travel' option
* Off. However, travel was initially implemented as a mouse-only
* command and the original purpose of the option was to be able
* to prevent clicks on the map from initiating travel.
*
* Travel via '_' came later. Since it requires a destination--
* which offers the user a chance to cancel if it was accidental--
* there's no reason for the option to disable travel-by-keys.
*/
cmd[1] = 0;
cc.x = iflags.travelcc.x;