Merge branch 'NetHack-3.6.2'
This commit is contained in:
@@ -5,6 +5,7 @@ window.doc NHSUBST
|
|||||||
config.nh NHSUBST
|
config.nh NHSUBST
|
||||||
Guidebook.txt NH_header=no
|
Guidebook.txt NH_header=no
|
||||||
tmac.n NH_header=no
|
tmac.n NH_header=no
|
||||||
|
tmac.nh NUSUBST
|
||||||
fixes* NH_header=no
|
fixes* NH_header=no
|
||||||
*.txt NH_header=no
|
*.txt NH_header=no
|
||||||
* NH_filestag=(file%s_for_all_versions)
|
* NH_filestag=(file%s_for_all_versions)
|
||||||
|
|||||||
+36
-79
@@ -1,4 +1,4 @@
|
|||||||
.\" $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.284 $ $NHDT-Date: 1539898655 2018/10/18 21:37:35 $
|
.\" $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.286 $ $NHDT-Date: 1540625949 2018/10/27 07:39:09 $
|
||||||
.\"
|
.\"
|
||||||
.\" This is an excerpt from the 'roff' man page from the 'groff' package.
|
.\" This is an excerpt from the 'roff' man page from the 'groff' package.
|
||||||
.\" NetHack's Guidebook.mn currently does *not* adhere to these guidelines.
|
.\" NetHack's Guidebook.mn currently does *not* adhere to these guidelines.
|
||||||
@@ -15,6 +15,9 @@
|
|||||||
.\"| ter each sentence.
|
.\"| ter each sentence.
|
||||||
.\"|||
|
.\"|||
|
||||||
.\"
|
.\"
|
||||||
|
.
|
||||||
|
.so tmac.nh \" extra macros which aren't in tmac.n
|
||||||
|
.
|
||||||
.ds h0 "NetHack Guidebook
|
.ds h0 "NetHack Guidebook
|
||||||
.ds h1
|
.ds h1
|
||||||
.ds h2 %
|
.ds h2 %
|
||||||
@@ -23,67 +26,6 @@
|
|||||||
.ds f1
|
.ds f1
|
||||||
.ds f2 "October 16, 2018
|
.ds f2 "October 16, 2018
|
||||||
.
|
.
|
||||||
.\" labeled paragraph start (should be part of tmac.n, but I don't want to
|
|
||||||
.\" make changes to that file)
|
|
||||||
.\" .PS word
|
|
||||||
.\" set the width for the label column
|
|
||||||
.\" .PL word
|
|
||||||
.\" label for the entry
|
|
||||||
.\" .PE
|
|
||||||
.\" clean up
|
|
||||||
.de PS
|
|
||||||
.nr PY \\w'\\$1\ -\ 'u \" width of label plus " - "
|
|
||||||
.nr PX \\w'\ -\ 'u \" width of " - "
|
|
||||||
.sn \\n(pdu \" tmac.n: inter-paragraph space
|
|
||||||
.in +\\n(PYu \" additional indent past label (etc)
|
|
||||||
.si \" tmac.n: start indented section
|
|
||||||
..
|
|
||||||
.\" labeled paragraph label (and first line)
|
|
||||||
.de PL
|
|
||||||
.br
|
|
||||||
\\h'|-\\n(PYu'\\$1\\h'|-\\n(PXu'\ -\ \\c \" back up, output the label, then
|
|
||||||
. \" skip to width-of(" - ") before the
|
|
||||||
. \" normal indentation, output the " - "
|
|
||||||
. \" then attach the next line (the
|
|
||||||
. \" text) without stopping (\c: nroff
|
|
||||||
. \" section 4.2)
|
|
||||||
..
|
|
||||||
.\"labeled paragraph end
|
|
||||||
.de PE
|
|
||||||
.ei \" tmac.n: end indented section
|
|
||||||
.in -\\n(PYu \" undo indent past label (etc)
|
|
||||||
.sn \\n(pdu \" tmac.n: inter-paragraph space
|
|
||||||
..
|
|
||||||
.\" end of labeled paragraph
|
|
||||||
.\"
|
|
||||||
.\" aligned single character key with SHORT definition (if it overflows one
|
|
||||||
.\" line, all bets are off)
|
|
||||||
.\" Usage:
|
|
||||||
.\" .CC k "definition here"
|
|
||||||
.nr CZ \w'\fBW' \" width of the key character column
|
|
||||||
.nr CW \n(CZ/2 \" half the width of the key character column
|
|
||||||
.de CC
|
|
||||||
.nr CX \\w'\\fB\\$1'u/2 \" half the width of the key character
|
|
||||||
.nr CY \\n(CWu-\\n(CXu \" difference between the two half widths
|
|
||||||
.\" output: move right CR units, print the key letter, move right to
|
|
||||||
.\" the full width of the column, print " - " and the definition
|
|
||||||
\\h'|\\n(CYu'\\fB\\$1\\fP\\h'|\\n(CZu'\ -\ \\$2
|
|
||||||
..
|
|
||||||
.\" '.UX' is verbatim copy of tmac.n's '.ux' with the exception that
|
|
||||||
.\" the trademark owner for "UNIX" has been updated. (tmac.n contains
|
|
||||||
.\" a comment asking that modified versions not be distributed, so we
|
|
||||||
.\" are using this substitute instead of modifying that file.)
|
|
||||||
.de UX \" print "UNIX"
|
|
||||||
.ie \\n(ux \\&\\$2\\s-1UNIX\\s0\\$1
|
|
||||||
.el \{\
|
|
||||||
. nr ux +1 \" mark footnote as dropped
|
|
||||||
\\&\\$2\\s-1UNIX\\s0\\*(rg\\$1
|
|
||||||
. fn \" put out the footnote
|
|
||||||
\\&\\*(rgUNIX is a registered trademark of The Open Group.
|
|
||||||
. ef \" short and sweet ...
|
|
||||||
.\}
|
|
||||||
..
|
|
||||||
.
|
|
||||||
.\" A note on some special characters:
|
.\" A note on some special characters:
|
||||||
.\" \(lq = left double quote
|
.\" \(lq = left double quote
|
||||||
.\" \(rq = right double quote \(dq = double quote character
|
.\" \(rq = right double quote \(dq = double quote character
|
||||||
@@ -285,8 +227,7 @@ replaces the \(lqYou see ...\(rq descriptions of text adventure games.
|
|||||||
Figure 1 is a sample of what a NetHack screen might look like.
|
Figure 1 is a sample of what a NetHack screen might look like.
|
||||||
The way the screen looks for you depends on your platform.
|
The way the screen looks for you depends on your platform.
|
||||||
.
|
.
|
||||||
.br \" break - advance to next line
|
.BR 2
|
||||||
\ \" space to force non-empty line before table
|
|
||||||
.ft CR \" set font to constant-width Roman
|
.ft CR \" set font to constant-width Roman
|
||||||
.TS S
|
.TS S
|
||||||
center box tab(~);
|
center box tab(~);
|
||||||
@@ -2479,7 +2420,8 @@ Very large humanoids (giants and their ilk) have been known to use boulders
|
|||||||
as weapons.
|
as weapons.
|
||||||
.pg
|
.pg
|
||||||
For some configurations of the program, statues are no longer shown as
|
For some configurations of the program, statues are no longer shown as
|
||||||
\(oq\`\(cq but by the letter representing the monster they depict instead.
|
\(oq\f(CR\`\fP\(cq but by the letter representing the monster they depict
|
||||||
|
instead.
|
||||||
.hn 2
|
.hn 2
|
||||||
Gold (\(oq$\(cq)
|
Gold (\(oq$\(cq)
|
||||||
.pg
|
.pg
|
||||||
@@ -2816,6 +2758,7 @@ OPTIONS=lit_corridor
|
|||||||
OPTIONS=!splash_screen
|
OPTIONS=!splash_screen
|
||||||
.ft \" revert to previous font
|
.ft \" revert to previous font
|
||||||
.ed
|
.ed
|
||||||
|
.BR 2
|
||||||
.hn 2
|
.hn 2
|
||||||
Using the NETHACKOPTIONS environment variable
|
Using the NETHACKOPTIONS environment variable
|
||||||
.pg
|
.pg
|
||||||
@@ -2823,32 +2766,46 @@ The NETHACKOPTIONS variable is a comma-separated list of initial
|
|||||||
values for the various options.
|
values for the various options.
|
||||||
Some can only be turned on or off.
|
Some can only be turned on or off.
|
||||||
You turn one of these on by adding the name of the option to the list,
|
You turn one of these on by adding the name of the option to the list,
|
||||||
and turn it off by typing a \(oq!\(cq or \(lqno\(rq before the name.
|
and turn it off by typing a \(oq\f(CR!\fP\(cq or \(lq\f(CRno\fP\(rq
|
||||||
|
before the name.
|
||||||
Others take a character string as a value.
|
Others take a character string as a value.
|
||||||
You can set string options by typing
|
You can set string options by typing
|
||||||
the option name, a colon or equals sign, and then the value of the string.
|
the option name, a colon or equals sign, and then the value of the string.
|
||||||
The value is terminated by the next comma or the end of string.
|
The value is terminated by the next comma or the end of string.
|
||||||
.pg
|
.pg
|
||||||
For example, to set up an environment variable so that \(lqcolor\(rq
|
For example, to set up an environment variable so that
|
||||||
is on, \(lqautopickup\(rq is off, the name is set to \(lqBlue Meanie\(rq,
|
\fIcolor\fP is \f(CRon\fP,
|
||||||
and the fruit is set to \(lqpapaya\(rq, you would enter the command
|
\fIlegacy\fP is \f(CRoff\fP,
|
||||||
.sd
|
character \fIname\fP is set to \(lq\f(CRBlue Meanie\fP\(rq,
|
||||||
% \f(CRsetenv NETHACKOPTIONS "color,\e!autopickup,name:Blue Meanie,fruit:papaya"\fP
|
and named \fIfruit\fP is set to \(lq\f(CRlime\fP\(rq,
|
||||||
.ed
|
you would enter the command
|
||||||
|
.\" Guidebook.ps looks better with the normal indentation for .sd (.SD i)
|
||||||
|
.\" but the 'setenv' example is too wide for Guidebook.txt unless the
|
||||||
|
.\" indentation is suppressed (.SD n). Even though the second example
|
||||||
|
.\" can be indented, it should match the first or they'll both look odd.
|
||||||
|
.\" groff has a built-in register allowing recognition of '-T', but we
|
||||||
|
.\" can't rely on that. Assume Guidebook.ps uses a proportional font
|
||||||
|
.\" and Guidebook.txt a fixed-width one and test which sort we're using.
|
||||||
|
.ds sD i \" assume proportional, indentation acceptable and preferred
|
||||||
|
.\" Check for fixed-width font; 'f' will be same width as 'F'.
|
||||||
|
.if (\w'f'p)=(\w'F'p) .ds sD n \" if same width, suppress indentation
|
||||||
|
.SD \*(sD
|
||||||
|
\f(CR% setenv NETHACKOPTIONS "color,\\!leg,name:Blue Meanie,fruit:lime"\fP
|
||||||
|
.ED
|
||||||
in \fIcsh\fP (note the need to escape the \(oq!\(cq since it's special
|
in \fIcsh\fP (note the need to escape the \(oq!\(cq since it's special
|
||||||
to the shell), or
|
to that shell), or the pair of commands
|
||||||
.sd
|
.SD \*(sD
|
||||||
$ \f(CRNETHACKOPTIONS="color,!autopickup,name:Blue Meanie,fruit:papaya"\fP
|
\f(CR$ NETHACKOPTIONS="color,!leg,name:Blue Meanie,fruit:lime"\fP
|
||||||
$ \f(CRexport NETHACKOPTIONS\fP
|
\f(CR$ export NETHACKOPTIONS\fP
|
||||||
.ed
|
.ED
|
||||||
in \fIsh\fP, \fIksh\fP, or \fIbash\fP.
|
in \fIsh\fP, \fIksh\fP, or \fIbash\fP.
|
||||||
.pg
|
.pg
|
||||||
Instead of a comma-separated list of options,
|
Instead of a comma-separated list of options,
|
||||||
NETHACKOPTIONS can be set to the full name of a configuration file you
|
NETHACKOPTIONS can be set to the full name of a configuration file you
|
||||||
want to use.
|
want to use.
|
||||||
If that full name doesn't start with a slash, precede it with \(oq@\(cq
|
If that full name doesn't start with a slash, precede it with \(oq\f(CR@\fP\(cq
|
||||||
(at-sign) to let NetHack know that the rest is intended as a file name.
|
(at-sign) to let NetHack know that the rest is intended as a file name.
|
||||||
If it does start with \(oq/\(cq, the at-sign is optional.
|
If it does start with \(oq\f(CR/\fP\(cq, the at-sign is optional.
|
||||||
.hn 2
|
.hn 2
|
||||||
Customization options
|
Customization options
|
||||||
.pg
|
.pg
|
||||||
|
|||||||
+23
-17
@@ -283,6 +283,7 @@ understand what {\it NetHack\/} is doing with the screen. The {\it NetHack\/}
|
|||||||
screen replaces the ``You see \ldots'' descriptions of text adventure games.
|
screen replaces the ``You see \ldots'' descriptions of text adventure games.
|
||||||
Figure 1 is a sample of what a {\it NetHack\/} screen might look like.
|
Figure 1 is a sample of what a {\it NetHack\/} screen might look like.
|
||||||
The way the screen looks for you depends on your platform.
|
The way the screen looks for you depends on your platform.
|
||||||
|
%.BR 2
|
||||||
|
|
||||||
\vbox{
|
\vbox{
|
||||||
\begin{verbatim}
|
\begin{verbatim}
|
||||||
@@ -297,8 +298,8 @@ The way the screen looks for you depends on your platform.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
Player the Rambler St:12 Dx:7 Co:18 In:11 Wi:9 Ch:15 Neutral
|
Player the Rambler St:12 Dx:7 Co:18 In:11 Wi:9 Ch:15 Neutral
|
||||||
Dlvl:1 $:0 HP:9(12) Pw:3(3) AC:10 Exp:1/19 T:257 Weak
|
Dlvl:1 $:0 HP:9(12) Pw:3(3) AC:10 Exp:1/19 T:257 Weak
|
||||||
\end{verbatim}
|
\end{verbatim}
|
||||||
\begin{center}
|
\begin{center}
|
||||||
Figure 1
|
Figure 1
|
||||||
@@ -1620,7 +1621,7 @@ bit), you can invoke many extended commands by meta-ing the first
|
|||||||
letter of the command.
|
letter of the command.
|
||||||
In {\it NT, OS/2, PC\/ {\rm and} ST NetHack},
|
In {\it NT, OS/2, PC\/ {\rm and} ST NetHack},
|
||||||
the `Alt' key can be used in this fashion;
|
the `Alt' key can be used in this fashion;
|
||||||
on the {\it Amiga\/}, set the {\it altmeta\/} option to get this behavior.
|
on the {\it Amiga}, set the {\it altmeta\/} option to get this behavior.
|
||||||
On other systems, if typing `Alt' plus another key transmits a
|
On other systems, if typing `Alt' plus another key transmits a
|
||||||
two character sequence consisting of an {\tt Escape}
|
two character sequence consisting of an {\tt Escape}
|
||||||
followed by the other key, you may set the {\it altmeta\/}
|
followed by the other key, you may set the {\it altmeta\/}
|
||||||
@@ -2040,7 +2041,7 @@ location ordinarily wouldn't be seen any more.
|
|||||||
|
|
||||||
%.pg
|
%.pg
|
||||||
When you find something in the dungeon, it is common to want to pick
|
When you find something in the dungeon, it is common to want to pick
|
||||||
it up. In {\it NetHack\/}, this is accomplished automatically by walking over
|
it up. In {\it NetHack}, this is accomplished automatically by walking over
|
||||||
the object (unless you turn off the {\it autopickup\/}
|
the object (unless you turn off the {\it autopickup\/}
|
||||||
option (see below), or move with the `{\tt m}' prefix (see above)), or
|
option (see below), or move with the `{\tt m}' prefix (see above)), or
|
||||||
manually by using the `{\tt ,}' command.
|
manually by using the `{\tt ,}' command.
|
||||||
@@ -2791,7 +2792,7 @@ fire, and kick weapons; use a wand, spell, or other type of item;
|
|||||||
or fight with your hands and feet.
|
or fight with your hands and feet.
|
||||||
|
|
||||||
%.pg
|
%.pg
|
||||||
In {\it NetHack\/}, a pacifist refuses to cause the death of any other monster
|
In {\it NetHack}, a pacifist refuses to cause the death of any other monster
|
||||||
(i.e. if you would get experience for the death). This is a particularly
|
(i.e. if you would get experience for the death). This is a particularly
|
||||||
difficult challenge, although it is still possible to gain experience
|
difficult challenge, although it is still possible to gain experience
|
||||||
by other means.
|
by other means.
|
||||||
@@ -3032,6 +3033,7 @@ Here is a short example of config file contents:
|
|||||||
OPTIONS=!splash_screen
|
OPTIONS=!splash_screen
|
||||||
\end{verbatim}
|
\end{verbatim}
|
||||||
%.ed
|
%.ed
|
||||||
|
%.BR 2
|
||||||
|
|
||||||
%.hn 2
|
%.hn 2
|
||||||
\subsection*{Using the NETHACKOPTIONS environment variable}
|
\subsection*{Using the NETHACKOPTIONS environment variable}
|
||||||
@@ -3047,25 +3049,29 @@ the option name, a colon or equals sign, and then the value of the string.
|
|||||||
The value is terminated by the next comma or the end of string.
|
The value is terminated by the next comma or the end of string.
|
||||||
|
|
||||||
%.pg
|
%.pg
|
||||||
For example, to set up an environment variable so that {\it color\/}
|
For example, to set up an environment variable so that
|
||||||
is on, {\it autopickup\/} is off, the {\it name\/} is set to ``Blue Meanie'',
|
{\it color\/} is {\tt on},
|
||||||
and the {\it fruit\/} is set to ``papaya'', you would enter the command
|
{\it legacy\/} is {\tt off},
|
||||||
%.sd
|
character {\it name\/} is set to ``{\tt Blue Meanie}'',
|
||||||
|
and named {\it fruit\/} is set to ``{\tt lime}'',
|
||||||
|
you would enter the command
|
||||||
|
%.SD i
|
||||||
\begin{verbatim}
|
\begin{verbatim}
|
||||||
setenv NETHACKOPTIONS "color,\!autopickup,name:Blue Meanie,fruit:papaya"
|
setenv NETHACKOPTIONS "color,\!leg,name:Blue Meanie,fruit:lime"
|
||||||
\end{verbatim}
|
\end{verbatim}
|
||||||
%.ed
|
%.ED
|
||||||
|
|
||||||
\nd in {\it csh}
|
\nd in {\it csh}
|
||||||
(note the need to escape the `!' since it's special to the shell), or
|
(note the need to escape the `!' since it's special
|
||||||
%.sd
|
to that shell), or the pair of commands
|
||||||
|
%.SD i
|
||||||
\begin{verbatim}
|
\begin{verbatim}
|
||||||
NETHACKOPTIONS="color,!autopickup,name:Blue Meanie,fruit:papaya"
|
NETHACKOPTIONS="color,!leg,name:Blue Meanie,fruit:lime"
|
||||||
export NETHACKOPTIONS
|
export NETHACKOPTIONS
|
||||||
\end{verbatim}
|
\end{verbatim}
|
||||||
%.ed
|
%.ED
|
||||||
|
|
||||||
\nd in {\it sh\/}, {\it ksh}, or {\it bash}.
|
\nd in {\it sh}, {\it ksh}, or {\it bash}.
|
||||||
|
|
||||||
%.pg
|
%.pg
|
||||||
Instead of a comma-separated list of options,
|
Instead of a comma-separated list of options,
|
||||||
@@ -4593,7 +4599,7 @@ percentage or absolute number threshold, or text to match against.
|
|||||||
``{\tt always}'' will set the default attributes for that field.
|
``{\tt always}'' will set the default attributes for that field.
|
||||||
%.lp "*"
|
%.lp "*"
|
||||||
\item{\bb{}}
|
\item{\bb{}}
|
||||||
``{\tt up}'' and ``(\tt down}'' set the field attributes for when the field
|
``{\tt up}'' and ``{\tt down}'' set the field attributes for when the field
|
||||||
value changes upwards or downwards. This attribute times out after
|
value changes upwards or downwards. This attribute times out after
|
||||||
{\tt statushilites} turns.
|
{\tt statushilites} turns.
|
||||||
%.lp "*"
|
%.lp "*"
|
||||||
|
|||||||
+8
-8
@@ -3154,11 +3154,11 @@
|
|||||||
equals sign, and then the value of the string. The value is ter-
|
equals sign, and then the value of the string. The value is ter-
|
||||||
minated by the next comma or the end of string.
|
minated by the next comma or the end of string.
|
||||||
|
|
||||||
For example, to set up an environment variable so that "col-
|
For example, to set up an environment variable so that color
|
||||||
or" is on, "autopickup" is off, the name is set to "Blue Meanie",
|
is on, legacy is off, character name is set to "Blue Meanie", and
|
||||||
and the fruit is set to "papaya", you would enter the command
|
named fruit is set to "lime", you would enter the command
|
||||||
|
|
||||||
% setenv NETHACKOPTIONS "color,\!autopickup,name:Blue Meanie,fruit:papaya"
|
% setenv NETHACKOPTIONS "color,\!leg,name:Blue Meanie,fruit:lime"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -3172,11 +3172,11 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
in csh (note the need to escape the `!' since it's special to the
|
in csh (note the need to escape the `!' since it's special to
|
||||||
shell), or
|
that shell), or the pair of commands
|
||||||
|
|
||||||
$ NETHACKOPTIONS="color,!autopickup,name:Blue Meanie,fruit:papaya"
|
$ NETHACKOPTIONS="color,!leg,name:Blue Meanie,fruit:lime"
|
||||||
$ export NETHACKOPTIONS
|
$ export NETHACKOPTIONS
|
||||||
|
|
||||||
in sh, ksh, or bash.
|
in sh, ksh, or bash.
|
||||||
|
|
||||||
|
|||||||
@@ -172,6 +172,10 @@ in Guidebook.mn and Guidebook.txt, the 'I' command mis-described `IX' as
|
|||||||
displaying inventory items whose bless/curse state is "known"
|
displaying inventory items whose bless/curse state is "known"
|
||||||
(Guidebook.tex correctly had "unknown")
|
(Guidebook.tex correctly had "unknown")
|
||||||
poison gas (stinking cloud) wasn't shown at drawbridge-up spot
|
poison gas (stinking cloud) wasn't shown at drawbridge-up spot
|
||||||
|
prayer result which enhanced strength (fix weakness from hunger) didn't give
|
||||||
|
a message if a change in encumbrance occurred; it came on next move
|
||||||
|
add current location within the dungeon to the Background section of ^X and
|
||||||
|
final disclosure (it's not background but doesn't fit anywhere else)
|
||||||
|
|
||||||
|
|
||||||
Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository
|
Fixes to Post-3.6.1 Problems that Were Exposed Via git Repository
|
||||||
@@ -184,6 +188,7 @@ orctown: prevent Bad fruit #0 and some minor tuning
|
|||||||
make long extended commands list be more navigable
|
make long extended commands list be more navigable
|
||||||
simplify #wizidentify; don't rely on having bold menu entries
|
simplify #wizidentify; don't rely on having bold menu entries
|
||||||
ensure tmp_at() structures are initialized for all code paths when swallowed
|
ensure tmp_at() structures are initialized for all code paths when swallowed
|
||||||
|
trapped-vs-levitation/flying change broke Sting releasing hero from web
|
||||||
tty: turn off an optimization that is the suspected cause of Windows reported
|
tty: turn off an optimization that is the suspected cause of Windows reported
|
||||||
partial status lines following level changes
|
partial status lines following level changes
|
||||||
tty: ensure that current status fields are always copied to prior status
|
tty: ensure that current status fields are always copied to prior status
|
||||||
|
|||||||
+127
@@ -0,0 +1,127 @@
|
|||||||
|
.\" NetHack 3.6 tmac.nh $NHDT-Date: $ $NHDT-Branch: $:$NHDT-Revision: $
|
||||||
|
.
|
||||||
|
.\" Miscellaneous tmac.n-style macros specifically for nethack's Guidebook.
|
||||||
|
.\"
|
||||||
|
.\" Most are modelled after, or variations of, macros in tmac.n whose author
|
||||||
|
.\" has specified that that file remain unmodified if it gets distributed.
|
||||||
|
.\" These used to be inline within Guidebook.mn but it was becoming too
|
||||||
|
.\" cluttered as their number increased. It now uses the '.so' directive
|
||||||
|
.\" to include this file. (tmac.n is passed to 'roff on the command line.)
|
||||||
|
.
|
||||||
|
.\" labeled paragraph start
|
||||||
|
.\" .PS word
|
||||||
|
.\" set the width for the label column
|
||||||
|
.\" .PL word
|
||||||
|
.\" label for the entry
|
||||||
|
.\" .PE
|
||||||
|
.\" clean up
|
||||||
|
.de PS
|
||||||
|
.nr PY \\w'\\$1\ -\ 'u \" width of label plus " - "
|
||||||
|
.nr PX \\w'\ -\ 'u \" width of " - "
|
||||||
|
.sn \\n(pdu \" tmac.n: inter-paragraph space
|
||||||
|
.in +\\n(PYu \" additional indent past label (etc)
|
||||||
|
.si \" tmac.n: start indented section
|
||||||
|
..
|
||||||
|
.\" labeled paragraph label (and first line)
|
||||||
|
.de PL
|
||||||
|
.br
|
||||||
|
\\h'|-\\n(PYu'\\$1\\h'|-\\n(PXu'\ -\ \\c \" back up, output the label, then
|
||||||
|
. \" skip to width-of(" - ") before the
|
||||||
|
. \" normal indentation, output the " - "
|
||||||
|
. \" then attach the next line (the
|
||||||
|
. \" text) without stopping (\c: nroff
|
||||||
|
. \" section 4.2)
|
||||||
|
..
|
||||||
|
.\" labeled paragraph end
|
||||||
|
.de PE
|
||||||
|
.ei \" tmac.n: end indented section
|
||||||
|
.in -\\n(PYu \" undo indent past label (etc)
|
||||||
|
.sn \\n(pdu \" tmac.n: inter-paragraph space
|
||||||
|
..
|
||||||
|
.\" end of labeled paragraph
|
||||||
|
.
|
||||||
|
.\"
|
||||||
|
.\" aligned single character key with SHORT definition (if it overflows one
|
||||||
|
.\" line, all bets are off)
|
||||||
|
.\" Usage:
|
||||||
|
.\" .CC k "definition here"
|
||||||
|
.nr CZ \w'\fBW' \" width of the key character column
|
||||||
|
.nr CW \n(CZ/2 \" half the width of the key character column
|
||||||
|
.de CC
|
||||||
|
.nr CX \\w'\\fB\\$1'u/2 \" half the width of the key character
|
||||||
|
.nr CY \\n(CWu-\\n(CXu \" difference between the two half widths
|
||||||
|
.\" output: move right CR units, print the key letter, move right to
|
||||||
|
.\" the full width of the column, print " - " and the definition
|
||||||
|
\\h'|\\n(CYu'\\fB\\$1\\fP\\h'|\\n(CZu'\ -\ \\$2
|
||||||
|
..
|
||||||
|
.
|
||||||
|
.\" .SD = .sd with extra choices for argument; pair with .ED
|
||||||
|
.\" c - centered (original choice; as of this writing, not used by nethack)
|
||||||
|
.\" i - indented (default if choice is omitted)
|
||||||
|
.\" n - not indented
|
||||||
|
.\" SF - set (1=>indent, 0=>no-indent) by .SD, used by .ED unless centering
|
||||||
|
.de SD \" start display
|
||||||
|
. \" look for nested displays -- ILLEGAL
|
||||||
|
.ie \\n(id>0 .er "display within display"
|
||||||
|
.el \{\
|
||||||
|
. nr sf 0 \" don't center by default
|
||||||
|
. nr SF 1 \" assume indent
|
||||||
|
. ie '\\$1'c' .nr sf 1 \" center the sucker
|
||||||
|
. el .if '\\$1'n' .nr SF 0 \" don't indent if 'n'
|
||||||
|
.\}
|
||||||
|
.sn \\n(pdu \" a little bit of space
|
||||||
|
.ev 2 \" switch to display environment
|
||||||
|
.nf \" what you type is what you get
|
||||||
|
.if \\n(id=0 .di dd \" start saving text
|
||||||
|
.rs \" don't eat leading space
|
||||||
|
.nr id +1 \" increment level of display
|
||||||
|
..
|
||||||
|
.\" .ED = .ed with support for \n(SF (indent vs no-indent); pair with .SD
|
||||||
|
.de ED \" end display
|
||||||
|
.br \" flush line
|
||||||
|
.ie \\n(id<=0 .er "end display has no corresponding begin display"
|
||||||
|
.el \{\
|
||||||
|
. nr id -1 \" decrement level of display
|
||||||
|
. if \\n(id=0 \{\
|
||||||
|
. di \" end diversion
|
||||||
|
. fi \" resume filling
|
||||||
|
. in -\\n(piu \" dedent
|
||||||
|
. ev \" pop environment
|
||||||
|
. ne \\n(dnu \" be sure you have room
|
||||||
|
. nf \" don't reprocess display
|
||||||
|
. rs \" don't eat leading space
|
||||||
|
. zi \" save indents
|
||||||
|
. ie \\n(sf .in (\\n(llu-\\n(dlu)/2u \" center
|
||||||
|
. el .if \\n(SF .in +\\n(piu \" indent
|
||||||
|
. dd \" drop display
|
||||||
|
. yi \" restore indents
|
||||||
|
. \}
|
||||||
|
.\}
|
||||||
|
.fi \" resume filling
|
||||||
|
.sn \\n(pdu \" a little bit of space
|
||||||
|
..
|
||||||
|
.
|
||||||
|
.\" '.UX' is verbatim copy of tmac.n's '.ux' with the exception that
|
||||||
|
.\" the trademark owner for "UNIX" has been updated.
|
||||||
|
.de UX \" print "UNIX"
|
||||||
|
.ie \\n(ux \\&\\$2\\s-1UNIX\\s0\\$1
|
||||||
|
.el \{\
|
||||||
|
. nr ux +1 \" mark footnote as dropped
|
||||||
|
\\&\\$2\\s-1UNIX\\s0\\*(rg\\$1
|
||||||
|
. fn \" put out the footnote
|
||||||
|
\\&\\*(rgUNIX is a registered trademark of The Open Group.
|
||||||
|
. ef \" short and sweet ...
|
||||||
|
.\}
|
||||||
|
..
|
||||||
|
.
|
||||||
|
.\" .BR - hard line break with vertical padding inserted
|
||||||
|
.\" $1 - repeat count for amount of padding (optional; default is 1)
|
||||||
|
.de BR
|
||||||
|
.nr bR (\\$1-0)
|
||||||
|
.if \\n(bR<1 .nr bR 1
|
||||||
|
.nr bR \\n(bR*\\n(pd
|
||||||
|
.sn \\n(bRu
|
||||||
|
.br
|
||||||
|
..
|
||||||
|
.
|
||||||
|
.\"tmac.nh/"
|
||||||
@@ -628,6 +628,7 @@ E void FDECL(room_discovered, (int));
|
|||||||
E void FDECL(recbranch_mapseen, (d_level *, d_level *));
|
E void FDECL(recbranch_mapseen, (d_level *, d_level *));
|
||||||
E void FDECL(overview_stats, (winid, const char *, long *, long *));
|
E void FDECL(overview_stats, (winid, const char *, long *, long *));
|
||||||
E void FDECL(remdun_mapseen, (int));
|
E void FDECL(remdun_mapseen, (int));
|
||||||
|
E const char *FDECL(endgamelevelname, (char *, int));
|
||||||
|
|
||||||
/* ### eat.c ### */
|
/* ### eat.c ### */
|
||||||
|
|
||||||
@@ -2420,6 +2421,7 @@ E void NDECL(timer_sanity_check);
|
|||||||
/* ### topten.c ### */
|
/* ### topten.c ### */
|
||||||
|
|
||||||
E void FDECL(formatkiller, (char *, unsigned, int, BOOLEAN_P));
|
E void FDECL(formatkiller, (char *, unsigned, int, BOOLEAN_P));
|
||||||
|
E int FDECL(observable_depth, (d_level *));
|
||||||
E void FDECL(topten, (int, time_t));
|
E void FDECL(topten, (int, time_t));
|
||||||
E void FDECL(prscore, (int, char **));
|
E void FDECL(prscore, (int, char **));
|
||||||
E struct toptenentry *NDECL(get_rnd_toptenentry);
|
E struct toptenentry *NDECL(get_rnd_toptenentry);
|
||||||
|
|||||||
@@ -202,6 +202,7 @@ struct xwindow {
|
|||||||
XColor nh_colors[CLR_MAX];
|
XColor nh_colors[CLR_MAX];
|
||||||
XFontStruct *boldfs; /* Bold font */
|
XFontStruct *boldfs; /* Bold font */
|
||||||
Display *boldfs_dpy; /* Bold font display */
|
Display *boldfs_dpy; /* Bold font display */
|
||||||
|
char *title;
|
||||||
|
|
||||||
union {
|
union {
|
||||||
struct map_info_t *Map_info; /* map window info */
|
struct map_info_t *Map_info; /* map window info */
|
||||||
|
|||||||
@@ -1833,6 +1833,41 @@ int final;
|
|||||||
difalgn ? align_str(u.ualignbase[A_ORIGINAL]) : "");
|
difalgn ? align_str(u.ualignbase[A_ORIGINAL]) : "");
|
||||||
putstr(en_win, 0, buf);
|
putstr(en_win, 0, buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 3.6.2: dungeon level, so that ^X really has all status info as
|
||||||
|
claimed by the comment below; this reveals more information than
|
||||||
|
the basic status display, but that's one of the purposes of ^X;
|
||||||
|
similar information is revealed by #overview; the "You died in
|
||||||
|
<location>" given by really_done() is more rudimentary than this */
|
||||||
|
*buf = *tmpbuf = '\0';
|
||||||
|
if (In_endgame(&u.uz)) {
|
||||||
|
int egdepth = observable_depth(&u.uz);
|
||||||
|
|
||||||
|
(void) endgamelevelname(tmpbuf, egdepth);
|
||||||
|
Sprintf(buf, "in the endgame, on the %s%s",
|
||||||
|
!strncmp(tmpbuf, "Plane", 5) ? "Elemental " : "", tmpbuf);
|
||||||
|
} else if (Is_knox(&u.uz)) {
|
||||||
|
/* this gives away the fact that the knox branch is only 1 level */
|
||||||
|
Sprintf(buf, "on the %s level", dungeons[u.uz.dnum].dname);
|
||||||
|
/* TODO? maybe phrase it differently when actually inside the fort,
|
||||||
|
if we're able to determine that (not trivial) */
|
||||||
|
} else {
|
||||||
|
char dgnbuf[QBUFSZ];
|
||||||
|
|
||||||
|
Strcpy(dgnbuf, dungeons[u.uz.dnum].dname);
|
||||||
|
if (!strncmpi(dgnbuf, "The ", 4))
|
||||||
|
*dgnbuf = lowc(*dgnbuf);
|
||||||
|
Sprintf(tmpbuf, "level %d",
|
||||||
|
In_quest(&u.uz) ? dunlev(&u.uz) : depth(&u.uz));
|
||||||
|
/* TODO? maybe extend this bit to include various other automatic
|
||||||
|
annotations from the dungeon overview code */
|
||||||
|
if (Is_rogue_level(&u.uz))
|
||||||
|
Strcat(tmpbuf, ", a primitive area");
|
||||||
|
else if (Is_bigroom(&u.uz) && !Blind)
|
||||||
|
Strcat(tmpbuf, ", a very big room");
|
||||||
|
Sprintf(buf, "in %s, on %s", dgnbuf, tmpbuf);
|
||||||
|
}
|
||||||
|
you_are(buf, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* characteristics: expanded version of bottom line strength, dexterity, &c;
|
/* characteristics: expanded version of bottom line strength, dexterity, &c;
|
||||||
|
|||||||
+1
-2
@@ -71,7 +71,6 @@ STATIC_DCL void FDECL(traverse_mapseenchn, (BOOLEAN_P, winid,
|
|||||||
int, int, int *));
|
int, int, int *));
|
||||||
STATIC_DCL const char *FDECL(seen_string, (XCHAR_P, const char *));
|
STATIC_DCL const char *FDECL(seen_string, (XCHAR_P, const char *));
|
||||||
STATIC_DCL const char *FDECL(br_string2, (branch *));
|
STATIC_DCL const char *FDECL(br_string2, (branch *));
|
||||||
STATIC_DCL const char *FDECL(endgamelevelname, (char *, int));
|
|
||||||
STATIC_DCL const char *FDECL(shop_string, (int));
|
STATIC_DCL const char *FDECL(shop_string, (int));
|
||||||
STATIC_DCL char *FDECL(tunesuffix, (mapseen *, char *));
|
STATIC_DCL char *FDECL(tunesuffix, (mapseen *, char *));
|
||||||
|
|
||||||
@@ -2775,7 +2774,7 @@ branch *br;
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* get the name of an endgame level; topten.c does something similar */
|
/* get the name of an endgame level; topten.c does something similar */
|
||||||
STATIC_OVL const char *
|
const char *
|
||||||
endgamelevelname(outbuf, indx)
|
endgamelevelname(outbuf, indx)
|
||||||
char *outbuf;
|
char *outbuf;
|
||||||
int indx;
|
int indx;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* NetHack 3.6 eat.c $NHDT-Date: 1502754159 2017/08/14 23:42:39 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.179 $ */
|
/* NetHack 3.6 eat.c $NHDT-Date: 1540596900 2018/10/26 23:35:00 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.193 $ */
|
||||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/*-Copyright (c) Robert Patrick Rankin, 2012. */
|
/*-Copyright (c) Robert Patrick Rankin, 2012. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
@@ -110,14 +110,18 @@ register struct obj *obj;
|
|||||||
return (boolean) (obj->oclass == FOOD_CLASS);
|
return (boolean) (obj->oclass == FOOD_CLASS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* used for hero init, life saving (if choking), and prayer results of fix
|
||||||
|
starving, fix weak from hunger, or golden glow boon (if u.uhunger < 900) */
|
||||||
void
|
void
|
||||||
init_uhunger()
|
init_uhunger()
|
||||||
{
|
{
|
||||||
context.botl = (u.uhs != NOT_HUNGRY || ATEMP(A_STR) < 0);
|
context.botl = (u.uhs != NOT_HUNGRY || ATEMP(A_STR) < 0);
|
||||||
u.uhunger = 900;
|
u.uhunger = 900;
|
||||||
u.uhs = NOT_HUNGRY;
|
u.uhs = NOT_HUNGRY;
|
||||||
if (ATEMP(A_STR) < 0)
|
if (ATEMP(A_STR) < 0) {
|
||||||
ATEMP(A_STR) = 0;
|
ATEMP(A_STR) = 0;
|
||||||
|
(void) encumber_msg();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* tin types [SPINACH_TIN = -1, overrides corpsenm, nut==600] */
|
/* tin types [SPINACH_TIN = -1, overrides corpsenm, nut==600] */
|
||||||
|
|||||||
+4
-2
@@ -1,4 +1,4 @@
|
|||||||
/* NetHack 3.6 hack.c $NHDT-Date: 1518861490 2018/02/17 09:58:10 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.182 $ */
|
/* NetHack 3.6 hack.c $NHDT-Date: 1540591769 2018/10/26 22:09:29 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.194 $ */
|
||||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/*-Copyright (c) Derek S. Ray, 2015. */
|
/*-Copyright (c) Derek S. Ray, 2015. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
@@ -1213,8 +1213,10 @@ struct trap *desttrap; /* nonnull if another trap at <x,y> */
|
|||||||
break;
|
break;
|
||||||
case TT_WEB:
|
case TT_WEB:
|
||||||
if (uwep && uwep->oartifact == ART_STING) {
|
if (uwep && uwep->oartifact == ART_STING) {
|
||||||
|
/* escape trap but don't move and don't destroy it */
|
||||||
|
u.utrap = 0; /* caller will call reset_utrap() */
|
||||||
pline("Sting cuts through the web!");
|
pline("Sting cuts through the web!");
|
||||||
break; /* escape trap but don't move */
|
break;
|
||||||
}
|
}
|
||||||
if (--u.utrap) {
|
if (--u.utrap) {
|
||||||
if (flags.verbose) {
|
if (flags.verbose) {
|
||||||
|
|||||||
+6
-2
@@ -1,4 +1,4 @@
|
|||||||
/* NetHack 3.6 pray.c $NHDT-Date: 1539804904 2018/10/17 19:35:04 $ $NHDT-Branch: keni-makedefsm $:$NHDT-Revision: 1.103 $ */
|
/* NetHack 3.6 pray.c $NHDT-Date: 1540596912 2018/10/26 23:35:12 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.104 $ */
|
||||||
/* Copyright (c) Benson I. Margulies, Mike Stephenson, Steve Linhart, 1989. */
|
/* Copyright (c) Benson I. Margulies, Mike Stephenson, Steve Linhart, 1989. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
|
|
||||||
@@ -1074,7 +1074,11 @@ aligntyp g_align;
|
|||||||
u.uhp = u.uhpmax;
|
u.uhp = u.uhpmax;
|
||||||
if (Upolyd)
|
if (Upolyd)
|
||||||
u.mh = u.mhmax;
|
u.mh = u.mhmax;
|
||||||
ABASE(A_STR) = AMAX(A_STR);
|
if (ABASE(A_STR) < AMAX(A_STR)) {
|
||||||
|
ABASE(A_STR) = AMAX(A_STR);
|
||||||
|
context.botl = 1; /* before potential message */
|
||||||
|
(void) encumber_msg();
|
||||||
|
}
|
||||||
if (u.uhunger < 900)
|
if (u.uhunger < 900)
|
||||||
init_uhunger();
|
init_uhunger();
|
||||||
/* luck couldn't have been negative at start of prayer because
|
/* luck couldn't have been negative at start of prayer because
|
||||||
|
|||||||
+1
-2
@@ -62,7 +62,6 @@ struct toptenentry {
|
|||||||
|
|
||||||
STATIC_DCL void FDECL(topten_print, (const char *));
|
STATIC_DCL void FDECL(topten_print, (const char *));
|
||||||
STATIC_DCL void FDECL(topten_print_bold, (const char *));
|
STATIC_DCL void FDECL(topten_print_bold, (const char *));
|
||||||
STATIC_DCL xchar FDECL(observable_depth, (d_level *));
|
|
||||||
STATIC_DCL void NDECL(outheader);
|
STATIC_DCL void NDECL(outheader);
|
||||||
STATIC_DCL void FDECL(outentry, (int, struct toptenentry *, BOOLEAN_P));
|
STATIC_DCL void FDECL(outentry, (int, struct toptenentry *, BOOLEAN_P));
|
||||||
STATIC_DCL void FDECL(discardexcess, (FILE *));
|
STATIC_DCL void FDECL(discardexcess, (FILE *));
|
||||||
@@ -178,7 +177,7 @@ const char *x;
|
|||||||
putstr(toptenwin, ATR_BOLD, x);
|
putstr(toptenwin, ATR_BOLD, x);
|
||||||
}
|
}
|
||||||
|
|
||||||
STATIC_OVL xchar
|
int
|
||||||
observable_depth(lev)
|
observable_depth(lev)
|
||||||
d_level *lev;
|
d_level *lev;
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# NetHack Documentation Makefile.
|
# NetHack Documentation Makefile.
|
||||||
# NetHack 3.6 Makefile.doc $NHDT-Date: 1524689449 2018/04/25 20:50:49 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.16 $
|
# NetHack 3.6 Makefile.doc $NHDT-Date: 1540625947 2018/10/27 07:39:07 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.17 $
|
||||||
# Copyright (c) 2015 by Kenneth Lorber, Kensington, Maryland
|
# Copyright (c) 2015 by Kenneth Lorber, Kensington, Maryland
|
||||||
# NetHack may be freely redistributed. See license for details.
|
# NetHack may be freely redistributed. See license for details.
|
||||||
|
|
||||||
@@ -45,11 +45,11 @@ NHGREP = $(MAKEDEFS) --grep --input - --output -
|
|||||||
GUIDE_PREFORMAT = cat Guidebook.mn | $(NHGREP) | tbl tmac.n -
|
GUIDE_PREFORMAT = cat Guidebook.mn | $(NHGREP) | tbl tmac.n -
|
||||||
|
|
||||||
# the basic guidebook
|
# the basic guidebook
|
||||||
Guidebook: Guidebook.mn
|
Guidebook: Guidebook.mn tmac.n tmac.nh
|
||||||
$(GUIDECMD) > Guidebook
|
$(GUIDECMD) > Guidebook
|
||||||
|
|
||||||
# Fancier output for those with ditroff, psdit and a PostScript printer.
|
# Fancier output for those with ditroff, psdit and a PostScript printer.
|
||||||
Guidebook.ps: Guidebook.mn
|
Guidebook.ps: Guidebook.mn tmac.n tmac.nh
|
||||||
$(GUIDE_PREFORMAT) | $(PSCMD) > Guidebook.ps
|
$(GUIDE_PREFORMAT) | $(PSCMD) > Guidebook.ps
|
||||||
|
|
||||||
# Guidebook.tex is the same as Guidebook.mn but formatted with LaTeX.
|
# Guidebook.tex is the same as Guidebook.mn but formatted with LaTeX.
|
||||||
@@ -95,7 +95,7 @@ DISTRIB = Guidebook.txt nethack.txt lev_comp.txt dgn_comp.txt recover.txt \
|
|||||||
distrib: $(DISTRIB)
|
distrib: $(DISTRIB)
|
||||||
@echo "Plain text documentation is up to date."
|
@echo "Plain text documentation is up to date."
|
||||||
|
|
||||||
Guidebook.txt : Guidebook.mn tmac.n
|
Guidebook.txt : Guidebook.mn tmac.n tmac.nh
|
||||||
$(GUIDECMD) > Guidebook.txt
|
$(GUIDECMD) > Guidebook.txt
|
||||||
MAN2TXT = $(NHGREP) | nroff -man - | $(COLCMD)
|
MAN2TXT = $(NHGREP) | nroff -man - | $(COLCMD)
|
||||||
nethack.txt : nethack.6
|
nethack.txt : nethack.6
|
||||||
|
|||||||
+20
-133
@@ -164,8 +164,6 @@ static void FDECL(done_button, (Widget, XtPointer, XtPointer));
|
|||||||
static void FDECL(getline_delete, (Widget, XEvent *, String *, Cardinal *));
|
static void FDECL(getline_delete, (Widget, XEvent *, String *, Cardinal *));
|
||||||
static void FDECL(abort_button, (Widget, XtPointer, XtPointer));
|
static void FDECL(abort_button, (Widget, XtPointer, XtPointer));
|
||||||
static void NDECL(release_getline_widgets);
|
static void NDECL(release_getline_widgets);
|
||||||
static void FDECL(delete_file, (Widget, XEvent *, String *, Cardinal *));
|
|
||||||
static void FDECL(dismiss_file, (Widget, XEvent *, String *, Cardinal *));
|
|
||||||
static void FDECL(yn_delete, (Widget, XEvent *, String *, Cardinal *));
|
static void FDECL(yn_delete, (Widget, XEvent *, String *, Cardinal *));
|
||||||
static void FDECL(yn_key, (Widget, XEvent *, String *, Cardinal *));
|
static void FDECL(yn_key, (Widget, XEvent *, String *, Cardinal *));
|
||||||
static void NDECL(release_yn_widgets);
|
static void NDECL(release_yn_widgets);
|
||||||
@@ -1077,6 +1075,7 @@ int type;
|
|||||||
wp->nh_colors_inited = FALSE;
|
wp->nh_colors_inited = FALSE;
|
||||||
wp->boldfs = (XFontStruct *) 0;
|
wp->boldfs = (XFontStruct *) 0;
|
||||||
wp->boldfs_dpy = (Display *) 0;
|
wp->boldfs_dpy = (Display *) 0;
|
||||||
|
wp->title = (char *) 0;
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case NHW_MAP:
|
case NHW_MAP:
|
||||||
@@ -1227,6 +1226,11 @@ winid window;
|
|||||||
wp->boldfs_dpy = (Display *) 0;
|
wp->boldfs_dpy = (Display *) 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (wp->title) {
|
||||||
|
free(wp->title);
|
||||||
|
wp->title = (char *) 0;
|
||||||
|
}
|
||||||
|
|
||||||
switch (wp->type) {
|
switch (wp->type) {
|
||||||
case NHW_MAP:
|
case NHW_MAP:
|
||||||
destroy_map_window(wp);
|
destroy_map_window(wp);
|
||||||
@@ -1369,8 +1373,6 @@ Widget toplevel = (Widget) 0; /* toplevel widget */
|
|||||||
Atom wm_delete_window; /* pop down windows */
|
Atom wm_delete_window; /* pop down windows */
|
||||||
|
|
||||||
static XtActionsRec actions[] = {
|
static XtActionsRec actions[] = {
|
||||||
{ nhStr("dismiss_file"), dismiss_file }, /* file viewing widget */
|
|
||||||
{ nhStr("delete_file"), delete_file }, /* file delete-window */
|
|
||||||
{ nhStr("dismiss_text"), dismiss_text }, /* text widget button action */
|
{ nhStr("dismiss_text"), dismiss_text }, /* text widget button action */
|
||||||
{ nhStr("delete_text"), delete_text }, /* text widget delete action */
|
{ nhStr("delete_text"), delete_text }, /* text widget delete action */
|
||||||
{ nhStr("key_dismiss_text"), key_dismiss_text }, /* text key action */
|
{ nhStr("key_dismiss_text"), key_dismiss_text }, /* text key action */
|
||||||
@@ -1917,46 +1919,6 @@ char *input;
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Display file ----------------------------------------------------------- */
|
/* Display file ----------------------------------------------------------- */
|
||||||
static const char display_translations[] = "#override\n\
|
|
||||||
<Key>q: dismiss_file()\n\
|
|
||||||
<Key>Escape: dismiss_file()\n\
|
|
||||||
<BtnDown>: dismiss_file()";
|
|
||||||
|
|
||||||
/* WM_DELETE_WINDOW callback for file dismissal. */
|
|
||||||
/*ARGSUSED*/
|
|
||||||
static void
|
|
||||||
delete_file(w, event, params, num_params)
|
|
||||||
Widget w;
|
|
||||||
XEvent *event;
|
|
||||||
String *params;
|
|
||||||
Cardinal *num_params;
|
|
||||||
{
|
|
||||||
nhUse(event);
|
|
||||||
nhUse(params);
|
|
||||||
nhUse(num_params);
|
|
||||||
|
|
||||||
nh_XtPopdown(w);
|
|
||||||
XtDestroyWidget(w);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Callback for file dismissal. */
|
|
||||||
/*ARGSUSED*/
|
|
||||||
static void
|
|
||||||
dismiss_file(w, event, params, num_params)
|
|
||||||
Widget w;
|
|
||||||
XEvent *event;
|
|
||||||
String *params;
|
|
||||||
Cardinal *num_params;
|
|
||||||
{
|
|
||||||
Widget popup = XtParent(w);
|
|
||||||
|
|
||||||
nhUse(event);
|
|
||||||
nhUse(params);
|
|
||||||
nhUse(num_params);
|
|
||||||
|
|
||||||
nh_XtPopdown(popup);
|
|
||||||
XtDestroyWidget(popup);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
X11_display_file(str, complain)
|
X11_display_file(str, complain)
|
||||||
@@ -1964,17 +1926,8 @@ const char *str;
|
|||||||
boolean complain;
|
boolean complain;
|
||||||
{
|
{
|
||||||
dlb *fp;
|
dlb *fp;
|
||||||
Arg args[12];
|
|
||||||
Cardinal num_args;
|
|
||||||
Widget popup, dispfile;
|
|
||||||
Position top_margin, bottom_margin, left_margin, right_margin;
|
|
||||||
XFontStruct *fs;
|
|
||||||
int new_width, new_height;
|
|
||||||
#define LLEN 128
|
#define LLEN 128
|
||||||
char line[LLEN];
|
char line[LLEN];
|
||||||
int num_lines;
|
|
||||||
char *textlines, *bp;
|
|
||||||
int charcount;
|
|
||||||
|
|
||||||
/* Use the port-independent file opener to see if the file exists. */
|
/* Use the port-independent file opener to see if the file exists. */
|
||||||
fp = dlb_fopen(str, RDTMODE);
|
fp = dlb_fopen(str, RDTMODE);
|
||||||
@@ -1985,92 +1938,26 @@ boolean complain;
|
|||||||
return; /* it doesn't exist, ignore */
|
return; /* it doesn't exist, ignore */
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
winid newwin = X11_create_nhwindow(NHW_MENU);
|
||||||
* Count the number of lines and characters in the file.
|
struct xwindow *wp = &window_list[newwin];
|
||||||
*/
|
anything any = zeroany;
|
||||||
num_lines = 0;
|
menu_item *menu_list;
|
||||||
charcount = 1;
|
|
||||||
|
X11_start_menu(newwin);
|
||||||
|
|
||||||
while (dlb_fgets(line, LLEN, fp)) {
|
while (dlb_fgets(line, LLEN, fp)) {
|
||||||
num_lines++;
|
X11_add_menu(newwin, NO_GLYPH, &any, 0, 0, ATR_NONE, line, MENU_UNSELECTED);
|
||||||
charcount += strlen(line);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
(void) dlb_fclose(fp);
|
(void) dlb_fclose(fp);
|
||||||
|
|
||||||
/* Ignore empty files */
|
/* show file name as the window title */
|
||||||
if (num_lines == 0)
|
if (str)
|
||||||
return;
|
wp->title = dupstr(str);
|
||||||
|
|
||||||
/* If over the max window size, truncate the window size to the max */
|
wp->menu_information->permi = FALSE;
|
||||||
if (num_lines >= DISPLAY_FILE_SIZE)
|
(void) X11_select_menu(newwin, PICK_NONE, &menu_list);
|
||||||
num_lines = DISPLAY_FILE_SIZE;
|
X11_destroy_nhwindow(newwin);
|
||||||
|
|
||||||
/*
|
|
||||||
* Re-open the file and read the data into a buffer. Cannot use
|
|
||||||
* the XawAsciiFile type of widget, because that is not DLB-aware.
|
|
||||||
*/
|
|
||||||
textlines = (char *) alloc((unsigned int) charcount);
|
|
||||||
textlines[0] = '\0';
|
|
||||||
|
|
||||||
fp = dlb_fopen(str, RDTMODE);
|
|
||||||
|
|
||||||
bp = textlines;
|
|
||||||
while (dlb_fgets(line, LLEN, fp)) {
|
|
||||||
Strcpy((bp = eos(bp)), line);
|
|
||||||
}
|
|
||||||
|
|
||||||
(void) dlb_fclose(fp);
|
|
||||||
|
|
||||||
num_args = 0;
|
|
||||||
XtSetArg(args[num_args], nhStr(XtNtitle), str); num_args++;
|
|
||||||
|
|
||||||
popup = XtCreatePopupShell("display_file", topLevelShellWidgetClass,
|
|
||||||
toplevel, args, num_args);
|
|
||||||
XtOverrideTranslations(popup,
|
|
||||||
XtParseTranslationTable("<Message>WM_PROTOCOLS: delete_file()"));
|
|
||||||
|
|
||||||
num_args = 0;
|
|
||||||
XtSetArg(args[num_args], nhStr(XtNscrollHorizontal),
|
|
||||||
XawtextScrollWhenNeeded); num_args++;
|
|
||||||
XtSetArg(args[num_args], nhStr(XtNscrollVertical), XawtextScrollAlways);
|
|
||||||
num_args++;
|
|
||||||
XtSetArg(args[num_args], nhStr(XtNtype), XawAsciiString); num_args++;
|
|
||||||
XtSetArg(args[num_args], nhStr(XtNstring), textlines); num_args++;
|
|
||||||
XtSetArg(args[num_args], nhStr(XtNdisplayCaret), False); num_args++;
|
|
||||||
XtSetArg(args[num_args], nhStr(XtNtranslations),
|
|
||||||
XtParseTranslationTable(display_translations)); num_args++;
|
|
||||||
|
|
||||||
dispfile = XtCreateManagedWidget("text", /* name */
|
|
||||||
asciiTextWidgetClass, popup, /* parent */
|
|
||||||
args, num_args);
|
|
||||||
|
|
||||||
/* Get font and border information. */
|
|
||||||
num_args = 0;
|
|
||||||
XtSetArg(args[num_args], nhStr(XtNfont), &fs); num_args++;
|
|
||||||
XtSetArg(args[num_args], nhStr(XtNtopMargin), &top_margin); num_args++;
|
|
||||||
XtSetArg(args[num_args], nhStr(XtNbottomMargin), &bottom_margin);
|
|
||||||
num_args++;
|
|
||||||
XtSetArg(args[num_args], nhStr(XtNleftMargin), &left_margin); num_args++;
|
|
||||||
XtSetArg(args[num_args], nhStr(XtNrightMargin), &right_margin);
|
|
||||||
num_args++;
|
|
||||||
XtGetValues(dispfile, args, num_args);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The data files are currently set up assuming an 80 char wide window
|
|
||||||
* and a fixed width font. Soo..
|
|
||||||
*/
|
|
||||||
new_height =
|
|
||||||
num_lines * nhFontHeight(dispfile) + top_margin + bottom_margin;
|
|
||||||
new_width = 80 * fs->max_bounds.width + left_margin + right_margin;
|
|
||||||
|
|
||||||
/* Set the new width and height. */
|
|
||||||
num_args = 0;
|
|
||||||
XtSetArg(args[num_args], XtNwidth, new_width); num_args++;
|
|
||||||
XtSetArg(args[num_args], XtNheight, new_height); num_args++;
|
|
||||||
XtSetValues(dispfile, args, num_args);
|
|
||||||
|
|
||||||
nh_XtPopup(popup, (int) XtGrabNone, (Widget) 0);
|
|
||||||
free(textlines);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* yn_function ------------------------------------------------------------ */
|
/* yn_function ------------------------------------------------------------ */
|
||||||
|
|||||||
@@ -819,6 +819,9 @@ menu_item **menu_list;
|
|||||||
XtSetArg(args[num_args], nhStr(XtNheight), menu_info->permi_h);
|
XtSetArg(args[num_args], nhStr(XtNheight), menu_info->permi_h);
|
||||||
num_args++;
|
num_args++;
|
||||||
}
|
}
|
||||||
|
if (wp->title) {
|
||||||
|
XtSetArg(args[num_args], nhStr(XtNtitle), wp->title); num_args++;
|
||||||
|
}
|
||||||
wp->popup = XtCreatePopupShell((window == WIN_INVEN)
|
wp->popup = XtCreatePopupShell((window == WIN_INVEN)
|
||||||
? "inventory" : "menu",
|
? "inventory" : "menu",
|
||||||
(how == PICK_NONE)
|
(how == PICK_NONE)
|
||||||
|
|||||||
Reference in New Issue
Block a user