From e218a13a64d417505ba8ca0abb79dddfb943f2c7 Mon Sep 17 00:00:00 2001 From: Ignacio Etcheverry Date: Tue, 24 Oct 2017 01:54:47 +0200 Subject: 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. --- editor/script_create_dialog.cpp | 35 +++++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) (limited to 'editor/script_create_dialog.cpp') diff --git a/editor/script_create_dialog.cpp b/editor/script_create_dialog.cpp index 00f44ad9b0..c19b80e649 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