Simplify add_menu, part 10

This commit is contained in:
Pasi Kallinen
2023-11-03 22:37:50 +02:00
parent 4dd9602f4b
commit 56f4657041
2 changed files with 4 additions and 10 deletions
+1 -3
View File
@@ -1656,9 +1656,7 @@ spellsortmenu(void)
if (i == SORTRETAINORDER) { if (i == SORTRETAINORDER) {
let = 'z'; /* assumes fewer than 26 sort choices... */ let = 'z'; /* assumes fewer than 26 sort choices... */
/* separate final choice from others with a blank line */ /* separate final choice from others with a blank line */
any.a_int = 0; add_menu_str(tmpwin, "");
add_menu(tmpwin, &nul_glyphinfo, &any, 0, 0,
ATR_NONE, clr, "", MENU_ITEMFLAGS_NONE);
} else { } else {
let = 'a' + i; let = 'a' + i;
} }
+3 -7
View File
@@ -1195,25 +1195,21 @@ enhance_weapon_skill(void)
/* start with a legend if any entries will be annotated /* start with a legend if any entries will be annotated
with "*" or "#" below */ with "*" or "#" below */
if (eventually_advance > 0 || maxxed_cnt > 0) { if (eventually_advance > 0 || maxxed_cnt > 0) {
any = cg.zeroany;
if (eventually_advance > 0) { if (eventually_advance > 0) {
Sprintf(buf, "(Skill%s flagged by \"*\" may be enhanced %s.)", Sprintf(buf, "(Skill%s flagged by \"*\" may be enhanced %s.)",
plur(eventually_advance), plur(eventually_advance),
(u.ulevel < MAXULEV) (u.ulevel < MAXULEV)
? "when you're more experienced" ? "when you're more experienced"
: "if skill slots become available"); : "if skill slots become available");
add_menu(win, &nul_glyphinfo, &any, 0, 0, add_menu_str(win, buf);
ATR_NONE, clr, buf, MENU_ITEMFLAGS_NONE);
} }
if (maxxed_cnt > 0) { if (maxxed_cnt > 0) {
Sprintf(buf, Sprintf(buf,
"(Skill%s flagged by \"#\" cannot be enhanced any further.)", "(Skill%s flagged by \"#\" cannot be enhanced any further.)",
plur(maxxed_cnt)); plur(maxxed_cnt));
add_menu(win, &nul_glyphinfo, &any, 0, 0, add_menu_str(win, buf);
ATR_NONE, clr, buf, MENU_ITEMFLAGS_NONE);
} }
add_menu(win, &nul_glyphinfo, &any, 0, 0, add_menu_str(win, "");
ATR_NONE, clr, "", MENU_ITEMFLAGS_NONE);
} }
/* List the skills, making ones that could be advanced /* List the skills, making ones that could be advanced