Commit Graph

810 Commits

Author SHA1 Message Date
PatR
84ddf85cb4 new composite status conditions: weaponstatus,\
armorstatus, and terrainstatus

This adds three special status items to show at a glance what the hero
is wielding, wearing, and standing on.

Each of the three items has its own boolean option rather than try to
fix them in with the existing opttional status conditions.  After a
lot of testing, I think the weapon and armor ones will prove useful
but the terrain one probably won't be.

Presently it is implemented for tty and curses.  When I developed it
six years ago, it was also working for X11 but I'm not able to test
the resurrection of that part so have left it out.
2026-04-16 13:35:08 -07:00
Pasi Kallinen
9d27cfe8b8 Prevent selecting all options in #optionsfull menu
No-one ever intentionally selected all entries in the options
menu.  Prevent it from happening by accident.
2026-04-11 18:37:56 +03:00
nhmall
fffbf4c2e5 Windows option update for map_mode
Ensure preference_update() is called
2026-04-10 10:36:36 -04:00
nhmall
e005c26fbd another safestartup vestige 2026-04-10 09:24:10 -04:00
nhmall
4dd47db3ad yet more Windows startup; also safestartup vestige 2026-04-09 15:08:07 -04:00
nhmall
8cbbb74f3b more early config file pass
Because some optlist entries were ignored in the early pass,
some non OPTIONS= lines in the config file were having issues
due to those options not being set.

Extend what is being disregarded in the early config file pass
to include other config file statements.
2026-04-07 14:22:07 -04:00
nhmall
fdbf84b9b7 remove some dead code 2026-04-06 13:17:32 -04:00
nhmall
b2b2c3f6f2 remove extraneous line 2026-04-06 11:00:12 -04:00
nhmall
6234e96b57 Change Windows startup - take 2
remove the safeproc pseudo-windowport routines from
almost a decade ago.

A very early pass is made through the config file,
seeking out just the interface-related OPTIONS=windowport
and OPTIONS=soundlib and ignoring all other options in the
config file during that early pass, so the windowport
can be activated without the NetHack core initialization
in place that some of the other rcfile OPTIONS require.

Bundles the existing rcfile processing code into rcfile().

New functions to control which rcfile options will be
disregarded in the early config file pass, and which will be
processed:

    set_all_options_disregarded();
    set_all_options_heeded();
    disregard_this_option(opt_xx);
    heed_this_option(opt_xx);

Windows calls rcfile_interface_options(), which is
a bundling of a series of function calls to achieve
the desired result.

    void
    rcfile_interface_options(void)
    {
        allopt_array_init();
        set_all_options_disregarded();
        heed_this_option(opt_windowtype);
        heed_this_option(opt_soundlib);
        rcfile();
        set_all_options_heeded();
        disregard_this_option(opt_windowtype);
        disregard_this_option(opt_soundlib);
    }
2026-04-05 13:11:14 -04:00
nhmall
db1f230772 Revert "Change Windows startup"
This reverts commit acb85b18cf.

Some optlist issues arose on some platforms, but not all.
I need to investigate the cause of those.
2026-04-05 12:07:57 -04:00
nhmall
acb85b18cf Change Windows startup
remove the safeproc pseudo-windowport routines from
almost a decade ago.

A very early pass is made through the config file,
seeking out just the interface-related OPTIONS=windowport
and OPTIONS=soundlib and ignoring all other options in the
config file during that early pass, so the windowport
can be activated without the NetHack core initialization
in place that some of the other rcfile OPTIONS require.

Bundles the existing rcfile processing code into rcfile().

New functions to control which rcfile options will be
disregarded in the early config file pass, and which will be
processed:

    set_all_options_disregarded();
    set_all_options_heeded();
    disregard_this_option(opt_xx);
    heed_this_option(opt_xx);

