Commit Graph

8532 Commits

Author SHA1 Message Date
nhmall
c3b89f775e Merge branch 'NetHack-3.6.2' 2019-03-21 18:18:34 -04:00
nhmall
bd3a61597d Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2019-03-21 18:18:10 -04:00
PatR
5efea7115a 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.
2019-03-21 14:33:39 -07:00
nhmall
5a7d780db6 Merge branch 'NetHack-3.6.2' 2019-03-20 09:28:48 -04:00
nhmall
6a553235b3 Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2019-03-20 09:28:23 -04:00
PatR
7049145712 curses update
Miscellaenous stuff either groundwork for or noticed while updating
curses status.  The status changes themselves need some more testing.
One or two of the comments refer to that revised status which hasn't
been checked in yet.
2019-03-18 15:08:01 -07:00
PatR
44a7bfbab6 decode_mixed()'s return type
decode_mixed() writes its output into a 'char *' buffer that's passed
in to it and then returns that buffer.  Some excessively paranoid
error checking forced to return 'const char *'.  Relax that and use
'char *' so callers can work with the result without extra casts.
2019-03-18 14:38:30 -07:00
nhmall
d52ab63f33 Merge branch 'NetHack-3.6.2' 2019-03-15 20:57:59 -04:00
nhmall
49e69e4730 Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2019-03-15 20:57:10 -04:00
PatR
9d67cd1597 status lines' "End Game"
Change the generic status line location "End Game" to relevant element
name "Earth", "Air", &c.  ("Plane of <element>" might be too long if
hungry and encumbered and afflicted by conditions.  "Astral Plane" is
already specific so not affected.)
2019-03-15 17:51:39 -07:00
PatR
ed55fa23f6 hacklib.c tidbit
Describe 'trimspaces()' more accurately.
2019-03-15 01:45:10 -07:00
PatR
3d4164bcce curses STATUS_HILITES
Honor hilite_status rules specifying color even if curses-specific
option 'guicolor' is off.

