options.c formatting

This commit is contained in:
PatR
2017-11-12 17:35:30 -08:00
parent 2f4fcb837d
commit b4b3dedd59

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 options.c $NHDT-Date: 1508827592 2017/10/24 06:46:32 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.316 $ */ /* NetHack 3.6 options.c $NHDT-Date: 1510536906 2017/11/13 01:35:06 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.318 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -106,8 +106,7 @@ static struct Bool_Opt {
#endif #endif
{ "confirm", &flags.confirm, TRUE, SET_IN_GAME }, { "confirm", &flags.confirm, TRUE, SET_IN_GAME },
{ "dark_room", &flags.dark_room, TRUE, SET_IN_GAME }, { "dark_room", &flags.dark_room, TRUE, SET_IN_GAME },
{ "eight_bit_tty", &iflags.wc_eight_bit_input, FALSE, { "eight_bit_tty", &iflags.wc_eight_bit_input, FALSE, SET_IN_GAME }, /*WC*/
SET_IN_GAME }, /*WC*/
#ifdef TTY_GRAPHICS #ifdef TTY_GRAPHICS
{ "extmenu", &iflags.extmenu, FALSE, SET_IN_GAME }, { "extmenu", &iflags.extmenu, FALSE, SET_IN_GAME },
#else #else
@@ -408,8 +407,9 @@ static struct Comp_Opt {
#endif #endif
{ "whatis_coord", "show coordinates when auto-describing cursor position", { "whatis_coord", "show coordinates when auto-describing cursor position",
1, SET_IN_GAME }, 1, SET_IN_GAME },
{ "whatis_filter", "filter coordinate locations when targeting next or previous", { "whatis_filter",
1, SET_IN_GAME }, "filter coordinate locations when targeting next or previous",
1, SET_IN_GAME },
{ "windowcolors", "the foreground/background colors of windows", /*WC*/ { "windowcolors", "the foreground/background colors of windows", /*WC*/
80, DISP_IN_GAME }, 80, DISP_IN_GAME },
{ "windowtype", "windowing system to use", WINTYPELEN, DISP_IN_GAME }, { "windowtype", "windowing system to use", WINTYPELEN, DISP_IN_GAME },
@@ -492,7 +492,8 @@ static const menu_cmd_t default_menu_cmd_info[] = {
{ "menu_deselect_all", MENU_UNSELECT_ALL, "Unselect all items" }, { "menu_deselect_all", MENU_UNSELECT_ALL, "Unselect all items" },
{ "menu_invert_all", MENU_INVERT_ALL, "Invert selection" }, { "menu_invert_all", MENU_INVERT_ALL, "Invert selection" },
{ "menu_select_page", MENU_SELECT_PAGE, "Select items in current page" }, { "menu_select_page", MENU_SELECT_PAGE, "Select items in current page" },
{ "menu_deselect_page", MENU_UNSELECT_PAGE, "Unselect items in current page" }, { "menu_deselect_page", MENU_UNSELECT_PAGE,
"Unselect items in current page" },
{ "menu_invert_page", MENU_INVERT_PAGE, "Invert current page selection" }, { "menu_invert_page", MENU_INVERT_PAGE, "Invert current page selection" },
{ "menu_search", MENU_SEARCH, "Search and toggle matching items" }, { "menu_search", MENU_SEARCH, "Search and toggle matching items" },
}; };
@@ -713,8 +714,8 @@ initoptions_init()
iflags.getpos_coords = GPCOORDS_NONE; iflags.getpos_coords = GPCOORDS_NONE;
/* hero's role, race, &c haven't been chosen yet */ /* hero's role, race, &c haven't been chosen yet */
flags.initrole = flags.initrace = flags.initgend = flags.initalign = flags.initrole = flags.initrace = flags.initgend = flags.initalign
ROLE_NONE; = ROLE_NONE;
/* Set the default monster and object class symbols. */ /* Set the default monster and object class symbols. */
init_symbols(); init_symbols();
@@ -1165,14 +1166,14 @@ int on_or_off;
/*-- ON --*/ /*-- ON --*/
if (iflags.opt_booldup) if (iflags.opt_booldup)
impossible("iflags.opt_booldup already on (memory leak)"); impossible("iflags.opt_booldup already on (memory leak)");
iflags.opt_booldup = (int *) alloc(SIZE(boolopt) * sizeof(int)); iflags.opt_booldup = (int *) alloc(SIZE(boolopt) * sizeof (int));
optptr = iflags.opt_booldup; optptr = iflags.opt_booldup;
for (k = 0; k < SIZE(boolopt); ++k) for (k = 0; k < SIZE(boolopt); ++k)
*optptr++ = 0; *optptr++ = 0;
if (iflags.opt_compdup) if (iflags.opt_compdup)
impossible("iflags.opt_compdup already on (memory leak)"); impossible("iflags.opt_compdup already on (memory leak)");
iflags.opt_compdup = (int *) alloc(SIZE(compopt) * sizeof(int)); iflags.opt_compdup = (int *) alloc(SIZE(compopt) * sizeof (int));
optptr = iflags.opt_compdup; optptr = iflags.opt_compdup;
for (k = 0; k < SIZE(compopt); ++k) for (k = 0; k < SIZE(compopt); ++k)
*optptr++ = 0; *optptr++ = 0;
@@ -1233,7 +1234,7 @@ int iscompound; /* 0 == boolean option, 1 == compound */
*/ */
#else /* !MAC */ #else /* !MAC */
config_error_add("%s option specified multiple times: %s", config_error_add("%s option specified multiple times: %s",
iscompound ? "compound" : "boolean", opts); iscompound ? "compound" : "boolean", opts);
#endif /* ?MAC */ #endif /* ?MAC */
return; return;
} }
@@ -1458,7 +1459,7 @@ const char *prompt;
static const struct { static const struct {
const char *name; const char *name;
const xchar msgtyp; xchar msgtyp;
const char *descr; const char *descr;
} msgtype_names[] = { } msgtype_names[] = {
{ "show", MSGTYP_NORMAL, "Show message normally" }, { "show", MSGTYP_NORMAL, "Show message normally" },
@@ -1514,11 +1515,9 @@ msgtype_add(typ, pattern)
int typ; int typ;
char *pattern; char *pattern;
{ {
struct plinemsg_type *tmp struct plinemsg_type
= (struct plinemsg_type *) alloc(sizeof (struct plinemsg_type)); *tmp = (struct plinemsg_type *) alloc(sizeof (struct plinemsg_type));
if (!tmp)
return FALSE;
tmp->msgtype = typ; tmp->msgtype = typ;
tmp->regex = regex_init(); tmp->regex = regex_init();
if (!regex_compile(pattern, tmp->regex)) { if (!regex_compile(pattern, tmp->regex)) {
@@ -1670,7 +1669,8 @@ const char *errmsg;
} }
if (!regex_compile(str, match)) { if (!regex_compile(str, match)) {
config_error_add("%s: %s", errmsg ? errmsg : re_error, regex_error_desc(match)); config_error_add("%s: %s", errmsg ? errmsg : re_error,
regex_error_desc(match));
retval = FALSE; retval = FALSE;
} }
regex_free(match); regex_free(match);
@@ -1901,7 +1901,7 @@ boolean tinitial, tfrom_file;
} }
if (strlen(opts) > BUFSZ / 2) { if (strlen(opts) > BUFSZ / 2) {
config_error_add("Option too long, max length is %i characters", config_error_add("Option too long, max length is %i characters",
(BUFSZ / 2)); (BUFSZ / 2));
return FALSE; return FALSE;
} }
@@ -2025,8 +2025,7 @@ boolean tinitial, tfrom_file;
/* We always check for duplicates on the remaining compound options, /* We always check for duplicates on the remaining compound options,
although individual option processing can choose to complain or not */ although individual option processing can choose to complain or not */
duplicate = duplicate = duplicate_opt_detection(opts, 1); /* 1: check compounds */
duplicate_opt_detection(opts, 1); /* 1 means check compounds */
fullname = "pettype"; fullname = "pettype";
if (match_optname(opts, fullname, 3, TRUE)) { if (match_optname(opts, fullname, 3, TRUE)) {
@@ -2485,7 +2484,8 @@ boolean tinitial, tfrom_file;
forig = fruit_from_name(pl_fruit, FALSE, (int *) 0); forig = fruit_from_name(pl_fruit, FALSE, (int *) 0);
if (!forig && fnum >= 100) { if (!forig && fnum >= 100) {
config_error_add("Doing that so many times isn't very fruitful."); config_error_add(
"Doing that so many times isn't very fruitful.");
return retval; return retval;
} }
} }
@@ -2681,6 +2681,7 @@ boolean tinitial, tfrom_file;
} }
return retval; return retval;
} }
/* WINCAP /* WINCAP
* align_message:[left|top|right|bottom] */ * align_message:[left|top|right|bottom] */
fullname = "align_message"; fullname = "align_message";
@@ -2707,7 +2708,8 @@ boolean tinitial, tfrom_file;
} }
return retval; return retval;
} }
/* the order to list the pack */
/* the order to list inventory */
fullname = "packorder"; fullname = "packorder";
if (match_optname(opts, fullname, 4, TRUE)) { if (match_optname(opts, fullname, 4, TRUE)) {
if (duplicate) if (duplicate)
@@ -2831,9 +2833,10 @@ boolean tinitial, tfrom_file;
} }
/* types of objects to pick up automatically */ /* types of objects to pick up automatically */
if (match_optname(opts, "pickup_types", 8, TRUE)) { fullname = "pickup_types";
if (match_optname(opts, fullname, 8, TRUE)) {
char ocl[MAXOCLASSES + 1], tbuf[MAXOCLASSES + 1], qbuf[QBUFSZ], char ocl[MAXOCLASSES + 1], tbuf[MAXOCLASSES + 1], qbuf[QBUFSZ],
abuf[BUFSZ]; abuf[BUFSZ];
int oc_sym; int oc_sym;
boolean badopt = FALSE, compat = (strlen(opts) <= 6), use_menu; boolean badopt = FALSE, compat = (strlen(opts) <= 6), use_menu;
@@ -2855,7 +2858,7 @@ boolean tinitial, tfrom_file;
if (flags.menu_style == MENU_TRADITIONAL if (flags.menu_style == MENU_TRADITIONAL
|| flags.menu_style == MENU_COMBINATION) { || flags.menu_style == MENU_COMBINATION) {
use_menu = FALSE; use_menu = FALSE;
Sprintf(qbuf, "New pickup_types: [%s am] (%s)", ocl, Sprintf(qbuf, "New %s: [%s am] (%s)", fullname, ocl,
*tbuf ? tbuf : "all"); *tbuf ? tbuf : "all");
getlin(qbuf, abuf); getlin(qbuf, abuf);
op = mungspaces(abuf); op = mungspaces(abuf);
@@ -2871,7 +2874,7 @@ boolean tinitial, tfrom_file;
} }
} }
if (negated) { if (negated) {
bad_negation("pickup_types", TRUE); bad_negation(fullname, TRUE);
return FALSE; return FALSE;
} }
while (*op == ' ') while (*op == ' ')
@@ -2890,8 +2893,7 @@ boolean tinitial, tfrom_file;
op++; op++;
} }
if (badopt) { if (badopt) {
config_error_add("Unknown %s parameter '%s'", config_error_add("Unknown %s parameter '%s'", fullname, op);
"pickup_types", op);
return FALSE; return FALSE;
} }
} }
@@ -3256,10 +3258,11 @@ boolean tinitial, tfrom_file;
} }
return retval; return retval;
} }
/* WINCAP /* WINCAP
* scroll_amount:nn */ * scroll_amount:nn */
fullname = "scroll_amount"; fullname = "scroll_amount";
if (match_optname(opts, fullname, sizeof("scroll_amount") - 1, TRUE)) { if (match_optname(opts, fullname, sizeof "scroll_amount" - 1, TRUE)) {
if (duplicate) if (duplicate)
complain_about_duplicate(opts, 1); complain_about_duplicate(opts, 1);
op = string_for_opt(opts, negated); op = string_for_opt(opts, negated);
@@ -3271,10 +3274,11 @@ boolean tinitial, tfrom_file;
} }
return retval; return retval;
} }
/* WINCAP /* WINCAP
* scroll_margin:nn */ * scroll_margin:nn */
fullname = "scroll_margin"; fullname = "scroll_margin";
if (match_optname(opts, fullname, sizeof("scroll_margin") - 1, TRUE)) { if (match_optname(opts, fullname, sizeof "scroll_margin" - 1, TRUE)) {
if (duplicate) if (duplicate)
complain_about_duplicate(opts, 1); complain_about_duplicate(opts, 1);
op = string_for_opt(opts, negated); op = string_for_opt(opts, negated);
@@ -3286,6 +3290,7 @@ boolean tinitial, tfrom_file;
} }
return retval; return retval;
} }
fullname = "subkeyvalue"; fullname = "subkeyvalue";
if (match_optname(opts, fullname, 5, TRUE)) { if (match_optname(opts, fullname, 5, TRUE)) {
/* no duplicate complaint here */ /* no duplicate complaint here */
@@ -3302,6 +3307,7 @@ boolean tinitial, tfrom_file;
} }
return retval; return retval;
} }
/* WINCAP /* WINCAP
* tile_width:nn */ * tile_width:nn */
fullname = "tile_width"; fullname = "tile_width";
@@ -3346,6 +3352,7 @@ boolean tinitial, tfrom_file;
} }
return retval; return retval;
} }
/* WINCAP /* WINCAP
* vary_msgcount:nn */ * vary_msgcount:nn */
fullname = "vary_msgcount"; fullname = "vary_msgcount";
@@ -3361,6 +3368,19 @@ boolean tinitial, tfrom_file;
} }
return retval; return retval;
} }
/*
* windowtype: option to choose the interface for binaries built
* with support for more than one interface (tty + X11, for instance).
*
* Ideally, 'windowtype' should be processed first, because it
* causes the wc_ and wc2_ flags to be set up.
* For user, making it be first in a config file is trivial, use
* OPTIONS=windowtype:Foo
* as the first non-comment line of the file.
* Making it first in NETHACKOPTIONS requires it to be at the _end_
* because option strings are processed from right to left.
*/
fullname = "windowtype"; fullname = "windowtype";
if (match_optname(opts, fullname, 3, TRUE)) { if (match_optname(opts, fullname, 3, TRUE)) {
if (duplicate) if (duplicate)
@@ -3370,6 +3390,7 @@ boolean tinitial, tfrom_file;
return FALSE; return FALSE;
} else if ((op = string_for_env_opt(fullname, opts, FALSE)) != 0) { } else if ((op = string_for_env_opt(fullname, opts, FALSE)) != 0) {
char buf[WINTYPELEN]; char buf[WINTYPELEN];
nmcpy(buf, op, WINTYPELEN); nmcpy(buf, op, WINTYPELEN);
choose_windows(buf); choose_windows(buf);
} else } else
@@ -3385,6 +3406,7 @@ boolean tinitial, tfrom_file;
return FALSE; return FALSE;
} else if ((op = string_for_env_opt(fullname, opts, FALSE)) != 0) { } else if ((op = string_for_env_opt(fullname, opts, FALSE)) != 0) {
char buf[WINTYPELEN]; char buf[WINTYPELEN];
nmcpy(buf, op, WINTYPELEN); nmcpy(buf, op, WINTYPELEN);
addto_windowchain(buf); addto_windowchain(buf);
} else } else
@@ -3452,6 +3474,7 @@ boolean tinitial, tfrom_file;
fullname = "menu_headings"; fullname = "menu_headings";
if (match_optname(opts, fullname, 12, TRUE)) { if (match_optname(opts, fullname, 12, TRUE)) {
int tmpattr; int tmpattr;
if (duplicate) if (duplicate)
complain_about_duplicate(opts, 1); complain_about_duplicate(opts, 1);
if (negated) { if (negated) {
@@ -3491,6 +3514,7 @@ boolean tinitial, tfrom_file;
return retval; return retval;
} }
} }
/* hilite fields in status prompt */ /* hilite fields in status prompt */
fullname = "hilite_status"; fullname = "hilite_status";
if (match_optname(opts, fullname, 13, TRUE)) { if (match_optname(opts, fullname, 13, TRUE)) {
@@ -3886,8 +3910,10 @@ get_menu_cmd_key(ch)
char ch; char ch;
{ {
char *found = index(mapped_menu_op, ch); char *found = index(mapped_menu_op, ch);
if (found) { if (found) {
int idx = (int) (found - mapped_menu_op); int idx = (int) (found - mapped_menu_op);
ch = mapped_menu_cmds[idx]; ch = mapped_menu_cmds[idx];
} }
return ch; return ch;
@@ -3902,8 +3928,10 @@ map_menu_cmd(ch)
char ch; char ch;
{ {
char *found = index(mapped_menu_cmds, ch); char *found = index(mapped_menu_cmds, ch);
if (found) { if (found) {
int idx = (int) (found - mapped_menu_cmds); int idx = (int) (found - mapped_menu_cmds);
ch = mapped_menu_op[idx]; ch = mapped_menu_op[idx];
} }
return ch; return ch;
@@ -3919,6 +3947,7 @@ boolean dolist;
putstr(win, 0, "Menu control keys:"); putstr(win, 0, "Menu control keys:");
if (dolist) { if (dolist) {
int i; int i;
for (i = 0; i < SIZE(default_menu_cmd_info); i++) { for (i = 0; i < SIZE(default_menu_cmd_info); i++) {
Sprintf(buf, "%-8s %s", Sprintf(buf, "%-8s %s",
visctrl(get_menu_cmd_key(default_menu_cmd_info[i].cmd)), visctrl(get_menu_cmd_key(default_menu_cmd_info[i].cmd)),
@@ -4186,8 +4215,7 @@ doset() /* changing options via menu by Per Liboriussen */
any = zeroany; any = zeroany;
add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, "", MENU_UNSELECTED); add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, "", MENU_UNSELECTED);
add_menu(tmpwin, NO_GLYPH, &any, 0, 0, iflags.menu_headings, add_menu(tmpwin, NO_GLYPH, &any, 0, 0, iflags.menu_headings,
"Other settings:", "Other settings:", MENU_UNSELECTED);
MENU_UNSELECTED);
for (i = 0; (name = othropt[i].name) != 0; i++) { for (i = 0; (name = othropt[i].name) != 0; i++) {
if ((is_wc_option(name) && !wc_supported(name)) if ((is_wc_option(name) && !wc_supported(name))
@@ -4216,7 +4244,8 @@ doset() /* changing options via menu by Per Liboriussen */
*/ */
for (pick_idx = 0; pick_idx < pick_cnt; ++pick_idx) { for (pick_idx = 0; pick_idx < pick_cnt; ++pick_idx) {
opt_indx = pick_list[pick_idx].item.a_int - 1; opt_indx = pick_list[pick_idx].item.a_int - 1;
if (opt_indx < -1) opt_indx++; /* -1 offset for select_menu() */ if (opt_indx < -1)
opt_indx++; /* -1 offset for select_menu() */
if (opt_indx == OPT_OTHER_APEXC) { if (opt_indx == OPT_OTHER_APEXC) {
(void) special_handling("autopickup_exception", setinitial, (void) special_handling("autopickup_exception", setinitial,
fromfile); fromfile);
@@ -4342,6 +4371,7 @@ boolean setinitial, setfromfile;
if (!strcmp("menustyle", optname)) { if (!strcmp("menustyle", optname)) {
const char *style_name; const char *style_name;
menu_item *style_pick = (menu_item *) 0; menu_item *style_pick = (menu_item *) 0;
tmpwin = create_nhwindow(NHW_MENU); tmpwin = create_nhwindow(NHW_MENU);
start_menu(tmpwin); start_menu(tmpwin);
any = zeroany; any = zeroany;
@@ -4529,8 +4559,8 @@ boolean setinitial, setfromfile;
0, ATR_NONE, "compass ('east' or '3s' or '2n,4w')", 0, ATR_NONE, "compass ('east' or '3s' or '2n,4w')",
(gp == GPCOORDS_COMPASS) ? MENU_SELECTED : MENU_UNSELECTED); (gp == GPCOORDS_COMPASS) ? MENU_SELECTED : MENU_UNSELECTED);
any.a_char = GPCOORDS_COMFULL; any.a_char = GPCOORDS_COMFULL;
add_menu(tmpwin, NO_GLYPH, &any, GPCOORDS_COMFULL, add_menu(tmpwin, NO_GLYPH, &any, GPCOORDS_COMFULL, 0, ATR_NONE,
0, ATR_NONE, "full compass ('east' or '3south' or '2north,4west')", "full compass ('east' or '3south' or '2north,4west')",
(gp == GPCOORDS_COMFULL) ? MENU_SELECTED : MENU_UNSELECTED); (gp == GPCOORDS_COMFULL) ? MENU_SELECTED : MENU_UNSELECTED);
any.a_char = GPCOORDS_MAP; any.a_char = GPCOORDS_MAP;
add_menu(tmpwin, NO_GLYPH, &any, GPCOORDS_MAP, add_menu(tmpwin, NO_GLYPH, &any, GPCOORDS_MAP,
@@ -4596,7 +4626,7 @@ boolean setinitial, setfromfile;
0, ATR_NONE, "in same area", 0, ATR_NONE, "in same area",
(gf == GFILTER_AREA) ? MENU_SELECTED : MENU_UNSELECTED); (gf == GFILTER_AREA) ? MENU_SELECTED : MENU_UNSELECTED);
end_menu(tmpwin, end_menu(tmpwin,
"Select location filtering when going for next/previous map position:"); "Select location filtering when going for next/previous map position:");
if ((pick_cnt = select_menu(tmpwin, PICK_ONE, &window_pick)) > 0) { if ((pick_cnt = select_menu(tmpwin, PICK_ONE, &window_pick)) > 0) {
iflags.getloc_filter = (window_pick[0].item.a_char - 1); iflags.getloc_filter = (window_pick[0].item.a_char - 1);
/* PICK_ONE doesn't unselect preselected entry when /* PICK_ONE doesn't unselect preselected entry when
@@ -4955,10 +4985,7 @@ boolean setinitial, setfromfile;
struct symsetentry *sl; struct symsetentry *sl;
int res, which_set, setcount = 0, chosen = -2; int res, which_set, setcount = 0, chosen = -2;
if (rogueflag) which_set = rogueflag ? ROGUESET : PRIMARY;
which_set = ROGUESET;
else
which_set = PRIMARY;
/* clear symset[].name as a flag to read_sym_file() to build list */ /* clear symset[].name as a flag to read_sym_file() to build list */
symset_name = symset[which_set].name; symset_name = symset[which_set].name;
@@ -5238,36 +5265,23 @@ char *buf;
Sprintf(buf, "%s", rolestring(flags.initgend, genders, adj)); Sprintf(buf, "%s", rolestring(flags.initgend, genders, adj));
else if (!strcmp(optname, "horsename")) else if (!strcmp(optname, "horsename"))
Sprintf(buf, "%s", horsename[0] ? horsename : none); Sprintf(buf, "%s", horsename[0] ? horsename : none);
else if (!strcmp(optname, "map_mode")) else if (!strcmp(optname, "map_mode")) {
i = iflags.wc_map_mode;
Sprintf(buf, "%s", Sprintf(buf, "%s",
iflags.wc_map_mode == MAP_MODE_TILES (i == MAP_MODE_TILES) ? "tiles"
? "tiles" : (i == MAP_MODE_ASCII4x6) ? "ascii4x6"
: iflags.wc_map_mode == MAP_MODE_ASCII4x6 : (i == MAP_MODE_ASCII6x8) ? "ascii6x8"
? "ascii4x6" : (i == MAP_MODE_ASCII8x8) ? "ascii8x8"
: iflags.wc_map_mode == MAP_MODE_ASCII6x8 : (i == MAP_MODE_ASCII16x8) ? "ascii16x8"
? "ascii6x8" : (i == MAP_MODE_ASCII7x12) ? "ascii7x12"
: iflags.wc_map_mode == MAP_MODE_ASCII8x8 : (i == MAP_MODE_ASCII8x12) ? "ascii8x12"
? "ascii8x8" : (i == MAP_MODE_ASCII16x12) ? "ascii16x12"
: iflags.wc_map_mode == MAP_MODE_ASCII16x8 : (i == MAP_MODE_ASCII12x16) ? "ascii12x16"
? "ascii16x8" : (i == MAP_MODE_ASCII10x18) ? "ascii10x18"
: iflags.wc_map_mode == MAP_MODE_ASCII7x12 : (i == MAP_MODE_ASCII_FIT_TO_SCREEN)
? "ascii7x12" ? "fit_to_screen"
: iflags.wc_map_mode == MAP_MODE_ASCII8x12 : defopt);
? "ascii8x12" } else if (!strcmp(optname, "menustyle"))
: iflags.wc_map_mode
== MAP_MODE_ASCII16x12
? "ascii16x12"
: iflags.wc_map_mode
== MAP_MODE_ASCII12x16
? "ascii12x16"
: iflags.wc_map_mode
== MAP_MODE_ASCII10x18
? "ascii10x18"
: iflags.wc_map_mode
== MAP_MODE_ASCII_FIT_TO_SCREEN
? "fit_to_screen"
: defopt);
else if (!strcmp(optname, "menustyle"))
Sprintf(buf, "%s", menutype[(int) flags.menu_style]); Sprintf(buf, "%s", menutype[(int) flags.menu_style]);
else if (!strcmp(optname, "menu_deselect_all")) else if (!strcmp(optname, "menu_deselect_all"))
Sprintf(buf, "%s", to_be_done); Sprintf(buf, "%s", to_be_done);
@@ -5299,13 +5313,10 @@ char *buf;
Sprintf(buf, "%u", iflags.msg_history); Sprintf(buf, "%u", iflags.msg_history);
#ifdef TTY_GRAPHICS #ifdef TTY_GRAPHICS
} else if (!strcmp(optname, "msg_window")) { } else if (!strcmp(optname, "msg_window")) {
Sprintf(buf, "%s", (iflags.prevmsg_window == 's') Sprintf(buf, "%s", (iflags.prevmsg_window == 's') ? "single"
? "single" : (iflags.prevmsg_window == 'c') ? "combination"
: (iflags.prevmsg_window == 'c') : (iflags.prevmsg_window == 'f') ? "full"
? "combination" : "reversed");
: (iflags.prevmsg_window == 'f')
? "full"
: "reversed");
#endif #endif
} else if (!strcmp(optname, "name")) { } else if (!strcmp(optname, "name")) {
Sprintf(buf, "%s", plname); Sprintf(buf, "%s", plname);
@@ -5589,8 +5600,9 @@ count_ape_maps(leave, grab)
int *leave, *grab; int *leave, *grab;
{ {
struct autopickup_exception *ape; struct autopickup_exception *ape;
int pass, totalapes, numapes[2] = { 0, 0 }; int pass, totalapes, numapes[2];
numapes[0] = numapes[1] = 0;
for (pass = AP_LEAVE; pass <= AP_GRAB; ++pass) { for (pass = AP_LEAVE; pass <= AP_GRAB; ++pass) {
ape = iflags.autopickup_exceptions[pass]; ape = iflags.autopickup_exceptions[pass];
while (ape) { while (ape) {
@@ -6075,53 +6087,56 @@ char *class_select;
return ret; return ret;
} }
struct wc_Opt wc_options[] = { { "ascii_map", WC_ASCII_MAP }, static struct wc_Opt wc_options[] = {
{ "color", WC_COLOR }, { "ascii_map", WC_ASCII_MAP },
{ "eight_bit_tty", WC_EIGHT_BIT_IN }, { "color", WC_COLOR },
{ "hilite_pet", WC_HILITE_PET }, { "eight_bit_tty", WC_EIGHT_BIT_IN },
{ "popup_dialog", WC_POPUP_DIALOG }, { "hilite_pet", WC_HILITE_PET },
{ "player_selection", WC_PLAYER_SELECTION }, { "popup_dialog", WC_POPUP_DIALOG },
{ "preload_tiles", WC_PRELOAD_TILES }, { "player_selection", WC_PLAYER_SELECTION },
{ "tiled_map", WC_TILED_MAP }, { "preload_tiles", WC_PRELOAD_TILES },
{ "tile_file", WC_TILE_FILE }, { "tiled_map", WC_TILED_MAP },
{ "tile_width", WC_TILE_WIDTH }, { "tile_file", WC_TILE_FILE },
{ "tile_height", WC_TILE_HEIGHT }, { "tile_width", WC_TILE_WIDTH },
{ "use_inverse", WC_INVERSE }, { "tile_height", WC_TILE_HEIGHT },
{ "align_message", WC_ALIGN_MESSAGE }, { "use_inverse", WC_INVERSE },
{ "align_status", WC_ALIGN_STATUS }, { "align_message", WC_ALIGN_MESSAGE },
{ "font_map", WC_FONT_MAP }, { "align_status", WC_ALIGN_STATUS },
{ "font_menu", WC_FONT_MENU }, { "font_map", WC_FONT_MAP },
{ "font_message", WC_FONT_MESSAGE }, { "font_menu", WC_FONT_MENU },
{ "font_message", WC_FONT_MESSAGE },
#if 0 #if 0
{"perm_invent", WC_PERM_INVENT}, {"perm_invent", WC_PERM_INVENT},
#endif #endif
{ "font_size_map", WC_FONTSIZ_MAP }, { "font_size_map", WC_FONTSIZ_MAP },
{ "font_size_menu", WC_FONTSIZ_MENU }, { "font_size_menu", WC_FONTSIZ_MENU },
{ "font_size_message", WC_FONTSIZ_MESSAGE }, { "font_size_message", WC_FONTSIZ_MESSAGE },
{ "font_size_status", WC_FONTSIZ_STATUS }, { "font_size_status", WC_FONTSIZ_STATUS },
{ "font_size_text", WC_FONTSIZ_TEXT }, { "font_size_text", WC_FONTSIZ_TEXT },
{ "font_status", WC_FONT_STATUS }, { "font_status", WC_FONT_STATUS },
{ "font_text", WC_FONT_TEXT }, { "font_text", WC_FONT_TEXT },
{ "map_mode", WC_MAP_MODE }, { "map_mode", WC_MAP_MODE },
{ "scroll_amount", WC_SCROLL_AMOUNT }, { "scroll_amount", WC_SCROLL_AMOUNT },
{ "scroll_margin", WC_SCROLL_MARGIN }, { "scroll_margin", WC_SCROLL_MARGIN },
{ "splash_screen", WC_SPLASH_SCREEN }, { "splash_screen", WC_SPLASH_SCREEN },
{ "vary_msgcount", WC_VARY_MSGCOUNT }, { "vary_msgcount", WC_VARY_MSGCOUNT },
{ "windowcolors", WC_WINDOWCOLORS }, { "windowcolors", WC_WINDOWCOLORS },
{ "mouse_support", WC_MOUSE_SUPPORT }, { "mouse_support", WC_MOUSE_SUPPORT },
{ (char *) 0, 0L } }; { (char *) 0, 0L }
};
struct wc_Opt wc2_options[] = { { "fullscreen", WC2_FULLSCREEN }, static struct wc_Opt wc2_options[] = {
{ "softkeyboard", WC2_SOFTKEYBOARD }, { "fullscreen", WC2_FULLSCREEN },
{ "wraptext", WC2_WRAPTEXT }, { "softkeyboard", WC2_SOFTKEYBOARD },
{ "use_darkgray", WC2_DARKGRAY }, { "wraptext", WC2_WRAPTEXT },
{ "hitpointbar", WC2_HITPOINTBAR }, { "use_darkgray", WC2_DARKGRAY },
{ "hilite_status", WC2_HILITE_STATUS }, { "hitpointbar", WC2_HITPOINTBAR },
/* name shown in 'O' menu is different */ { "hilite_status", WC2_HILITE_STATUS },
{ "status hilite rules", WC2_HILITE_STATUS }, /* name shown in 'O' menu is different */
/* statushilites doesn't have its own bit */ { "status hilite rules", WC2_HILITE_STATUS },
{ "statushilites", WC2_HILITE_STATUS }, /* statushilites doesn't have its own bit */
{ (char *) 0, 0L } }; { "statushilites", WC2_HILITE_STATUS },
{ (char *) 0, 0L }
};
/* /*
* If a port wants to change or ensure that the SET_IN_SYS, * If a port wants to change or ensure that the SET_IN_SYS,