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

Function show_gamelog

src/insight.c:2560–2593  ·  view source on GitHub ↗

#chronicle details */

Source from the content-addressed store, hash-verified

2558
2559/* #chronicle details */
2560void
2561show_gamelog(int final)
2562{
2563#ifdef CHRONICLE
2564 struct gamelog_line *llmsg;
2565 winid win;
2566 char buf[BUFSZ];
2567 int eventcnt = 0;
2568
2569 win = create_nhwindow(NHW_TEXT);
2570 Sprintf(buf, "%s events:", final ? "Major" : "Logged");
2571 putstr(win, 0, buf);
2572 for (llmsg = gg.gamelog; llmsg; llmsg = llmsg->next) {
2573 if (final && !majorevent(llmsg))
2574 continue;
2575 if (!final && !wizard && spoilerevent(llmsg))
2576 continue;
2577 if (!eventcnt++)
2578 putstr(win, 0, " Turn");
2579 Snprintf(buf, sizeof buf, "%5ld: %s", llmsg->turn, llmsg->text);
2580 putstr(win, 0, buf);
2581 }
2582 /* since start of game is logged as a major event, 'eventcnt' should
2583 never end up as 0; for 'final', end of game is a major event too */
2584 if (!eventcnt)
2585 putstr(win, 0, " none");
2586
2587 display_nhwindow(win, TRUE);
2588 destroy_nhwindow(win);
2589#else
2590 nhUse(final);
2591#endif /* !CHRONICLE */
2592 return;
2593}
2594
2595/*
2596 * Vanquished monsters.

Callers 2

dump_everythingFunction · 0.85
do_gamelogFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected