aboutsummaryrefslogtreecommitdiff
path: root/modules/gdscript/gd_editor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gdscript/gd_editor.cpp')
-rw-r--r--modules/gdscript/gd_editor.cpp11
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;
+
}