.PS "sound index"
.PL MESG
message window mapping (the only one supported in 3.7);
+.PL msgtype
+optional; message type to use, see \(lqConfiguring Message Types\(rq
.PL pattern
the pattern to match;
.PL "sound file"
.lp ""
The pattern should be a POSIX extended regular expression.
.pg
+For example:
+.sd
+.si
+SOUNDDIR=C:\\nethack\\sounds
+SOUND=MESG "This door is locked" "lock.wav" 100
+SOUND=MESG hide "^You miss the " "swing.wav" 75
+.ei
+.ed
+.pg
.hn 2
Configuring Status Hilites
.pg
%.sd
%.si
{\tt MESG } --- message window mapping (the only one supported in 3.7);\\
+{\tt msgtype } --- optional; message type to use, see ``Configuring User Sounds''\\
{\tt pattern } --- the pattern to match;\\
{\tt sound file } --- the sound file to play;\\
{\tt volume } --- the volume to be set while playing the sound file;\\
%.lp ""
The pattern should be a POSIX extended regular expression.
+For example:
+
+\begin{verbatim}
+ SOUNDDIR=C:\\nethack\\sounds
+ SOUND=MESG "This door is locked" "lock.wav" 100
+ SOUND=MESG hide "^You miss the " "swing.wav" 75
+\end{verbatim}
+%.pg
+
%.lp
%.hn 2
\subsection*{Configuring Status Hilites}
pets are more likely to follow you closely if you are carrying something they
really like to eat; behave as if you are carrying such whenever you
are standing on stairs so that pets will try harder to come to you
+allow setting msgtype in SOUND line
+
Platform- and/or Interface-Specific New Features
------------------------------------------------
char text[256];
char filename[256];
char filespec[256];
+ char msgtyp[11];
int volume, idx = -1;
- if (sscanf(mapping, "MESG \"%255[^\"]\"%*[\t ]\"%255[^\"]\" %d %d", text,
- filename, &volume, &idx) == 4
- || sscanf(mapping, "MESG \"%255[^\"]\"%*[\t ]\"%255[^\"]\" %d", text,
- filename, &volume) == 3) {
+ msgtyp[0] = '\0';
+ if (sscanf(mapping, "MESG \"%255[^\"]\"%*[\t ]\"%255[^\"]\" %d %d",
+ text, filename, &volume, &idx) == 4
+ || sscanf(mapping, "MESG %10[^\"] \"%255[^\"]\"%*[\t ]\"%255[^\"]\" %d %d",
+ msgtyp, text, filename, &volume, &idx) == 5
+ || sscanf(mapping, "MESG %10[^\"] \"%255[^\"]\"%*[\t ]\"%255[^\"]\" %d",
+ msgtyp, text, filename, &volume) == 4
+ || sscanf(mapping, "MESG \"%255[^\"]\"%*[\t ]\"%255[^\"]\" %d",
+ text, filename, &volume) == 3) {
audio_mapping *new_map;
if (!sounddir)
raw_print(re_error_desc);
return 0;
} else {
+ if (*msgtyp) {
+ char tmpbuf[BUFSZ];
+
+ Sprintf(tmpbuf, "%.10s \"%.230s\"", msgtyp, text);
+ (void) msgtype_parse_add(tmpbuf);
+ }
soundmap = new_map;
}
} else {