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

Function query_conditions

src/botl.c:3108–3138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3106}
3107
3108staticfn unsigned long
3109query_conditions(void)
3110{
3111 int i,res;
3112 unsigned long ret = 0UL;
3113 winid tmpwin;
3114 anything any;
3115 menu_item *picks = (menu_item *) 0;
3116 int clr = NO_COLOR;
3117
3118 tmpwin = create_nhwindow(NHW_MENU);
3119 start_menu(tmpwin, MENU_BEHAVE_STANDARD);
3120
3121 for (i = 0; i < SIZE(conditions); i++) {
3122 any = cg.zeroany;
3123 any.a_ulong = conditions[i].mask;
3124 add_menu(tmpwin, &nul_glyphinfo, &any, 0, 0, ATR_NONE,
3125 clr, conditions[i].text[0], MENU_ITEMFLAGS_NONE);
3126 }
3127
3128 end_menu(tmpwin, "Choose status conditions");
3129
3130 res = select_menu(tmpwin, PICK_ANY, &picks);
3131 destroy_nhwindow(tmpwin);
3132 if (res > 0) {
3133 for (i = 0; i < res; i++)
3134 ret |= picks[i].item.a_ulong;
3135 free((genericptr_t) picks);
3136 }
3137 return ret;
3138}
3139
3140staticfn char *
3141conditionbitmask2str(unsigned long ul)

Callers 1

status_hilite_menu_addFunction · 0.85

Calls 2

add_menuFunction · 0.85
select_menuFunction · 0.85

Tested by

no test coverage detected