this is the error im getting from ecompile:
Code: Select all
Compiling: D:/shard/Broken Blade/pkg/commands/seer/createnpc.src
File: D:/shard/Broken Blade/pkg/utils/gumps/include/gumps.inc, Line 335
Error reading function
File: D:/shard/Broken Blade/pkg/utils/gumps/include/gumps.inc, Line 335
Compilation failed.Code: Select all
function XGFError(text, log:=0)
if ( log )
SysLog("Gump Error:: "+text);
endif
return error{"errortext":=text};
endfunctionCode: Select all
function GFGetCfgConst(elem_name, prop_name)
var cfg := ReadConfigFile(":gumps:GumpInfo");
if ( cfg.errortext )
return XGFError("GFGetCfgConst():: Unable to open GumpInfo.cfg -> "+cfg.errortext);
endif
var elem := cfg[elem_name];
if ( elem.errortext )
return XGFError("GFGetCfgConst():: Unable to find GumpInfo.cfg["+elem_name+"] ->"+elem.errortext);
endif
var value := GetConfigInt(elem, prop_name);
if ( !value )
return XGFError("GFGetCfgConst():: Unable to find property ["+prop_name+"] in elem ["+elem_name+"]");
endif
return value;
endfunctionCode: Select all
function BuildNPCGump( category_name )
var npc_list := SortNPCs();
if( !npc_list.Exists( category_name ))
return error{ "errortext":="Category name does not exist." };
endif
npc_list := npc_list[category_name];
var gump := GFCreateGump();
GFPage( gump, 0 );
GFResizePic( gump, 0, 0, GFGetCfgConst( "Defaults", "BackGround" ), 300, 480 );
GFResizePic( gump, 15, 15, GFGetCfgConst( "Defaults", "ForeGround" ), 270, 450 );
GFAddButton( gump, 27, 432, 4014, 4015, GF_CLOSE_BTN, BACK_BTN );
GFTextLine( gump, 60, 432, 2100, "Back" );
var y_pos := 60;
var counter := 1;
GFTextMid( gump, 15, 30, 290, 2100, "NPC List - "+category_name );
GFPage( gump, 1 );
foreach template in ( npc_list[category_name] )
GFAddButton( gump, 35, y_pos+3, 2117, 2118, GF_CLOSE_BTN, template.pos );
GFTextLine( gump, 55, y_pos, template.color, template.name );
y_pos += 20;
counter += 1;
if( counter > 18 )
counter := 1;
y_pos := 60;
GFAddButton( gump, 252, 430, 2648, 2649, GF_PAGE_BTN, gump.cur_page+1 );
GFPage( gump, gump.cur_page+1 );
GFAddButton( gump, 252, 30, 2650, 2651, GF_PAGE_BTN, gump.cur_page-1 );
endif
SleepMS(2);
endforeach
var data_elem := DFFindElement( g_datafile, Lower( category_name ), DF_CREATE );
data_elem.SetProp( "Gump", gump );
return gump;
endfunctionid try and fix it myself but i really have no clue whats going on because its not giving me an error and the XGFerror function is used by multiple other scripts that work fine :s
thanks,
mat