.ds vr "NetHack 3.4
.ds f0 "\*(vr
.ds f1
-.ds f2 "August 14, 2003
+.ds f2 "October 5, 2003
.mt
A Guide to the Mazes of Menace
(Guidebook for NetHack)
Menu character accelerator to jump to the first page in a menu.
Implemented by the Amiga, Gem and tty ports.
Default '^'.
+.lp menu_headings
+Controls how the headings in a menu are highlighted.
+Values are 'bold', 'inverse', or 'underline'.
+Not all ports can actually display all three types.
.lp menu_invert_all
Menu character accelerator to invert all items in a menu.
Implemented by the Amiga, Gem, X11 and tty ports.
\begin{document}
%
% input file: guidebook.mn
-% $Revision: 1.70 $ $Date: 2003/09/27 15:55:35 $
+% $Revision: 1.71 $ $Date: 2003/09/28 03:42:24 $
%
%.ds h0 "
%.ds h1 %.ds h2 \%
%.au
\author{Eric S. Raymond\\
(Extensively edited and expanded for 3.4)}
-\date{August 14, 2003}
+\date{October 5, 2003}
\maketitle
Menu character accelerator to jump to the first page in a menu.
Implemented by the Amiga, Gem and tty ports.
Default `\verb+^+'.
+\item[\ib{menu\_headings}]
+Controls how the headings in a menu are highlighted.
+Values are ``{\tt bold}'', ``{\tt inverse}'', or ``{\tt underline}''.
+Not all ports can actually display all three types.
\item[\ib{menu\_invert\_all}]
Menu character accelerator to invert all items in a menu.
Implemented by the Amiga, Gem, X11 and tty ports.
--------------------
bones file compatibility info is now written into the dat/options file
extend autodig to work downwards via '>'
+make attribute that is used to distinguish headings in a menu configurable
Platform- and/or Interface-Specific New Features
boolean menu_requested; /* Flag for overloaded use of 'm' prefix
* on some non-move commands */
uchar num_pad_mode;
+ int menu_headings; /* ATR for menu headings */
int purge_monsters; /* # of dead monsters still on fmon list */
int *opt_booldup; /* for duplication of boolean opts in config file */
int *opt_compdup; /* for duplication of compound opts in config file */
for (i = 0; i < NROFARTIFACTS; i++) {
if (artidisco[i] == 0) break; /* empty slot implies end of list */
- if (i == 0) putstr(tmpwin, ATR_INVERSE, "Artifacts");
+ if (i == 0) putstr(tmpwin, iflags.menu_headings, "Artifacts");
m = artidisco[i];
otyp = artilist[m].otyp;
Sprintf(buf, " %s [%s %s]", artiname(m),
buf[0] = buf2[0] = '\0';
tmpwin = create_nhwindow(NHW_MENU);
start_menu(tmpwin);
- add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_BOLD, "Starting", FALSE);
+ add_menu(tmpwin, NO_GLYPH, &any, 0, 0, iflags.menu_headings, "Starting", FALSE);
/* Starting name, race, role, gender */
Sprintf(buf, fmtstr, "name", plname);
/* Current name, race, role, gender */
add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, "", FALSE);
- add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_BOLD, "Current", FALSE);
+ add_menu(tmpwin, NO_GLYPH, &any, 0, 0, iflags.menu_headings, "Current", FALSE);
Sprintf(buf, fmtstr, "race", Upolyd ? youmonst.data->mname : urace.noun);
add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, FALSE);
if (Upolyd) {
/* Deity list */
add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, "", FALSE);
- add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_BOLD, "Deities", FALSE);
+ add_menu(tmpwin, NO_GLYPH, &any, 0, 0, iflags.menu_headings, "Deities", FALSE);
Sprintf(buf2, deity_fmtstr, align_gname(A_CHAOTIC),
(u.ualignbase[A_ORIGINAL] == u.ualign.type
&& u.ualign.type == A_CHAOTIC) ? " (s,c)" :
}
if (bymenu) {
any.a_void = 0;
- add_menu(win, NO_GLYPH, &any, 0, 0, ATR_BOLD, buf, MENU_UNSELECTED);
+ add_menu(win, NO_GLYPH, &any, 0, 0, iflags.menu_headings, buf, MENU_UNSELECTED);
} else
putstr(win, 0, buf);
if (first) {
if (bymenu) {
any.a_void = 0;
- add_menu(win, NO_GLYPH, &any, 0, 0, ATR_BOLD,
+ add_menu(win, NO_GLYPH, &any, 0, 0, iflags.menu_headings,
"Floating branches", MENU_UNSELECTED);
} else {
putstr(win, 0, "");
if (!flags.sortpack || otmp->oclass == *invlet) {
if (flags.sortpack && !classcount) {
any.a_void = 0; /* zero */
- add_menu(win, NO_GLYPH, &any, 0, 0, ATR_INVERSE,
+ add_menu(win, NO_GLYPH, &any, 0, 0, iflags.menu_headings,
let_to_name(*invlet, FALSE), MENU_UNSELECTED);
classcount++;
}
any.a_void = 0;
win = create_nhwindow(NHW_MENU);
start_menu(win);
- add_menu(win, NO_GLYPH, &any, 0, 0, ATR_INVERSE, hdr, MENU_UNSELECTED);
+ add_menu(win, NO_GLYPH, &any, 0, 0, iflags.menu_headings, hdr, MENU_UNSELECTED);
add_menu(win, NO_GLYPH, &any, 0, 0, ATR_NONE, "", MENU_UNSELECTED);
add_menu(win, NO_GLYPH, &any, 0, 0, ATR_NONE, txt, MENU_UNSELECTED);
end_menu(win, (char *)0);
for (i = dis = 0; i < SIZE(uniq_objs); i++)
if (objects[uniq_objs[i]].oc_name_known) {
if (!dis++)
- putstr(tmpwin, ATR_INVERSE, "Unique Items");
+ putstr(tmpwin, iflags.menu_headings, "Unique Items");
Sprintf(buf, " %s", OBJ_NAME(objects[uniq_objs[i]]));
putstr(tmpwin, 0, buf);
++ct;
if ((dis = disco[i]) && interesting_to_discover(dis)) {
ct++;
if (oclass != prev_class) {
- putstr(tmpwin, ATR_INVERSE, let_to_name(oclass, FALSE));
+ putstr(tmpwin, iflags.menu_headings, let_to_name(oclass, FALSE));
prev_class = oclass;
}
Sprintf(buf, "%s %s",(objects[dis].oc_pre_discovered ? "*" : " "),
4, SET_IN_FILE },
{ "menu_first_page", "jump to the first page in a menu",
4, SET_IN_FILE },
+ { "menu_headings", "bold, inverse, or underline headings", 9, SET_IN_GAME },
{ "menu_invert_all", "invert all items in a menu", 4, SET_IN_FILE },
{ "menu_invert_page", "invert all items on this page of a menu",
4, SET_IN_FILE },
#ifdef TTY_GRAPHICS
iflags.prevmsg_window = 's';
#endif
+ iflags.menu_headings = ATR_INVERSE;
/* Use negative indices to indicate not yet selected */
flags.initrole = -1;
return;
}
+ fullname = "menu_headings";
+ if (match_optname(opts, fullname, 12, TRUE)) {
+ if (negated) {
+ bad_negation(fullname, FALSE);
+ return;
+ }
+ else if (!(opts = string_for_env_opt(fullname, opts, FALSE))) {
+ return;
+ }
+ if (!strcmpi(opts,"bold"))
+ iflags.menu_headings = ATR_BOLD;
+ else if (!strcmpi(opts,"inverse"))
+ iflags.menu_headings = ATR_INVERSE;
+ else if (!strcmpi(opts,"underline"))
+ iflags.menu_headings = ATR_ULINE;
+ else
+ badoption(opts);
+ return;
+ }
+
/* check for menu command mapping */
for (i = 0; i < NUM_MENU_CMDS; i++) {
fullname = default_menu_cmd_info[i].name;
start_menu(tmpwin);
any.a_void = 0;
- add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_BOLD,
+ add_menu(tmpwin, NO_GLYPH, &any, 0, 0, iflags.menu_headings,
"Booleans (selecting will toggle value):", MENU_UNSELECTED);
any.a_int = 0;
/* first list any other non-modifiable booleans, then modifiable ones */
indexoffset = boolcount;
any.a_void = 0;
add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, "", MENU_UNSELECTED);
- add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_BOLD,
+ add_menu(tmpwin, NO_GLYPH, &any, 0, 0, iflags.menu_headings,
"Compounds (selecting will prompt for new value):",
MENU_UNSELECTED);
}
#ifdef PREFIXES_IN_USE
add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, "", MENU_UNSELECTED);
- add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_BOLD,
+ add_menu(tmpwin, NO_GLYPH, &any, 0, 0, iflags.menu_headings,
"Variable playground locations:", MENU_UNSELECTED);
for (i = 0; i < PREFIX_COUNT; i++)
doset_add_menu(tmpwin, fqn_prefix_names[i], 0);
boolean retval = FALSE;
/* Special handling of menustyle, pickup_burden, pickup_types,
- disclose, runmode, msg_window, and number_pad options. */
+ disclose, runmode, msg_window, menu_headings, and number_pad options. */
if (!strcmp("menustyle", optname)) {
const char *style_name;
menu_item *style_pick = (menu_item *)0;
destroy_nhwindow(tmpwin);
retval = TRUE;
}
+ else if (!strcmp("menu_headings", optname)) {
+ static const char *mhchoices[3] = {"bold", "inverse", "underline"};
+ char *npletters = "biu";
+ menu_item *mode_pick = (menu_item *)0;
+ tmpwin = create_nhwindow(NHW_MENU);
+ start_menu(tmpwin);
+ for (i = 0; i < SIZE(mhchoices); i++) {
+ any.a_int = i + 1;
+ add_menu(tmpwin, NO_GLYPH, &any, npletters[i], 0,
+ ATR_NONE, mhchoices[i], MENU_UNSELECTED);
+ }
+ end_menu(tmpwin, "How to highlight menu headings:");
+ if (select_menu(tmpwin, PICK_ONE, &mode_pick) > 0) {
+ int mode = mode_pick->item.a_int - 1;
+ switch(mode) {
+ case 2:
+ iflags.menu_headings = ATR_ULINE;
+ break;
+ case 0:
+ iflags.menu_headings = ATR_BOLD;
+ break;
+ case 1:
+ default:
+ iflags.menu_headings = ATR_INVERSE;
+ }
+ free((genericptr_t)mode_pick);
+ }
+ destroy_nhwindow(tmpwin);
+ retval = TRUE;
+ }
return retval;
}
Sprintf(buf, "%s", to_be_done);
else if (!strcmp(optname, "menu_invert_all"))
Sprintf(buf, "%s", to_be_done);
+ else if (!strcmp(optname, "menu_headings")) {
+ Sprintf(buf, "%s", (iflags.menu_headings == ATR_BOLD) ?
+ "bold" : (iflags.menu_headings == ATR_INVERSE) ?
+ "inverse" : (iflags.menu_headings == ATR_ULINE) ?
+ "underline" : "unknown");
+ }
else if (!strcmp(optname, "menu_invert_page"))
Sprintf(buf, "%s", to_be_done);
else if (!strcmp(optname, "menu_last_page"))
/* if sorting, print type name (once only) */
if (qflags & INVORDER_SORT && !printed_type_name) {
any.a_obj = (struct obj *) 0;
- add_menu(win, NO_GLYPH, &any, 0, 0, ATR_INVERSE,
+ add_menu(win, NO_GLYPH, &any, 0, 0, iflags.menu_headings,
let_to_name(*pack, FALSE), MENU_UNSELECTED);
printed_type_name = TRUE;
}
/* Print headings for skill types */
any.a_void = 0;
if (i == skill_ranges[pass].first)
- add_menu(win, NO_GLYPH, &any, 0, 0, ATR_BOLD,
+ add_menu(win, NO_GLYPH, &any, 0, 0, iflags.menu_headings,
skill_ranges[pass].name, MENU_UNSELECTED);
if (P_RESTRICTED(i)) continue;