summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/gd_editor.cpp
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2016-08-05 22:46:45 -0300
committerJuan Linietsky <reduzio@gmail.com>2016-08-05 22:48:00 -0300
commit259418f8275371fc2f0bab6892caa4ef66b84240 (patch)
tree721e21ff566212918bf837f45c7687ce32213032 /modules/gdscript/gd_editor.cpp
parent6d5d23fa8de8673f4a2b312c05588fd4e7195543 (diff)
downloadredot-engine-259418f8275371fc2f0bab6892caa4ef66b84240.tar.gz
VisualScript can now execute visual scripts, but there is no debugger or profiler yet.
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 b02e55cf9d..b3ab75b07c 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;
+
}