diff options
Diffstat (limited to 'editor')
-rw-r--r-- | editor/create_dialog.cpp | 2 | ||||
-rw-r--r-- | editor/debugger/script_editor_debugger.cpp | 4 | ||||
-rw-r--r-- | editor/editor_export.cpp | 2 | ||||
-rw-r--r-- | editor/editor_file_dialog.cpp | 8 | ||||
-rw-r--r-- | editor/editor_layouts_dialog.cpp | 2 | ||||
-rw-r--r-- | editor/editor_node.cpp | 24 | ||||
-rw-r--r-- | editor/editor_node.h | 4 | ||||
-rw-r--r-- | editor/editor_plugin.cpp | 6 | ||||
-rw-r--r-- | editor/editor_plugin.h | 2 | ||||
-rw-r--r-- | editor/filesystem_dock.cpp | 2 | ||||
-rw-r--r-- | editor/node_3d_editor_gizmos.cpp | 4 | ||||
-rw-r--r-- | editor/plugins/node_3d_editor_plugin.cpp | 16 | ||||
-rw-r--r-- | editor/plugins/tile_map_editor_plugin.cpp | 2 | ||||
-rw-r--r-- | editor/project_export.cpp | 2 |
14 files changed, 40 insertions, 40 deletions
diff --git a/editor/create_dialog.cpp b/editor/create_dialog.cpp index 75d57b040f..b28fe400e6 100644 --- a/editor/create_dialog.cpp +++ b/editor/create_dialog.cpp @@ -492,7 +492,7 @@ void CreateDialog::_favorite_selected() { } search_box->set_text(item->get_text(0).get_slicec(' ', 0)); - recent->unselect_all(); + recent->deselect_all(); _update_search(); } diff --git a/editor/debugger/script_editor_debugger.cpp b/editor/debugger/script_editor_debugger.cpp index 80d7934938..6f0d537fa2 100644 --- a/editor/debugger/script_editor_debugger.cpp +++ b/editor/debugger/script_editor_debugger.cpp @@ -802,8 +802,8 @@ void ScriptEditorDebugger::_notification(int p_what) { msg.push_back(true); msg.push_back(cam->get_fov()); } - msg.push_back(cam->get_znear()); - msg.push_back(cam->get_zfar()); + msg.push_back(cam->get_near()); + msg.push_back(cam->get_far()); _put_msg("scene:override_camera_3D:transform", msg); } } diff --git a/editor/editor_export.cpp b/editor/editor_export.cpp index a0876ffa3d..231c143c05 100644 --- a/editor/editor_export.cpp +++ b/editor/editor_export.cpp @@ -398,7 +398,7 @@ Error EditorExportPlatform::_save_zip_file(void *p_userdata, const String &p_pat Ref<ImageTexture> EditorExportPlatform::get_option_icon(int p_index) const { Ref<Theme> theme = EditorNode::get_singleton()->get_editor_theme(); ERR_FAIL_COND_V(theme.is_null(), Ref<ImageTexture>()); - if (EditorNode::get_singleton()->get_viewport()->is_layout_rtl()) { + if (EditorNode::get_singleton()->get_main_control()->is_layout_rtl()) { return theme->get_icon("PlayBackwards", "EditorIcons"); } else { return theme->get_icon("Play", "EditorIcons"); diff --git a/editor/editor_file_dialog.cpp b/editor/editor_file_dialog.cpp index 0719d3f018..55373c47a4 100644 --- a/editor/editor_file_dialog.cpp +++ b/editor/editor_file_dialog.cpp @@ -499,7 +499,7 @@ void EditorFileDialog::_multi_selected(int p_item, bool p_selected) { } void EditorFileDialog::_items_clear_selection() { - item_list->unselect_all(); + item_list->deselect_all(); // If nothing is selected, then block Open button. switch (mode) { @@ -595,7 +595,7 @@ void EditorFileDialog::_item_list_item_rmb_selected(int p_item, const Vector2 &p void EditorFileDialog::_item_list_rmb_clicked(const Vector2 &p_pos) { // Right click on folder background. Deselect all files so that actions are applied on the current folder. for (int i = 0; i < item_list->get_item_count(); i++) { - item_list->unselect(i); + item_list->deselect(i); } item_menu->clear(); @@ -849,7 +849,7 @@ void EditorFileDialog::update_file_list() { } if (favorites->get_current() >= 0) { - favorites->unselect(favorites->get_current()); + favorites->deselect(favorites->get_current()); } favorite->set_pressed(false); @@ -1226,7 +1226,7 @@ void EditorFileDialog::_update_favorites() { if (setthis) { favorite->set_pressed(true); favorites->set_current(favorites->get_item_count() - 1); - recent->unselect_all(); + recent->deselect_all(); } } } diff --git a/editor/editor_layouts_dialog.cpp b/editor/editor_layouts_dialog.cpp index 74f45fa628..71d369be1f 100644 --- a/editor/editor_layouts_dialog.cpp +++ b/editor/editor_layouts_dialog.cpp @@ -119,7 +119,7 @@ EditorLayoutsDialog::EditorLayoutsDialog() { name->set_anchor_and_offset(SIDE_LEFT, Control::ANCHOR_BEGIN, 5); name->set_anchor_and_offset(SIDE_RIGHT, Control::ANCHOR_END, -5); name->connect("gui_input", callable_mp(this, &EditorLayoutsDialog::_line_gui_input)); - name->connect("focus_entered", callable_mp(layout_names, &ItemList::unselect_all)); + name->connect("focus_entered", callable_mp(layout_names, &ItemList::deselect_all)); } void EditorLayoutsDialog::set_name_line_enabled(bool p_enabled) { diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index d883b6c909..4fb34f58bf 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -2745,14 +2745,14 @@ void EditorNode::_screenshot(bool p_use_utc) { } void EditorNode::_save_screenshot(NodePath p_path) { - Control *editor_viewport = EditorInterface::get_singleton()->get_editor_viewport(); - ERR_FAIL_COND_MSG(!editor_viewport, "Cannot get editor viewport."); - Viewport *viewport = editor_viewport->get_viewport(); - ERR_FAIL_COND_MSG(!viewport, "Cannot get editor viewport."); + Control *editor_main_control = EditorInterface::get_singleton()->get_editor_main_control(); + ERR_FAIL_COND_MSG(!editor_main_control, "Cannot get editor main control."); + Viewport *viewport = editor_main_control->get_viewport(); + ERR_FAIL_COND_MSG(!viewport, "Cannot get editor main control viewport."); Ref<ViewportTexture> texture = viewport->get_texture(); - ERR_FAIL_COND_MSG(texture.is_null(), "Cannot get editor viewport texture."); + ERR_FAIL_COND_MSG(texture.is_null(), "Cannot get editor main control viewport texture."); Ref<Image> img = texture->get_data(); - ERR_FAIL_COND_MSG(img.is_null(), "Cannot get editor viewport texture image."); + ERR_FAIL_COND_MSG(img.is_null(), "Cannot get editor main control viewport texture image."); Error error = img->save_png(p_path); ERR_FAIL_COND_MSG(error != OK, "Cannot save screenshot to file '" + p_path + "'."); } @@ -2884,8 +2884,8 @@ void EditorNode::_update_file_menu_closed() { pop->set_item_disabled(pop->get_item_index(FILE_OPEN_PREV), false); } -Control *EditorNode::get_viewport() { - return viewport; +Control *EditorNode::get_main_control() { + return main_control; } void EditorNode::_editor_select(int p_which) { @@ -6041,10 +6041,10 @@ EditorNode::EditorNode() { scene_root->set_disable_input(true); scene_root->set_as_audio_listener_2d(true); - viewport = memnew(VBoxContainer); - viewport->set_v_size_flags(Control::SIZE_EXPAND_FILL); - viewport->add_theme_constant_override("separation", 0); - scene_root_parent->add_child(viewport); + main_control = memnew(VBoxContainer); + main_control->set_v_size_flags(Control::SIZE_EXPAND_FILL); + main_control->add_theme_constant_override("separation", 0); + scene_root_parent->add_child(main_control); HBoxContainer *left_menu_hb = memnew(HBoxContainer); menu_hb->add_child(left_menu_hb); diff --git a/editor/editor_node.h b/editor/editor_node.h index a53ae6934f..9ebc0f522c 100644 --- a/editor/editor_node.h +++ b/editor/editor_node.h @@ -255,7 +255,7 @@ private: Control *vp_base; HBoxContainer *menu_hb; - Control *viewport; + Control *main_control; MenuButton *file_menu; MenuButton *project_menu; MenuButton *debug_menu; @@ -728,7 +728,7 @@ public: bool is_changing_scene() const; static EditorLog *get_log() { return singleton->log; } - Control *get_viewport(); + Control *get_main_control(); void set_edited_scene(Node *p_scene); diff --git a/editor/editor_plugin.cpp b/editor/editor_plugin.cpp index a84f26193a..76912c8925 100644 --- a/editor/editor_plugin.cpp +++ b/editor/editor_plugin.cpp @@ -152,8 +152,8 @@ void EditorInterface::set_main_screen_editor(const String &p_name) { EditorNode::get_singleton()->select_editor_by_name(p_name); } -Control *EditorInterface::get_editor_viewport() { - return EditorNode::get_singleton()->get_viewport(); +Control *EditorInterface::get_editor_main_control() { + return EditorNode::get_singleton()->get_main_control(); } void EditorInterface::edit_resource(const Ref<Resource> &p_resource) { @@ -319,7 +319,7 @@ void EditorInterface::_bind_methods() { ClassDB::bind_method(D_METHOD("get_edited_scene_root"), &EditorInterface::get_edited_scene_root); ClassDB::bind_method(D_METHOD("get_resource_previewer"), &EditorInterface::get_resource_previewer); ClassDB::bind_method(D_METHOD("get_resource_filesystem"), &EditorInterface::get_resource_file_system); - ClassDB::bind_method(D_METHOD("get_editor_viewport"), &EditorInterface::get_editor_viewport); + ClassDB::bind_method(D_METHOD("get_editor_main_control"), &EditorInterface::get_editor_main_control); ClassDB::bind_method(D_METHOD("make_mesh_previews", "meshes", "preview_size"), &EditorInterface::_make_mesh_previews); ClassDB::bind_method(D_METHOD("select_file", "file"), &EditorInterface::select_file); ClassDB::bind_method(D_METHOD("get_selected_path"), &EditorInterface::get_selected_path); diff --git a/editor/editor_plugin.h b/editor/editor_plugin.h index 03908b43ca..1697b79216 100644 --- a/editor/editor_plugin.h +++ b/editor/editor_plugin.h @@ -69,7 +69,7 @@ protected: public: static EditorInterface *get_singleton() { return singleton; } - Control *get_editor_viewport(); + Control *get_editor_main_control(); void edit_resource(const Ref<Resource> &p_resource); void open_scene_from_path(const String &scene_path); void reload_scene_from_path(const String &scene_path); diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index 1efa38c181..e7a621eee6 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -2447,7 +2447,7 @@ void FileSystemDock::_file_list_rmb_select(int p_item, const Vector2 &p_pos) { continue; } if (files->get_item_text(p_item) == "..") { - files->unselect(i); + files->deselect(i); continue; } paths.push_back(files->get_item_metadata(i)); diff --git a/editor/node_3d_editor_gizmos.cpp b/editor/node_3d_editor_gizmos.cpp index 1d09ad8a4c..71ceff7fee 100644 --- a/editor/node_3d_editor_gizmos.cpp +++ b/editor/node_3d_editor_gizmos.cpp @@ -633,7 +633,7 @@ bool EditorNode3DGizmo::intersect_ray(Camera3D *p_camera, const Point2 &p_point, tcp = a; } - if (camp.distance_to(tcp) < p_camera->get_znear()) { + if (camp.distance_to(tcp) < p_camera->get_near()) { continue; } cp = tcp; @@ -1357,7 +1357,7 @@ void Camera3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { case Camera3D::PROJECTION_FRUSTUM: { float hsize = camera->get_size() / 2.0; - Vector3 side = Vector3(hsize, 0, -camera->get_znear()).normalized(); + Vector3 side = Vector3(hsize, 0, -camera->get_near()).normalized(); Vector3 nside = side; nside.x = -nside.x; Vector3 up = Vector3(0, side.x, 0); diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp index d92ee48247..c88c6f488e 100644 --- a/editor/plugins/node_3d_editor_plugin.cpp +++ b/editor/plugins/node_3d_editor_plugin.cpp @@ -2210,8 +2210,8 @@ void Node3DEditorViewport::set_freelook_active(bool active_now) { } void Node3DEditorViewport::scale_cursor_distance(real_t scale) { - real_t min_distance = MAX(camera->get_znear() * 4, ZOOM_FREELOOK_MIN); - real_t max_distance = MIN(camera->get_zfar() / 4, ZOOM_FREELOOK_MAX); + real_t min_distance = MAX(camera->get_near() * 4, ZOOM_FREELOOK_MIN); + real_t max_distance = MIN(camera->get_far() / 4, ZOOM_FREELOOK_MAX); if (unlikely(min_distance > max_distance)) { cursor.distance = (min_distance + max_distance) / 2; } else { @@ -2223,8 +2223,8 @@ void Node3DEditorViewport::scale_cursor_distance(real_t scale) { } void Node3DEditorViewport::scale_freelook_speed(real_t scale) { - real_t min_speed = MAX(camera->get_znear() * 4, ZOOM_FREELOOK_MIN); - real_t max_speed = MIN(camera->get_zfar() / 4, ZOOM_FREELOOK_MAX); + real_t min_speed = MAX(camera->get_near() * 4, ZOOM_FREELOOK_MIN); + real_t max_speed = MIN(camera->get_far() / 4, ZOOM_FREELOOK_MAX); if (unlikely(min_speed > max_speed)) { freelook_speed = (min_speed + max_speed) / 2; } else { @@ -2715,8 +2715,8 @@ void Node3DEditorViewport::_draw() { if (is_freelook_active()) { // Show speed - real_t min_speed = MAX(camera->get_znear() * 4, ZOOM_FREELOOK_MIN); - real_t max_speed = MIN(camera->get_zfar() / 4, ZOOM_FREELOOK_MAX); + real_t min_speed = MAX(camera->get_near() * 4, ZOOM_FREELOOK_MIN); + real_t max_speed = MIN(camera->get_far() / 4, ZOOM_FREELOOK_MAX); real_t scale_length = (max_speed - min_speed); if (!Math::is_zero_approx(scale_length)) { @@ -2736,8 +2736,8 @@ void Node3DEditorViewport::_draw() { } else { // Show zoom - real_t min_distance = MAX(camera->get_znear() * 4, ZOOM_FREELOOK_MIN); - real_t max_distance = MIN(camera->get_zfar() / 4, ZOOM_FREELOOK_MAX); + real_t min_distance = MAX(camera->get_near() * 4, ZOOM_FREELOOK_MIN); + real_t max_distance = MIN(camera->get_far() / 4, ZOOM_FREELOOK_MAX); real_t scale_length = (max_distance - min_distance); if (!Math::is_zero_approx(scale_length)) { diff --git a/editor/plugins/tile_map_editor_plugin.cpp b/editor/plugins/tile_map_editor_plugin.cpp index 7351136593..860b974632 100644 --- a/editor/plugins/tile_map_editor_plugin.cpp +++ b/editor/plugins/tile_map_editor_plugin.cpp @@ -262,7 +262,7 @@ Vector<int> TileMapEditor::get_selected_tiles() const { } void TileMapEditor::set_selected_tiles(Vector<int> p_tiles) { - palette->unselect_all(); + palette->deselect_all(); for (int i = p_tiles.size() - 1; i >= 0; i--) { int idx = palette->find_metadata(p_tiles[i]); diff --git a/editor/project_export.cpp b/editor/project_export.cpp index 4eb1b76d63..c0f2f25465 100644 --- a/editor/project_export.cpp +++ b/editor/project_export.cpp @@ -196,7 +196,7 @@ void ProjectExportDialog::_edit_preset(int p_index) { export_path->hide(); runnable->set_disabled(true); parameters->edit(nullptr); - presets->unselect_all(); + presets->deselect_all(); duplicate_preset->set_disabled(true); delete_preset->set_disabled(true); sections->hide(); |