static void display_options_item(struct menu *menu, int oid, bool cursor, int row, int col, int width) { size_t line = (size_t) oid; /* Most of the menu is svals, with a small "extra options" section below */ if (line < N_ELEMENTS(sval_dependent)) { bool known = seen_tval(sval_dependent[line].tval); byte attr = curs_attrs[known ? CURS_KNOWN: CURS_UNKNOWN][(int)cursor]; c_prt(attr, sval_dependent[line].desc, row, col); } else { byte attr = curs_attrs[CURS_KNOWN][(int)cursor]; line = line - N_ELEMENTS(sval_dependent) - 1; if (line < N_ELEMENTS(extra_item_options)) c_prt(attr, extra_item_options[line].name, row, col); } }
static void display_options_item(menu_type *menu, int oid, bool cursor, int row, int col, int width) { size_t line = (size_t) oid; /* First section of menu - the svals */ if (line < N_ELEMENTS(sval_dependent)) { bool known = seen_tval(sval_dependent[line].tval); byte attr = curs_attrs[known ? CURS_KNOWN: CURS_UNKNOWN][(int)cursor]; c_prt(attr, sval_dependent[line].desc, row, col); } /* Second section - the "extra options" */ else { byte attr = curs_attrs[CURS_KNOWN][(int)cursor]; line = line - N_ELEMENTS(sval_dependent) - 1; if (line < N_ELEMENTS(extra_item_options)) c_prt(attr, extra_item_options[line].name, row, col); } }