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

Function X11_update_inventory

win/X11/winX.c:1285–1310  ·  view source on GitHub ↗

display persistent inventory in its own window */

Source from the content-addressed store, hash-verified

1283
1284/* display persistent inventory in its own window */
1285void
1286X11_update_inventory(int arg)
1287{
1288 struct xwindow *wp = 0;
1289
1290 if (!x_inited)
1291 return;
1292
1293 if (iflags.perm_invent) {
1294 /* skip any calls to update_inventory() before in_moveloop starts */
1295 if (program_state.in_moveloop || program_state.gameover) {
1296 updated_inventory = 1; /* hack to avoid mapping&raising window */
1297 if (!arg) {
1298 repopulate_perminvent();
1299 } else {
1300 x11_scroll_perminv(arg);
1301 }
1302 updated_inventory = 0;
1303 }
1304 } else if ((wp = &window_list[WIN_INVEN]) != 0
1305 && wp->type == NHW_MENU && wp->menu_information->is_up) {
1306 /* persistent inventory is up but perm_invent is off, take it down */
1307 x11_no_perminv(wp);
1308 }
1309 return;
1310}
1311
1312win_request_info *
1313X11_ctrl_nhwindow(

Callers 1

x11_scroll_perminvFunction · 0.85

Calls 3

repopulate_perminventFunction · 0.85
x11_scroll_perminvFunction · 0.85
x11_no_perminvFunction · 0.85

Tested by

no test coverage detected