1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

Add more template to Script_Create_dialog.cpp

This commit is contained in:
sersoong
2017-11-13 14:24:51 +08:00
parent aafb06cf9f
commit 875fd90467
5 changed files with 52 additions and 1 deletions

View File

@@ -58,6 +58,24 @@ String GDScriptLanguage::get_template(const String &p_class_name, const String &
return _template.replace("%BASE%", p_base_class_name);
}
String GDScriptLanguage::get_empty_template(const String &p_class_name, const String &p_base_class_name) const {
String _template = String() +
"extends %BASE%\n\n";
return _template.replace("%BASE%", p_base_class_name);
}
String GDScriptLanguage::get_nocomment_template(const String &p_class_name, const String &p_base_class_name) const {
String _template = String() +
"extends %BASE%\n\n" +
"func _ready():\n" +
"\tpass\n";
return _template.replace("%BASE%", p_base_class_name);
}
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;