combine boolean and compound options into a single allopt[] array for
processing in options.c.
move the definitions of the options into new include/optlist.h file which
uses a set of macros to define them appropriately.
during compile of options.c each option described in include/optlist.h:
1. automatically results in a function prototype for an optfn called
optfn_xxxx (xxxx is the option name).
2. automatically results in an opt_xxxx enum value for referencing
its index throughout options.c (xxxx is the option name).
3. is used to initialize an element of the allopt[] array at index
opt_xxxx (xxxx is the option name) based on the settings in the
NHOPTB, NHOPTC, NHOPTP macros. Those macros only live during the
compilation of include/optlist.h.
each optfn_xxxx() function can be called with a req id of: do_init, do_set,
get_val or do_handler.
req do_init is called from options_init, and if initialization or memory
allocation or other initialization for that particular option is needed,
it can be done in response to the init req.
req do_set is called from parseoptions() for each option it encounters
and the optfn_xxxx() function is expected to react and set the option
based on the string values that parseoptions() passes to it.
req get_val expects each optfn_xxxx() function to write the current
option value into the buffer it is passed.
req do_handler is called during doset() operations in response to player
selections most likely from the 'O' option-setting menu, but only if the
option is identified as having do_handler support in the allopts[]
'has_handler' boolean flag. Not every optfn_xxxx() does.
function special_handling() is eliminated. It's code has been redistributed
to individual handler functions for the option or purpose that they serve.
moved reglyph_darkroom() function from options.c to display.c
Provide a way to communicate additional behaviors and/or appearances
desired from NetHack window port menus.
This is foundation work for changes to follow at a future date.
- Don't display 'Held' when swallowed.
- Don't display 'Held' when the hero is doing the holding; add a condition display
entry "UHold" for that (the opt_in option is "holding")
- Allow resorting of the 'O' menu for status condition fields. Default is alphabetical, but you
can sort by condition field ranking now.
Use CONDITION_SIZE which does not require manual updating.
Also attempts to adjust win32 graphics window port for
the new fields.
That port has its own field names and should be adjusted
to using the following which are declared extern in
include/botl.h.
struct conditions[CONDITION_COUNT];
int cond_idx[CONDITION_COUNT];
The former contains the fields that were port-specifically
added to the win32 graphical port and more, plus it is
centrally maintained and currently utilized by tty and curses.
The cond_idx[] array contains the ranked ordering of the
condition fields from highest ranking to lowest. Instead
of indexing like this:
int i;
for (i = 0; i < CONDITION_COUNT; ++i) {
...conditons[i].enabled;
...condtions[i].text[0];
}
you can use the ranked ordering like this:
int i, ci;
for (i = 0; i < CONDITION_COUNT; ++i) {
ci = cond_idx[i];
...conditons[ci].enabled;
...condtions[ci].text[0];
}
Attempt to test whether Lua fetch succeeded (and pdcurses for windows
and msdos as well)
If those prerequisite fetches and untars didn't work, just exit without
marking the travis-ci build as a failure so that the development team
isn't notified about something transient that they don't need to fix
in the code.
groundwork only - window port interface change
This changes the last parameter for add_menu() from a boolean
to an unsigned int, to allow additional itemflags in future
beyond just the "preselected" that the original boolean offered.
There shouldn't be any functionality changes with this groundwork-only
change, and if there are it is unintentional and should be reported.
New procedures added to win/win32/vs2017/travisci.sh for travis-ci testing.
- use curl to obtain Lua from http://www.lua.org/ftp/lua-5.3.5.tar.gz
- use tar to unzip lua into lib/lua-5.3.5/...
Note: curl and tar were both added as part of Windows 10 in late Dec 2017
https://techcommunity.microsoft.com/t5/Containers/Tar-and-Curl-Come-to-Windows/ba-p/382409
- use git to clone pdcurses into lib/pdcurses
- use git to clone universal-ctags into lib/ctags
- build universal-ctags ahead of building NetHack + lua + pdcurses
- adjust sys/winnt/Makefile.msc to look for those things in their lib locations when
building under travis