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

Function Item_Parse

code/ui/ui_shared.cpp:5014–5068  ·  view source on GitHub ↗

=============== Item_Parse =============== */

Source from the content-addressed store, hash-verified

5012===============
5013*/
5014qboolean Item_Parse(itemDef_t *item)
5015{
5016 keywordHash_t *key;
5017 const char *token;
5018
5019
5020 if (PC_ParseString(&token))
5021 {
5022 return qfalse;
5023 }
5024
5025 if (*token != '{')
5026 {
5027 return qfalse;
5028 }
5029
5030 while ( 1 )
5031 {
5032 if (PC_ParseString(&token))
5033 {
5034 PC_ParseWarning("End of file inside menu item");
5035 return qfalse;
5036 }
5037
5038 if (*token == '}')
5039 {
5040/* if (!item->window.name)
5041 {
5042 item->window.name = defaultString;
5043 Com_Printf(S_COLOR_YELLOW"WARNING: Menu item has no name\n");
5044 }
5045
5046 if (!item->window.group)
5047 {
5048 item->window.group = defaultString;
5049 Com_Printf(S_COLOR_YELLOW"WARNING: Menu item has no group\n");
5050 }
5051*/
5052 return qtrue;
5053 }
5054
5055 key = (keywordHash_s *) KeywordHash_Find(itemParseKeywordHash, token);
5056 if (!key)
5057 {
5058 PC_ParseWarning(va("Unknown item keyword '%s'", token));
5059 continue;
5060 }
5061
5062 if ( !key->func(item) )
5063 {
5064 PC_ParseWarning(va("Couldn't parse item keyword '%s'", token));
5065 return qfalse;
5066 }
5067 }
5068}
5069
5070static void Item_TextScroll_BuildLines ( itemDef_t* item )
5071{

Callers 1

MenuParse_itemDefFunction · 0.70

Calls 4

PC_ParseStringFunction · 0.85
PC_ParseWarningFunction · 0.85
KeywordHash_FindFunction · 0.70
vaFunction · 0.50

Tested by

no test coverage detected