Commit Graph
2507 Commits
Author SHA1 Message Date
Ray Chason 8d7d609a56 Implement attributes: bold, dim, italic, inverse
Track highlighting of recent changes separately from inverse, and
display highlight plus inverse as bordered text
2026-08-14 11:08:25 +03:00
Ray Chason 0ee7eef3ef Implement a hit point bar 2026-08-14 11:08:25 +03:00
Ray Chason 6043d189e1 Define wrapper for Label widgets
Renders to a Pixmap and then sets the Pixmap. This in itself does not
change the appearance, but provides a means to do percentage bars,
italics and more.
2026-08-14 11:08:25 +03:00
Ray Chason f7bb4eaae8 Fix timeout of fancy status colors
This was trying to retrieve the foreground color of the form created
in create_value(). Forms don't have colors, and so this was failing,
and update_color() didn't update the color.
2026-08-14 11:08:25 +03:00
Pasi Kallinen b56189cfcd X11: toggle off perm_invent if the window is closed manually 2026-08-13 11:16:45 +03:00
Pasi Kallinen a64c7c64e5 X11: Allow scrolling menus with PageUp/PageDown/Home/End
Change the menu_key() translation table command so it accepts
a parameter, and we can pass a (default) menu control key to it.
2026-08-12 12:37:37 +03:00
Pasi Kallinen f019d03a2f X11: fix menu windows being taller than the screen
Menu windows with lots of entries (such as #optionsfull) were taller
than the screen, making them awkward to use.

The widget needs to be realized before we can get the size.
Also, we need to set the size of the parent popup, not the
acting widget.
2026-08-11 11:46:24 +03:00
Ray Chason c50f9d8176 Draw the hitpoint bar in the hitpoint colors 2026-08-10 09:28:04 +03:00
Ray Chason b9bf823100 Implement a hit point bar 2026-08-10 09:28:04 +03:00
Ray Chason ac169e7100 Clean up, and block out with STATUS_HILITES 2026-08-10 09:28:04 +03:00
Ray Chason ba2c99f28c Remove old code 2026-08-10 09:28:04 +03:00
Ray Chason b763944fb4 Implement three line status 2026-08-10 09:28:04 +03:00
Ray Chason 7521e7120a Implement blink 2026-08-10 09:28:04 +03:00
Ray Chason 8137f6cf3d Remove some debug code 2026-08-10 09:28:03 +03:00
Ray Chason 0f39437315 Implement underline and italic 2026-08-10 09:28:03 +03:00
Ray Chason a7eb50fb36 Query font for status window height 2026-08-10 09:28:03 +03:00
Ray Chason 647fd71a2d Implement bold and dim attributes 2026-08-10 09:28:03 +03:00
Ray Chason 5dd1673678 Implement colors 2026-08-10 09:28:03 +03:00
Ray Chason 725bb3d05f Display gold symbol as Unicode if so configured
Some Unicode bits from winmap.c are moved to winX.c, so that winstat.c
can also use them.
2026-08-10 09:28:03 +03:00
Ray Chason c2b4ee53e5 Begin reimplemented TTY-style status 2026-08-10 09:28:03 +03:00
nhmall 29cb8b7d9a Windows: group accelerator and menu item collision
In the event that there is a collision between a menu group accelerator
and an individual menu item's accelerator, disregard the group
accelerator.

'$' is the only known collision in NetHack 5.0 presently.

Close #805
2026-07-31 14:53:19 -04:00
nhmall de842ec483 add a set of decals to stock tileset
win/share/decals.txt contains (initially) a decal_delimiter tile,
a decal_pet tile, and a decal_pile tile.
The latter two can be used for hilite_pet and hilite_pile implementations
that don't have something in place already. The implementation would
just need to apply (merge) the non-background decal pixels over a
regular tile.

The special decal_delimiter tile can be used to confirm the presence
of the delimiter tiles in the tileset and mark the end of the regular tiles,
and the start of the decal tiles.
   row 1 contains the background color whose pixels should be
   ignored when applying a decal to a tile.
   row 2 contains a row of pixels colored (0, 0, 0).
   row 3 contains a row of pixels colored pure green (0, 255, 0).
   row 3 contains a row of pixels colored pure blue  (0, 0, 255).
2026-07-29 20:47:50 -04:00
Ray Chason 7889eedfa5 MS-DOS: Support no-tiles and no-graphics builds
In previous versions of NetHack, setting -DUSE_TILES enabled the tile
support, while setting -DSUPPRESS_GRAPHICS produced a NetHack that
would write its TTY output to standard output, and rely on ANSI.SYS or
similar to do screen control. (USE_TILES is now TILES_IN_GLYPHMAP.)

This change ensures that the current NetHack can be built the same
ways.

One twist is that previous NetHacks would drop all support for graphical
modes when tiles were not supported. Thus sys/msdos/vid{vga,vesa}.c have
very disordered use of TILES_IN_GLYPHMAP. There was no need to check
this. But now, the graphical modes also support Unicode. A non-tiled
build should have the graphical modes, with only the text functions
present, provided that ENHANCED_SYMBOLS is defined.

Some unused and locally used symbols were cleaned up along the way.
2026-07-09 23:48:14 -04:00
nhmall 98bb86ab33 Windows: fix ascii map hilite_pet
hilite_pet was working with tiles, but not with ascii map.
2026-07-06 11:00:50 -04:00
nhmall bb0016db0a Windows:OPTIONS=windowtype:tty NetHackW.exe issue 2026-07-06 10:59:53 -04:00
Ray Chason 12560f9b13 Add return value where needed. 2026-07-05 22:26:42 -04:00
Ray Chason af79ad629c MS-DOS: some optimizations for tile handling
* In both the 16 color and the VESA mode, the tileset image is loaded
      and split into individual tiles; the tiles are then processed into a
      form that is compatible with the video mode in use. For 16 color mode,
      a tile is processed each time it is displayed, leading to slow
      redrawing. For VESA mode, each tile is processed at startup, leading
      to long startup times. Both modes are changed so that the tile is
      processed once, when it is first displayed, and the result is cached.

    * Use memcpy when splitting the image into tiles.

    * Only load the tileset once. In 16 color mode, for reasons I do not
      understand, the gr_init function is called twice, leading to delay
      in startup. This does not happen in VESA mode.
2026-07-04 13:43:23 -04:00
nhmall 6808e87869 yet more 3.7 cleanup 2026-06-20 18:55:28 -04:00
nhmall 198ac655e5 more 3.7 vestiges
A little later than this probably should have been committed.
2026-06-20 18:26:43 -04:00
Doktor L 08ac68b754 Use 256 colours in curses window port
Only glyphs that are customised via config can have colours different
from the basic 16. For such glyphs, when curses supports 256 colours,
use them.
2026-06-19 16:36:27 +02:00
Doktor L 19c87585fa Create curses colour pairs for 256 colours
Keep only 8 background colours but if curses supports 256 colours and
256*8 colours pairs, create colours pairs for 256 foregrounds rather
than just 16.
2026-06-19 16:36:27 +02:00
Doktor L 7036f902d2 Pass base-256 colour index to curses_putch
And to its inner function write_char
2026-06-19 16:36:27 +02:00
Doktor L f3d292e111 Combine three arguments of curses_putch into one
It will need another parameter for 256-colour support. To avoid having
too many arguments, put glyph colour, background colour and attributes
into a struct and, since to curses library all of that is attributes
that are handled by same function, call the struct "gryph attributes".

curses_putch was also declared in two different headers, remove one of
those declarations.
2026-06-19 16:36:27 +02:00
Doktor L 24adb1c592 curses: use existing background parameter for pile
The blue background colour for piles was implemented by changing glyph
colour to curses colour pair with the desired background, and then
passed to curses_putch which takes character and background colour and
makes curses colour pair out of them once again.

Pass blue background to curses_putch instead and let it create curses
colour pair just once.
2026-06-19 16:36:27 +02:00
Patric Mueller 49ac961884 replace NOTPARMDECL with TPARM_WORKAROUND
The old logic used a negative check to emit an extern declaration for
tparm(). This guarded against old platforms whose curses implementations
did not declare their own functions.

If there are still any platforms left that need this declaration, they
can set TPARM_WORKAROUND to get the old behavior back.
2026-06-10 10:16:44 +02:00
Ingo Paschke 28ca8b26c3 rename MACOS9 to MAC68K to avoid confusion with modern macOS 2026-06-05 16:30:09 +02:00
Pasi Kallinen eb4d098717 X11: Obey timed_delay
I noticed a strange thing where the X11 windowport didn't show the tethered
thrown aklys animation correctly.  Interestingly, other stuff, such as zapped
wands did show the path.  I didn't bother trying to figure out what the core
was doing differently, as the animation worked in all the other windowports,
so instead fix the issue in X11, so it behaves the same as all the others.

The issue seems to be that the event loop exited on any(?) event, instead
of our specific timed event.  So, create our event with a magic id number,
and exit only when we encounter that.

Also: Obey the timed_delay option, and change the delay from 30ms to 50ms,
like in other windowports.
2026-06-03 23:06:30 +03:00
Patric Mueller 207db14301 tty: handle indexed colors separately from RGB color space
The terminfo entries from the standard ncurses distribution have
peculiar settings for entries supporting 24 bit colors. The direct
entries mix indexed and RGB values into an incompatible mess.

This commit adds a simple workaround for the tty port.  Colors are
initialised as if only 8 ANSI colors are available.  This does not
affect color customisation from the symsets.

The curses port is affected as well. But I am not yet comfortable to
refactor a large part of the code for an absolute edge case.
2026-05-30 13:53:13 +02:00
nhmall be4d613bff follow-up curses idlecheckpoint 2026-05-22 14:20:13 -04:00
nhmall a1fad59f2d idlecheckpoint support in curses 2026-05-22 12:24:32 -04:00
nhmall 4c7f2dfaac some Windows curses adjustments dialog on startup 2026-05-22 12:21:42 -04:00
nhmall 18845b6f67 match magic object tiles with mundane counterparts
Fixes #1533
2026-05-21 10:44:29 -04:00
nhmall f9165e66fc curses display sizes on Windows console, GUI 2026-05-20 08:55:28 -04:00
nhmall 8ce430bd89 put the values on other pdcurses platforms back
They were set this way on other pdcurses platforms prior
to this recent change, so leave them at those values.
2026-05-16 22:13:40 -04:00
nhmall 51011e234d build fix attempt for msdos cross-compile
Recent change was #ifdef PDCURSES, but that is
also used on msdos and other platforms
2026-05-16 21:41:05 -04:00
nhmall d78a875110 more Windows curses size tinkering 2026-05-16 12:15:20 -04:00
nhmall a8f97a3926 OpenBSD build bits
An issue still remains with fetch-Lua in the top Makefile.
2026-05-15 21:58:51 -04:00
Patric Mueller 3a0c6f17c7 fix buffer overflow in update_topl
Buffer overflows could occur when interacting with containers while
inputting or outputting many items.

This commit ensures topline updates do not exceed buffer limits by
checking against TBUFSZ.

Issue reported by k21971 on IRC.
2026-05-15 23:32:14 +02:00
Pasi Kallinen a533350537 TTY: allow custom glyph colors on more limited terminals
Previously changing glyph colors required a terminal with more
than 256 colors, even if the color was one of the basic 16 colors
used by NetHack.
2026-05-15 20:21:52 +03:00
nhmall 99f559fe18 utilize more real estate on Windows GUI curses
Some inventory items were being hidden in a lengthy list.
2026-05-15 01:21:45 -04:00