curses options and status groundwork

More groundwork for overhauling the status display for curses, plus
a few functional changes.  It was doing a full status update for
every changed field (except conditions), instead of waiting for a
flush directive after gathering multiple changes at a time.  Since
it already does gather every change, the fix to wait is trivial.

This decouples 'hitpointbar' from 'statushilites'.  When highlighting
is off, it uses inverse video only.  When on, it behaves as before:
using inverse video plus the most recent color used to highlight HP
(which can vary if that has rules to highlight changes or percentage
thresholds) but ignoring any HP attribute(s).  This also enables the
latent 'statuslines' option and changes 'windowborders' option from
being settable at startup only to changeable during play.

'statuslines' can have a value of 2 (the default) or 3 and applies to
'align_status:bottom' or 'top'; it's ignored for 'left' and 'right'.
At the moment, setting it to 3 only allows status condition overflow
to wrap from the end of line to 2 to the beginning of line 3, and if
window borders are drawn they'll clobber the last character on line 2
and first one on line 3.  There's no point in trying to fix that
because it will go away when the main status overhaul changes go in.
Condition wrapping for vertical orientation (left or right placement)
was already subject to the same phenomenon and will be superseded too.

This also changes the meaning of the 'windowborders' value so could
impact players using source from git (or possibly beta binaries for
Windows, but not for OSX where curses interface wasn't included).
Old:
 0 = unspecified, 1 = On, 2 = Off, 3 = Auto (On if display is big
     enough, Off otherwise; reevaluated after dynamic resizing);
 Unspecified got changed to 3 during curses windowing initialization.
New:
 0 = Off, 1 = On, 2 = Auto;
 0 gets changed to 2 for default value at start of options processing.
So old value of 2 is changing meaning and explicit old value of 3 is
becoming invalid.  Implicit 3 changes to default 2.  Explicit 3 could
be the subject of a fixup but there isn't much point since 2 can't
have a similar fix.  Users who are using old 2 or explicit 3 will need
to update their run-time config files.

This adds 'statuslines' to the Guidebook and moves some other recently
added documentation of curses options from among the general options
(section 9.4) to "Window Port Customization options" (section 9.5).
None of them have been added to dat/opthelp which seems to be missing
all the wincap options.

Originally I made a lot of changes (mostly moving C99 declarations to
start of their blocks) to the old '#if 0' code at end of cursstat.c,
but have tossed those, except for one subtle bug that assumed 'int'
and 'long' are the same size.
This commit is contained in:
PatR
2019-03-21 14:33:39 -07:00
parent 7049145712
commit 5efea7115a
10 changed files with 336 additions and 282 deletions

View File

@@ -1,4 +1,4 @@
.\" $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.299 $ $NHDT-Date: 1551488947 2019/03/02 01:09:07 $
.\" $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.300 $ $NHDT-Date: 1553204011 2019/03/21 21:33:31 $
.\"
.\" This is an excerpt from the 'roff' man page from the 'groff' package.
.\" NetHack's Guidebook.mn currently does *not* adhere to these guidelines.
@@ -24,7 +24,7 @@
.ds vr "NetHack 3.6
.ds f0 "\*(vr
.ds f1
.ds f2 "February 27, 2019
.ds f2 "March 19, 2019
.
.\" A note on some special characters:
.\" \(lq = left double quote
@@ -3010,10 +3010,6 @@ Gold is never blessed or cursed, but it is not described as \(lquncursed\(rq
even when the
.op implicit_uncursed
option is \(lqoff\(rq.
.lp guicolor
Use color text and/or highlighting attributes when displaying some
non-map data (such as menu selector letters).
Curses interface only; default is on.
.lp "help "
If more information is available for an object looked at
with the \(oq/\(cq command, ask if you want to see it (default on).
@@ -3281,6 +3277,7 @@ such as \(lqparanoid_confirmation:attack pray Remove\(rq.
.lp perm_invent
If true, always display your current inventory in a window. This only
makes sense for windowing system interfaces that implement this feature.
.\" petattr is a wincap option but we'll document it here...
.lp petattr
Specifies one or more text highlighting attributes to use when showing
pets on the map.
@@ -3308,7 +3305,7 @@ Currently multiple highlight-style letters can be combined by simply
stringing them together (for example, \(lqbk\(rq), but in the future
they might require being separated by plus signs (such as \(lqb+k\(rq,
which works already).
When using the \(oqN\(cq choice, it should be specified on its own,
When using the \(oqn\(cq choice, it should be specified on its own,
not in combination with any of the other letters.
.lp pettype
Specify the type of your initial pet, if you are playing a character class
@@ -3473,13 +3470,6 @@ and prior versions (for example \(lqsuppress_alert:3.3.1\(rq).
This option may be used to select one of the named symbol sets found within
\(lqsymbols\(rq to alter the symbols displayed on the screen.
Use \(lqsymset:default\(rq to explicitly select the default symbols.
.lp "term_cols\ \ \fIand\fP"
.lp term_rows
Curses interface only.
Number of columns and rows to use for the display.
Curses will attempt to resize to the values specified but will settle
for smaller sizes if they are too big.
Default is the current window size.
.lp "time "
Show the elapsed game time in turns on bottom line (default off).
Persistent.
@@ -3554,26 +3544,20 @@ When getting a location on the map, and using shifted movement keys or
meta-digit keys to fast-move, instead of moving 8 units at a time,
move by skipping the same glyphs.
(default off)
.lp windowborders
Whether to draw boxes around the map, status area, message area, and
persistent inventory window if enabled.
Curses interface only.
Acceptable values are
.sd
.si
.CC 1 "on, always show borders"
.CC 2 "off, never show borders"
.CC 3 "auto, on if terminal or window is at least (24+2)x(80+2)\ \ (default)"
.ei
.ed
.lp ""
(The 26x82 size threshold for \(oq3\(cq refers to number of rows and
columns of the display.)
.lp windowtype
When the program has been built to support multiple interfaces,
select which one to use, such as \(lqtty\(rq or \(lqX11\(rq
(default depends on build-time settings; use \(lq#version\(rq to check).
Cannot be set with the \(oqO\(cq command.
.lp ""
When used, it should be the first option set since its value might
enable or disable the availability of various other options.
For multiple lines in a configuration file, that would be the first
non-comment line.
For a comma-separated list in NETHACKOPTIONS or an OPTIONS line in a
configuration file,
that would
be the \fIrightmost\fP option in the list.
.lp wizweight
Augment object descriptions with their objects' weight (default off).
Debug mode only.
@@ -3634,6 +3618,10 @@ If NetHack can, it should use this size font for text windows.
.lp fullscreen
If NetHack can, it should try and display on the entire screen rather than
in a window.
.lp guicolor
Use color text and/or highlighting attributes when displaying some
non-map data (such as menu selector letters).
Curses interface only; default is on.
.lp large_font
If NetHack can, it should use a large font.
.lp map_mode
@@ -3665,6 +3653,17 @@ Handhelds are most likely to support this option.
.lp splash_screen
If NetHack can, it should display an opening splash screen when it starts
up (default yes).
.lp statuslines
Number of lines for traditional below-the-map status display.
Acceptable values are 2 and 3 (default is 2).
Curses interface only.
.lp "term_cols\ \ \fIand\fP"
.lp term_rows
Curses interface only.
Number of columns and rows to use for the display.
Curses will attempt to resize to the values specified but will settle
for smaller sizes if they are too big.
Default is the current window size.
.lp tiled_map
If NetHack can, it should display a tiled map if it can.
.lp tile_file
@@ -3680,6 +3679,24 @@ If NetHack can, it should display inverse when the game specifies it.
.lp vary_msgcount
If NetHack can, it should display this number of messages at a time in
the message window.
.lp windowborders
Whether to draw boxes around the map, status area, message area, and
persistent inventory window if enabled.
Curses interface only.
Acceptable values are
.sd
.si
.CC 0 "off, never show borders"
.CC 1 "on, always show borders"
.CC 2 "auto, on if display is at least (24+2)x(80+2)\ \ (default)"
.ei
.ed
.lp ""
(The 26x82 size threshold for \(oq2\(cq refers to number of rows and
columns of the display.
A width of at least 110 columns (80+2+26+2) is needed for
.op align_status
set to \f(CRleft\fP or \f(CRright\fP.)
.lp windowcolors
If NetHack can, it should display windows with the specified
foreground/background colors. Windows GUI only. The format is