Windows calls rcfile_interface_options(), which is
a bundling of a series of function calls to achieve
the desired result.

    void
    rcfile_interface_options(void)
    {
        allopt_array_init();
        set_all_options_disregarded();
        heed_this_option(opt_windowtype);
        heed_this_option(opt_soundlib);
        rcfile();
        set_all_options_heeded();
        disregard_this_option(opt_windowtype);
        disregard_this_option(opt_soundlib);
    }
2026-04-05 11:37:20 -04:00
nhmall
90db8d7e2d clear up some warnings appearing with gcc 15.2.0
allmain.c: In function ‘debug_fields’:
allmain.c:1133:16: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
 1133 |     while ((op = strchr(opts, ',')) != 0) {
      |                ^
cfgfiles.c: In function ‘find_optparam’:
cfgfiles.c:590:10: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  590 |     bufp = strchr(buf, '=');
      |          ^
cfgfiles.c:591:10: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  591 |     altp = strchr(buf, ':');
      |          ^
end.c: In function ‘should_query_disclose_option’:
end.c:482:14: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  482 |     if ((dop = strchr(disclosure_options, category)) != 0) {
      |              ^
invent.c: In function ‘loot_classify’:
invent.c:175:7: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  175 |     p = strchr(classorder, oclass);
      |       ^
o_init.c: In function ‘dodiscovered’:
o_init.c:774:33: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  774 |     if (!flags.discosort || !(p = strchr(disco_order_let, flags.discosort)))
      |                                 ^
o_init.c: In function ‘doclassdisco’:
o_init.c:907:33: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  907 |     if (!flags.discosort || !(p = strchr(disco_order_let, flags.discosort)))
      |                                 ^
objnam.c: In function ‘the’:
objnam.c:2200:19: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
 2200 |         if (((tmp = strrchr(str, ' ')) != 0 || (tmp = strrchr(str, '-')) != 0)
      |                   ^
objnam.c:2200:53: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
 2200 |         if (((tmp = strrchr(str, ' ')) != 0 || (tmp = strrchr(str, '-')) != 0)
      |                                                     ^
options.c: In function ‘optfn_disclose’:
options.c:1529:17: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
 1529 |             dop = strchr(disclosure_options, c);
      |                 ^
pager.c: In function ‘add_cmap_descr’:
pager.c:1212:28: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
 1212 |                     || ((p = strchr(x_str, ' ')) != 0 && !strcmpi(p, " ice"))
      |                            ^
2026-03-31 10:16:28 -04:00
Pasi Kallinen
63a78edcfa Add toggle extended command
Allows the user to configure a key binding to toggle any boolean
option, for example:

BIND=':toggle(price_quotes)
BIND=v:toggle(autodig)

The option must be settable in-game.
2026-03-21 12:17:37 +02:00
Pasi Kallinen
c595f241e6 Change key binds from array to linked list
Key bindings were stored as a fixed-size array, indexed by the input
character, pointing to the extended commands.  This changes that into
a linked list of an intermediary struct Cmd_bind, storing the input key
and the pointer to the command.

This is just code cleanup for future enhancements, and should have
no effect on gameplay.
2026-03-20 19:57:44 +02:00
Alex Smith
4fae45220e Remember price quotes that have been seen for types of item
These are displayed in discoveries, and a new 'price_quotes' option
allows them to be displayed for un-IDed objects in other contexts
too (the idea is that you turn on the option while identifying
objects and off for general play).

Invalidates existing save files.
2026-03-18 21:08:22 +00:00
nhmall
f4a6da2e52 save/restore changes - part 2
This is the second of a series of changes related to save/restore.

    No EDITLEVEL bump has been included, because although the code
    is changed extensively by this, the content of the savefiles have
    not been changed.

    Push the use of the structlevel bwrite() and mread() function use
    out of the core and into sfstruct.c. This is groundwork for upcoming
    changes.

    In the core, replace the bwrite() and mread() calls with the
    use of type-specific savefile output (Sfo) and savefile
    input (Sfi) macros.  The macros are defined in a new header file
    savefile.h, which also contains the prototypes for the sfo_* and
    sfi_* functions that the macros ultimately expand to. The functions
    themselves are in src/sfbase.c.

    On C99, each Sfo or Sfi macro expansion refers directly to the
    corresponding  type-specific sfo_* or sfi_* function.

    If C23 or later is is use, the majority (all but 3 types) of the
    macros refer to a single _Generic output routine sfo(nhfp, dt, tag),
    and a single _Generic input routine sfi(nhfp, dt, tag), which handles
    the dispatch of the type-specific underlying functions. This was
    somewhat experimental, but turned out to be practical because the
    compiler would gripe if the type for a variable was not included in
    the _Generic when passed as an argument, so it could be fixed.

    This alters the savefile verication process by having a common set
    return values for the related functions such as uptodate(),
    check_version(), etc. The new return values return more information
    about savefile incompatibilities, beyond failure/sucess. The
    additional information will be useful for an upcoming addition.
    The expanded return values are:
     SF_UPTODATE                     (0) everything matched and looks good
     SF_OUTDATED                     (1) savefile is outdated
     SF_CRITICAL_BYTE_COUNT_MISMATCH (2) critical size count mismatch
     SF_DM_IL32LLP64_ON_ILP32LL64    (3) Windows x64 savefile on x86
     SF_DM_I32LP64_ON_ILP32LL64      (4) Unix 64 savefile on x86
     SF_DM_ILP32LL64_ON_I32LP64      (5) x86 savefile on Unix 64
     SF_DM_ILP32LL64_ON_IL32LLP64    (6) x86 savefile on Windows x64
     SF_DM_I32LP64_ON_IL32LLP64      (7) Unix 64 savefile on Windows x64
     SF_DM_IL32LLP64_ON_I32LP64      (8) Windows x64 savefile on Unix 64
     SF_DM_MISMATCH                  (9) some other mismatch
    The callers in the core have been adjusted to deal with the expanded
    return values.

    Other miscellaneous inclusions:

       - go.oracle_loc -> svo.oracle_loc.
       - add a bit (1UL << 30) to  called SFCTOOL_BIT as groundwork
         for changes to follow.
2025-05-25 15:03:13 -04:00
nhmall
78a4fd2fb8 split config file processing into its own src file 2025-05-21 23:58:01 -04:00
PatR
a587ccaa26 merge new use_menu_glyphs option with menu_objsyms
The two options are very similar but probably mutually exclusive
except when using look-here and look-into-container (both via ':')
with the default setting for 'sortloot', or with inventory when
'sortpack' has been toggled off.

This removes 'use_menu_glyphs' and changes 'menu_objsyms' from a
boolean to a compound taking six possible values:
| 0: no object symbols in menus,
| 1: append object class symbol to object header lines (same as old
|menu_objsyms boolean),
| 2: include object symbol in menu entry lines for objects (same as
|recently added use_menu_glyphs),
| 3: both 1 and 2,
| 4: display as #2 but only if the menu lacks class header lines,
| 5: if header lines are present, display as #1; if headers are not
|present, then display as #4 (which will implicitly be #2).
Default is #4.

Effectively replaces the options portion of pull request #1406 and
retains the functionality, but not as default for normal menus.

Guidebook.tex is only partially updated.  Someone else will need to
finish that.
2025-04-28 18:12:02 -07:00
PatR
7c40819202 free CRASHREPORT option data
Plug a straightforward memory leak.
2025-04-17 17:00:39 -07:00
PatR
3109e706e9 static analysis for o*.c
This construct triggered several complaints about passing Null to
  Strcpy(simpleoname, obufp = the(simpleoname));
Changing that to
  obufp = the(simpleoname);
  Strcpy(simpleoname, obufp);
prevents it, but the original complaint is bogus and the "fix"
doesn't do anything to deal with Null arguments.

A couple of other changes introduce different code in order to get
different behavior.  I updated from llvm-16 to llvm-19 but didn't
eliminate any of the spurious complaints.
2025-01-21 22:42:23 -08:00
nhmall
d3c57e1b42 fix reported crash of TTY_PERM_INVENT segfaulting
Options processing can be early, even before ttyDisplay is allocated.
If we find that TTY_PERM_INVENT initialization is happening too early,
just set a marker (iflags.perm_invent_pending) to try again a bit later.

The changes in win/share are just to be able to sucessfully
reproduce the original issue on Windows. It was easily reproduced
on Unix, just by building with TTY_PERM_INVENT in include/config.h
and setting OPTIONS=perm_invent in config file.
2025-01-02 11:46:15 -05:00
nhmall
eacfa202d9 soundlib selection in config file wasn't working
When there was more than one option #define'd
selection was not working correctly.
2024-12-30 12:54:12 -05:00
nhmall
57f86662fd try harder to have --showpaths succeed
This helps avoid a potential chicken-and-egg scenario
with the system configuration file (sysconf).

If sysconf wasn't accessible at the expected location, it
caused an immediate exit, without relaying any helpful
information. That happened even when using:
    'nethack --showpaths'

That's particularly unhelpful, because the --showpaths
output might have been useful towards understanding where
NetHack was looking for such things.

That left you without an easy recourse to identify where
the game is looking for the sysconf file. That might be
especially troublesome if you didn't build the game
yourself.
2024-12-22 19:58:52 -05:00
nhmall
0792e5fe9e expand implicit fallthrough detection to non-gcc compilers
gcc has recognized various "magic comments" for white-listing
occurrences of implicit fallthrough in switch statements for
a long time:

    The range and shape of "falls through" comments accepted are
    contingent upon the level of the warning. (The default level is =3.)

    -Wimplicit-fallthrough=0 disables the warning altogether.
    -Wimplicit-fallthrough=1 treats any kind of comment as a "falls through" comment.
    -Wimplicit-fallthrough=2 essentially accepts any comment that contains something
     that matches (case insensitively) "falls?[ \t-]*thr(ough|u)" regular expression.
    -Wimplicit-fallthrough=3 case sensitively matches a wide range of regular
     expressions, listed in the GCC manual. E.g., all of these are accepted:
        /* Falls through. */
        /* fall-thru */
        /* Else falls through. */
        /* FALLTHRU */
        /* ... falls through ... */
       etc.
    -Wimplicit-fallthrough=4 also, case sensitively matches a range of regular
     expressions but is much more strict than level =3.
    -Wimplicit-fallthrough=5 doesn't recognize any comments.

Plenty of other compilers did not recognize the gcc comment convention,
and up until now the compiler warning for detecting unintended
fallthrough had to be suppressed on other compilers. That's because the code
in NetHack has been relying on the gcc approach, and only the gcc approach.

The C23 standard introduces an attribute [[fallthrough]] for the
functionality, when implicit fallthrough warnings have been enabled.

Several popular compilers already support that, or a very similar attribute
style approach, today, even ahead of their C23 support:

       C compiler                       whitelist approach
       ---------------------------   -------------------------------------
       C23 conforming compilers         [[fallthrough]]

       clang versions supporting
       standards prior to
       C23                              __attribute__((__fallthrough__))

       Microsoft Visual Studio
       since VS 2022 17.4.
       The warning C5262 controls
       whether the implict
       fallthrough is detected and
       warned about with
       /std:clatest.                    [[fallthrough]]

This adds support to NetHack for the attribute approach by inserting a
macro FALLTHROUGH to the existing cases that require white-listing, so
other compilers can analyze things too.

The definition of the FALLTHROUGH macro is controlled in include/tradstdc.h.

The gcc comment approach has also been left in place at this time.
2024-11-30 14:16:27 -05:00
PatR
3615b17b62 'O' feedback when toggling 'accessiblemsg'
When accessiblemsg is Off, coordiates supplied for various messages
stayed put after becoming stale.  If you used 'mO' to toggle that
option On, you could see things like
 (2east):'accessiblemsg' option toggled on.
After that, accessibility message coordinates behaved as intended.

Clear a11y.msg_loc.x,y for every pline instead of just when they
are used to augment the current message.

Most players who use accessiblemsg are bound to set it in their
config file rather than toggle it interactively so never noticed.

Misc 1:  option.c doesn't need '#include <ctype.h>' because
cstd.h includes it unconditionally.  Several other src/*.c are in
the same situation but I didn't touch them.

Misc 2:  move set_msg_dir() and set_msg_xy() out of a warning
suppression block that isn't relevant to them.
2024-11-26 19:28:30 -08:00
nhmall
13db1aed0d replace stray tabs that have crept in 2024-11-14 11:54:39 -05:00
nhmall
e83e04dbb3 fix some memory leaks 2024-11-10 22:24:45 -05:00
Pasi Kallinen
945ccff1ff Allow changing command autocompletions via #optionsfull 2024-10-19 14:46:11 +03:00
PatR
cc1066b1ff some reformatting (3 of 4) 2024-09-05 15:55:24 -07:00
Pasi Kallinen
e645c0b4bb Allow starting game as pauper, without any inventory
And also without spells, skills, or preidentified items.
This also implies nudist.

Breaks saves and bones.
2024-08-29 20:51:13 +03:00
PatR
61affaed37 fix #K4202 - O/mO for prompted values treated \
player's input as a comma-separated list of option:value settings

Several compound values that aren't amenable to menus prompt for a
line of input and pass it to parseoptions() as if it came from the
run-time configuration file.  That shouldn't be treating commas as
option separators.

The fix is trival, at least for handling the text properly without
introducing new warnings to complain about rejections.  Some options
notice an unwanted comma and complain, others don't notice and the
extra text gets ignored.
2024-07-15 13:13:01 -07:00
nhmall
0eb7f109e0 follow-up, program_state 2024-07-13 16:31:35 -04:00
nhmall
6c0ae092c6 distinguish global variables that get written to savefile
The g? structs had a mix of variables that were written to
the savefile, and those that were not.

For better clarity and to distinguish those that end up in
the savefile, relocate some g? variables that get written
directly to the savefile into different structs.

This updates EDITLEVEL, although technically it probably
didn't need to, since savefile contents are not changing.

Details:

    gb.bases            -> svb.bases
    gb.bbubbles         -> svb.bbubbles
    gb.branches         -> svb.branches
    gc.context          -> svc.context
    gd.disco            -> svd.disco
    gd.dndest           -> svd.dndest
    gd.doors            -> svd.doors
    gd.doors_alloc      -> svd.doors_alloc
    gd.dungeon_topology -> svd.dungeon_topology
    gd.dungeons         -> svd.dungeons
    ge.exclusion_zones  -> sve.exclusion_zones
    gh.hackpid          -> svh.hackpid
    gi.inv_pos          -> svi.inv_pos
    gk.killer           -> svk.killer
    gl.lastseentyp      -> svl.lastseentyp
    gl.level            -> svl.level
    gl.level_info       -> svl.level_info
    gm.mapseenchn       -> svm.mapseenchn
    gm.moves            -> svm.moves
    gm.mvitals          -> svm.mvitals
    gn.n_dgns           -> svn.n_dgns
    gn.n_regions        -> svn.n_regions
    gn.nroom            -> svn.nroom
    go.oracle_cnt       -> svo.oracle_cnt
    gp.pl_character     -> svp.pl_character
    gp.pl_fruit         -> svp.pl_fruit
    gp.plname           -> svp.plname
    gp.program_state    -> svp.program_state
    gq.quest_status     -> svq.quest_status
    gr.rooms            -> svr.rooms
    gs.sp_levchn        -> svs.sp_levchn
    gs.spl_book         -> svs.spl_book
    gt.timer_id         -> svt.timer_id
    gt.tune             -> svt.tune
    gu.updest           -> svu.updest
    gx.xmax             -> svx.xmax
    gx.xmin             -> svx.xmin
    gy.ymax             -> svy.ymax
    gy.ymin             -> svy.ymin

Related note:
There are some pointer variables that are heads of chains that were not
moved from 'g?' to 'sv?', because they are not actually written to the
savefile directly, but the objects/monst/trap/lightsource/timer in the
chains they point to are. That can be changed, if desired.
Examples: gi.invent, gm.migrating_objs, gb.billobjs, gm.migrating_mons,
          gf.ftrap, gl.light_base, gt.timer_base
2024-07-13 14:57:50 -04:00
nhmall
588b3ae92f replace some leading tabs that had crept in 2024-06-10 10:57:59 -04:00
nhmall
329ffae7df simple O menu requires clear screen for symset 2024-05-12 08:10:36 -04:00
RainRat
e7aaf8dc1c fix typos 2024-04-26 08:10:10 -04:00
Pasi Kallinen
94dd316e80 Make saveoptions save changed autocompletions 2024-04-25 10:13:08 +03:00
Pasi Kallinen
bb3b9b7271 CHANGE_COLOR: Save the palette with #saveoptions 2024-04-18 09:24:34 +03:00
nhmall
ebd200ecc2 follow-up: preprocessor conditional 2024-04-12 21:59:59 -04:00
nhmall
15db874f71 CHANGE_COLOR palette option adjustments
It was too early to call the windowport change_color() routine
while processing the config file. The windowport was not yet
fully operational.

Now the palette option processing will just place the rgb
value into the appropriate ga.altpalette[CLR_MAX] entry.

init_sound_disp_gamewindows(void) [allmain.c] calls
change_palette() [coloratt.c] and it will call the windowport
change_color() function for each ga.altpalette[] entry that
has been set.

Notes:
The rgb values stored in ga.altpalette[] have the NH_ALTPALETTE bit set
so that the rgb value of 0 can be stored and be distinguishable from
a "not set" entry.

The NH_ALTPALETTE bit is cleared from the rgb value in change_palette()
prior to calling the windowport change_color() function.

The syntax for palette is colorname/r-g-b.
For example: palette:black/12-12-12

colorname must be one of the NH_BASIC_COLOR names or a suitable
alias for one of those 16 entries.

Some of the windowport CHANGE_COLOR functions had the wrong parameters,
perhaps due to bitrot. Those have been corrected to match the prototype.
2024-04-12 21:57:27 -04:00
PatR
2b0459e2b8 undo a dodgy 'O' menu optimization
Normally the 'O' menu covers the status display, but not always.

Toggling 'time' or 'showexp' via the "simple 'O'" menu should update
the status lines.

Toggling 'hitpointbar' already does so so.  I didn't try to figure out
why.  Presumeably it triggers a different bot() call somewhere and the
code here sees 'disp.bot' as reset to False.

I didn't check the behavior when adding or removing a status highlight
but those can change the current status display.
2024-04-04 13:35:51 -07:00
nhmall
a1a1049890 follow-up for an apparent conflict in Qt5 2024-03-29 16:10:33 -04:00
nhmall
af3a0db083 onefile fix 2024-03-29 07:02:04 -04:00
nhmall
29495f77f7 runtime toggle of ENHANCED_SYMBOLS customsymbols 2024-03-24 19:39:36 -04:00
nhmall
780d0912ee indent bit 2024-03-24 17:01:41 -04:00
nhmall
0b35079acc add customcolors option
customcolors (default) and !customcolors toggle whether the
custom colors get applied to the glyphmap.
2024-03-24 16:55:23 -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
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
Pasi Kallinen
23d1657dca Add walking on traps to default paranoid_confirm 2024-03-20 19:31:09 +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