diff options
| author | Juan Linietsky | 2014-10-12 02:13:22 -0300 |
|---|---|---|
| committer | Juan Linietsky | 2014-10-12 02:13:22 -0300 |
| commit | 948fd83cdded7fed77ae5213101c1a2ece580434 (patch) | |
| tree | a6953095dc4feaac1485c04b35039b85f1a95534 /modules/gdscript/gd_script.cpp | |
| parent | 37354da5b0dc1dc8dcfd9d844e593935311f4f8f (diff) | |
| download | godot-948fd83cdded7fed77ae5213101c1a2ece580434.tar.gz godot-948fd83cdded7fed77ae5213101c1a2ece580434.tar.zst godot-948fd83cdded7fed77ae5213101c1a2ece580434.zip | |
Diffstat (limited to 'modules/gdscript/gd_script.cpp')
| -rw-r--r-- | modules/gdscript/gd_script.cpp | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/modules/gdscript/gd_script.cpp b/modules/gdscript/gd_script.cpp index 196e32876..f0ef69df5 100644 --- a/modules/gdscript/gd_script.cpp +++ b/modules/gdscript/gd_script.cpp @@ -1626,9 +1626,11 @@ void GDScript::set_source_code(const String& p_code) { source=p_code; } -void GDScript::update_exports() { + +void GDScript::_update_exports(Set<PlaceHolderScriptInstance*> *p_instances) { #ifdef TOOLS_ENABLED + String basedir=path; if (basedir=="") @@ -1645,8 +1647,20 @@ void GDScript::update_exports() { const GDParser::Node* root = parser.get_parse_tree(); ERR_FAIL_COND(root->type!=GDParser::Node::TYPE_CLASS); + + const GDParser::ClassNode *c = static_cast<const GDParser::ClassNode*>(root); + if (c->extends_used && String(c->extends_file)!="") { + + Ref<GDScript> bf = ResourceLoader::load(c->extends_file); + if (bf.is_valid()) { + + bf->_update_exports(p_instances); + + } + } + List<PropertyInfo> plist; Map<StringName,Variant> default_values; @@ -1660,10 +1674,19 @@ void GDScript::update_exports() { } - for (Set<PlaceHolderScriptInstance*>::Element *E=placeholders.front();E;E=E->next()) { + for (Set<PlaceHolderScriptInstance*>::Element *E=p_instances->front();E;E=E->next()) { E->get()->update(plist,default_values); } +#endif +} + +void GDScript::update_exports() { + +#ifdef TOOLS_ENABLED + + _update_exports(&placeholders); + #endif } |
