Commit Graph

16705 Commits

Author SHA1 Message Date
nhmall
8efc329db2 DOS stubs for unfilled functionality 2024-03-23 16:55:56 -04:00
nhmall
340588e907 follow-up fix a regression on color naming 2024-03-23 16:51:51 -04:00
PatR
d2928ce2ba symset customization warning fixes 2024-03-23 13:39:23 -07:00
nhmall
5c43c81018 attempt to fix DOS cross-compile 2024-03-23 15:56:04 -04:00
nhmall
d610d16863 visual studio project file updates for glyphs.c 2024-03-23 15:51:06 -04:00
nhmall
19f1036672 add some custom color glyph definitions to a few symsets
Exercise the previous commit a little.

FIQ's suggested wildcard syntax would make this easier
and a lot less verbose, but that isn't available yet.

This updates (adds some colored walls on specific levels) to the following:

IBMgraphics
IBMgraphics_1
IBMgraphics_2
curses
DECgraphics
2024-03-23 15:41:48 -04:00
nhmall
ba00dc9066 sever extracolors from utf8map and ENHANCED_SYMBOLS
move the custom color data into its own field in the glyphmap
and disassociate it from the unicode/utf8 stuff.

move the glyphcache stuff during options processing and parsing
into new file glyphs.c and out of utf8map.c, and make it
general, and not part of ENHANCED_SYMBOLS.

Do the groundwork for allowing glyph color customizations to
work when any symset is loaded and not restrict it only to
the enhanced1 H_UTF8 symsets.

The customizations in effect are still affiliated with a particular
symset.

Also closes #1224, but the PR itself references a data structure
made obsolete by this commit. The curses comment from the PR was
added into the code.

The PR also made several suggestions, but only the first
one has been included in this commit (and no longer based on
the handler), that being:
"allow defining colors if other symbol handling modes are used
(possibly limited to the standard 16 colors)."

FredrIQ also wrote the following suggestions in PR#1224:

Something I was also contemplating, unrelated to implementation of this
support in curses, would be the ability for the following:

allow defining colors if other symbol handling modes are used (possibly limited to the standard 16 colors)
allow defining attributes (for example: glyph:G_pet_female_kitten:U+0066/red/underline)
allow specifying glyphs as wildcards for defining global color/attribute changes

Something I also want to see are keywords for "don't change the current defined data". If this
were to be added, you could for example do this:
OPTIONS=glyph:G_*_fox:U+0064/blue
OPTIONS=glyph:G_statue_*:basechar/gray/underline
for "make all foxes use a blue color, make all statues gray with underline" without needing
to specify the relevant character for every statue. This ("basechar", "basefg", etc)
should perhaps also be added for MENUCOLORS and statushilites, so that you can, for
example, underline all items being worn without needing to specify a bunch of
near-duplicate rules for combining BUC colors + underline worn items
as per #1064
2024-03-23 15:36:22 -04:00
PatR
ef17c7ac2b unix check_panic_save
Inspired by self-recover, sort of.  Enabled for unix by default; can
be disabled by commenting out '#define CHECK_PANIC_SAVE' in unixconf.h.

When starting the game, if there is no save file to restore and no
lock/level files to recover, check whether a panic save file exists.
If there is one, tell the player that it's there and that it might be
viable, then ask whether to start a new game.

It doesn't convert the panic save into a reconverable one (rename by
nethack, then continue trying to restore) or tell the player how to
make it viable (rename to remove ".e" by game admin), just whether it
is present.  If player opts to start a new game, the panic save is
left alone and will trigger the "there's a panic save file" situation
again once the new game finishes and player starts another.
2024-03-23 10:11:35 -07:00
Pasi Kallinen
4d206c1c40 Make tamedog give a message
People seemed to be confused when a monster next to them was tame
after stepping on a magic trap; this is also an accessibility issue.
2024-03-23 18:37:12 +02:00
Pasi Kallinen
e0cb6e2206 Query menu for putting ring on left or right hand 2024-03-23 13:22:29 +02:00
Pasi Kallinen
720c62c340 Ring of aggravate monster increases level difficulty 2024-03-23 12:35:54 +02:00
Pasi Kallinen
a26f3d1838 yn_function menu code cleanup 2024-03-23 11:05:38 +02:00
Pasi Kallinen
82a698f333 Comment typofix 2024-03-23 10:36:00 +02:00
PatR
19e985fa26 fix #K4123 - pair of u_init.c macros not used
W_MULTSTART and W_MULTEND were last used in nethack 2.3.
Time to finally Get rid of them.
2024-03-22 20:43:15 -07: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
Pasi Kallinen
cbae237d62 Minor CRASHREPORT formatting bit 2024-03-22 17:54:36 +02:00
PatR
f801863e5c misbehavior by #adjust
Reported directly to devteam:  using '#adjust a a' to collect
invent stacks compatible with the one in slot 'a' all into 'a' gave
feedback of "Merging: a - ..." even though "Collecting: a - ..."
was intended.  Also, if there weren't any such compatible stacks,
so that the whole operation didn't accomplish anything, it reported
"Collecting a - ..." without the intended colon between the action
and the inventory letter.

