Add toggle extended command

Allows the user to configure a key binding to toggle any boolean
option, for example:

BIND=':toggle(price_quotes)
BIND=v:toggle(autodig)

The option must be settable in-game.
This commit is contained in:
Pasi Kallinen
2026-03-21 11:52:36 +02:00
parent 62a50413d3
commit 63a78edcfa
7 changed files with 167 additions and 12 deletions

View File

@@ -1754,6 +1754,18 @@ floor container menu.
.lp ""
Autocompletes.
Default key is \(oqM-T\(cq.
.lp "#toggle "
Toggle a boolean option on or off.
Requires a parameter in parenthesis, the name of the option to toggle.
The option must be settable in-game.
.lp ""
For example:
.sd
.ft CR
BIND=':toggle(price_quotes)
BIND=@:toggle(autopickup)
.ft
.ed
.lp "#travel "
Travel to a specific location on the map.
Default key is \(oq_\(cq. \" underscore

View File

@@ -1826,6 +1826,21 @@ floor container menu.
\\
%.lp ""
Autocompletes. Default key is `\texttt{M-T}'.
%.lp
\item[\#toggle]
Toggle a boolean option on or off.
Requires a parameter in parenthesis, the name of the option to toggle.
The option must be settable in-game.
%.lp ""
For example:
%.sd
\begin{verbatim}
BIND=':toggle(price_quotes)
BIND=@:toggle(autopickup)
\end{verbatim}
%.ed
%.lp
\item[\#travel]
Travel to a specific location on the map.

View File

@@ -2912,6 +2912,7 @@ the game now automatically tracks which sell prices and buy prices you have
new shields: shield of shock resistance, shield of drain resistance
new wand: wand of stasis
early-game monsters always miss with their first use of an attack wand
new command #toggle which can be used to toggle a boolean option
Platform- and/or Interface-Specific New Features