aboutsummaryrefslogtreecommitdiff
path: root/modules/gdscript/gd_editor.cpp
diff options
context:
space:
mode:
authorAndreas Haas2017-06-13 20:03:08 +0000
committerAndreas Haas2017-06-13 20:03:08 +0000
commit8361b1ce07266350ef6b6a2d34411030b7e587b2 (patch)
treeff9cab7037410224c1b76aab30f394305b523fe8 /modules/gdscript/gd_editor.cpp
parenta8a1f2e2a864e6b58d5bcf1c7e53a43cdb6d95d9 (diff)
downloadgodot-8361b1ce07266350ef6b6a2d34411030b7e587b2.tar.gz
godot-8361b1ce07266350ef6b6a2d34411030b7e587b2.tar.zst
godot-8361b1ce07266350ef6b6a2d34411030b7e587b2.zip
Diffstat (limited to 'modules/gdscript/gd_editor.cpp')
-rw-r--r--modules/gdscript/gd_editor.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/modules/gdscript/gd_editor.cpp b/modules/gdscript/gd_editor.cpp
index eea5b1523..5e3ce31dd 100644
--- a/modules/gdscript/gd_editor.cpp
+++ b/modules/gdscript/gd_editor.cpp
@@ -69,6 +69,19 @@ Ref<Script> GDScriptLanguage::get_template(const String &p_class_name, const Str
return script;
}
+bool GDScriptLanguage::is_using_templates() {
+
+ return true;
+}
+
+void GDScriptLanguage::make_template(const String &p_class_name, const String &p_base_class_name, Ref<Script> &p_script) {
+
+ String src = p_script->get_source_code();
+ src = src.replace("%BASE%", p_base_class_name);
+ src = src.replace("%TS%", _get_indentation());
+ p_script->set_source_code(src);
+}
+
bool GDScriptLanguage::validate(const String &p_script, int &r_line_error, int &r_col_error, String &r_test_error, const String &p_path, List<String> *r_functions) const {
GDParser parser;