fix github issue 361 to make user_sounds useful even if MSGTYPE is hidden

fixes #361

Also, experminental introduction of vt_sounddata to enable tty to pass
a sound file index to the terminal side of things where perhaps someone
can add code to something like hterm to take the information relayed by
NetHack to trigger user_sounds locally even if playing on a server.

Compile time option TTY_SOUND_ESCCODES required to build that support in.

It should be independent of TTY_TILE_ESCCODES.
This commit is contained in:
nhmall
2020-07-02 15:49:45 -04:00
parent 3a94f0a9f8
commit e4b18f0545
13 changed files with 151 additions and 32 deletions

View File

@@ -474,7 +474,10 @@ typedef unsigned char uchar;
*/
/* TTY_TILES_ESCCODES: Enable output of special console escape codes
* which act as hints for external programs such as EbonHack.
* which act as hints for external programs such as EbonHack, or hterm.
*
* TTY_SOUND_ESCCODES: Enable output of special console escape codes
* which act as hints for theoretical external programs to play sound effect.
*
* Only for TTY_GRAPHICS.
*
@@ -482,12 +485,14 @@ typedef unsigned char uchar;
* one or more positive integer values, separated by semicolons.
* For example ESC [ 1 ; 0 ; 120 z
*
* Possible codes are:
* Possible TTY_TILES_ESCCODES codes are:
* ESC [ 1 ; 0 ; n ; m z Start a glyph (aka a tile) number n, with flags m
* ESC [ 1 ; 1 z End a glyph.
* ESC [ 1 ; 2 ; n z Select a window n to output to.
* ESC [ 1 ; 3 z End of data. NetHack has finished sending data,
* and is waiting for input.
* Possible TTY_SOUND_ESCCODES codes are:
* ESC [ 1 ; 4 ; n ; m z Play specified sound n, volume m
*
* Whenever NetHack outputs anything, it will first output the "select window"
* code. Whenever NetHack outputs a tile, it will first output the "start
@@ -496,9 +501,10 @@ typedef unsigned char uchar;
*
* To compile NetHack with this, add tile.c to WINSRC and tile.o to WINOBJ
* in the hints file or Makefile.
* Set boolean option vt_tiledata in your config file to turn this on.
* Set boolean option vt_xdata in your config file to turn either of these on.
* Note that gnome-terminal at least doesn't work with this. */
/* #define TTY_TILES_ESCCODES */
/* #define TTY_SOUND_ESCCODES */
/* NetHack will execute an external program whenever a new message-window
* message is shown. The program to execute is given in environment variable