Update status from scratch when 'O' is used to manipulate hilite_status
rules.
2019-03-15 01:12:59 -07:00
nhmall
fc9dde7ae1 Merge branch 'NetHack-3.6.2' 2019-03-13 20:21:56 -04:00
nhmall
6a2f843366 Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2019-03-13 20:19:12 -04:00
nhmall
963cb352bc Merge branch 'NetHack-3.6.2-beta01' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.6.2-beta01 2019-03-13 20:04:50 -04:00
nhmall
12aedbd60f Merge branch 'NetHack-3.6.2-beta01' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.6.2-beta01 2019-03-13 20:04:16 -04:00
nhmall
13c0428721 even more mingw 2019-03-13 19:59:57 -04:00
nhmall
acc92bcacb yet more mingw w64 build
Fix:
../sys/winnt/nhraykey.c: In function 'CheckInput':
../sys/winnt/nhraykey.c:459:37: warning: type of 'mode' defaults to 'int' [-Wimplicit-int]
 int __declspec(dllexport) __stdcall CheckInput(hConIn, ir, count, numpad,
                                     ^~~~~~~~~~
2019-03-13 19:55:43 -04:00
PatR
ccd6d1407e curses: hilite_pet, hilite_pile without color
The curses interface was ignoring video attributes (bold, inverse, &c)
when color is toggled off or if built with TEXTCOLOR disabled.  Honor
attributes regardless of whether color is displayed.

Also, toggling 'hilite_pet' On during play wouldn't do anything if the
curses-specific 'petattr' option had been left as None.  (It worked as
intended if set in starting options.)
2019-03-13 16:50:56 -07:00
PatR
62a34040bd X11 graphical tombstone tweak
Add some bullet-proofing to the X11 graphical tombstone sanity check.
Probably not necessary but better safe than sorry.
2019-03-12 18:37:15 -07:00
nhmall
80683eacaf re-comment some optional Makefile lines for sys/winnt/Makefile.gcc 2019-03-12 21:32:54 -04:00
nhmall
9604e50e3d more mingw 2019-03-12 21:30:22 -04:00
nhmall
fa186b49a1 Merge branch 'NetHack-3.6.2' 2019-03-12 21:18:46 -04:00
nhmall
03b4ba21f8 Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2019-03-12 21:18:21 -04:00
nhmall
93201e9e24 first attempt at mingw w64 build for Windows 2019-03-12 21:14:43 -04:00
PatR
e0bf7a01cc nethack.sh: test -e vs test -f
Change the test for whether fonts.dir exists (added to the script
in 3.6.0, for automatically setting up possible use of the NH10 font
under X11) from 'test -e file' to 'test -f file' since the latter
seems to be more universally available.  When present, fonts.dir is
plain text, so a test for "exists and is a regular file" rather than
one for general existance is appropriate.
2019-03-12 14:11:26 -07:00
PatR
8e7fe38dae avoid crash for X11 tombstone
If nethack is built to use graphical tombstone but file rip.xpm is
missing from the playground, there would be a crash if the rip output
was shown.  My first attempt to fix it prevented the crash but didn't
display any tombstone, just the last couple of lines of output which
follow the tombstone.  This keeps that in case of some other Xpm
failure, but checks for rip.xpm via stdio and reverts to genl_outrip
for text tombstone if it can't be opened.
2019-03-12 13:31:00 -07:00
PatR
44639ab1e8 long #version feedback
Hide a bug in the X11 interface by manually wrapping 'short' version
line (the first line of #version output) when runtime ID or git hash
and/or branch is present.  Otherwise the very wide 'short' line causes
a horizontal scrollbar to be present at the bottom of the popup window,
but the window size doesn't take that into account so ends up being
one line too short.  Worse, there's no vertical scrollbar to bring the
last line into view.

Even if somebody figures out how to fix that properly, the really wide
line above a couple of paragraphs which have been carefully wrapped
for a much narrower width looked strange.

Also, move the 'short' version's period to the end of the text.
old: basic version info. (extra info)
new: basic version info (extra info).
2019-03-11 18:11:21 -07:00
PatR
53777fa03a win/curses comment
Twice I've gone through the curses code to deal with CHAR_P, BOOLEAN_P,
and so forth.  Both times I eventually changed my mind.  This time I'm
just adding an explanatory comment instead.
2019-03-10 16:06:29 -07:00
PatR
683226c3c5 curses vs extended commands
Extend the earlier support for Delete/Rubout in getline() to the
text entry for extended commands.  In other words, treat <delete>
and <backspace> as synonyms in both places.

Some reformatting too, but only in a couple of the files.
2019-03-10 14:53:31 -07:00
PatR
02b21865fd more UCHAR_P
When setting up an alternate definition for UCHAR_P to accommodate
DEC C's non-ANSI mode(s), leave the default definition to tradstdc.h.
DEC C's VAXC mode will end up expecting 'unsigned char' rather than
either 'int' or 'unsigned int'.  Not applicable for Unix but this
makes similar change there as is being made for VMS.
2019-03-08 11:48:31 -08:00
nhmall
7e79bb2169 Merge branch 'NetHack-3.6.2' 2019-03-08 10:38:18 -05:00
nhmall
0050608f57 Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2019-03-08 10:31:46 -05:00
PatR
df84da3ec2 vms update
Suppress Isaac64 on VAX were there isn't an easy way to do 64-bit
arithmetic.  (Hard way isn't worth it for just an alternate RNG.)

Eliminate or suppress some diagnostics:

1) In strict ANSI mode, DEC C was reporting that '$' in identifier is
an extension (one time for each file in sys/vms/*.c).  (It doesn't do
that for the default 'relaxed ANSI' mode.)

2) DEC C uses WIDENED_PROTOTYPES but widens uchar (unsigned char)
differently depending upon the mode it is operating in.  (Applies to
Unix as well as VMS; based on documentation rather than testing.)

Update the comment in tradstdc.h about WIDENED vs UNWIDENED_PROTOTYPES.

An old comment in config1.h about a problem with the earliest version
of DEC C was probably based on an incorrect assumption of what was
really going, but I have no way to go back in time to verify that....
2019-03-07 17:12:01 -08:00
PatR
8728de2a0a fix #H8330 - kicking obj stack uses wrong weight
Kicking a stack splits off one item (except for gold coins) and
propels it, but the range for how far it would move was calculated
before the split using the entire stack's weight.  So a large stack of
small items might fail with "thump" (which the report suggested hurt
the hero, but it doesn't) and none of the stack would move.  Splitting
sooner looked complicated because of several potential early returns
between the range calculation and the eventual kick, so this hacks the
stack's quantity to get the intended weight instead.
2019-03-06 16:59:39 -08:00
PatR
62507fa40f sys/share/*_yacc.c update
For the pre-generated yacc sources, revert to the version of byacc
used for 3.6.1 and 3.6.0 to avoid unnecessary changes for 3.6.2.
2019-03-06 11:43:27 -08:00
PatR
df3df3cb6f revise integer.h for vms
The VMS compiler supports C99 and defines __STDC_VERSION__ to the
corresponding value, but it doesn't supply <stdint.h> so isaac64.c
wouldn't compile.  It does supply another header containing what is
needed.
2019-03-06 11:37:52 -08:00
nhmall
d2262ca0ec Merge branch 'NetHack-3.6.2' 2019-03-05 22:02:09 -05:00
nhmall
85ea24b61c Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2019-03-05 09:51:18 -05:00
PatR
e2b6cf4066 fix #H8319 - hero-owned container used inside shop
showed non-empty containers in inventory (including the one being
applied) with a 'for sale' suffix during put-in operations, as if the
shop was trying to sell it to the hero.  Amount shown was cumulative
value of its contents.  (Using /menustyle:T doesn't show the container
being applied so this wasn't visible with it unless other non-empty
containers were being carried.)

Two or three fix attempts solved one problem but introduced another.
This one seems to finally get things right but considering that there
was trial and error along the way, my confidence isn't great.
2019-03-04 14:40:01 -08:00
PatR
b211c1b832 fix #H8310 - riding a saddled tripe ration
If steed ate a mimic corpse and started mimicking an object or dungeon
furniture, the hero was able to keep riding.  Force a dismount when
that happens, even if steed takes on monster shape rather than object
or furniture.  After that, #ride to remount non-monster will fail
unless using wizard mode's "force mount to succeed" action, in which
case steed's eating finishes immediately and it returns to normal.

This doesn't address the older report that mounted hero can continue
to move around while the steed is eating.
2019-03-01 18:32:41 -08:00
PatR
23ea5b07fe Guidebook update
number_pad got removed from Guidebook.tex when mouse_support was added
by cc0e7a8750fd4e07d3a44592c38f5912d4e603de; put it back.  Evidently
a cut-and-paste mishap when copy-and-paste was intended, probably
provoked by '\numbox{}'.

Remove \numbox{} from mouse_support; it isn't needed there since the
choices aren't trying to line up with '-1'.

Both Guidebook.mn and Guidebook.tex:

Remove number_pad's "for backward compatibility" from mouse_support
since the latter is brand new.

New petattr list of uppercase letters seemed intrusive when rendered
with a bold font, so switch to lowercase.  (Option processing already
supports either case.)

Mention the '=' prefix for hilite_status 'absolute' threshold.

[As usual, the Guidebook.tex changes haven't been tested.]
2019-03-01 17:09:54 -08:00
nhmall
eea2800660 merge NetHack-3.6.2 part 2 2019-02-28 19:19:42 -05:00
nhmall
89f1d113da Merge branch 'NetHack-3.6.2' 2019-02-28 19:15:45 -05:00
nhmall
399cb8f5ee Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2019-02-28 19:15:19 -05:00
PatR
7664d604da fix #H8297 - healer vs undead turning
Report forwarded from spam filter so not included in bugzilla list.
Make corpse revival feedback be more consistent.  Some of the healer-
specific flavor is still there.
2019-02-28 15:12:12 -08:00
PatR
eb1514da15 document curses options
Add curses options to the Guidebook.

The TeX one hasn't been tested (particularly "term_cols and\nterm_rows")
and windowborders #3).
2019-02-27 16:04:51 -08:00
nhmall
4f679352b7 Merge branch 'NetHack-3.6.2' 2019-02-27 08:20:38 -05:00
nhmall
e33767c38d Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2019-02-27 08:09:03 -05:00
nhmall
6a81d78c56 Merge branch 'NetHack-3.6.2-beta01' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.6.2-beta01 2019-02-26 19:53:42 -05:00