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

Function show_overview

src/dungeon.c:3304–3340  ·  view source on GitHub ↗

called for #overview or for end of game disclosure */

Source from the content-addressed store, hash-verified

3302
3303/* called for #overview or for end of game disclosure */
3304void
3305show_overview(
3306 int why, /* 0 => normal #overview command, -1 => 'm' prefix #overview;
3307 * 1 or 2 => final disclosure (1: hero lived, 2: hero died) */
3308 int reason) /* how hero died; used when disclosing end-of-game level */
3309{
3310 winid win;
3311 int lastdun = -1;
3312 menu_item *selected;
3313 int n;
3314
3315 /* lazy initialization */
3316 (void) recalc_mapseen();
3317
3318 win = create_nhwindow(NHW_MENU);
3319 start_menu(win, MENU_BEHAVE_STANDARD);
3320 /* show the endgame levels before the rest of the dungeon,
3321 so that the Planes (dnum 5-ish) come out above main dungeon (dnum 0) */
3322 if (In_endgame(&u.uz))
3323 traverse_mapseenchn(1, win, why, reason, &lastdun);
3324 /* if game is over or we're not in the endgame yet, show the dungeon */
3325 if (why > 0 || !In_endgame(&u.uz))
3326 traverse_mapseenchn(0, win, why, reason, &lastdun);
3327 end_menu(win, (char *) 0);
3328 n = select_menu(win, (why != -1) ? PICK_NONE : PICK_ONE, &selected);
3329 if (n > 0) {
3330 int ledger;
3331 d_level lev;
3332
3333 ledger = selected[0].item.a_int - 1;
3334 lev.dnum = ledger_to_dnum(ledger);
3335 lev.dlevel = ledger_to_dlev(ledger);
3336 query_annotation(&lev);
3337 free((genericptr_t) selected);
3338 }
3339 destroy_nhwindow(win);
3340}
3341
3342/* display endgame levels or non-endgame levels, not both */
3343staticfn void

Callers 3

dump_everythingFunction · 0.85
discloseFunction · 0.85
dooverviewFunction · 0.85

Calls 6

recalc_mapseenFunction · 0.85
traverse_mapseenchnFunction · 0.85
select_menuFunction · 0.85
ledger_to_dnumFunction · 0.85
ledger_to_dlevFunction · 0.85
query_annotationFunction · 0.85

Tested by

no test coverage detected