interface groundwork for core-side color decisions
(user-side decisions really, but as it stands right now user-side decisions/options are made and processed by the core) add a parameter to add_menu so color can be passed
This commit is contained in:
12
src/spell.c
12
src/spell.c
@@ -1583,6 +1583,7 @@ spellsortmenu(void)
|
||||
anything any;
|
||||
char let;
|
||||
int i, n, choice;
|
||||
int clr = 0;
|
||||
|
||||
tmpwin = create_nhwindow(NHW_MENU);
|
||||
start_menu(tmpwin, MENU_BEHAVE_STANDARD);
|
||||
@@ -1594,13 +1595,13 @@ spellsortmenu(void)
|
||||
/* separate final choice from others with a blank line */
|
||||
any.a_int = 0;
|
||||
add_menu(tmpwin, &nul_glyphinfo, &any, 0, 0,
|
||||
ATR_NONE, "", MENU_ITEMFLAGS_NONE);
|
||||
ATR_NONE, clr, "", MENU_ITEMFLAGS_NONE);
|
||||
} else {
|
||||
let = 'a' + i;
|
||||
}
|
||||
any.a_int = i + 1;
|
||||
add_menu(tmpwin, &nul_glyphinfo, &any, let, 0,
|
||||
ATR_NONE, spl_sortchoices[i],
|
||||
ATR_NONE, clr, spl_sortchoices[i],
|
||||
(i == g.spl_sortmode) ? MENU_ITEMFLAGS_SELECTED : MENU_ITEMFLAGS_NONE);
|
||||
}
|
||||
end_menu(tmpwin, "View known spells list sorted");
|
||||
@@ -1672,6 +1673,7 @@ dospellmenu(
|
||||
const char *fmt;
|
||||
menu_item *selected;
|
||||
anything any;
|
||||
int clr = 0;
|
||||
|
||||
tmpwin = create_nhwindow(NHW_MENU);
|
||||
start_menu(tmpwin, MENU_BEHAVE_STANDARD);
|
||||
@@ -1698,7 +1700,7 @@ dospellmenu(
|
||||
Sprintf(eos(buf), "%c%6s", sep, "turns");
|
||||
|
||||
add_menu(tmpwin, &nul_glyphinfo, &any, 0, 0,
|
||||
iflags.menu_headings, buf, MENU_ITEMFLAGS_NONE);
|
||||
iflags.menu_headings, clr, buf, MENU_ITEMFLAGS_NONE);
|
||||
for (i = 0; i < MAXSPELL && spellid(i) != NO_SPELL; i++) {
|
||||
splnum = !g.spl_orderindx ? i : g.spl_orderindx[i];
|
||||
Sprintf(buf, fmt, spellname(splnum), spellev(splnum),
|
||||
@@ -1710,7 +1712,7 @@ dospellmenu(
|
||||
|
||||
any.a_int = splnum + 1; /* must be non-zero */
|
||||
add_menu(tmpwin, &nul_glyphinfo, &any, spellet(splnum), 0,
|
||||
ATR_NONE, buf,
|
||||
ATR_NONE, clr, buf,
|
||||
(splnum == splaction)
|
||||
? MENU_ITEMFLAGS_SELECTED : MENU_ITEMFLAGS_NONE);
|
||||
}
|
||||
@@ -1723,7 +1725,7 @@ dospellmenu(
|
||||
/* more than 1 spell, add an extra menu entry */
|
||||
any.a_int = SPELLMENU_SORT + 1;
|
||||
add_menu(tmpwin, &nul_glyphinfo, &any, '+', 0,
|
||||
ATR_NONE, "[sort spells]", MENU_ITEMFLAGS_NONE);
|
||||
ATR_NONE, clr, "[sort spells]", MENU_ITEMFLAGS_NONE);
|
||||
}
|
||||
}
|
||||
end_menu(tmpwin, prompt);
|
||||
|
||||
Reference in New Issue
Block a user