diff options
author | RedMser <redmser.jj2@gmail.com> | 2023-06-11 18:23:48 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-03-05 09:43:29 +0100 |
commit | 2bd714e34eb57b3fff2c9eaff0eb59ac2cb515aa (patch) | |
tree | 7ec18020c3d986dafe5078a4e394a749933111c8 /modules | |
parent | a07dd0d6a520723c4838fb4b65461a16b7a50f90 (diff) | |
download | redot-engine-2bd714e34eb57b3fff2c9eaff0eb59ac2cb515aa.tar.gz |
Allow configuring the script filename casing rule
Defaults to "Auto", which detects the casing based on the
preference of the currently selected language (C# for example
prefers PascalCase whereas GDScript prefers snake_case).
Diffstat (limited to 'modules')
-rw-r--r-- | modules/mono/csharp_script.cpp | 4 | ||||
-rw-r--r-- | modules/mono/csharp_script.h | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp index 9ccaa27e84..93fb5f1dc6 100644 --- a/modules/mono/csharp_script.cpp +++ b/modules/mono/csharp_script.cpp @@ -405,6 +405,10 @@ bool CSharpLanguage::supports_builtin_mode() const { return false; } +ScriptLanguage::ScriptNameCasing CSharpLanguage::preferred_file_name_casing() const { + return SCRIPT_NAME_CASING_PASCAL_CASE; +} + #ifdef TOOLS_ENABLED struct VariantCsName { Variant::Type variant_type; diff --git a/modules/mono/csharp_script.h b/modules/mono/csharp_script.h index 99e6ebf2e3..7821420620 100644 --- a/modules/mono/csharp_script.h +++ b/modules/mono/csharp_script.h @@ -518,6 +518,7 @@ public: virtual String _get_indentation() const; /* TODO? */ void auto_indent_code(String &p_code, int p_from_line, int p_to_line) const override {} /* TODO */ void add_global_constant(const StringName &p_variable, const Variant &p_value) override {} + virtual ScriptNameCasing preferred_file_name_casing() const override; /* SCRIPT GLOBAL CLASS FUNCTIONS */ virtual bool handles_global_class_type(const String &p_type) const override; |