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

Function UI_ParseMenu

code/ui/ui_main.cpp:2805–2869  ·  view source on GitHub ↗

================= UI_ParseMenu ================= */

Source from the content-addressed store, hash-verified

2803=================
2804*/
2805void UI_ParseMenu(const char *menuFile)
2806{
2807 char *buffer,*holdBuffer,*token2;
2808 int len;
2809// pc_token_t token;
2810
2811 //Com_DPrintf("Parsing menu file: %s\n", menuFile);
2812 len = PC_StartParseSession(menuFile,&buffer);
2813
2814 holdBuffer = buffer;
2815
2816 if (len<=0)
2817 {
2818 Com_Printf("UI_ParseMenu: Unable to load menu %s\n", menuFile);
2819 return;
2820 }
2821
2822 while ( 1 )
2823 {
2824
2825 token2 = PC_ParseExt();
2826
2827 if (!*token2)
2828 {
2829 break;
2830 }
2831/*
2832 if ( menuCount == MAX_MENUS )
2833 {
2834 PC_ParseWarning("Too many menus!");
2835 break;
2836 }
2837*/
2838 if ( *token2 == '{')
2839 {
2840 continue;
2841 }
2842 else if ( *token2 == '}' )
2843 {
2844 break;
2845 }
2846 else if (Q_stricmp(token2, "assetGlobalDef") == 0)
2847 {
2848 if (Asset_Parse(&holdBuffer))
2849 {
2850 continue;
2851 }
2852 else
2853 {
2854 break;
2855 }
2856 }
2857 else if (Q_stricmp(token2, "menudef") == 0)
2858 {
2859 // start a new menu
2860 Menu_New(holdBuffer);
2861 continue;
2862 }

Callers 1

Load_MenuFunction · 0.70

Calls 9

PC_StartParseSessionFunction · 0.85
PC_ParseExtFunction · 0.85
Q_stricmpFunction · 0.85
PC_ParseWarningFunction · 0.85
PC_EndParseSessionFunction · 0.85
Asset_ParseFunction · 0.70
Menu_NewFunction · 0.70
Com_PrintfFunction · 0.50
vaFunction · 0.50

Tested by

no test coverage detected