Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks

This commit is contained in:
Rémi Verschelde 2021-05-04 14:41:06 +02:00
parent 64a63e0861
commit b5e1e05ef2
No known key found for this signature in database
GPG key ID: C3336907360768E1
1439 changed files with 1 additions and 34187 deletions

View file

@ -41,7 +41,6 @@
#include "editor_file_system.h"
void ScriptCreateDialog::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_THEME_CHANGED:
case NOTIFICATION_ENTER_TREE: {
@ -97,7 +96,6 @@ bool ScriptCreateDialog::_can_be_built_in() {
}
void ScriptCreateDialog::config(const String &p_base_name, const String &p_base_path, bool p_built_in_enabled, bool p_load_enabled) {
class_name->set_text("");
class_name->deselect();
parent_name->set_text(p_base_name);
@ -122,12 +120,10 @@ void ScriptCreateDialog::config(const String &p_base_name, const String &p_base_
}
void ScriptCreateDialog::set_inheritance_base_type(const String &p_base) {
base_type = p_base;
}
bool ScriptCreateDialog::_validate_parent(const String &p_string) {
if (p_string.length() == 0)
return false;
@ -141,12 +137,10 @@ bool ScriptCreateDialog::_validate_parent(const String &p_string) {
}
bool ScriptCreateDialog::_validate_class(const String &p_string) {
if (p_string.length() == 0)
return false;
for (int i = 0; i < p_string.length(); i++) {
if (i == 0) {
if (p_string[0] >= '0' && p_string[0] <= '9')
return false; // no start with number plz
@ -162,7 +156,6 @@ bool ScriptCreateDialog::_validate_class(const String &p_string) {
}
String ScriptCreateDialog::_validate_path(const String &p_path, bool p_file_must_exist) {
String p = p_path.strip_edges();
if (p == "")
@ -240,7 +233,6 @@ String ScriptCreateDialog::_get_class_name() const {
}
void ScriptCreateDialog::_class_name_changed(const String &p_name) {
if (_validate_class(class_name->get_text())) {
is_class_name_valid = true;
} else {
@ -250,7 +242,6 @@ void ScriptCreateDialog::_class_name_changed(const String &p_name) {
}
void ScriptCreateDialog::_parent_name_changed(const String &p_parent) {
if (_validate_parent(parent_name->get_text())) {
is_parent_name_valid = true;
} else {
@ -260,7 +251,6 @@ void ScriptCreateDialog::_parent_name_changed(const String &p_parent) {
}
void ScriptCreateDialog::_template_changed(int p_template) {
String selected_template = p_template == 0 ? "" : template_menu->get_item_text(p_template);
EditorSettings::get_singleton()->set_project_metadata("script_setup", "last_selected_template", selected_template);
if (p_template == 0) {
@ -280,7 +270,6 @@ void ScriptCreateDialog::_template_changed(int p_template) {
}
void ScriptCreateDialog::ok_pressed() {
if (is_new_script_created) {
_create_new();
} else {
@ -330,7 +319,6 @@ void ScriptCreateDialog::_create_new() {
}
void ScriptCreateDialog::_load_exist() {
String path = file_path->get_text();
RES p_script = ResourceLoader::load(path, "Script");
if (p_script.is_null()) {
@ -344,7 +332,6 @@ void ScriptCreateDialog::_load_exist() {
}
void ScriptCreateDialog::_lang_changed(int l) {
ScriptLanguage *language = ScriptServer::get_language(l);
has_named_classes = language->has_named_classes();
@ -408,7 +395,6 @@ void ScriptCreateDialog::_lang_changed(int l) {
// Populate script template items previously sorted and now grouped by origin
for (int i = 0; i < template_list.size(); i++) {
if (int(templates[i].origin) != cur_origin) {
template_menu->add_separator();
@ -473,7 +459,6 @@ void ScriptCreateDialog::_lang_changed(int l) {
}
void ScriptCreateDialog::_update_script_templates(const String &p_extension) {
template_list.clear();
template_overrides.clear();
@ -484,7 +469,6 @@ void ScriptCreateDialog::_update_script_templates(const String &p_extension) {
dirs.push_back(EditorSettings::get_singleton()->get_script_templates_dir());
for (int i = 0; i < dirs.size(); i++) {
Vector<String> list = EditorSettings::get_singleton()->get_script_templates(p_extension, dirs[i]);
for (int j = 0; j < list.size(); j++) {
@ -508,7 +492,6 @@ void ScriptCreateDialog::_update_script_templates(const String &p_extension) {
}
void ScriptCreateDialog::_built_in_pressed() {
if (internal->is_pressed()) {
is_built_in = true;
is_new_script_created = true;
@ -521,7 +504,6 @@ void ScriptCreateDialog::_built_in_pressed() {
}
void ScriptCreateDialog::_browse_path(bool browse_parent, bool p_save) {
is_browsing_parent = browse_parent;
if (p_save) {
@ -549,7 +531,6 @@ void ScriptCreateDialog::_browse_path(bool browse_parent, bool p_save) {
}
void ScriptCreateDialog::_file_selected(const String &p_file) {
String p = ProjectSettings::get_singleton()->localize_path(p_file);
if (is_browsing_parent) {
parent_name->set_text("\"" + p + "\"");
@ -567,19 +548,16 @@ void ScriptCreateDialog::_file_selected(const String &p_file) {
}
void ScriptCreateDialog::_create() {
parent_name->set_text(select_class->get_selected_type().split(" ")[0]);
_parent_name_changed(parent_name->get_text());
}
void ScriptCreateDialog::_browse_class_in_tree() {
select_class->set_base_type(base_type);
select_class->popup_create(true);
}
void ScriptCreateDialog::_path_changed(const String &p_path) {
if (is_built_in) {
return;
}
@ -612,7 +590,6 @@ void ScriptCreateDialog::_path_entered(const String &p_path) {
}
void ScriptCreateDialog::_msg_script_valid(bool valid, const String &p_msg) {
error_label->set_text("- " + TTR(p_msg));
if (valid) {
error_label->add_color_override("font_color", get_color("success_color", "Editor"));
@ -622,7 +599,6 @@ void ScriptCreateDialog::_msg_script_valid(bool valid, const String &p_msg) {
}
void ScriptCreateDialog::_msg_path_valid(bool valid, const String &p_msg) {
path_error_label->set_text("- " + TTR(p_msg));
if (valid) {
path_error_label->add_color_override("font_color", get_color("success_color", "Editor"));
@ -632,7 +608,6 @@ void ScriptCreateDialog::_msg_path_valid(bool valid, const String &p_msg) {
}
void ScriptCreateDialog::_update_dialog() {
/* "Add Script Dialog" GUI logic and script checks. */
bool script_ok = true;
@ -741,7 +716,6 @@ void ScriptCreateDialog::_update_dialog() {
}
void ScriptCreateDialog::_bind_methods() {
ClassDB::bind_method("_path_hbox_sorted", &ScriptCreateDialog::_path_hbox_sorted);
ClassDB::bind_method("_class_name_changed", &ScriptCreateDialog::_class_name_changed);
ClassDB::bind_method("_parent_name_changed", &ScriptCreateDialog::_parent_name_changed);
@ -761,7 +735,6 @@ void ScriptCreateDialog::_bind_methods() {
}
ScriptCreateDialog::ScriptCreateDialog() {
/* DIALOG */
/* Main Controls */
@ -822,7 +795,6 @@ ScriptCreateDialog::ScriptCreateDialog() {
default_language = -1;
for (int i = 0; i < ScriptServer::get_language_count(); i++) {
String lang = ScriptServer::get_language(i)->get_name();
language_menu->add_item(lang);
if (lang == "GDScript") {