diff --git a/core/script_language.h b/core/script_language.h index 25767a2f7ad..c243ef781bc 100644 --- a/core/script_language.h +++ b/core/script_language.h @@ -202,6 +202,7 @@ public: virtual bool validate(const String &p_script, int &r_line_error, int &r_col_error, String &r_test_error, const String &p_path = "", List *r_functions = NULL) const = 0; virtual Script *create_script() const = 0; virtual bool has_named_classes() const = 0; + virtual bool supports_builtin_mode() const = 0; virtual bool can_inherit_from_file() { return false; } virtual int find_function(const String &p_function, const String &p_code) const = 0; virtual String make_function(const String &p_class, const String &p_name, const PoolStringArray &p_args) const = 0; diff --git a/editor/script_create_dialog.cpp b/editor/script_create_dialog.cpp index 00f44ad9b04..c19b80e6493 100644 --- a/editor/script_create_dialog.cpp +++ b/editor/script_create_dialog.cpp @@ -145,9 +145,13 @@ void ScriptCreateDialog::ok_pressed() { void ScriptCreateDialog::_create_new() { - String cname; - if (has_named_classes) - cname = class_name->get_text(); + String cname_param; + + if (has_named_classes) { + cname_param = class_name->get_text(); + } else { + cname_param = ProjectSettings::get_singleton()->localize_path(file_path->get_text()).get_file().get_basename(); + } Ref