Test case was trivial:  start with a stack of 2 of something in 'a'
and use '#adjust 1a b' to split into two stacks, then '#adjust a a'
to collect them back again.

While fixing this, I noticed that '#adjust a b' and '#adjust b a'
(from same starting situation) just swapped a and b instead of the
intended behavior of merging them back together.
2024-03-21 22:32:31 -07:00
PatR
9ba0cf2ff0 fix memory leaks for #quit while in tutorial
The new change to reset discoveries and monster-stats when exiting
the tutorial used dynamic data which wouldn't be freed if player
used #quit and declined to resume the regular game.

It turns out that such a leak was already present for start-of-game
inventory that gets stashed away during the tutorial.

In both cases, it could happen at most once per game so wasn't a big
deal as far as memory leaks go.
2024-03-21 15:28:13 -07: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
PatR
a0bea150e1 rephrase fixes entry about tutorial obj discovery
The fixes entry about object info carrying over when normal play
was resumed could have been mistrued as stating that the objects
themselves were carrying over.
2024-03-21 08:58:48 -07:00
PatR
a79d6d8e63 partly fix issue #1134 - tutorial leaks obj info
Reported by AndrioCelos, a handful of objects in the tutorial can
be discovered via use, and such discoveries were carrying over to
normal play when the tutorial ended.

This causes the hero to forget such discoveries.  The player will
still be able to remember them.  The proper fix would be to discard
the initialized but not-yet-started game when entering the tutorial
and then start a whole new one when exiting so that saving and
restoring game state would become unnecessary.  This doesn't do that.

This also causes monster birth and death statistics to be reset when
exiting the tutorial.  Affects the #vanquished command and potentially
extinctionist play.

Closes #1134
2024-03-21 08:32:58 -07:00
nhmall
058e0cf18c update tested versions of Visual Studio 2024-03-21 2024-03-21 11:24:40 -04:00
Pasi Kallinen
fe2f58fbad Curses: Fix accessing illegal window id 2024-03-21 16:55:26 +02:00
Pasi Kallinen
8e83fcb1cc Fix returning from tutorial
Removing these two values from the stack seems to prevent calling
the leave_tutorial hook.
2024-03-20 22:44:12 +02:00
PatR
a8f835f968 fix #saveoptions for 'windowcolors'
The constructed value for 'windowcolors' didn't specify the option
value correctly.  If windowcolors was not at its default value, the
new RC file created by #saveoptions would contain a value for it
that didn't work when read back the next time nethack was run.

This works, but a non-default windowcolors value shown by the 'm O'
menu won't fit on an 80 column display.  curses wraps it ok, but in
a manner that doesn't look good for that menu.

