MCPcopy Create free account
hub / github.com/JACoders/OpenJK / Menu_GetMatchingItemByNumber

Function Menu_GetMatchingItemByNumber

code/ui/ui_shared.cpp:1486–1502  ·  view source on GitHub ↗

=============== Menu_GetMatchingItemByNumber =============== */

Source from the content-addressed store, hash-verified

1484===============
1485*/
1486itemDef_t *Menu_GetMatchingItemByNumber(menuDef_t *menu, int index, const char *name)
1487{
1488 int i;
1489 int count = 0;
1490 for (i = 0; i < menu->itemCount; i++)
1491 {
1492 if (Q_stricmp(menu->items[i]->window.name, name) == 0 || (menu->items[i]->window.group && Q_stricmp(menu->items[i]->window.group, name) == 0))
1493 {
1494 if (count == index)
1495 {
1496 return menu->items[i];
1497 }
1498 count++;
1499 }
1500 }
1501 return NULL;
1502}
1503
1504/*
1505===============

Callers 12

Menu_FadeItemByNameFunction · 0.70
Menu_ShowItemByNameFunction · 0.70
Menu_SetItemBackgroundFunction · 0.70
Menu_SetItemTextFunction · 0.70
Menu_OrbitItemByNameFunction · 0.70
Menu_ItemDisableFunction · 0.70
Script_SetItemRectFunction · 0.70
UI_SetItemVisibleFunction · 0.70
UI_SetItemColorFunction · 0.70

Calls 1

Q_stricmpFunction · 0.85

Tested by

no test coverage detected