MCPcopy Index your code
hub / github.com/NetHack/NetHack / add_menu

Function add_menu

src/windows.c:1784–1812  ·  view source on GitHub ↗

* Common code point leading into the interface-specific * add_menu() to allow single-spot adjustments to the parameters, * such as those done by menu_colors. */

Source from the content-addressed store, hash-verified

1782 * such as those done by menu_colors.
1783 */
1784void
1785add_menu(
1786 winid window, /* window to use, must be of type NHW_MENU */
1787 const glyph_info *glyphinfo, /* glyph info with glyph to
1788 * display with item */
1789 const anything *identifier, /* what to return if selected */
1790 char ch, /* selector letter (0 = pick our own) */
1791 char gch, /* group accelerator (0 = no group) */
1792 int attr, /* attribute for menu text (str) */
1793 int color, /* color for menu text (str) */
1794 const char *str, /* menu text */
1795 unsigned int itemflags) /* itemflags such as MENU_ITEMFLAGS_SELECTED */
1796{
1797 if (!str) {
1798 /* if 'str' is Null, just return without adding any menu entry */
1799 debugpline0("add_menu(Null)");
1800 return;
1801 }
1802
1803 if (iflags.use_menu_color) {
1804 if ((itemflags & MENU_ITEMFLAGS_SKIPMENUCOLORS) == 0)
1805 (void) get_menu_coloring(str, &color, &attr);
1806 }
1807 /* this is the only function that cared about this flag; remove it now */
1808 itemflags &= ~MENU_ITEMFLAGS_SKIPMENUCOLORS;
1809
1810 (*windowprocs.win_add_menu)(window, glyphinfo, identifier,
1811 ch, gch, attr, color, str, itemflags);
1812}
1813
1814/* insert a non-selectable, possibly highlighted line of text into a menu */
1815void

Callers 15

amii_player_selectionFunction · 0.85
ask_do_tutorialFunction · 0.85
handler_menustyleFunction · 0.85
handler_align_miscFunction · 0.85
handler_autounlockFunction · 0.85
handler_discloseFunction · 0.85
handler_menu_objsymsFunction · 0.85
handler_msg_windowFunction · 0.85
handler_number_padFunction · 0.85

Calls 1

get_menu_coloringFunction · 0.85

Tested by

no test coverage detected