MCPcopy Create free account
hub / github.com/NetHack/NetHack / status_hilite_menu_choose_field

Function status_hilite_menu_choose_field

src/botl.c:3671–3704  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3669}
3670
3671staticfn int
3672status_hilite_menu_choose_field(void)
3673{
3674 winid tmpwin;
3675 int i, res, fld = BL_FLUSH;
3676 anything any;
3677 menu_item *picks = (menu_item *) 0;
3678 int clr = NO_COLOR;
3679
3680 tmpwin = create_nhwindow(NHW_MENU);
3681 start_menu(tmpwin, MENU_BEHAVE_STANDARD);
3682
3683 for (i = 0; i < MAXBLSTATS; i++) {
3684#ifndef SCORE_ON_BOTL
3685 if (initblstats[i].fld == BL_SCORE
3686 && !gb.blstats[0][BL_SCORE].thresholds)
3687 continue;
3688#endif
3689 any = cg.zeroany;
3690 any.a_int = (i + 1);
3691 add_menu(tmpwin, &nul_glyphinfo, &any, 0, 0, ATR_NONE,
3692 clr, initblstats[i].fldname, MENU_ITEMFLAGS_NONE);
3693 }
3694
3695 end_menu(tmpwin, "Select a hilite field:");
3696
3697 res = select_menu(tmpwin, PICK_ONE, &picks);
3698 destroy_nhwindow(tmpwin);
3699 if (res > 0) {
3700 fld = picks->item.a_int - 1;
3701 free((genericptr_t) picks);
3702 }
3703 return fld;
3704}
3705
3706staticfn int
3707status_hilite_menu_choose_behavior(int fld)

Callers 1

status_hilite_menu_addFunction · 0.85

Calls 2

add_menuFunction · 0.85
select_menuFunction · 0.85

Tested by

no test coverage detected