diff options
| author | Juan Linietsky | 2016-08-05 22:46:45 -0300 |
|---|---|---|
| committer | Juan Linietsky | 2016-08-05 22:48:00 -0300 |
| commit | 259418f8275371fc2f0bab6892caa4ef66b84240 (patch) | |
| tree | 721e21ff566212918bf837f45c7687ce32213032 /modules/gdscript/gd_editor.cpp | |
| parent | 6d5d23fa8de8673f4a2b312c05588fd4e7195543 (diff) | |
| download | godot-259418f8275371fc2f0bab6892caa4ef66b84240.tar.gz godot-259418f8275371fc2f0bab6892caa4ef66b84240.tar.zst godot-259418f8275371fc2f0bab6892caa4ef66b84240.zip | |
Diffstat (limited to 'modules/gdscript/gd_editor.cpp')
| -rw-r--r-- | modules/gdscript/gd_editor.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/modules/gdscript/gd_editor.cpp b/modules/gdscript/gd_editor.cpp index b02e55cf9..b3ab75b07 100644 --- a/modules/gdscript/gd_editor.cpp +++ b/modules/gdscript/gd_editor.cpp @@ -44,7 +44,7 @@ void GDScriptLanguage::get_string_delimiters(List<String> *p_delimiters) const { } -String GDScriptLanguage::get_template(const String& p_class_name, const String& p_base_class_name) const { +Ref<Script> GDScriptLanguage::get_template(const String& p_class_name, const String& p_base_class_name) const { String _template = String()+ "\nextends %BASE%\n\n"+ @@ -58,7 +58,14 @@ String GDScriptLanguage::get_template(const String& p_class_name, const String& "\n"+ "\n"; - return _template.replace("%BASE%",p_base_class_name); + _template = _template.replace("%BASE%",p_base_class_name); + + Ref<GDScript> script; + script.instance(); + script->set_source_code(_template); + + return script; + } |
