Files
nethack/win/curses
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
..
2018-11-16 20:53:38 -05:00
2023-12-29 18:16:14 -08:00
2023-11-15 11:11:55 -05:00
2021-03-13 18:18:53 -08:00
2023-01-09 23:34:32 -08:00
2024-03-15 20:36:56 +02:00
2024-03-16 12:53:58 -04:00
2021-01-26 21:06:16 -05:00
2024-02-28 20:15:56 -08:00
2024-02-28 20:15:56 -08:00

INTRO
=====

The "curses" windowport is a new text-based interface for NetHack,
using high-level curses routines to control the display.  Currently, it
has been compiled and tested on Linux, macOS, Windows, and msdos, but it
should also be portable to a number of other systems, such as other
forms of UNIX and OS/2.

Some features of this interface compared to the traditional tty
interface include:

 * Dynamic window resizing (e.g. maximizing a terminal window)
 * Dynamic configurable placement of status and message windows,
 relative to the map
 * Makes better use of larger terminal windows
 * Fancier display (e.g. window borders, optional popup dialogs)
 * "cursesgraphics" option for fancier line-drawing characters for
 drawing the dungeon - this should work on most terminals/platforms


BUILDING
========

UNIX/Linux/macOS build instructions:

Follow the instructions in
sys/unix/Install.unx.  By default, the Makefile is setup to compile
against ncurses.  Edit Makefile.src if you wish to compile against a
different curses library, such as PDCurses for SDL.
See sys/unix/NewInstall.unx for more information about building
NetHack 3.7 and above.

Windows build instructions:

By default, the Makefile.msc and Makefile.mingw32 are set up to build
curses from the submodules/pdcurses submodules folder (assumes you
obtained your NetHack sources via cloning a git repository),
If you obtained your NetHack by another means, such as a zip download,
follow the instructions in sys/windows/Install.windows.

If you are using a different compiler, you will have to manually modify
the appropriate Makefile to include the curses windowport files.

GAMEPLAY
========

Gameplay should be similar to the tty interface for NetHack; the 
differences are primarily visual.  This windowport supports dymanic
resizing of the terminal window, so you can play with it to see how it
looks best to you during a game.  Also, the align_status and
align_message options may be set during the game, so you can experiment
to see what arrangement looks best to you.

For menus, in addition to the normal configurable keybindings for menu
navigation descrived in the Guidebook, you can use the right and left
arrows to forward or backward one page, respectively, and the home
and end keys to go to the first and last pages, respectively.

Some configuration options that are specific to or relevant to the
curses windowport are shown below.  Copy any of these that you like to
your nethack configuration file (e.g. .nethackrc for UNIX or
NetHack.cnf for Windows):
#
# Use this if the binary was compiled with multiple window interfaces,
# and curses is not the default
OPTIONS=windowtype:curses
#
# Set this for Windows systems, or for PDCurses for SDL on any system.
# The latter uses a cp437 font, which works with this option
#OPTIONS=IBMgraphics
#
# Set this if IBMgraphics above won't work for your system.  Mutually
# exclusive with the above option, and should work on nearly any
# system.
OPTIONS=cursesgraphics
#
# Optionally specify the alignment of the message and status windows
# relative to the map window.  If not specified, the code will default
# to the locations used in the tty interface: message window on top,
# and status window on bottom.  Placing either of these on the right or
# left really only works well for winder terminal windows.
OPTIONS=align_message:bottom,align_status:right
#
# Use a small popup "window" for short prompts, e.g. "Really save?".
# If this is not set, the message window will be used for these as is
# done for the tty interface.
OPTIONS=popup_dialog
#
# Specify the initial window size for NetHack in units of characters.
# This is supported on PDCurses for SDL as well as PDCurses for
# Windows.
OPTIONS=term_cols:110,term_rows:32
#
# Controls the usage of window borders for the main NetHack windows
# (message, map, and status windows).  A value of 1 forces the borders
# to be drawn, a value of 2 forces them to be off, and a value of 3
# allows the code to decide if they should be drawn based on the size
# of the terminal window.
OPTIONS=windowborders:3


CONTACT
=======

Please send any bug reports, suggestions, patches, or miscellaneous
feedback to me (Karl Garrison) at: kgarrison@pobox.com.  Note that as
of this writing, I only have sporadic Internet access, so I may not get
back to you right away.

Happy Hacking!

Karl Garrison
March, 2009