From 93fd946ff6ae44e4ade6e2b21cf3ed24d3c108b1 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Fri, 3 Nov 2023 21:41:26 +0200 Subject: [PATCH] Simplify add_menu, part 5 --- src/insight.c | 8 +------- src/invent.c | 23 +++++++---------------- 2 files changed, 8 insertions(+), 23 deletions(-) diff --git a/src/insight.c b/src/insight.c index 86126913c..6c4addce6 100644 --- a/src/insight.c +++ b/src/insight.c @@ -114,14 +114,8 @@ static struct ll_achieve_msg achieve_msg [] = { static void enlght_out(const char *buf) { - int clr = 0; - if (ge.en_via_menu) { - anything any; - - any = cg.zeroany; - add_menu(ge.en_win, &nul_glyphinfo, &any, 0, 0, ATR_NONE, clr, buf, - MENU_ITEMFLAGS_NONE); + add_menu_str(ge.en_win, buf); } else putstr(ge.en_win, 0, buf); } diff --git a/src/invent.c b/src/invent.c index ef7a6489c..bbc4c435c 100644 --- a/src/invent.c +++ b/src/invent.c @@ -3412,12 +3412,10 @@ display_pickinv( Sprintf(eos(prompt), " -- unidentified or partially identified item%s", plur(unid_cnt)); - add_menu(win, &nul_glyphinfo, &any, 0, 0, ATR_NONE, clr, prompt, - MENU_ITEMFLAGS_NONE); + add_menu_str(win, prompt); if (!unid_cnt) { - add_menu(win, &nul_glyphinfo, &any, 0, 0, ATR_NONE, clr, - "(all items are permanently identified already)", - MENU_ITEMFLAGS_NONE); + add_menu_str(win, + "(all items are permanently identified already)"); gotsomething = TRUE; } else { any.a_obj = &wizid_fakeobj; @@ -3522,12 +3520,10 @@ display_pickinv( there isn't anything applicable to list; the n==0 case above gets skipped for perm_invent), put something into the menu */ if (iflags.perm_invent && !lets && !gotsomething) { - any = cg.zeroany; - add_menu(win, &nul_glyphinfo, &any, 0, 0, ATR_NONE, clr, + add_menu_str(win, (inuse_only && skipped_noninuse) ? not_using_anything : (!show_gold && skipped_gold) ? only_carrying_gold - : not_carrying_anything, - MENU_ITEMFLAGS_NONE); + : not_carrying_anything); want_reply = FALSE; } #ifdef TTY_PERM_INVENT @@ -5353,18 +5349,13 @@ static void invdisp_nothing(const char *hdr, const char *txt) { winid win; - anything any; menu_item *selected; - int clr = 0; - any = cg.zeroany; win = create_nhwindow(NHW_MENU); start_menu(win, MENU_BEHAVE_STANDARD); add_menu_heading(win, hdr); - add_menu(win, &nul_glyphinfo, &any, 0, 0, ATR_NONE, clr, - "", MENU_ITEMFLAGS_NONE); - add_menu(win, &nul_glyphinfo, &any, 0, 0, ATR_NONE, clr, txt, - MENU_ITEMFLAGS_NONE); + add_menu_str(win, ""); + add_menu_str(win, txt); end_menu(win, (char *) 0); if (select_menu(win, PICK_NONE, &selected) > 0) free((genericptr_t) selected);