There's a bunch of reformatting here.  The actual changes are at the
end of the diff.
2024-03-20 12:49:04 -07:00
PatR
826dab9425 artilist.h formatting
When bulk reformatting took place prior to 3.6.0, the
\#if 0 "Palandir of Westernesse" #endif
block was left as-is, making it different from all the ones that
changed.  Reformat it manually, a shorten a couple of wide lines.
2024-03-20 11:01:36 -07:00
Pasi Kallinen
23d1657dca Add walking on traps to default paranoid_confirm 2024-03-20 19:31:09 +02:00
nhkeni
4786f82e73 Merge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.7 2024-03-20 11:56:32 -04:00
nhkeni
41bdaa348a teach mdgrep.* about NH_DEVEL_STATUS 2024-03-20 11:51:55 -04:00
nhkeni
6e43ea1635 remove use of obsolete BETA macro 2024-03-20 11:49:24 -04:00
Pasi Kallinen
e3ec21c5d3 Curses: avoid redrawing message window for each restored message 2024-03-19 19:19:16 +02:00
Pasi Kallinen
55263050df Doc: windowport putmsghistory 2024-03-19 18:59:23 +02:00
PatR
2e9d0753c8 enhance the windowcolors option
When processing
|OPTIONS=windowcolors:window-type foreground-color/background-color
parse the color values and use their names rather than the player's
raw options text.  Affects the feedback from 'm O' and is essential
for the next feature.

Accept either "gray" or "grey" where colortable[] always uses "gray"
(half a dozen or so instances), and accept dash or underscore where
colortable[] always uses dash (many instances).

Also, complain about 'window-type' if it isn't recognized as one of
menu, message, status, or text.  [For curses, the complaint gets
written to stdout and is then immediately erased as it goes into full
screen mode.  That's a general problem, not specific to this option.]
2024-03-18 13:24:21 -07:00
Pasi Kallinen
ba7af36bfc Curses: Fix message window unhighlighting
The recent change to allow setting window colors in curses
resulted in PDCurses clearing the message window background color.
2024-03-18 10:02:51 +02:00
nhmall
70ac5e6a32 duplicate detection refinement for windowcolors
Recently, a config file complaint when windowcolors was used multiple
times was fixed.

This adds a complaint when windowcolors was specified for the
same type of window multiple times thus superseding a previous
setting.
2024-03-17 14:53:29 -04:00
nhmall
b6b9bb0f27 follow-up to curses windowcolors
Make sure the windowcolors option can be specified more than
once without a config file warning.

Make the struct holding the details a little more extendable.
2024-03-17 14:18:14 -04:00
Pasi Kallinen
0700f60983 Fix segfault in curses
Curses handles menu and text windows specially; their id numbers
keep going up, so we need to check if the id is for a menu or
text window instead of directly accessing the windows array.
2024-03-17 20:09:43 +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
9dbab97a1e depend.awk: Allow sort suppression from the command line. Idea from Pat. 2024-03-17 12:17:41 -04:00
nhmall
118a82c9a0 staticfn bit in sounds.c 2024-03-16 20:45:25 -04:00
nhkeni
0227a2e0bf hints/macOS.370: remove testing code 2024-03-16 19:42:42 -04:00
nhkeni
8f74c5fa57 Merge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.7 2024-03-16 16:41:43 -04:00
nhkeni
9f37ba849c code_style.txt: Document staticfn and NEARDATA. 2024-03-16 16:41:09 -04:00
nhmall
a9fd04013a remove some obsolete code from options.c 2024-03-16 15:23:47 -04:00
nhmall
295d6e257c used, unused variables
some variables marked as unused, are now actually used
some unused variables are eliminated or commented out
2024-03-16 12:53:58 -04:00
Pasi Kallinen
cad4d87101 wishtest fix
left-over bit from testing
2024-03-16 17:09:54 +02:00
Pasi Kallinen
9d97835686 Minor wishing alias improvement
Previously when wishing for "ring of protection from shape shifters",
you got a random ring instead of the protection from shape changers,
because the string matching alias was "protection from shape shifters"
without the object class.  Now, we'll check if the wish matched any
object class, but not existing object or alias, and try matching
the aliases again, but only those of the already matching obj class.

Add an alias for the ring of increase accuracy: "ring of accuracy",
and tests for it.
2024-03-16 16:59:58 +02:00
nhkeni
54c3dd35ac Merge branch 'keni-staticfn' into NetHack-3.7 2024-03-16 09:38:21 -04:00
Pasi Kallinen
c91d8d9450 Curses: unnecessary window erasing
When removing a temporary (menu, text, popup) window, the code
was erasing it from memory and then refreshing the screen.
This is unnecessary, as we're refreshing all the windows anyway.
2024-03-16 13:58:28 +02:00
nhkeni
fabbb491e8 Avoid a complaint from GCC's analyzer. Patch from Pat. 2024-03-15 20:46:10 -04:00