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

Add ScriptLanguage::supports_builtin_mode and improve ScriptCreateDialog

- Make ScriptCreateDialog disable the built-in script checked button if the language does not support it.
- ScriptLanguage's get_template and make_template now receive the script path as class name if the the script language does not have named classes.
This commit is contained in:
Ignacio Etcheverry
2017-10-24 01:54:47 +02:00
parent 9905002fa6
commit e218a13a64
14 changed files with 60 additions and 10 deletions

View File

@@ -279,11 +279,13 @@ Ref<Script> CSharpLanguage::get_template(const String &p_class_name, const Strin
" }\n"
"}\n";
script_template = script_template.replace("%BASE_CLASS_NAME%", p_base_class_name).replace("%CLASS_NAME%", p_class_name);
script_template = script_template.replace("%BASE_CLASS_NAME%", p_base_class_name)
.replace("%CLASS_NAME%", p_class_name);
Ref<CSharpScript> script;
script.instance();
script->set_source_code(script_template);
script->set_name(p_class_name);
return script;
}
@@ -295,7 +297,12 @@ Script *CSharpLanguage::create_script() const {
bool CSharpLanguage::has_named_classes() const {
return true;
return false;
}
bool CSharpLanguage::supports_builtin_mode() const {
return false;
}
static String variant_type_to_managed_name(const String &p_var_type_name) {