Add MSGTYPE config option

MSGTYPE allows the user to define how messages in the message
area behave. For example:

  MSGTYPE=stop "You swap places with "

would always make that message prompt for -more-.  Allowed types
are "show" (normal message), "hide" (do not show), "stop" (wait
for user), and "norep" (do not repeat message).

Adding this, because it's relatively simple, proven to work, and
it seemed to be the major thing betatesters felt was lacking when
compared to NAO.
This commit is contained in:
Pasi Kallinen
2015-05-27 18:29:12 +03:00
parent c447088538
commit f0eca282a8
9 changed files with 356 additions and 0 deletions

View File

@@ -3184,6 +3184,64 @@ The second example results in the exclusion of any corpse from autopickup.
The last example results in the exclusion of items known to be cursed from
autopickup.
%.lp
%.hn 2
\subsection*{Configuring Message Types}
%.pg
You can change the way the messages are shown in the message area, when
the message matches a user-defined pattern.
%.pg
In general, the config file entries to configure the message types
look like this:
\begin{verbatim}
MSGTYPE=type "pattern"
\end{verbatim}
\blist{}
%.lp
\item[\ib{type}]
how the message should be shown;
%.lp
\item[\ib{pattern}]
the pattern to match.
\elist
%.lp ""
The pattern should be a regular expression.
%.lp ""
Allowed types are:
%.sd
%.si
{\tt show} --- show message normally.\\
{\tt hide} --- never show the message.\\
{\tt stop} --- wait for user with more-prompt.\\
{\tt norep} --- show the message once, but not again if no other message is shown in between.
%.ei
%.ed
%.lp ""
Here's an example of menu colors using NetHack's internal
pattern matching facility:
\begin{verbatim}
MSGTYPE=stop "You feel hungry."
MSGTYPE=hide "You displaced *."
\end{verbatim}
specifies that whenever a message ``You feel hungry'' is shown,
the user is prompted with more-prompt, and a message matching
``You displaced <something>'' is not shown at all.
%.lp
The order of the defined MSGTYPE-lines is important; the last matching
rule is used. Put the general case first, exceptions below them.
%.pg
%.lp
%.hn 2
\subsection*{Configuring Menu Colors}