diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2017-10-24 18:59:26 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-24 18:59:26 +0200 |
commit | 847c55bcb11337bd2d386347b299863f82a1be02 (patch) | |
tree | a3fd3327204845f108886419f6e28f6b5bc60b60 /modules/mono | |
parent | b44fb58c90e4c0f55da7b3b3292a7891d053e339 (diff) | |
parent | e218a13a64d417505ba8ca0abb79dddfb943f2c7 (diff) |
Merge pull request #12365 from neikeq/p
Add ScriptLanguage::supports_builtin_mode and improve ScriptCreateDialog
Diffstat (limited to 'modules/mono')
-rw-r--r-- | modules/mono/csharp_script.cpp | 11 | ||||
-rw-r--r-- | modules/mono/csharp_script.h | 1 |
2 files changed, 10 insertions, 2 deletions
diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp index 7143177c3f..855f7e9670 100644 --- a/modules/mono/csharp_script.cpp +++ b/modules/mono/csharp_script.cpp @@ -286,11 +286,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; } @@ -302,7 +304,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) { diff --git a/modules/mono/csharp_script.h b/modules/mono/csharp_script.h index 6b8475fb61..8700b7fc5c 100644 --- a/modules/mono/csharp_script.h +++ b/modules/mono/csharp_script.h @@ -270,6 +270,7 @@ public: /* TODO */ virtual bool 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 { return true; } virtual Script *create_script() const; virtual bool has_named_classes() const; + virtual bool supports_builtin_mode() const; /* TODO? */ virtual int find_function(const String &p_function, const String &p_code) const { return -1; } virtual String make_function(const String &p_class, const String &p_name, const PoolStringArray &p_args) const; /* TODO? */ Error complete_code(const String &p_code, const String &p_base_path, Object *p_owner, List<String> *r_options, String &r_call_hint) { return ERR_UNAVAILABLE; } |