diff --git a/core/object/script_language.cpp b/core/object/script_language.cpp index 3b9b1f90947..d358a8d2a0e 100644 --- a/core/object/script_language.cpp +++ b/core/object/script_language.cpp @@ -535,6 +535,13 @@ TypedArray ScriptLanguage::CodeCompletionOption::get_option_cached_characte return charac; } +void ScriptLanguage::_bind_methods() { + BIND_ENUM_CONSTANT(SCRIPT_NAME_CASING_AUTO); + BIND_ENUM_CONSTANT(SCRIPT_NAME_CASING_PASCAL_CASE); + BIND_ENUM_CONSTANT(SCRIPT_NAME_CASING_SNAKE_CASE); + BIND_ENUM_CONSTANT(SCRIPT_NAME_CASING_KEBAB_CASE); +} + bool PlaceHolderScriptInstance::set(const StringName &p_name, const Variant &p_value) { if (script->is_placeholder_fallback_enabled()) { return false; diff --git a/core/object/script_language.h b/core/object/script_language.h index 4217bc9f96a..95e9d2b4aff 100644 --- a/core/object/script_language.h +++ b/core/object/script_language.h @@ -193,6 +193,10 @@ public: class ScriptLanguage : public Object { GDCLASS(ScriptLanguage, Object) + +protected: + static void _bind_methods(); + public: virtual String get_name() const = 0; @@ -224,6 +228,13 @@ public: TEMPLATE_PROJECT }; + enum ScriptNameCasing { + SCRIPT_NAME_CASING_AUTO, + SCRIPT_NAME_CASING_PASCAL_CASE, + SCRIPT_NAME_CASING_SNAKE_CASE, + SCRIPT_NAME_CASING_KEBAB_CASE, + }; + struct ScriptTemplate { String inherit = "Object"; String name; @@ -260,6 +271,7 @@ public: virtual bool can_make_function() const { return true; } virtual Error open_in_external_editor(const Ref