Commit Graph

2623 Commits

Author SHA1 Message Date
Pasi Kallinen
a57d0e6f4f Curses: add support for the palette config option
Depends on CHANGE_COLOR compile-time option.

Also allow multiple palette-definitions in the config file.
2024-04-13 12:01:43 +03: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
nhmall
8bbbe38fb5 fix garbled message on symset change from O menu 2024-04-11 20:24:38 -04:00
nhmall
40e3b3b64a doc update VIEWDEPRECATIONS=1 2024-04-01 15:12:28 -04:00
nhmall
d0c543748e follow-up: use VIEWDEPRECATIONS instead of KEEPDEPRECATIONS 2024-04-01 15:04:07 -04:00
nhmall
61252f5c02 allow KEEPDEPRECATIONS=1 on make command line to see what's deprecated 2024-04-01 14:59:41 -04:00
nhmall
459f5f77c1 pass NETHACK_VERSION to package subproject 2024-04-01 09:24:09 -04:00
nhmall
69ecd69871 follow-up re: vs2017 2024-03-31 21:38:57 -04:00
nhmall
410c1b6cbd stop support & testing of nearly 7 year old vs2017 2024-03-31 21:31:34 -04:00
nhmall
0a4f9de695 follow-up: remove explicit Windows SDK reference 2024-03-31 20:43:15 -04:00
nhmall
1d4aeb4f15 add some zip file packaging to visual studio proj 2024-03-31 20:37:56 -04:00
nhmall
6f3a54367e follow-up to fix the git mv done earlier 2024-03-31 14:06:05 -04:00
nhmall
e00e423262 remove leading period from Windows template file 2024-03-31 13:53:48 -04:00
nhmall
5ee813091a remove specific Windows 10 sdk reference 2024-03-31 12:01:05 -04:00
nhmall
f71b0caecd visual studio project updates 2024-03-31 10:21:08 -04:00
nhmall
8262eb2fe4 add fetch 2024-03-31 09:09:31 -04:00
nhmall
b4cd1d6ee0 remove unnecessary paragraph 2024-03-28 10:09:59 -04:00
nhmall
c80bb1990d some Windows build doc updates and typo fixes 2024-03-28 10:06:08 -04:00
nhmall
9955b2364b update sys/windows/Install.windows 2024-03-27 16:44:40 -04:00
nhmall
5355ee67e2 follow-up: fix copy-and-paste error 2024-03-27 16:25:33 -04:00
nhmall
bb2fef0f7d rework Windows build instructions 2024-03-27 16:20:06 -04:00
nhmall
66f92ad182 startup sequence and iflags values
early_init() calls decl_globals_init() which zeros out
a number structures:
    ZERO(flags);
    ZERO(iflags);
    ZERO(a11y);
    ZERO(disp);
    ZERO(u);
    ZERO(ubirthday);
    ZERO(urealtime);

Setting values in any of those during startup prior to
the early_init() call was futile, and the values would
get overwritten.

Such was the case with the setting of iflags.colorcount
during Windows startup, so do it after early_init() has
been called.
2024-03-25 22:30:08 -04:00
nhmall
80fb1b5f54 provide way for developer to verify custom colors and symbols in effect
' #wizcustom
2024-03-25 20:42:48 -04:00
nhmall
7f2af9698f put wintty.c and termcap.c logic to previous 2024-03-25 09:38:54 -04:00
nhmall
750cf7f619 rename glyphmap nhcolor field to customcolor 2024-03-24 11:04:31 -04:00
nhmall
8efc329db2 DOS stubs for unfilled functionality 2024-03-23 16:55:56 -04: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
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
nhmall
058e0cf18c update tested versions of Visual Studio 2024-03-21 2024-03-21 11:24:40 -04: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
6e43ea1635 remove use of obsolete BETA macro 2024-03-20 11:49:24 -04: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
nhkeni
0227a2e0bf hints/macOS.370: remove testing code 2024-03-16 19:42:42 -04:00
nhkeni
54c3dd35ac Merge branch 'keni-staticfn' into NetHack-3.7 2024-03-16 09:38:21 -04:00
nhkeni
ab6d7cdc3b depend.awk: bugfix for commented out replacement text 2024-03-13 22:04:19 -04:00
nhmall
31a8b44312 fix error in copied dependencies from Makefile.src 2024-03-13 20:29:40 -04:00
nhmall
2911596c5b sys/windows/Makefile.nmake dependency update
Copy the dependencies from the tail of sys/unix/Makefile.src
and adjust them for the Windows nmake build.
2024-03-13 20:10:34 -04:00
nhkeni
59486fb8ad something concrete for discussion:
infrastructure for NOSTATICFN, replacing NOSTATICCORE
2024-03-13 11:39:24 -04:00
nhmall
a13b9da286 Makefile.mingw32 update
$(HLHACKLIB) was missing from the dependency list for NetHack.exe
2024-03-12 17:27:21 -04:00
nhmall
2fae2b1a25 update tested versions of Visual Studio 2024-03-12 2024-03-12 15:23:04 -04:00
nhmall
f9f9641fd4 typo fix README-hints 2024-03-12 13:02:19 -04:00
nhmall
605c6c19b6 add a doc outlining some .370 hints file build options 2024-03-12 12:30:57 -04:00
nhmall
bb4bcb400e cross-compiling update 2024-03-12 10:06:37 -04:00
nhkeni
4e11d526da Show only active .c.o commands; clean up temp file from make depend 2024-03-10 21:53:33 -04:00
nhkeni
0edfb577f7 Two more bug fixes:
split depend target so "make depend" and "make updatedepend"
 get the right dependencies (this puts back the previously
 temporarily removed dependencies)

deterministically pull out the right source so moc rules
 are correct
2024-03-10 19:51:55 -04:00
nhkeni
998240d5f5 remove gmake-specific code from Makefile.src
The awk script for NOSTATICCORE is currently broken.
2024-03-10 18:35:19 -04:00
nhkeni
387b145b58 more fixes
removal of depend target dependencies is temporary
2024-03-10 16:23:20 -04:00