diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-10-28 17:10:52 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-28 17:10:52 +0200 |
commit | f7d852b5322104a90d45ef63c2ee54c937429487 (patch) | |
tree | 88adafe357d9de615c9a89088af86a4fbcb1bd94 /editor | |
parent | e2deec67b9b3258f1c4fc7ee8c9a375676a0571a (diff) | |
parent | 0ae65472e71324b3bb0fb43038630d31e700e562 (diff) |
Merge pull request #54350 from akien-mga/clang-format-dont-align-operands
Diffstat (limited to 'editor')
-rw-r--r-- | editor/action_map_editor.cpp | 14 | ||||
-rw-r--r-- | editor/editor_about.cpp | 2 | ||||
-rw-r--r-- | editor/editor_node.cpp | 6 | ||||
-rw-r--r-- | editor/editor_properties.cpp | 24 | ||||
-rw-r--r-- | editor/filesystem_dock.cpp | 2 | ||||
-rw-r--r-- | editor/import/collada.cpp | 28 | ||||
-rw-r--r-- | editor/import/editor_import_collada.cpp | 3 | ||||
-rw-r--r-- | editor/import/resource_importer_scene.cpp | 15 | ||||
-rw-r--r-- | editor/import/resource_importer_wav.cpp | 14 | ||||
-rw-r--r-- | editor/plugins/canvas_item_editor_plugin.cpp | 14 | ||||
-rw-r--r-- | editor/plugins/curve_editor_plugin.cpp | 6 | ||||
-rw-r--r-- | editor/plugins/node_3d_editor_gizmos.cpp | 18 | ||||
-rw-r--r-- | editor/plugins/node_3d_editor_plugin.cpp | 4 | ||||
-rw-r--r-- | editor/plugins/path_3d_editor_plugin.cpp | 9 | ||||
-rw-r--r-- | editor/plugins/script_editor_plugin.cpp | 5 | ||||
-rw-r--r-- | editor/plugins/script_text_editor.cpp | 11 | ||||
-rw-r--r-- | editor/plugins/visual_shader_editor_plugin.cpp | 5 | ||||
-rw-r--r-- | editor/property_editor.cpp | 10 | ||||
-rw-r--r-- | editor/rename_dialog.cpp | 2 |
19 files changed, 93 insertions, 99 deletions
diff --git a/editor/action_map_editor.cpp b/editor/action_map_editor.cpp index fc7e7389d5..519dd654ef 100644 --- a/editor/action_map_editor.cpp +++ b/editor/action_map_editor.cpp @@ -238,10 +238,16 @@ void InputEventConfigurationDialog::_listen_window_input(const Ref<InputEvent> & Ref<InputEventJoypadButton> joyb = p_event; Ref<InputEventJoypadMotion> joym = p_event; - int type = k.is_valid() ? INPUT_KEY : joyb.is_valid() ? INPUT_JOY_BUTTON : - joym.is_valid() ? INPUT_JOY_MOTION : - mb.is_valid() ? INPUT_MOUSE_BUTTON : - 0; + int type = 0; + if (k.is_valid()) { + type = INPUT_KEY; + } else if (joyb.is_valid()) { + type = INPUT_JOY_BUTTON; + } else if (joym.is_valid()) { + type = INPUT_JOY_MOTION; + } else if (mb.is_valid()) { + type = INPUT_MOUSE_BUTTON; + } if (!(allowed_input_types & type)) { return; diff --git a/editor/editor_about.cpp b/editor/editor_about.cpp index c895e2c158..414264e697 100644 --- a/editor/editor_about.cpp +++ b/editor/editor_about.cpp @@ -155,7 +155,7 @@ EditorAbout::EditorAbout() { Label *about_text = memnew(Label); about_text->set_v_size_flags(Control::SIZE_SHRINK_CENTER); about_text->set_text(String::utf8("\xc2\xa9 2007-2021 Juan Linietsky, Ariel Manzur.\n\xc2\xa9 2014-2021 ") + - TTR("Godot Engine contributors") + "\n"); + TTR("Godot Engine contributors") + "\n"); version_info_vbc->add_child(about_text); hbc->add_child(version_info_vbc); diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 1904ac58b0..372cf14dc1 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -4964,9 +4964,9 @@ void EditorNode::_scene_tab_closed(int p_tab, int option) { return; } - bool unsaved = (p_tab == editor_data.get_edited_scene()) ? - saved_version != editor_data.get_undo_redo().get_version() : - editor_data.get_scene_version(p_tab) != 0; + bool unsaved = (p_tab == editor_data.get_edited_scene()) + ? saved_version != editor_data.get_undo_redo().get_version() + : editor_data.get_scene_version(p_tab) != 0; if (unsaved) { save_confirmation->get_ok_button()->set_text(TTR("Save & Close")); save_confirmation->set_text(vformat(TTR("Save changes to '%s' before closing?"), scene->get_scene_file_path() != "" ? scene->get_scene_file_path() : "unsaved scene")); diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp index 6a36304ba4..e679222567 100644 --- a/editor/editor_properties.cpp +++ b/editor/editor_properties.cpp @@ -3237,11 +3237,11 @@ EditorProperty *EditorInspectorDefaultPlugin::get_editor_for_property(Object *p_ return editor; } else if (p_hint == PROPERTY_HINT_LAYERS_2D_PHYSICS || - p_hint == PROPERTY_HINT_LAYERS_2D_RENDER || - p_hint == PROPERTY_HINT_LAYERS_2D_NAVIGATION || - p_hint == PROPERTY_HINT_LAYERS_3D_PHYSICS || - p_hint == PROPERTY_HINT_LAYERS_3D_RENDER || - p_hint == PROPERTY_HINT_LAYERS_3D_NAVIGATION) { + p_hint == PROPERTY_HINT_LAYERS_2D_RENDER || + p_hint == PROPERTY_HINT_LAYERS_2D_NAVIGATION || + p_hint == PROPERTY_HINT_LAYERS_3D_PHYSICS || + p_hint == PROPERTY_HINT_LAYERS_3D_RENDER || + p_hint == PROPERTY_HINT_LAYERS_3D_NAVIGATION) { EditorPropertyLayers::LayerType lt = EditorPropertyLayers::LAYER_RENDER_2D; switch (p_hint) { case PROPERTY_HINT_LAYERS_2D_RENDER: @@ -3336,13 +3336,13 @@ EditorProperty *EditorInspectorDefaultPlugin::get_editor_for_property(Object *p_ } return editor; } else if (p_hint == PROPERTY_HINT_METHOD_OF_VARIANT_TYPE || - p_hint == PROPERTY_HINT_METHOD_OF_BASE_TYPE || - p_hint == PROPERTY_HINT_METHOD_OF_INSTANCE || - p_hint == PROPERTY_HINT_METHOD_OF_SCRIPT || - p_hint == PROPERTY_HINT_PROPERTY_OF_VARIANT_TYPE || - p_hint == PROPERTY_HINT_PROPERTY_OF_BASE_TYPE || - p_hint == PROPERTY_HINT_PROPERTY_OF_INSTANCE || - p_hint == PROPERTY_HINT_PROPERTY_OF_SCRIPT) { + p_hint == PROPERTY_HINT_METHOD_OF_BASE_TYPE || + p_hint == PROPERTY_HINT_METHOD_OF_INSTANCE || + p_hint == PROPERTY_HINT_METHOD_OF_SCRIPT || + p_hint == PROPERTY_HINT_PROPERTY_OF_VARIANT_TYPE || + p_hint == PROPERTY_HINT_PROPERTY_OF_BASE_TYPE || + p_hint == PROPERTY_HINT_PROPERTY_OF_INSTANCE || + p_hint == PROPERTY_HINT_PROPERTY_OF_SCRIPT) { EditorPropertyMember *editor = memnew(EditorPropertyMember); EditorPropertyMember::Type type = EditorPropertyMember::MEMBER_METHOD_OF_BASE_TYPE; diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index cdf0f6e391..f2a3aa3b44 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -1371,7 +1371,7 @@ void FileSystemDock::_make_dir_confirm() { EditorNode::get_singleton()->show_warning(TTR("No name provided.")); return; } else if (dir_name.find("/") != -1 || dir_name.find("\\") != -1 || dir_name.find(":") != -1 || dir_name.find("*") != -1 || - dir_name.find("|") != -1 || dir_name.find(">") != -1 || dir_name.ends_with(".") || dir_name.ends_with(" ")) { + dir_name.find("|") != -1 || dir_name.find(">") != -1 || dir_name.ends_with(".") || dir_name.ends_with(" ")) { EditorNode::get_singleton()->show_warning(TTR("Provided name contains invalid characters.")); return; } diff --git a/editor/import/collada.cpp b/editor/import/collada.cpp index 4cd9066350..19b4943e6d 100644 --- a/editor/import/collada.cpp +++ b/editor/import/collada.cpp @@ -541,7 +541,10 @@ void Collada::_parse_effect_material(XMLParser &parser, Effect &effect, String & COLLADA_PRINT("node name: " + parser.get_node_name()); - if (!parser.is_empty() && (parser.get_node_name() == "profile_COMMON" || parser.get_node_name() == "technique" || parser.get_node_name() == "extra")) { + if (!parser.is_empty() && + (parser.get_node_name() == "profile_COMMON" || + parser.get_node_name() == "technique" || + parser.get_node_name() == "extra")) { _parse_effect_material(parser, effect, id); // try again } else if (parser.get_node_name() == "newparam") { @@ -551,9 +554,9 @@ void Collada::_parse_effect_material(XMLParser &parser, Effect &effect, String & COLLADA_PRINT("param: " + name + " value:" + String(value)); } else if (parser.get_node_name() == "constant" || - parser.get_node_name() == "lambert" || - parser.get_node_name() == "phong" || - parser.get_node_name() == "blinn") { + parser.get_node_name() == "lambert" || + parser.get_node_name() == "phong" || + parser.get_node_name() == "blinn") { COLLADA_PRINT("shade model: " + parser.get_node_name()); while (parser.read() == OK) { if (parser.get_node_type() == XMLParser::NODE_ELEMENT) { @@ -627,10 +630,11 @@ void Collada::_parse_effect_material(XMLParser &parser, Effect &effect, String & } else if (what == "shininess") { effect.shininess = _parse_param(parser); } - } else if (parser.get_node_type() == XMLParser::NODE_ELEMENT_END && (parser.get_node_name() == "constant" || - parser.get_node_name() == "lambert" || - parser.get_node_name() == "phong" || - parser.get_node_name() == "blinn")) { + } else if (parser.get_node_type() == XMLParser::NODE_ELEMENT_END && + (parser.get_node_name() == "constant" || + parser.get_node_name() == "lambert" || + parser.get_node_name() == "phong" || + parser.get_node_name() == "blinn")) { break; } } @@ -681,10 +685,10 @@ void Collada::_parse_effect_material(XMLParser &parser, Effect &effect, String & parser.skip_section(); } } else if (parser.get_node_type() == XMLParser::NODE_ELEMENT_END && - (parser.get_node_name() == "effect" || - parser.get_node_name() == "profile_COMMON" || - parser.get_node_name() == "technique" || - parser.get_node_name() == "extra")) { + (parser.get_node_name() == "effect" || + parser.get_node_name() == "profile_COMMON" || + parser.get_node_name() == "technique" || + parser.get_node_name() == "extra")) { break; } } diff --git a/editor/import/editor_import_collada.cpp b/editor/import/editor_import_collada.cpp index ac8adedf2f..f9aa550e7d 100644 --- a/editor/import/editor_import_collada.cpp +++ b/editor/import/editor_import_collada.cpp @@ -1650,8 +1650,7 @@ void ColladaImport::create_animation(int p_clip, bool p_import_value_tracks) { Vector3 s = xform.basis.get_scale(); bool singular_matrix = Math::is_zero_approx(s.x) || Math::is_zero_approx(s.y) || Math::is_zero_approx(s.z); - Quaternion q = singular_matrix ? Quaternion() : - xform.basis.get_rotation_quaternion(); + Quaternion q = singular_matrix ? Quaternion() : xform.basis.get_rotation_quaternion(); Vector3 l = xform.origin; if (position_idx >= 0) { diff --git a/editor/import/resource_importer_scene.cpp b/editor/import/resource_importer_scene.cpp index 9cb69357bd..7d3b945b04 100644 --- a/editor/import/resource_importer_scene.cpp +++ b/editor/import/resource_importer_scene.cpp @@ -1300,27 +1300,28 @@ bool ResourceImporterScene::get_internal_option_visibility(InternalImportCategor if (p_option == "primitive/position" || p_option == "primitive/rotation") { const ShapeType physics_shape = (ShapeType)p_options["physics/shape_type"].operator int(); return generate_physics && - physics_shape >= SHAPE_TYPE_BOX; + physics_shape >= SHAPE_TYPE_BOX; } if (p_option == "primitive/size") { const ShapeType physics_shape = (ShapeType)p_options["physics/shape_type"].operator int(); return generate_physics && - physics_shape == SHAPE_TYPE_BOX; + physics_shape == SHAPE_TYPE_BOX; } if (p_option == "primitive/radius") { const ShapeType physics_shape = (ShapeType)p_options["physics/shape_type"].operator int(); - return generate_physics && (physics_shape == SHAPE_TYPE_SPHERE || - physics_shape == SHAPE_TYPE_CYLINDER || - physics_shape == SHAPE_TYPE_CAPSULE); + return generate_physics && + (physics_shape == SHAPE_TYPE_SPHERE || + physics_shape == SHAPE_TYPE_CYLINDER || + physics_shape == SHAPE_TYPE_CAPSULE); } if (p_option == "primitive/height") { const ShapeType physics_shape = (ShapeType)p_options["physics/shape_type"].operator int(); return generate_physics && - (physics_shape == SHAPE_TYPE_CYLINDER || - physics_shape == SHAPE_TYPE_CAPSULE); + (physics_shape == SHAPE_TYPE_CYLINDER || + physics_shape == SHAPE_TYPE_CAPSULE); } } break; case INTERNAL_IMPORT_CATEGORY_MESH: { diff --git a/editor/import/resource_importer_wav.cpp b/editor/import/resource_importer_wav.cpp index 2db1db9e51..89383d3dde 100644 --- a/editor/import/resource_importer_wav.cpp +++ b/editor/import/resource_importer_wav.cpp @@ -252,13 +252,13 @@ Error ResourceImporterWAV::import(const String &p_source_file, const String &p_s //loop point info! /** - * Consider exploring next document: - * http://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/Docs/RIFFNEW.pdf - * Especially on page: - * 16 - 17 - * Timestamp: - * 22:38 06.07.2017 GMT - **/ + * Consider exploring next document: + * http://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/Docs/RIFFNEW.pdf + * Especially on page: + * 16 - 17 + * Timestamp: + * 22:38 06.07.2017 GMT + **/ for (int i = 0; i < 10; i++) { file->get_32(); // i wish to know why should i do this... no doc! diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index 5544d9261e..0e1bdf0155 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -2983,18 +2983,16 @@ void CanvasItemEditor::_draw_ruler_tool() { const Vector2 end_to_begin = (end - begin); - real_t arc_1_start_angle = - end_to_begin.x < 0 ? - (end_to_begin.y < 0 ? 3.0 * Math_PI / 2.0 - vertical_angle_rad : Math_PI / 2.0) : - (end_to_begin.y < 0 ? 3.0 * Math_PI / 2.0 : Math_PI / 2.0 - vertical_angle_rad); + real_t arc_1_start_angle = end_to_begin.x < 0 + ? (end_to_begin.y < 0 ? 3.0 * Math_PI / 2.0 - vertical_angle_rad : Math_PI / 2.0) + : (end_to_begin.y < 0 ? 3.0 * Math_PI / 2.0 : Math_PI / 2.0 - vertical_angle_rad); real_t arc_1_end_angle = arc_1_start_angle + vertical_angle_rad; // Constrain arc to triangle height & max size real_t arc_1_radius = MIN(MIN(arc_radius_max_length_percent * ruler_length, ABS(end_to_begin.y)), arc_max_radius); - real_t arc_2_start_angle = - end_to_begin.x < 0 ? - (end_to_begin.y < 0 ? 0.0 : -horizontal_angle_rad) : - (end_to_begin.y < 0 ? Math_PI - horizontal_angle_rad : Math_PI); + real_t arc_2_start_angle = end_to_begin.x < 0 + ? (end_to_begin.y < 0 ? 0.0 : -horizontal_angle_rad) + : (end_to_begin.y < 0 ? Math_PI - horizontal_angle_rad : Math_PI); real_t arc_2_end_angle = arc_2_start_angle + horizontal_angle_rad; // Constrain arc to triangle width & max size real_t arc_2_radius = MIN(MIN(arc_radius_max_length_percent * ruler_length, ABS(end_to_begin.x)), arc_max_radius); diff --git a/editor/plugins/curve_editor_plugin.cpp b/editor/plugins/curve_editor_plugin.cpp index 4a22dc5b62..43eb6a7ce9 100644 --- a/editor/plugins/curve_editor_plugin.cpp +++ b/editor/plugins/curve_editor_plugin.cpp @@ -354,9 +354,9 @@ void CurveEditor::open_context_menu(Vector2 pos) { _context_menu->add_check_item(TTR("Linear"), CONTEXT_LINEAR); - bool is_linear = _selected_tangent == TANGENT_LEFT ? - _curve_ref->get_point_left_mode(_selected_point) == Curve::TANGENT_LINEAR : - _curve_ref->get_point_right_mode(_selected_point) == Curve::TANGENT_LINEAR; + bool is_linear = _selected_tangent == TANGENT_LEFT + ? _curve_ref->get_point_left_mode(_selected_point) == Curve::TANGENT_LINEAR + : _curve_ref->get_point_right_mode(_selected_point) == Curve::TANGENT_LINEAR; _context_menu->set_item_checked(_context_menu->get_item_index(CONTEXT_LINEAR), is_linear); diff --git a/editor/plugins/node_3d_editor_gizmos.cpp b/editor/plugins/node_3d_editor_gizmos.cpp index b28f3e134c..cbbdfd412d 100644 --- a/editor/plugins/node_3d_editor_gizmos.cpp +++ b/editor/plugins/node_3d_editor_gizmos.cpp @@ -3641,15 +3641,15 @@ void LightmapGIGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { const float c4 = 0.886227; const float c5 = 0.247708; Vector3 light = (c1 * sh_col[8] * (n.x * n.x - n.y * n.y) + - c3 * sh_col[6] * n.z * n.z + - c4 * sh_col[0] - - c5 * sh_col[6] + - 2.0 * c1 * sh_col[4] * n.x * n.y + - 2.0 * c1 * sh_col[7] * n.x * n.z + - 2.0 * c1 * sh_col[5] * n.y * n.z + - 2.0 * c2 * sh_col[3] * n.x + - 2.0 * c2 * sh_col[1] * n.y + - 2.0 * c2 * sh_col[2] * n.z); + c3 * sh_col[6] * n.z * n.z + + c4 * sh_col[0] - + c5 * sh_col[6] + + 2.0 * c1 * sh_col[4] * n.x * n.y + + 2.0 * c1 * sh_col[7] * n.x * n.z + + 2.0 * c1 * sh_col[5] * n.y * n.z + + 2.0 * c2 * sh_col[3] * n.x + + 2.0 * c2 * sh_col[1] * n.y + + 2.0 * c2 * sh_col[2] * n.z); colors.push_back(Color(light.x, light.y, light.z, 1)); } diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp index 632207befc..fb41a8f497 100644 --- a/editor/plugins/node_3d_editor_plugin.cpp +++ b/editor/plugins/node_3d_editor_plugin.cpp @@ -1855,7 +1855,7 @@ void Node3DEditorViewport::_sinput(const Ref<InputEvent> &p_event) { motion_snapped.snap(Vector3(snap, snap, snap)); // This might not be necessary anymore after issue #288 is solved (in 4.0?). set_message(TTR("Scaling: ") + "(" + String::num(motion_snapped.x, snap_step_decimals) + ", " + - String::num(motion_snapped.y, snap_step_decimals) + ", " + String::num(motion_snapped.z, snap_step_decimals) + ")"); + String::num(motion_snapped.y, snap_step_decimals) + ", " + String::num(motion_snapped.z, snap_step_decimals) + ")"); List<Node *> &selection = editor_selection->get_selected_node_list(); for (Node *E : selection) { @@ -1954,7 +1954,7 @@ void Node3DEditorViewport::_sinput(const Ref<InputEvent> &p_event) { Vector3 motion_snapped = motion; motion_snapped.snap(Vector3(snap, snap, snap)); set_message(TTR("Translating: ") + "(" + String::num(motion_snapped.x, snap_step_decimals) + ", " + - String::num(motion_snapped.y, snap_step_decimals) + ", " + String::num(motion_snapped.z, snap_step_decimals) + ")"); + String::num(motion_snapped.y, snap_step_decimals) + ", " + String::num(motion_snapped.z, snap_step_decimals) + ")"); List<Node *> &selection = editor_selection->get_selected_node_list(); for (Node *E : selection) { diff --git a/editor/plugins/path_3d_editor_plugin.cpp b/editor/plugins/path_3d_editor_plugin.cpp index e2902feba1..f9a5f429d2 100644 --- a/editor/plugins/path_3d_editor_plugin.cpp +++ b/editor/plugins/path_3d_editor_plugin.cpp @@ -614,15 +614,6 @@ Path3DEditorPlugin::Path3DEditorPlugin(EditorNode *p_node) { menu->connect("id_pressed", callable_mp(this, &Path3DEditorPlugin::_handle_option_pressed)); curve_edit->set_pressed(true); - /* - collision_polygon_editor = memnew( PathEditor(p_node) ); - editor->get_main_control()->add_child(collision_polygon_editor); - collision_polygon_editor->set_margin(MARGIN_LEFT,200); - collision_polygon_editor->set_margin(MARGIN_RIGHT,230); - collision_polygon_editor->set_margin(MARGIN_TOP,0); - collision_polygon_editor->set_margin(MARGIN_BOTTOM,10); - collision_polygon_editor->hide(); - */ } Path3DEditorPlugin::~Path3DEditorPlugin() { diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index 677a5f1f2c..3f98560a2f 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -315,10 +315,7 @@ void ScriptEditorQuickOpen::_text_changed(const String &p_newtext) { void ScriptEditorQuickOpen::_sbox_input(const Ref<InputEvent> &p_ie) { Ref<InputEventKey> k = p_ie; - if (k.is_valid() && (k->get_keycode() == KEY_UP || - k->get_keycode() == KEY_DOWN || - k->get_keycode() == KEY_PAGEUP || - k->get_keycode() == KEY_PAGEDOWN)) { + if (k.is_valid() && (k->get_keycode() == KEY_UP || k->get_keycode() == KEY_DOWN || k->get_keycode() == KEY_PAGEUP || k->get_keycode() == KEY_PAGEDOWN)) { search_options->gui_input(k); search_box->accept_event(); } diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp index 2c02389db2..219498b5e7 100644 --- a/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -1396,11 +1396,12 @@ Variant ScriptTextEditor::get_drag_data_fw(const Point2 &p_point, Control *p_fro bool ScriptTextEditor::can_drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) const { Dictionary d = p_data; - if (d.has("type") && (String(d["type"]) == "resource" || - String(d["type"]) == "files" || - String(d["type"]) == "nodes" || - String(d["type"]) == "obj_property" || - String(d["type"]) == "files_and_dirs")) { + if (d.has("type") && + (String(d["type"]) == "resource" || + String(d["type"]) == "files" || + String(d["type"]) == "nodes" || + String(d["type"]) == "obj_property" || + String(d["type"]) == "files_and_dirs")) { return true; } diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp index 09ca1f7608..d0f3da8d81 100644 --- a/editor/plugins/visual_shader_editor_plugin.cpp +++ b/editor/plugins/visual_shader_editor_plugin.cpp @@ -3207,10 +3207,7 @@ void VisualShaderEditor::_show_members_dialog(bool at_mouse_pos, VisualShaderNod void VisualShaderEditor::_sbox_input(const Ref<InputEvent> &p_ie) { Ref<InputEventKey> ie = p_ie; - if (ie.is_valid() && (ie->get_keycode() == KEY_UP || - ie->get_keycode() == KEY_DOWN || - ie->get_keycode() == KEY_ENTER || - ie->get_keycode() == KEY_KP_ENTER)) { + if (ie.is_valid() && (ie->get_keycode() == KEY_UP || ie->get_keycode() == KEY_DOWN || ie->get_keycode() == KEY_ENTER || ie->get_keycode() == KEY_KP_ENTER)) { members->gui_input(ie); node_filter->accept_event(); } diff --git a/editor/property_editor.cpp b/editor/property_editor.cpp index 6ea9b9dfae..db560af657 100644 --- a/editor/property_editor.cpp +++ b/editor/property_editor.cpp @@ -407,11 +407,11 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant:: return false; } else if (hint == PROPERTY_HINT_LAYERS_2D_PHYSICS || - hint == PROPERTY_HINT_LAYERS_2D_RENDER || - hint == PROPERTY_HINT_LAYERS_2D_NAVIGATION || - hint == PROPERTY_HINT_LAYERS_3D_PHYSICS || - hint == PROPERTY_HINT_LAYERS_3D_RENDER || - hint == PROPERTY_HINT_LAYERS_3D_NAVIGATION) { + hint == PROPERTY_HINT_LAYERS_2D_RENDER || + hint == PROPERTY_HINT_LAYERS_2D_NAVIGATION || + hint == PROPERTY_HINT_LAYERS_3D_PHYSICS || + hint == PROPERTY_HINT_LAYERS_3D_RENDER || + hint == PROPERTY_HINT_LAYERS_3D_NAVIGATION) { String basename; switch (hint) { case PROPERTY_HINT_LAYERS_2D_RENDER: diff --git a/editor/rename_dialog.cpp b/editor/rename_dialog.cpp index a5e1b0eab8..2792c193d9 100644 --- a/editor/rename_dialog.cpp +++ b/editor/rename_dialog.cpp @@ -626,7 +626,7 @@ void RenameDialog::reset() { bool RenameDialog::_is_main_field(LineEdit *line_edit) { return line_edit && - (line_edit == lne_search || line_edit == lne_replace || line_edit == lne_prefix || line_edit == lne_suffix); + (line_edit == lne_search || line_edit == lne_replace || line_edit == lne_prefix || line_edit == lne_suffix); } void RenameDialog::_insert_text(String text) { |