diff options
Diffstat (limited to 'editor')
-rw-r--r-- | editor/animation_track_editor.cpp | 16 | ||||
-rw-r--r-- | editor/connections_dialog.cpp | 56 | ||||
-rw-r--r-- | editor/editor_help.cpp | 6 | ||||
-rw-r--r-- | editor/editor_properties.cpp | 28 | ||||
-rw-r--r-- | editor/export_template_manager.cpp | 16 | ||||
-rw-r--r-- | editor/import/editor_scene_importer_gltf.cpp | 42 | ||||
-rw-r--r-- | editor/import/resource_importer_csv_translation.cpp | 12 | ||||
-rw-r--r-- | editor/import/resource_importer_scene.cpp | 30 | ||||
-rw-r--r-- | editor/node_3d_editor_gizmos.cpp | 72 | ||||
-rw-r--r-- | editor/plugins/asset_library_editor_plugin.cpp | 3 | ||||
-rw-r--r-- | editor/plugins/canvas_item_editor_plugin.cpp | 3 | ||||
-rw-r--r-- | editor/plugins/node_3d_editor_plugin.cpp | 15 | ||||
-rw-r--r-- | editor/plugins/theme_editor_plugin.cpp | 60 | ||||
-rw-r--r-- | editor/project_manager.cpp | 24 | ||||
-rw-r--r-- | editor/project_settings_editor.cpp | 23 | ||||
-rw-r--r-- | editor/scene_tree_dock.cpp | 8 |
16 files changed, 298 insertions, 116 deletions
diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp index 09f55bea0c..da81732a01 100644 --- a/editor/animation_track_editor.cpp +++ b/editor/animation_track_editor.cpp @@ -5297,10 +5297,18 @@ void AnimationTrackEditor::_edit_menu_pressed(int p_option) { } switch (animation->track_get_type(i)) { - case Animation::TYPE_TRANSFORM: text += " (Transform)"; break; - case Animation::TYPE_METHOD: text += " (Methods)"; break; - case Animation::TYPE_BEZIER: text += " (Bezier)"; break; - case Animation::TYPE_AUDIO: text += " (Audio)"; break; + case Animation::TYPE_TRANSFORM: + text += " (Transform)"; + break; + case Animation::TYPE_METHOD: + text += " (Methods)"; + break; + case Animation::TYPE_BEZIER: + text += " (Bezier)"; + break; + case Animation::TYPE_AUDIO: + text += " (Audio)"; + break; default: { }; } diff --git a/editor/connections_dialog.cpp b/editor/connections_dialog.cpp index bef5c3c2b0..4556a6e827 100644 --- a/editor/connections_dialog.cpp +++ b/editor/connections_dialog.cpp @@ -171,20 +171,48 @@ void ConnectDialog::_add_bind() { Variant value; switch (vt) { - case Variant::BOOL: value = false; break; - case Variant::INT: value = 0; break; - case Variant::FLOAT: value = 0.0; break; - case Variant::STRING: value = ""; break; - case Variant::STRING_NAME: value = ""; break; - case Variant::VECTOR2: value = Vector2(); break; - case Variant::RECT2: value = Rect2(); break; - case Variant::VECTOR3: value = Vector3(); break; - case Variant::PLANE: value = Plane(); break; - case Variant::QUAT: value = Quat(); break; - case Variant::AABB: value = AABB(); break; - case Variant::BASIS: value = Basis(); break; - case Variant::TRANSFORM: value = Transform(); break; - case Variant::COLOR: value = Color(); break; + case Variant::BOOL: + value = false; + break; + case Variant::INT: + value = 0; + break; + case Variant::FLOAT: + value = 0.0; + break; + case Variant::STRING: + value = ""; + break; + case Variant::STRING_NAME: + value = ""; + break; + case Variant::VECTOR2: + value = Vector2(); + break; + case Variant::RECT2: + value = Rect2(); + break; + case Variant::VECTOR3: + value = Vector3(); + break; + case Variant::PLANE: + value = Plane(); + break; + case Variant::QUAT: + value = Quat(); + break; + case Variant::AABB: + value = AABB(); + break; + case Variant::BASIS: + value = Basis(); + break; + case Variant::TRANSFORM: + value = Transform(); + break; + case Variant::COLOR: + value = Color(); + break; default: { ERR_FAIL(); } break; diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp index deee6bc2cb..b2bcab4717 100644 --- a/editor/editor_help.cpp +++ b/editor/editor_help.cpp @@ -1497,7 +1497,8 @@ void EditorHelp::_notification(int p_what) { _class_desc_resized(); } } break; - default: break; + default: + break; } } @@ -1642,7 +1643,8 @@ void EditorHelpBit::_notification(int p_what) { rich_text->add_theme_color_override("selection_color", get_theme_color("accent_color", "Editor") * Color(1, 1, 1, 0.4)); } break; - default: break; + default: + break; } } diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp index 5d16a8cf77..d411b6dec4 100644 --- a/editor/editor_properties.cpp +++ b/editor/editor_properties.cpp @@ -3318,13 +3318,27 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ EditorPropertyMember::Type type = EditorPropertyMember::MEMBER_METHOD_OF_BASE_TYPE; switch (p_hint) { - case PROPERTY_HINT_METHOD_OF_BASE_TYPE: type = EditorPropertyMember::MEMBER_METHOD_OF_BASE_TYPE; break; - case PROPERTY_HINT_METHOD_OF_INSTANCE: type = EditorPropertyMember::MEMBER_METHOD_OF_INSTANCE; break; - case PROPERTY_HINT_METHOD_OF_SCRIPT: type = EditorPropertyMember::MEMBER_METHOD_OF_SCRIPT; break; - case PROPERTY_HINT_PROPERTY_OF_VARIANT_TYPE: type = EditorPropertyMember::MEMBER_PROPERTY_OF_VARIANT_TYPE; break; - case PROPERTY_HINT_PROPERTY_OF_BASE_TYPE: type = EditorPropertyMember::MEMBER_PROPERTY_OF_BASE_TYPE; break; - case PROPERTY_HINT_PROPERTY_OF_INSTANCE: type = EditorPropertyMember::MEMBER_PROPERTY_OF_INSTANCE; break; - case PROPERTY_HINT_PROPERTY_OF_SCRIPT: type = EditorPropertyMember::MEMBER_PROPERTY_OF_SCRIPT; break; + case PROPERTY_HINT_METHOD_OF_BASE_TYPE: + type = EditorPropertyMember::MEMBER_METHOD_OF_BASE_TYPE; + break; + case PROPERTY_HINT_METHOD_OF_INSTANCE: + type = EditorPropertyMember::MEMBER_METHOD_OF_INSTANCE; + break; + case PROPERTY_HINT_METHOD_OF_SCRIPT: + type = EditorPropertyMember::MEMBER_METHOD_OF_SCRIPT; + break; + case PROPERTY_HINT_PROPERTY_OF_VARIANT_TYPE: + type = EditorPropertyMember::MEMBER_PROPERTY_OF_VARIANT_TYPE; + break; + case PROPERTY_HINT_PROPERTY_OF_BASE_TYPE: + type = EditorPropertyMember::MEMBER_PROPERTY_OF_BASE_TYPE; + break; + case PROPERTY_HINT_PROPERTY_OF_INSTANCE: + type = EditorPropertyMember::MEMBER_PROPERTY_OF_INSTANCE; + break; + case PROPERTY_HINT_PROPERTY_OF_SCRIPT: + type = EditorPropertyMember::MEMBER_PROPERTY_OF_SCRIPT; + break; default: { } } diff --git a/editor/export_template_manager.cpp b/editor/export_template_manager.cpp index f0ee5d451f..f52e340a26 100644 --- a/editor/export_template_manager.cpp +++ b/editor/export_template_manager.cpp @@ -504,18 +504,26 @@ void ExportTemplateManager::_notification(int p_what) { status = TTR("Disconnected"); errored = true; break; - case HTTPClient::STATUS_RESOLVING: status = TTR("Resolving"); break; + case HTTPClient::STATUS_RESOLVING: + status = TTR("Resolving"); + break; case HTTPClient::STATUS_CANT_RESOLVE: status = TTR("Can't Resolve"); errored = true; break; - case HTTPClient::STATUS_CONNECTING: status = TTR("Connecting..."); break; + case HTTPClient::STATUS_CONNECTING: + status = TTR("Connecting..."); + break; case HTTPClient::STATUS_CANT_CONNECT: status = TTR("Can't Connect"); errored = true; break; - case HTTPClient::STATUS_CONNECTED: status = TTR("Connected"); break; - case HTTPClient::STATUS_REQUESTING: status = TTR("Requesting..."); break; + case HTTPClient::STATUS_CONNECTED: + status = TTR("Connected"); + break; + case HTTPClient::STATUS_REQUESTING: + status = TTR("Requesting..."); + break; case HTTPClient::STATUS_BODY: status = TTR("Downloading"); if (download_templates->get_body_size() > 0) { diff --git a/editor/import/editor_scene_importer_gltf.cpp b/editor/import/editor_scene_importer_gltf.cpp index 45e376a2aa..1a1e7171b9 100644 --- a/editor/import/editor_scene_importer_gltf.cpp +++ b/editor/import/editor_scene_importer_gltf.cpp @@ -538,12 +538,18 @@ Error EditorSceneImporterGLTF::_parse_accessors(GLTFState &state) { String EditorSceneImporterGLTF::_get_component_type_name(const uint32_t p_component) { switch (p_component) { - case COMPONENT_TYPE_BYTE: return "Byte"; - case COMPONENT_TYPE_UNSIGNED_BYTE: return "UByte"; - case COMPONENT_TYPE_SHORT: return "Short"; - case COMPONENT_TYPE_UNSIGNED_SHORT: return "UShort"; - case COMPONENT_TYPE_INT: return "Int"; - case COMPONENT_TYPE_FLOAT: return "Float"; + case COMPONENT_TYPE_BYTE: + return "Byte"; + case COMPONENT_TYPE_UNSIGNED_BYTE: + return "UByte"; + case COMPONENT_TYPE_SHORT: + return "Short"; + case COMPONENT_TYPE_UNSIGNED_SHORT: + return "UShort"; + case COMPONENT_TYPE_INT: + return "Int"; + case COMPONENT_TYPE_FLOAT: + return "Float"; } return "<Error>"; @@ -655,12 +661,24 @@ Error EditorSceneImporterGLTF::_decode_buffer_view(GLTFState &state, double *dst int EditorSceneImporterGLTF::_get_component_type_size(const int component_type) { switch (component_type) { - case COMPONENT_TYPE_BYTE: return 1; break; - case COMPONENT_TYPE_UNSIGNED_BYTE: return 1; break; - case COMPONENT_TYPE_SHORT: return 2; break; - case COMPONENT_TYPE_UNSIGNED_SHORT: return 2; break; - case COMPONENT_TYPE_INT: return 4; break; - case COMPONENT_TYPE_FLOAT: return 4; break; + case COMPONENT_TYPE_BYTE: + return 1; + break; + case COMPONENT_TYPE_UNSIGNED_BYTE: + return 1; + break; + case COMPONENT_TYPE_SHORT: + return 2; + break; + case COMPONENT_TYPE_UNSIGNED_SHORT: + return 2; + break; + case COMPONENT_TYPE_INT: + return 4; + break; + case COMPONENT_TYPE_FLOAT: + return 4; + break; default: { ERR_FAIL_V(0); } diff --git a/editor/import/resource_importer_csv_translation.cpp b/editor/import/resource_importer_csv_translation.cpp index 1d7bed3975..9d72396449 100644 --- a/editor/import/resource_importer_csv_translation.cpp +++ b/editor/import/resource_importer_csv_translation.cpp @@ -83,9 +83,15 @@ Error ResourceImporterCSVTranslation::import(const String &p_source_file, const String delimiter; switch ((int)p_options["delimiter"]) { - case 0: delimiter = ","; break; - case 1: delimiter = ";"; break; - case 2: delimiter = "\t"; break; + case 0: + delimiter = ","; + break; + case 1: + delimiter = ";"; + break; + case 2: + delimiter = "\t"; + break; } FileAccessRef f = FileAccess::open(p_source_file, FileAccess::READ); diff --git a/editor/import/resource_importer_scene.cpp b/editor/import/resource_importer_scene.cpp index 239fae2268..e7f87acd03 100644 --- a/editor/import/resource_importer_scene.cpp +++ b/editor/import/resource_importer_scene.cpp @@ -221,16 +221,26 @@ int ResourceImporterScene::get_preset_count() const { String ResourceImporterScene::get_preset_name(int p_idx) const { switch (p_idx) { - case PRESET_SINGLE_SCENE: return TTR("Import as Single Scene"); - case PRESET_SEPARATE_ANIMATIONS: return TTR("Import with Separate Animations"); - case PRESET_SEPARATE_MATERIALS: return TTR("Import with Separate Materials"); - case PRESET_SEPARATE_MESHES: return TTR("Import with Separate Objects"); - case PRESET_SEPARATE_MESHES_AND_MATERIALS: return TTR("Import with Separate Objects+Materials"); - case PRESET_SEPARATE_MESHES_AND_ANIMATIONS: return TTR("Import with Separate Objects+Animations"); - case PRESET_SEPARATE_MATERIALS_AND_ANIMATIONS: return TTR("Import with Separate Materials+Animations"); - case PRESET_SEPARATE_MESHES_MATERIALS_AND_ANIMATIONS: return TTR("Import with Separate Objects+Materials+Animations"); - case PRESET_MULTIPLE_SCENES: return TTR("Import as Multiple Scenes"); - case PRESET_MULTIPLE_SCENES_AND_MATERIALS: return TTR("Import as Multiple Scenes+Materials"); + case PRESET_SINGLE_SCENE: + return TTR("Import as Single Scene"); + case PRESET_SEPARATE_ANIMATIONS: + return TTR("Import with Separate Animations"); + case PRESET_SEPARATE_MATERIALS: + return TTR("Import with Separate Materials"); + case PRESET_SEPARATE_MESHES: + return TTR("Import with Separate Objects"); + case PRESET_SEPARATE_MESHES_AND_MATERIALS: + return TTR("Import with Separate Objects+Materials"); + case PRESET_SEPARATE_MESHES_AND_ANIMATIONS: + return TTR("Import with Separate Objects+Animations"); + case PRESET_SEPARATE_MATERIALS_AND_ANIMATIONS: + return TTR("Import with Separate Materials+Animations"); + case PRESET_SEPARATE_MESHES_MATERIALS_AND_ANIMATIONS: + return TTR("Import with Separate Objects+Materials+Animations"); + case PRESET_MULTIPLE_SCENES: + return TTR("Import as Multiple Scenes"); + case PRESET_MULTIPLE_SCENES_AND_MATERIALS: + return TTR("Import as Multiple Scenes+Materials"); } return ""; diff --git a/editor/node_3d_editor_gizmos.cpp b/editor/node_3d_editor_gizmos.cpp index ce1f510fc9..901dfdfb38 100644 --- a/editor/node_3d_editor_gizmos.cpp +++ b/editor/node_3d_editor_gizmos.cpp @@ -2212,12 +2212,18 @@ int VisibilityNotifier3DGizmoPlugin::get_priority() const { String VisibilityNotifier3DGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_idx) const { switch (p_idx) { - case 0: return "Size X"; - case 1: return "Size Y"; - case 2: return "Size Z"; - case 3: return "Pos X"; - case 4: return "Pos Y"; - case 5: return "Pos Z"; + case 0: + return "Size X"; + case 1: + return "Size Y"; + case 2: + return "Size Z"; + case 3: + return "Pos X"; + case 4: + return "Pos Y"; + case 5: + return "Pos Z"; } return ""; @@ -2404,12 +2410,18 @@ bool GPUParticles3DGizmoPlugin::is_selectable_when_hidden() const { String GPUParticles3DGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_idx) const { switch (p_idx) { - case 0: return "Size X"; - case 1: return "Size Y"; - case 2: return "Size Z"; - case 3: return "Pos X"; - case 4: return "Pos Y"; - case 5: return "Pos Z"; + case 0: + return "Size X"; + case 1: + return "Size Y"; + case 2: + return "Size Z"; + case 3: + return "Pos X"; + case 4: + return "Pos Y"; + case 5: + return "Pos Z"; } return ""; @@ -2569,12 +2581,18 @@ int ReflectionProbeGizmoPlugin::get_priority() const { String ReflectionProbeGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_idx) const { switch (p_idx) { - case 0: return "Extents X"; - case 1: return "Extents Y"; - case 2: return "Extents Z"; - case 3: return "Origin X"; - case 4: return "Origin Y"; - case 5: return "Origin Z"; + case 0: + return "Extents X"; + case 1: + return "Extents Y"; + case 2: + return "Extents Z"; + case 3: + return "Origin X"; + case 4: + return "Origin Y"; + case 5: + return "Origin Z"; } return ""; @@ -2752,9 +2770,12 @@ int DecalGizmoPlugin::get_priority() const { String DecalGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_idx) const { switch (p_idx) { - case 0: return "Extents X"; - case 1: return "Extents Y"; - case 2: return "Extents Z"; + case 0: + return "Extents X"; + case 1: + return "Extents Y"; + case 2: + return "Extents Z"; } return ""; @@ -2893,9 +2914,12 @@ int GIProbeGizmoPlugin::get_priority() const { String GIProbeGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_gizmo, int p_idx) const { switch (p_idx) { - case 0: return "Extents X"; - case 1: return "Extents Y"; - case 2: return "Extents Z"; + case 0: + return "Extents X"; + case 1: + return "Extents Y"; + case 2: + return "Extents Z"; } return ""; diff --git a/editor/plugins/asset_library_editor_plugin.cpp b/editor/plugins/asset_library_editor_plugin.cpp index bb5147972c..1928d49556 100644 --- a/editor/plugins/asset_library_editor_plugin.cpp +++ b/editor/plugins/asset_library_editor_plugin.cpp @@ -1297,7 +1297,8 @@ void EditorAssetLibrary::_http_request_completed(int p_status, int p_code, const } } } break; - default: break; + default: + break; } } diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index 36184a3f42..65c0763e63 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -6262,7 +6262,8 @@ void CanvasItemEditorViewport::_notification(int p_what) { disconnect("mouse_exited", callable_mp(this, &CanvasItemEditorViewport::_on_mouse_exit)); } break; - default: break; + default: + break; } } diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp index 59f0edc347..bac00ed038 100644 --- a/editor/plugins/node_3d_editor_plugin.cpp +++ b/editor/plugins/node_3d_editor_plugin.cpp @@ -785,11 +785,16 @@ static int _get_key_modifier_setting(const String &p_property) { switch (EditorSettings::get_singleton()->get(p_property).operator int()) { - case 0: return 0; - case 1: return KEY_SHIFT; - case 2: return KEY_ALT; - case 3: return KEY_META; - case 4: return KEY_CONTROL; + case 0: + return 0; + case 1: + return KEY_SHIFT; + case 2: + return KEY_ALT; + case 3: + return KEY_META; + case 4: + return KEY_CONTROL; } return 0; } diff --git a/editor/plugins/theme_editor_plugin.cpp b/editor/plugins/theme_editor_plugin.cpp index b246b611fd..d9be2e32cb 100644 --- a/editor/plugins/theme_editor_plugin.cpp +++ b/editor/plugins/theme_editor_plugin.cpp @@ -74,11 +74,21 @@ void ThemeEditor::_name_menu_about_to_show() { switch (type_select->get_selected()) { - case 0: Theme::get_default()->get_icon_list(fromtype, &names); break; - case 1: Theme::get_default()->get_stylebox_list(fromtype, &names); break; - case 2: Theme::get_default()->get_font_list(fromtype, &names); break; - case 3: Theme::get_default()->get_color_list(fromtype, &names); break; - case 4: Theme::get_default()->get_constant_list(fromtype, &names); break; + case 0: + Theme::get_default()->get_icon_list(fromtype, &names); + break; + case 1: + Theme::get_default()->get_stylebox_list(fromtype, &names); + break; + case 2: + Theme::get_default()->get_font_list(fromtype, &names); + break; + case 3: + Theme::get_default()->get_color_list(fromtype, &names); + break; + case 4: + Theme::get_default()->get_constant_list(fromtype, &names); + break; } } else if (popup_mode == POPUP_REMOVE) { @@ -324,11 +334,21 @@ void ThemeEditor::_dialog_cbk() { switch (type_select->get_selected()) { - case 0: theme->set_icon(name_edit->get_text(), type_edit->get_text(), Ref<Texture2D>()); break; - case 1: theme->set_stylebox(name_edit->get_text(), type_edit->get_text(), Ref<StyleBox>()); break; - case 2: theme->set_font(name_edit->get_text(), type_edit->get_text(), Ref<Font>()); break; - case 3: theme->set_color(name_edit->get_text(), type_edit->get_text(), Color()); break; - case 4: theme->set_constant(name_edit->get_text(), type_edit->get_text(), 0); break; + case 0: + theme->set_icon(name_edit->get_text(), type_edit->get_text(), Ref<Texture2D>()); + break; + case 1: + theme->set_stylebox(name_edit->get_text(), type_edit->get_text(), Ref<StyleBox>()); + break; + case 2: + theme->set_font(name_edit->get_text(), type_edit->get_text(), Ref<Font>()); + break; + case 3: + theme->set_color(name_edit->get_text(), type_edit->get_text(), Color()); + break; + case 4: + theme->set_constant(name_edit->get_text(), type_edit->get_text(), 0); + break; } } break; @@ -376,11 +396,21 @@ void ThemeEditor::_dialog_cbk() { case POPUP_REMOVE: { switch (type_select->get_selected()) { - case 0: theme->clear_icon(name_edit->get_text(), type_edit->get_text()); break; - case 1: theme->clear_stylebox(name_edit->get_text(), type_edit->get_text()); break; - case 2: theme->clear_font(name_edit->get_text(), type_edit->get_text()); break; - case 3: theme->clear_color(name_edit->get_text(), type_edit->get_text()); break; - case 4: theme->clear_constant(name_edit->get_text(), type_edit->get_text()); break; + case 0: + theme->clear_icon(name_edit->get_text(), type_edit->get_text()); + break; + case 1: + theme->clear_stylebox(name_edit->get_text(), type_edit->get_text()); + break; + case 2: + theme->clear_font(name_edit->get_text(), type_edit->get_text()); + break; + case 3: + theme->clear_color(name_edit->get_text(), type_edit->get_text()); + break; + case 4: + theme->clear_constant(name_edit->get_text(), type_edit->get_text()); + break; } } break; diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp index c918a799e1..2d1eb54e9a 100644 --- a/editor/project_manager.cpp +++ b/editor/project_manager.cpp @@ -2429,12 +2429,24 @@ ProjectManager::ProjectManager() { #endif } break; - case 1: editor_set_scale(0.75); break; - case 2: editor_set_scale(1.0); break; - case 3: editor_set_scale(1.25); break; - case 4: editor_set_scale(1.5); break; - case 5: editor_set_scale(1.75); break; - case 6: editor_set_scale(2.0); break; + case 1: + editor_set_scale(0.75); + break; + case 2: + editor_set_scale(1.0); + break; + case 3: + editor_set_scale(1.25); + break; + case 4: + editor_set_scale(1.5); + break; + case 5: + editor_set_scale(1.75); + break; + case 6: + editor_set_scale(2.0); + break; default: { editor_set_scale(custom_display_scale); diff --git a/editor/project_settings_editor.cpp b/editor/project_settings_editor.cpp index f069886518..afcba4f67f 100644 --- a/editor/project_settings_editor.cpp +++ b/editor/project_settings_editor.cpp @@ -806,12 +806,23 @@ void ProjectSettingsEditor::_update_actions() { if (mb.is_valid()) { String str = _get_device_string(mb->get_device()) + ", "; switch (mb->get_button_index()) { - case BUTTON_LEFT: str += TTR("Left Button"); break; - case BUTTON_RIGHT: str += TTR("Right Button"); break; - case BUTTON_MIDDLE: str += TTR("Middle Button"); break; - case BUTTON_WHEEL_UP: str += TTR("Wheel Up"); break; - case BUTTON_WHEEL_DOWN: str += TTR("Wheel Down"); break; - default: str += vformat(TTR("%d Button"), mb->get_button_index()); + case BUTTON_LEFT: + str += TTR("Left Button"); + break; + case BUTTON_RIGHT: + str += TTR("Right Button"); + break; + case BUTTON_MIDDLE: + str += TTR("Middle Button"); + break; + case BUTTON_WHEEL_UP: + str += TTR("Wheel Up"); + break; + case BUTTON_WHEEL_DOWN: + str += TTR("Wheel Down"); + break; + default: + str += vformat(TTR("%d Button"), mb->get_button_index()); } action2->set_text(0, str); diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp index 66b7ed7a43..5ee5fbcf9c 100644 --- a/editor/scene_tree_dock.cpp +++ b/editor/scene_tree_dock.cpp @@ -990,8 +990,12 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { } } else { switch (p_tool) { - case TOOL_CREATE_2D_SCENE: new_node = memnew(Node2D); break; - case TOOL_CREATE_3D_SCENE: new_node = memnew(Node3D); break; + case TOOL_CREATE_2D_SCENE: + new_node = memnew(Node2D); + break; + case TOOL_CREATE_3D_SCENE: + new_node = memnew(Node3D); + break; case TOOL_CREATE_USER_INTERFACE: { Control *node = memnew(Control); node->set_anchors_and_margins_preset(PRESET_WIDE); //more useful for resizable UIs. |