#ifdef STATUS_HILITES
struct hilite_s *keep_hilite_chain = blstats[i][j].thresholds;
#endif
+
blstats[i][j] = initblstats[j];
blstats[i][j].a = zeroany;
if (blstats[i][j].valwidth) {
} else
blstats[i][j].val = (char *) 0;
#ifdef STATUS_HILITES
- if (keep_hilite_chain)
- blstats[i][j].thresholds = keep_hilite_chain;
+ blstats[i][j].thresholds = keep_hilite_chain;
#endif
}
}
const char *fieldname;
enum statusfields fldid;
} fieldids_alias[] = {
- {"characteristics", BL_CHARACTERISTICS},
- {"dx", BL_DX},
- {"co", BL_CO},
- {"con", BL_CO},
- {"points", BL_SCORE},
- {"cap", BL_CAP},
- {"pw", BL_ENE},
- {"pw-max", BL_ENEMAX},
- {"xl", BL_XP},
- {"xplvl", BL_XP},
- {"ac", BL_AC},
- {"hit-dice", BL_HD},
- {"turns", BL_TIME},
- {"hp", BL_HP},
- {"hp-max", BL_HPMAX},
- {"dgn", BL_LEVELDESC},
- {"xp", BL_EXP},
- {"exp", BL_EXP},
- {"flags", BL_CONDITION},
- {0, BL_FLUSH}
+ { "characteristics", BL_CHARACTERISTICS },
+ { "encumbrance", BL_CAP },
+ { "experience-points", BL_EXP },
+ { "dx", BL_DX },
+ { "co", BL_CO },
+ { "con", BL_CO },
+ { "points", BL_SCORE },
+ { "cap", BL_CAP },
+ { "pw", BL_ENE },
+ { "pw-max", BL_ENEMAX },
+ { "xl", BL_XP },
+ { "xplvl", BL_XP },
+ { "ac", BL_AC },
+ { "hit-dice", BL_HD },
+ { "turns", BL_TIME },
+ { "hp", BL_HP },
+ { "hp-max", BL_HPMAX },
+ { "dgn", BL_LEVELDESC },
+ { "xp", BL_EXP },
+ { "exp", BL_EXP },
+ { "flags", BL_CONDITION },
+ {0, BL_FLUSH }
};
/* format arguments */
if (!nmatches) {
/* check partial matches to canonical names */
int len = (int) strlen(name);
+
for (i = 0; i < SIZE(initblstats); i++)
if (!strncmpi(name, initblstats[i].fldname, len)) {
fld = initblstats[i].fld;
return FALSE;
while (tl) {
- /* only this style times out */
+ /* only this style times out (includes general 'changed'
+ as well as specific 'up' and 'down') */
if (tl->behavior == BL_TH_UPDOWN)
return TRUE;
tl = tl->next;
case BL_TH_TEXTMATCH:
txtstr = blstats[idx][fldidx].val;
if (fldidx == BL_TITLE)
+ /* "<name> the <rank-title>", skip past "<name> the " */
txtstr += (strlen(plname) + sizeof " the " - sizeof "");
if (hl->rel == TXT_VALUE && hl->textmatch[0]) {
if (fuzzymatch(hl->textmatch, txtstr, "\" -_", TRUE)) {
int idx;
int *coloridx, *attrib;
{
- if (coloridx && attrib) {
+ if (coloridx)
*coloridx = idx & 0x00FF;
+ if (attrib)
*attrib = (idx >> 8) & 0x00FF;
- }
}
-
/*
- * This is the parser for the hilite options
+ * This is the parser for the hilite options.
*
* parse_status_hl1() separates each hilite entry into
* a set of field threshold/action component strings,
status_hilite_linestr_countfield(fld)
int fld;
{
- struct _status_hilite_line_str *tmp = status_hilite_str;
+ struct _status_hilite_line_str *tmp;
+ boolean countall = (fld == BL_FLUSH);
int count = 0;
- while (tmp) {
- if (tmp->fld == fld || fld == BL_FLUSH)
+ for (tmp = status_hilite_str; tmp; tmp = tmp->next) {
+#ifndef SCORE_ON_BOTL
+ /* when SCORE_ON_BOTL is disabled, only count 'score' rules
+ if explicitly asked to do so; exclude them from 'all' count */
+ if (countall && tmp->fld == BL_SCORE)
+ continue;
+#endif
+ if (countall || tmp->fld == fld)
count++;
- tmp = tmp->next;
}
return count;
}
+/* used by options handling, doset(options.c) */
int
count_status_hilites(VOID_ARGS)
{
start_menu(tmpwin);
for (i = 0; i < MAXBLSTATS; i++) {
+#ifndef SCORE_ON_BOTL
+ if (initblstats[i].fld == BL_SCORE)
+ continue;
+#endif
any = zeroany;
- any.a_int = (i+1);
+ any.a_int = (i + 1);
add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE,
initblstats[i].fldname, MENU_UNSELECTED);
}
int count = status_hilite_linestr_countfield(i);
char buf[BUFSZ];
+#ifndef SCORE_ON_BOTL
+ /* config file might contain rules for highlighting 'score'
+ even when SCORE_ON_BOTL is disabled; if so, 'O' command
+ menus won't manipulate them, but will display them for
+ the "View all hilites in config format" operation */
+ if (initblstats[i].fld == BL_SCORE)
+ continue;
+#endif
any = zeroany;
any.a_int = i + 1;
Sprintf(buf, "%-18s", initblstats[i].fldname);
buf, MENU_UNSELECTED);
}
-
end_menu(tmpwin, "Status hilites:");
if ((res = select_menu(tmpwin, PICK_ONE, &picks)) > 0) {
i = picks->item.a_int - 1;