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

Function SelectMenuItem

win/win32/mhmenu.c:1618–1637  ·  view source on GitHub ↗

-----------------------------------------------------------------------------*/

Source from the content-addressed store, hash-verified

1616}
1617/*-----------------------------------------------------------------------------*/
1618void
1619SelectMenuItem(HWND hwndList, PNHMenuWindow data, int item, int count)
1620{
1621 int i;
1622
1623 if (item < 0 || item >= data->menui.menu.size)
1624 return;
1625
1626 if (data->how == PICK_ONE && count != 0) {
1627 for (i = 0; i < data->menui.menu.size; i++)
1628 if (item != i && data->menui.menu.items[i].count != 0) {
1629 data->menui.menu.items[i].count = 0;
1630 ListView_RedrawItems(hwndList, i, i);
1631 };
1632 }
1633
1634 data->menui.menu.items[item].count = count;
1635 ListView_RedrawItems(hwndList, item, item);
1636 reset_menu_count(hwndList, data);
1637}
1638/*-----------------------------------------------------------------------------*/
1639void
1640reset_menu_count(HWND hwndList, PNHMenuWindow data)

Callers 2

MenuWndProcFunction · 0.70
onListCharFunction · 0.70

Calls 1

reset_menu_countFunction · 0.70

Tested by

no test coverage detected