Commit Graph

599 Commits

Author SHA1 Message Date
PatR
59fbffd170 Guidebook update: "Map (rest of screen)"
The description of the default map display was out of date:

Sinks aren't conditional anymore, and were changed from '#' to '{'.
Statues were still listed as '`' but aren't displayed as that.
Room and corridor engravings weren't mentioned.
Wall of water and wall of lava weren't mentioned.
Drawbridge portcullis ('#' when closed) and span ('.' when open)
weren't mentioned.

This splits introductory "- and |" into two entries.

I've forced CR font (similar to TeX's tt font) for the initial
character of all the entries.

The formatting of letters for monsters left something to be desired
so I've tried to redo it.  The 'roff edition seems ok (as least when
there's no page break in the middle of it) but I'm not sure how the
LaTeX version will fare.  I didn't try to include the trailing "and"
on the first two lines the way the 'roff version does since I wasn't
sure how to accomplish that.
2024-07-16 14:49:34 -07:00
PatR
749f2ffb0e update 'hitpointbar' documentation 2024-04-12 11:52:26 -07:00
Pasi Kallinen
712a735111 Guidebook: hitpointbar is also available in curses 2024-04-07 12:24:19 +03:00
Pasi Kallinen
9a870b5f06 Option to use a menu to answer yes/no prompts
Add a new boolean option 'query_menu'. If on, game will pop up
a menu for specific yes/no questions, instead of using an input prompt.
2024-03-22 19:19:57 +02:00
PatR
a8fbb96f2b 'windowcolors' documentation
The construct "\\'#rrggbb'" seemed strange and while fixing that
I made several other changes.  There's an escape sequence for
apostrophe but "#rrggbb" doesn't actually need any quoting in the
first place (except for "\#" in the TeX version).

There was unwanted indentation after the OPTIONS=windowcolors line
in the 'roff version.  For the TeX version, avoid 'verbatim' since
it contains both literal text and placeholders that are now being
distinguished with italics.

Also, "trueblack" is Windows-specific rather than an ordinary named
color.
2024-03-21 09:59:43 -07:00
Pasi Kallinen
23d1657dca Add walking on traps to default paranoid_confirm 2024-03-20 19:31:09 +02:00
Pasi Kallinen
4030ef13a0 Curses: implement the windowcolors option
Allow changing the curses windows foreground and background colors,
for example:

OPTIONS=windowcolor:menu #8000F0/20F080 message grey/blue
2024-03-17 18:41:52 +02:00
nhkeni
e316d962a8 Minor regex naming and doc cleanup. 2024-03-09 13:28:15 -05:00
nhmall
258d7b2f56 Guidebook date stamp 2024-02-29 08:00:19 -05:00
RainRat
a3658f85ac fix typos 2024-02-28 20:15:56 -08:00
PatR
41a5565403 new 'showvers' option
Add options 'showvers' (boolean) and 'versinfo' (numeric mask) to
show nethack's version on the status lines during play.  It won't be
particularly interesting to ordinary players but should be useful
when making screenshots or video to be streamed, or for someone who
switches between git branches or between nethack and variants.

I worked on this several months back but it was combined with
unfinished changes to 'hitpointbar'.  I've separated it out so that
it can be put into use.  When enabled, one or more components of
"<name> <branch> <version>" will be shown right justified after
status conditions.  At present the default is "<branch>" if that is
available and overall status isn't 'released', or "<version>" if
'released' or if branch isn't available.  That might need some
refinement.

It works as intended for tty and curses, although some abbreviation
mechanism would be useful if/when the program resorts to abbreviating
status conditions to make things narrow enough to fit.

For X11, it works ok for fancy_status:True (the default, controlled
via NetHack.ad settings) but is messed up for tty-style status.  The
text is positioned correctly but there are gaps in it, making it
appear garbled, similar to what I saw when I tried and failed to
implement statuslines:3 for X11.  [It might be due to having empty
condition widgets be 1 pixel wide instead of being totally removed
but I don't think the situation is that simple.]

For Qt, if the text needs to be truncated in order to fit, the center
portion of the string will be shown, discarding parts from the left
and right.  That ought to discard from left and retain rightmost
portion instead.

For win32|mswin|Win GUI, no attempt to support it has been included.
Things should be ok when 'showvers' is left as False (the default)
but I don't know what will happen if that gets toggled to True.  At a
minimum, the version info won't be right justified.  The information,
or at least some of it, is displayed in the game window's title bar
so there isn't any pressing need to add it to status, but toggling
the option will need to behave sensibly if it doesn't already.
2024-02-28 11:47:16 -08:00
Pasi Kallinen
25fa293c81 Accessibility: lookaround command, mention_map option
Adds a new extended command #lookaround, which will describe
the map around the hero they can see or remember.

Adds a new boolean option mention_map, which will give a message
when an interesting map location in sight changes.
2024-02-28 20:53:52 +02:00
Pasi Kallinen
dd37c5326a Accessibility: showdamage option
Add a new boolean option showdamage, if on, outputs a message
like "[HP -2, 14 left]" - several variants have something similar,
but I chose the message based on how eSpeak said it, while keeping
it short.
2024-02-24 17:38:46 +02:00
nhkeni
3d3ce2369c Merge branch 'keni-wincw2' into NetHack-3.7
Lots of manually resolved conflicts.
2024-02-15 16:25:12 -05:00
Pasi Kallinen
6b9f411a32 Accessibility: mon_movement
Adds a new boolean option, mon_movement. When hero notices monster
movement, give a message. Use with spot_monsters and accessiblemsg.
2024-02-07 19:50:38 +02:00
nhkeni
dbe5c98dca add CRASHREPORT directly to browser
add CRASHREPORT for Windows
add ^P info to report (via DUMPLOG)

new options: crash_email, crash_name, crash_urlmax
new game command: #bugreport
new config option: CRASHREPORT_EXEC_NOSTDERR
new command line option: --bidshow

deleted helper scripts:
    NetHackCrashReport.Javascript
    nhcrashreport.lua

misc:
    update CRASHREPORTURL (will need to be updated before release)
    update bitrot in winchain
    winchain for Windows
    add missing synch_wait for NetHackW --showpaths
    add PANICTRACE (and CRASHREPORT) in mdlib.c:build_opts

missing:
    packaging (Windows needs the pdb file)
    no testing with MSVC command line build

port status:
    linux: working, but glibc's backtrace doesn't show static functions
    Windows VS: working.  pdb file is large - looking into options
    MacOS: working
    msdos: not supported
    VMS: not supported
    MSVC: planned, but not attempted
    MSYS2: working, but libbacktrace not showing symbols (yet?)
2024-02-06 18:33:59 -05:00
nhmall
e5e63b886e Guidebook update Feb 6, 2024 2024-02-06 15:39:50 -05:00
Pasi Kallinen
6c874267b8 Correct petattr doc in Guidebook 2024-02-06 08:54:32 +02:00
nhmall
4d09009fff Guidebook follow-up 2024-01-29 10:56:16 -05:00
Pasi Kallinen
41edcdf6d9 Mention italic for status hilites in Guidebook 2024-01-29 16:48:31 +02:00
Pasi Kallinen
5829863be2 petattr also accepts italic 2024-01-28 19:03:45 +02:00
Pasi Kallinen
fd8b2b58d1 petattr: Change accepted parameters, add support for tty 2024-01-28 10:05:42 +02:00
PatR
b6bc3ef698 more Guidebook for containers
"blue potion" wasn't a very good example for an item in a container;
plain "blue" isn't a potion description.

Add an extra sentence to make the association between a container's
"item count" that's really a stack count and the fact that inventory
slots are for stacks rather than for individual items too.

Style/usage bit: avoid using "another" twice in the same sentence.

Fix a typo in the spelling of "contents".
2024-01-19 10:44:39 -08:00
nhmall
5ab9904b8f fix Guidebook.tex processing 2024-01-19 08:36:12 -05:00
PatR
b156912c46 Guidebook tweaks for "containers" sub-section 2024-01-18 23:58:53 -08:00
Pasi Kallinen
3160112ece Accessibility: Show a message when monster is spotted
Adds a new boolean option, spot_monsters.  If on, every time
the hero notices a monster which was out of sight before,
a message is given.  Combine with accessiblemsg to get the
monster location:

(3north): You see a newt.

Breaks saves and bones.
2024-01-14 13:33:02 +02:00
nhmall
6db79b9f18 Guidebook update 2024-01-02 12:34:05 -05:00
Pasi Kallinen
dc8d9d6cd0 Accessibility: Add location info to messages
Adds a new boolean option, accessiblemsg.  If on, some game messages
are prefixed with direction or location information, for example:

   (west): The newt bites!
   (northwest): You find a hidden door.

I added the info to the most common messages, but several are
still missing it.
2024-01-02 18:59:25 +02:00
nhmall
a6985b1f1a Guidebook updates 2023-12-08 19:45:07 -05:00
Michael Meyer
e427063560 Enable 'dropped_nopick' by default 2023-12-08 15:20:20 -08:00
Michael Meyer
1736f3caaa Add 'pickup_stolen' option
Add pickup_stolen option to autopick items stolen from you by a nymph or
monkey, even if they don't match your normal autopickup settings.
Replace was_dropped, was_thrown with a 2-bit bitfield that can contain
values LOST_DROPPED, LOST_THROWN, and LOST_STOLEN (or 0), since they
should all be mutually exclusive anyway as they track the most recent
way the item left the hero's inventory.

[Rebase/merge conflict fixed up.  PR]
2023-12-08 15:19:54 -08:00
Michael Meyer
e2e89cb93e Rename/invert 'pickup_dropped' to 'dropped_nopick' 2023-12-08 15:19:05 -08:00
Michael Meyer
d7d1c1476d Add option to exclude dropped items from autopick
This is based on a feature in UnNetHack (and I think some other variants
as well).  If the hero intentionally drops an item with 'pickup_dropped'
disabled, don't autopick it back up when walking over that square again.

Typically when the player drops an item, it's because she doesn't want
it in her inventory any more, and this option stops autopickup from
defeating that goal (especially useful for tasks like stash management
without a container).  Players have come up with workarounds to this
problem like toggling autopickup when approaching their stash pile or
adding name-based autopickup exceptions to allow them to exclude
individual items from autopickup, but this behavior should reduce the
need for those things.

I think 'pickup_dropped' is a little unfortunate because it suggests
equivalence to 'pickup_thrown' (i.e. any dropped items will be
automatically picked up regardless of autopickup exceptions).  Calling
it something like 'nopick_dropped' might be better, but as far as I can
tell options cannot start with the word 'no' because it's interpreted as
a negation of the rest of the option name.
2023-12-08 15:19:04 -08:00
PatR
e6a7eb25d4 item actions for '* ) [ = " (' commands
Make the various item-in-use commands put up a menu--which allows
choosing an item for context-sensitive item action--if/when preceded
by the 'm' prefix.  Some of them do that even without the prefix ('*',
'[', or '=' when more than one ring is worn).  By default '(' shows
primary weapon, then secondary one if dual-wielding.  'm (' shows a
menu of primary, alternate whether dual-wielding it or not, and quiver.
2023-11-28 00:31:21 -08:00
nhmall
31a46e72c0 Guidebook date stamp 2023-11-13 07:46:17 -05:00
Pasi Kallinen
dd5ca5b058 Change menu_headings to accept color and attribute
Instead of just accepting an attribute, it's now possible to
use a color, or both color and attribute, for example:

OPTIONS=menu_headings:inverse
OPTIONS=menu_headings:red
OPTIONS=menu_headings:red&underline

Default is still just inverse.
This lets the player change the menu heading color without
needing to use menu colors for them.

Also makes it so the core uses NO_COLOR instead of 0, for all
the menu lines which don't have any prefedefined color.

Tested for tty, curses, x11, qt, and win32
2023-11-13 07:33:56 +02:00
G. Branden Robinson
44c012e9cf doc/Guidebook.mn: Fix overset lines in nroff mode
One can observe the following problems when generating or viewing plain
text versions of the Guidebook.  (There are three; "Guidebook" and
"Guidebook.txt" are identical, and are paginated; "Guidebook.dat" is not
paginated.)

1.  The line "(Edited and expanded for NetHack 3.7.0 by Mike Stephenson
    and others)" is overset.

2.  So are Figures 1 and 2, by one character cell, when rendered with
    groff 1.23.0 because of the way it handles boxed tables and those
    with vertical rules at table boundaries.

    https://git.savannah.gnu.org/cgit/groff.git/commit/?id=8f066786ea3cb5e1dbade1149e7d50ae978da202

3.  When viewing the Guidebook in an 80-column terminal, the left and
    right margins are asymmetric; you get 10 columns on the left but
    only 5 on the right.

So:

* doc/Guidebook.mn: In nroff mode, set page offset to 5n and increase
  line and title line lengths by 5n to 70n.

Now, the margins are symmetric, there's ample room for the figures, and
the expansion credit fits.

(One diagnostic remains when formatting with groff 1.23.0.

troff:tmac.n:762: error: cannot load font 'S' for emboldening

This is a groff bug and will be fixed in the next release.  The
diagnostic is spurious and can be ignored.

See <https://savannah.gnu.org/bugs/?64866>.)
2023-11-06 14:44:58 -06:00
G. Branden Robinson
4eeab8824d doc/Guidebook.txt: Update table annotations
Explain behavior of GNU tbl when setting boxed tables on terminals.
Drop reference to bug fixed in groff 1.23.0
<https://savannah.gnu.org/bugs/?49390>.

There's not much to say about other tbls except that they handle boxed
tables _terribly_ on terminals.

$ cat ./hello-table.roff
.TS
box;
L.
hello
.TE
$ ./bin/tbl ./hello-table.roff|./bin/nroff|cat -s # Heirloom Doctools
_______
 hello
_______
|
|     |

DWB tbl behaves the same way.  I expect all System V Unix-descended
tbls/nroffs do the same.
2023-11-06 14:44:54 -06:00
G. Branden Robinson
0571cb395e doc/Guidebook.mn: Completely revamp Figure 3
This is my attempt to revise the figure by working _with_ tbl(1)
and nroff(1)/troff(1) features instead of fighting them or enduring
suffering and significant maintenance challenges.

* Stop using mn(7) display macros; the other two figures didn't and they
  don't appear to be buying much.
* Use `tr` character translation feature to temporarily remap characters
  for clarity of input.  It's convenient to input ordinary characters
  here since the table's contents are (mostly) character-cell art.
  Remap `-` to minus sign and `@` to the "reverse solidus" special
  character.  (`\` is the default *roff escape character.  It can be
  changed, but attempting that seems hopeless inside a tbl(1) table.)
  Revert the translations after the table.  (There's nothing special
  about `@`; you could choose any other character that isn't otherwise
  needed in the table.)
* Use `box` region option as with Figures 1 and 2.  Perhaps this wasn't
  done because those are meant to depict a terminal window, but Figure 2
  depicts only part of one, so its top border is a fib.
* Use `expand` region option to obtain roughly the same spread-out
  effect that the table was laboriously using empty columns and the `e`
  column modifier for.
* Consequently, reduce the column count to 2; both have real content.
* Annotate both keycap diagrams--in part for clarity, but also to make
  it more obvious that the columns will balance in width.

These changes don't require GNU extensions to *roff or tbl except,
arguably, the \(rs special character.  But support for that special
character identifier is easily added to any device-independent troff;
see §23.2 of CSTR #54 (Kernighan 1992 revision) or groff_font(5).  Or I
can prepare a patch--just ask me.  But given that no one seems to have
complained about the disaster that AT&T tbl/nroff must have been making
of Figures 1 and 2 for decades, I'm guessing this isn't a practical
concern.  Any if it _is_ a problem, `\e` can be used instead of `\(rs`.
(I didn't use it because what is wanted is the backslash glyph
specifically [to mirror `/`], not "the escape character".  But given the
constraints imposed by use of tbl(1), it's an academic point.)
2023-11-06 14:44:09 -06:00
G. Branden Robinson
9658f6769d doc/Guidebook.mn: Caption figures consistently
On my system, the figure captions in Guidebook.ps were getting set in
Courier roman.  This was clearly unintentional.  Here's why it didn't
work.

1.  Figures 1 and 2 selected the previous font, but only after a table
    had been set.  But tbl(1) does not preserve identity of the previous
    font.  I investigated, and none of GNU, Heirloom Doctools, nor
    Documenter's Workbench tbl implementations preserve it.  So the user
    can't rely on it.  See
    <https://savannah.gnu.org/bugs/index.php?64862>.

2.  Figure 3 attempted to select the roman font (typically Times), but
    did so in a table cell that was empty of text.  It therefore did not
    have any visible effect.

* doc/Guidebook.mn: Explicitly select font `R` after setting tables.  On
  typesetters, put half a vee of space between the table's box border
  and the figure caption.
2023-11-06 14:43:59 -06:00
G. Branden Robinson
93dd1a09d5 doc/Guidebook.mn: Improve roff character reference
And point people to a more authoritative reference.
2023-11-06 14:43:56 -06:00
G. Branden Robinson
b35350d7d3 doc/Guidebook.mn: Drop junk argument to TS
The "S" argument has no meaning.  tbl(1) doesn't interpret it, and the
"n" and "nh" macro packages don't, either.
2023-11-06 14:43:47 -06:00
G. Branden Robinson
9a96e0a198 Fix *roff string usage nit
String definitions were being used with a pointless leading double
quote.  This syntax is used only to define strings containing leading
space characters.  (You might also use it defensively if you're defining
one string whose contents start with the interpolation of another, and
the latter might interpolate leading space--but that is not the case
here.)

Remove unnecessary leading quotes from string definitions.

* doc/Guidebook.mn: Do it.  Also annotate empty strings with comment.
* sys/unix/hints/include/gbdates-post.370: Don't put them back.

https://www.gnu.org/software/groff/manual/groff.html.node/Strings.html
2023-11-06 14:43:34 -06:00
PatR
6e137628fb perminv_mode in Guidebook
Tweak the new entry in Guidebook.mn and catch up with that entry in
Guidebook.tex (untested).
2023-11-06 00:46:18 -08:00
PatR
2ee7509945 replace getenv("TTYINV") with perminv_mode option
Add a new option 'perminv_mode' to augment perm_invent.  It handles
the same choices as the temporary TTYINV method:  show all items other
than gold, show full inventory including gold, or only show in-use
items (similar to the '*' command).

For tty, both the all-except-gold and full-inventory modes can add
the poorly named 'sparse' variation which populates unused slots in
its fixed grid with the inventory letter that would go in each.

For others, the default has been changed from full-inventory to
all-except-gold.  Note that gold is treated as part of 'all' or of
'in-use' if it is quivered because having the amount be shown on the
status line doesn't make that redundant.

Changing the default may mess up WinGUI if it assumes that perm_invent
is full inventory with gold.

Initially I was going to change perm_invent into a compound but this
leaves it as an on/off toggle and adds perminv_mode as a separate
option for how to show the inventory when the toggle is on.  It may
make sense to combine them since dual controls is a little confusing,
but right now setting perm_invent On when perminv_mode is 'none'
changes that to 'all' and changing perminv_mode away from 'none' when
perm_invent is Off toggles it to On.

Guidebook.mn has been updated but as usual Guidebook.tex is lagging.
2023-11-05 02:31:26 -08:00
G. Branden Robinson
467a0180a6 doc/Guidebook.mn: Use idiomatic *roff features
Stop trying to deduce whether the document is being formatted for a
typesetter (a device that can use proportional fonts) or a terminal (a
device that generally can't) by asking the formatter to measure
formatted texts.  Instead, use the built-in `n` and `t` conditions that
nroff and troff have supported for this purpose since 1976 at the
latest.  All known troff implementations support these.

https://www.gnu.org/software/groff/manual/groff.html.node/Operators-in-Conditionals.html
2023-11-02 11:55:35 -05:00
G. Branden Robinson
462973ab53 doc/Guidebook.mn: Drop junk syntax
These *roff control lines were ill-formed.  `.fi` is a request to turn
on filling, not a closing bracket for an `if` request (*roff is not a
Bourne shell).

https://www.gnu.org/software/groff/manual/groff.html.node/Conditional-Blocks.html

Further, *roff generally does not accept more than one request per
input line.  Exceptions to this rule are the control structuring
requests (`if`, `ie`, `el`, and in GNU troff, `while`, `do` and `nop`).
But here, only one (`do`-nested) request is governed by the `if` anyway.
2023-11-02 11:55:22 -05:00
PatR
b73e4815fa Guidebook.txt: silence groff complaints about CR
Don't attempt to switch to CR font (used to get fixed-width characters
when generating output that uses proportional width ones) when output
is already fixed-width (plain text).

The most recent release of groff (version 1.23) complains when a font
can't be found, then keeps going.  Earlier versions just silently kept
going.  Failing to load the CR font when already producing fixed-width
chars makes 'keep going' acceptable but the font-load-failure warnings
are a nuisance.
2023-11-01 21:35:56 -07:00
nhkeni
9472c0b797 Guidebook formatting typo 2023-09-09 15:10:49 -04:00
PatR
1a64ee1c28 github PR #259 - paranoid_confirmation:trap
Fairly old pull request from copperwater:  add new paranoid_confirm
setting 'trap'.

The old commit suffered from bit rot and merging needed too much
fixing up despite there not being many bands of change in the commit's
diffs.  I ultimately redid it from scratch, although the two biggest
chunks of code started with copy+paste of the pull request's commit.

It operates like paranoid:pray.  Setting paranoid:trap adds a new
"Really step into <trap>?" y/n prompt when attempting to move
into/onto a known trap, even if an object covers it on the map.
Setting both 'paranoid:Confirm trap' turns that into a yes/no prompt.
(Adding 'Confirm' affects other paranoid confirmations; in addition
to requiring yes<return> rather than just y to accept, it also forces
no<return> to reject.)

However, moving into a known trap that is considered to be harmless
behaves as if no trap was present.  Some of the trap classification
might be out of date; several types of traps have undergone changes
since implementation of the original pull request, notably anti-magic
field.  When the hero is hallucinating, all known traps are considered
harmful since the map no longer reliably describes them.

Preceding a movement command with the 'm' prefix also behaves as if
no trap was present, bypassing confirmation for that move, similar to
how paranoid:swim currently behaves.  Being stunned or confused also
behaves as if no trap was present, taking priority over hallucination.

This updates the documentation.

Supersedes #259
Closes #259
2023-09-08 15:55:31 -07:00