-Added method flags to global constants for script

-Added a new flag METHOD_FLAG_FROM_SCRIPT to get_method_list() flag property. Closes #3489
This commit is contained in:
Juan Linietsky 2016-01-31 15:40:51 -03:00
parent 53e237dfe4
commit 817fd1ab71
3 changed files with 12 additions and 0 deletions

View file

@ -476,6 +476,16 @@ static _GlobalConstant _global_constants[]={
BIND_GLOBAL_CONSTANT( PROPERTY_USAGE_EDITOR ),
BIND_GLOBAL_CONSTANT( PROPERTY_USAGE_NETWORK ),
BIND_GLOBAL_CONSTANT( PROPERTY_USAGE_DEFAULT ),
BIND_GLOBAL_CONSTANT( METHOD_FLAG_NORMAL ),
BIND_GLOBAL_CONSTANT( METHOD_FLAG_EDITOR ),
BIND_GLOBAL_CONSTANT( METHOD_FLAG_NOSCRIPT ),
BIND_GLOBAL_CONSTANT( METHOD_FLAG_CONST ),
BIND_GLOBAL_CONSTANT( METHOD_FLAG_REVERSE ),
BIND_GLOBAL_CONSTANT( METHOD_FLAG_VIRTUAL ),
BIND_GLOBAL_CONSTANT( METHOD_FLAG_FROM_SCRIPT ),
BIND_GLOBAL_CONSTANT( METHOD_FLAGS_DEFAULT ),
{"TYPE_NIL",Variant::NIL},
{"TYPE_BOOL",Variant::BOOL},
{"TYPE_INT",Variant::INT},

View file

@ -50,6 +50,7 @@ enum MethodFlags {
METHOD_FLAG_CONST=8,
METHOD_FLAG_REVERSE=16, // used for events
METHOD_FLAG_VIRTUAL=32,
METHOD_FLAG_FROM_SCRIPT=64,
METHOD_FLAGS_DEFAULT=METHOD_FLAG_NORMAL,
};

View file

@ -2456,6 +2456,7 @@ void GDInstance::get_method_list(List<MethodInfo> *p_list) const {
MethodInfo mi;
mi.name=E->key();
mi.flags|=METHOD_FLAG_FROM_SCRIPT;
for(int i=0;i<E->get().get_argument_count();i++)
mi.arguments.push_back(PropertyInfo(Variant::NIL,"arg"+itos(i)));
p_list->push_back(mi);