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

Function MenuParse_itemDef

code/ui/ui_shared.cpp:1140–1161  ·  view source on GitHub ↗

================ MenuParse_itemDef ================ */

Source from the content-addressed store, hash-verified

1138================
1139*/
1140qboolean MenuParse_itemDef( itemDef_t *item )
1141{
1142 menuDef_t *menu = (menuDef_t*)item;
1143 if (menu->itemCount < MAX_MENUITEMS)
1144 {
1145 itemDef_t *newItem = menu->items[menu->itemCount] = (struct itemDef_s *) UI_Alloc(sizeof(itemDef_t));
1146 Item_Init(newItem);
1147 if (!Item_Parse(newItem))
1148 {
1149 return qfalse;
1150 }
1151 Item_InitControls( newItem );
1152 newItem->parent = menu->items[menu->itemCount]->parent = menu;
1153 menu->itemCount++;
1154 Item_ApplyHacks( newItem );
1155 }
1156 else
1157 {
1158 PC_ParseWarning(va("Exceeded item/menu max of %d", MAX_MENUITEMS));
1159 }
1160 return qtrue;
1161}
1162
1163#define KEYWORDHASH_SIZE 512
1164

Callers

nothing calls this directly

Calls 7

PC_ParseWarningFunction · 0.85
UI_AllocFunction · 0.70
Item_InitFunction · 0.70
Item_ParseFunction · 0.70
Item_InitControlsFunction · 0.70
Item_ApplyHacksFunction · 0.70
vaFunction · 0.50

Tested by

no test coverage detected