MCPcopy Index your code
hub / github.com/NetHack/NetHack / status_initialize

Function status_initialize

src/botl.c:1682–1720  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1680}
1681
1682void
1683status_initialize(
1684 boolean reassessment) /* True: just recheck fields without other init */
1685{
1686 enum statusfields fld;
1687 boolean fldenabl;
1688 int i;
1689 const char *fieldfmt, *fieldname;
1690
1691 if (!reassessment) {
1692 if (gb.blinit)
1693 impossible("2nd status_initialize with full init.");
1694 init_blstats();
1695 (*windowprocs.win_status_init)();
1696 gb.blinit = TRUE;
1697 } else if (!gb.blinit) {
1698 panic("status 'reassess' before init");
1699 }
1700 for (i = 0; i < MAXBLSTATS; ++i) {
1701 fld = initblstats[i].fld;
1702 fldenabl = (fld == BL_SCORE) ? flags.showscore
1703 : (fld == BL_TIME) ? flags.time
1704 : (fld == BL_EXP) ? (boolean) (flags.showexp && !Upolyd)
1705 : (fld == BL_XP) ? (boolean) !Upolyd
1706 : (fld == BL_HD) ? (boolean) Upolyd
1707 : (fld == BL_VERS) ? flags.showvers
1708 : (fld == BL_WEAPON) ? flags.weaponstatus
1709 : (fld == BL_ARMOR) ? flags.armorstatus
1710 : (fld == BL_TERRAIN) ? flags.terrainstatus
1711 : TRUE;
1712
1713 fieldname = initblstats[i].fldname;
1714 fieldfmt = (fld == BL_TITLE && iflags.wc2_hitpointbar) ? "%-30.30s"
1715 : initblstats[i].fldfmt;
1716 status_enablefield(fld, fieldname, fieldfmt, fldenabl);
1717 }
1718 gu.update_all = TRUE;
1719 disp.botlx = TRUE;
1720}
1721
1722void
1723status_finish(void)

Callers 5

new_status_windowFunction · 0.85
curs_reset_windowsFunction · 0.85
optfn_booleanFunction · 0.85
set_uasmonFunction · 0.85

Calls 3

init_blstatsFunction · 0.85
impossibleFunction · 0.70
panicFunction · 0.50

Tested by

no test coverage detected