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

Function tty_start_menu

win/tty/wintty.c:2518–2551  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2516}
2517
2518void
2519tty_start_menu(winid window, unsigned long mbehavior)
2520{
2521 struct WinDesc *cw = 0;
2522
2523 if (window == WIN_ERR || (cw = wins[window]) == (struct WinDesc *) 0)
2524 ttywindowpanic();
2525
2526#ifdef TTY_PERM_INVENT
2527 if (cw->mbehavior == MENU_BEHAVE_PERMINV) {
2528 /* PERMINV is ready to go already; not much to do here */
2529 inuse_only_start = 0;
2530 return;
2531 }
2532 if (mbehavior == MENU_BEHAVE_PERMINV
2533 && (iflags.perm_invent
2534 || gp.perm_invent_toggling_direction == toggling_on)) {
2535 winid w = ttyinv_create_window(window, wins[window]);
2536
2537 if (w == WIN_ERR) {
2538 ; /* something went wrong, so add clean up code here */
2539 } else {
2540 cw->mbehavior = mbehavior;
2541 WIN_INVEN = w;
2542 }
2543 return;
2544 }
2545#else
2546 nhUse(mbehavior);
2547#endif
2548
2549 tty_clear_nhwindow(window);
2550 return;
2551}
2552
2553 /*ARGSUSED*/
2554/*

Callers

nothing calls this directly

Calls 2

ttyinv_create_windowFunction · 0.85
tty_clear_nhwindowFunction · 0.85

Tested by

no test coverage detected