| 2201 | } |
| 2202 | |
| 2203 | staticfn void |
| 2204 | tport_menu( |
| 2205 | winid win, |
| 2206 | char *entry, |
| 2207 | struct lchoice *lchoices, |
| 2208 | d_level *lvl_p, |
| 2209 | boolean cannotreach) |
| 2210 | { |
| 2211 | char tmpbuf[BUFSZ]; |
| 2212 | anything any; |
| 2213 | int clr = NO_COLOR; |
| 2214 | |
| 2215 | lchoices->lev[lchoices->idx] = lvl_p->dlevel; |
| 2216 | lchoices->dgn[lchoices->idx] = lvl_p->dnum; |
| 2217 | lchoices->playerlev[lchoices->idx] = depth(lvl_p); |
| 2218 | any = cg.zeroany; |
| 2219 | if (cannotreach) { |
| 2220 | /* not selectable, but still consumes next menuletter; |
| 2221 | prepend padding in place of missing menu selector */ |
| 2222 | Sprintf(tmpbuf, " %s", entry); |
| 2223 | entry = tmpbuf; |
| 2224 | } else { |
| 2225 | any.a_int = lchoices->idx + 1; |
| 2226 | } |
| 2227 | add_menu(win, &nul_glyphinfo, &any, lchoices->menuletter, 0, |
| 2228 | ATR_NONE, clr, entry, MENU_ITEMFLAGS_NONE); |
| 2229 | /* this assumes there are at most 52 interesting levels */ |
| 2230 | if (lchoices->menuletter == 'z') |
| 2231 | lchoices->menuletter = 'A'; |
| 2232 | else |
| 2233 | lchoices->menuletter++; |
| 2234 | lchoices->idx++; |
| 2235 | return; |
| 2236 | } |
| 2237 | |
| 2238 | /* Convert a branch type to a string usable by print_dungeon(). */ |
| 2239 | staticfn const char * |
no test coverage detected