diff options
Diffstat (limited to 'editor')
-rw-r--r-- | editor/code_editor.cpp | 2 | ||||
-rw-r--r-- | editor/editor_data.cpp | 7 | ||||
-rw-r--r-- | editor/localization_editor.cpp | 6 | ||||
-rw-r--r-- | editor/plugins/animation_blend_tree_editor_plugin.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/canvas_item_editor_plugin.cpp | 4 | ||||
-rw-r--r-- | editor/plugins/curve_editor_plugin.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/gpu_particles_2d_editor_plugin.cpp | 22 | ||||
-rw-r--r-- | editor/plugins/gpu_particles_2d_editor_plugin.h | 2 | ||||
-rw-r--r-- | editor/plugins/node_3d_editor_gizmos.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/tiles/tile_map_editor.cpp | 5 | ||||
-rw-r--r-- | editor/project_manager.cpp | 2 | ||||
-rw-r--r-- | editor/scene_tree_dock.cpp | 4 |
12 files changed, 48 insertions, 12 deletions
diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp index bfcd2dd4ca..1f01e9d4cf 100644 --- a/editor/code_editor.cpp +++ b/editor/code_editor.cpp @@ -1314,10 +1314,10 @@ void CodeTextEditor::delete_lines() { int count = Math::abs(to_line - from_line) + 1; text_editor->set_caret_line(from_line, false); + text_editor->deselect(); for (int i = 0; i < count; i++) { _delete_line(from_line); } - text_editor->deselect(); } else { _delete_line(text_editor->get_caret_line()); } diff --git a/editor/editor_data.cpp b/editor/editor_data.cpp index a163b468e6..6fd8cb47ea 100644 --- a/editor/editor_data.cpp +++ b/editor/editor_data.cpp @@ -893,8 +893,13 @@ bool EditorData::script_class_is_parent(const String &p_class, const String &p_i if (!ScriptServer::is_global_class(p_class)) { return false; } - String base = script_class_get_base(p_class); + Ref<Script> script = script_class_load_script(p_class); + if (script.is_null()) { + return false; + } + + String base = script_class_get_base(p_class); Ref<Script> base_script = script->get_base_script(); while (p_inherits != base) { diff --git a/editor/localization_editor.cpp b/editor/localization_editor.cpp index 5c25e6aae9..7458f617c3 100644 --- a/editor/localization_editor.cpp +++ b/editor/localization_editor.cpp @@ -497,7 +497,7 @@ void LocalizationEditor::update_translations() { TreeItem *t = translation_filter->create_item(root); t->set_cell_mode(0, TreeItem::CELL_MODE_CHECK); - t->set_text(0, n); + t->set_text(0, vformat("[%s] %s", l, n)); t->set_editable(0, true); t->set_tooltip(0, l); t->set_checked(0, is_checked); @@ -537,7 +537,7 @@ void LocalizationEditor::update_translations() { if (langnames.length() > 0) { langnames += ","; } - langnames += names[i]; + langnames += vformat("[%s] %s", langs[i], names[i]); translation_locales_idxs_remap.write[l_idx] = i; l_idx++; } @@ -546,7 +546,7 @@ void LocalizationEditor::update_translations() { if (i > 0) { langnames += ","; } - langnames += names[i]; + langnames += vformat("[%s] %s", langs[i], names[i]); } } diff --git a/editor/plugins/animation_blend_tree_editor_plugin.cpp b/editor/plugins/animation_blend_tree_editor_plugin.cpp index 75d2bed1b2..c4a938f91d 100644 --- a/editor/plugins/animation_blend_tree_editor_plugin.cpp +++ b/editor/plugins/animation_blend_tree_editor_plugin.cpp @@ -945,7 +945,7 @@ AnimationNodeBlendTreeEditor::AnimationNodeBlendTreeEditor() { add_node->set_text(TTR("Add Node...")); graph->get_zoom_hbox()->move_child(add_node, 0); add_node->get_popup()->connect("id_pressed", callable_mp(this, &AnimationNodeBlendTreeEditor::_add_node)); - add_node->connect("about_to_popup", callable_mp(this, &AnimationNodeBlendTreeEditor::_update_options_menu)); + add_node->connect("about_to_popup", callable_mp(this, &AnimationNodeBlendTreeEditor::_update_options_menu), varray(false)); add_options.push_back(AddOption("Animation", "AnimationNodeAnimation")); add_options.push_back(AddOption("OneShot", "AnimationNodeOneShot", 2)); diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index b6722b9d48..d9ce7cfd94 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -5267,7 +5267,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { select_button->set_pressed(true); select_button->set_shortcut(ED_SHORTCUT("canvas_item_editor/select_mode", TTR("Select Mode"), Key::Q)); select_button->set_shortcut_context(this); - select_button->set_tooltip(keycode_get_string((Key)KeyModifierMask::CMD) + TTR("Drag: Rotate selected node around pivot.") + "\n" + TTR("Alt+Drag: Move selected node.") + "\n" + TTR("V: Set selected node's pivot position.") + "\n" + TTR("Alt+RMB: Show list of all nodes at position clicked, including locked.") + "\n" + keycode_get_string((Key)KeyModifierMask::CMD) + TTR("RMB: Add node at position clicked.")); + select_button->set_tooltip(keycode_get_string((Key)KeyModifierMask::CMD) + TTR("Drag: Rotate selected node around pivot.") + "\n" + TTR("Alt+Drag: Move selected node.") + "\n" + keycode_get_string((Key)KeyModifierMask::CMD) + TTR("Alt+Drag: Scale selected node.") + "\n" + TTR("V: Set selected node's pivot position.") + "\n" + TTR("Alt+RMB: Show list of all nodes at position clicked, including locked.") + "\n" + keycode_get_string((Key)KeyModifierMask::CMD) + TTR("RMB: Add node at position clicked.")); hb->add_child(memnew(VSeparator)); @@ -5296,7 +5296,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { scale_button->connect("pressed", callable_mp(this, &CanvasItemEditor::_button_tool_select), make_binds(TOOL_SCALE)); scale_button->set_shortcut(ED_SHORTCUT("canvas_item_editor/scale_mode", TTR("Scale Mode"), Key::S)); scale_button->set_shortcut_context(this); - scale_button->set_tooltip(TTR("Scale Mode")); + scale_button->set_tooltip(TTR("Shift: Scale proportionally.")); hb->add_child(memnew(VSeparator)); diff --git a/editor/plugins/curve_editor_plugin.cpp b/editor/plugins/curve_editor_plugin.cpp index daf34903e6..d99d6709ad 100644 --- a/editor/plugins/curve_editor_plugin.cpp +++ b/editor/plugins/curve_editor_plugin.cpp @@ -460,7 +460,7 @@ void CurveEditor::remove_point(int index) { Curve::Point p = _curve_ref->get_point(index); ur.add_do_method(*_curve_ref, "remove_point", index); - ur.add_undo_method(*_curve_ref, "add_point", p.pos, p.left_tangent, p.right_tangent, p.left_mode, p.right_mode); + ur.add_undo_method(*_curve_ref, "add_point", p.position, p.left_tangent, p.right_tangent, p.left_mode, p.right_mode); if (index == _selected_point) { set_selected_point(-1); diff --git a/editor/plugins/gpu_particles_2d_editor_plugin.cpp b/editor/plugins/gpu_particles_2d_editor_plugin.cpp index 44c789b145..4b50f484a4 100644 --- a/editor/plugins/gpu_particles_2d_editor_plugin.cpp +++ b/editor/plugins/gpu_particles_2d_editor_plugin.cpp @@ -57,6 +57,27 @@ void GPUParticles2DEditorPlugin::_file_selected(const String &p_file) { emission_mask->popup_centered(); } +void GPUParticles2DEditorPlugin::_selection_changed() { + List<Node *> selected_nodes = editor->get_editor_selection()->get_selected_node_list(); + + if (selected_particles.is_empty() && selected_nodes.is_empty()) { + return; + } + + for (GPUParticles2D *SP : selected_particles) { + SP->set_show_visibility_rect(false); + } + selected_particles.clear(); + + for (Node *P : selected_nodes) { + GPUParticles2D *selected_particle = Object::cast_to<GPUParticles2D>(P); + if (selected_particle != nullptr) { + selected_particle->set_show_visibility_rect(true); + selected_particles.push_back(selected_particle); + } + } +} + void GPUParticles2DEditorPlugin::_menu_callback(int p_idx) { switch (p_idx) { case MENU_GENERATE_VISIBILITY_RECT: { @@ -334,6 +355,7 @@ void GPUParticles2DEditorPlugin::_notification(int p_what) { menu->get_popup()->connect("id_pressed", callable_mp(this, &GPUParticles2DEditorPlugin::_menu_callback)); menu->set_icon(menu->get_theme_icon(SNAME("GPUParticles2D"), SNAME("EditorIcons"))); file->connect("file_selected", callable_mp(this, &GPUParticles2DEditorPlugin::_file_selected)); + EditorNode::get_singleton()->get_editor_selection()->connect("selection_changed", callable_mp(this, &GPUParticles2DEditorPlugin::_selection_changed)); } } diff --git a/editor/plugins/gpu_particles_2d_editor_plugin.h b/editor/plugins/gpu_particles_2d_editor_plugin.h index 0b2028b745..bdfc021aa7 100644 --- a/editor/plugins/gpu_particles_2d_editor_plugin.h +++ b/editor/plugins/gpu_particles_2d_editor_plugin.h @@ -56,6 +56,7 @@ class GPUParticles2DEditorPlugin : public EditorPlugin { }; GPUParticles2D *particles; + List<GPUParticles2D *> selected_particles; EditorFileDialog *file; EditorNode *editor; @@ -79,6 +80,7 @@ class GPUParticles2DEditorPlugin : public EditorPlugin { void _menu_callback(int p_idx); void _generate_visibility_rect(); void _generate_emission_mask(); + void _selection_changed(); protected: void _notification(int p_what); diff --git a/editor/plugins/node_3d_editor_gizmos.cpp b/editor/plugins/node_3d_editor_gizmos.cpp index 74fbef3caf..154f9bd6b7 100644 --- a/editor/plugins/node_3d_editor_gizmos.cpp +++ b/editor/plugins/node_3d_editor_gizmos.cpp @@ -2579,7 +2579,7 @@ void CPUParticles3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) { GPUParticles3DGizmoPlugin::GPUParticles3DGizmoPlugin() { Color gizmo_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/particles", Color(0.8, 0.7, 0.4)); create_material("particles_material", gizmo_color); - gizmo_color.a = 0.1; + gizmo_color.a = MAX((gizmo_color.a - 0.2) * 0.02, 0.0); create_material("particles_solid_material", gizmo_color); create_icon_material("particles_icon", Node3DEditor::get_singleton()->get_theme_icon(SNAME("GizmoGPUParticles3D"), SNAME("EditorIcons"))); create_handle_material("handles"); diff --git a/editor/plugins/tiles/tile_map_editor.cpp b/editor/plugins/tiles/tile_map_editor.cpp index 73b1fc7c67..37d52174f9 100644 --- a/editor/plugins/tiles/tile_map_editor.cpp +++ b/editor/plugins/tiles/tile_map_editor.cpp @@ -598,7 +598,10 @@ bool TileMapEditorTilesPlugin::forward_canvas_gui_input(const Ref<InputEvent> &p } if (drag_type == DRAG_TYPE_CLIPBOARD_PASTE) { - // Do nothing. + // Cancel tile pasting on right-click + if (mb->get_button_index() == MouseButton::RIGHT) { + drag_type = DRAG_TYPE_NONE; + } } else if (tool_buttons_group->get_pressed_button() == select_tool_button) { drag_start_mouse_pos = mpos; if (tile_map_selection.has(tile_map->world_to_map(drag_start_mouse_pos)) && !mb->is_shift_pressed()) { diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp index 372a77f67d..9f8a42eccc 100644 --- a/editor/project_manager.cpp +++ b/editor/project_manager.cpp @@ -2743,7 +2743,7 @@ ProjectManager::ProjectManager() { for (int i = 0; i < editor_languages.size(); i++) { String lang = editor_languages[i]; String lang_name = TranslationServer::get_singleton()->get_locale_name(lang); - language_btn->add_item(lang_name + " [" + lang + "]", i); + language_btn->add_item(vformat("[%s] %s", lang, lang_name), i); language_btn->set_item_metadata(i, lang); if (current_lang == lang) { language_btn->select(i); diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp index 611038a947..cf89120beb 100644 --- a/editor/scene_tree_dock.cpp +++ b/editor/scene_tree_dock.cpp @@ -419,6 +419,9 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { if (!selected_item) { selected_item = tree->get_root(); + if (!selected_item) { + break; + } } bool collapsed = _is_collapsed_recursive(selected_item); @@ -1306,6 +1309,7 @@ void SceneTreeDock::_notification(int p_what) { button_instance->set_icon(get_theme_icon(SNAME("Instance"), SNAME("EditorIcons"))); button_create_script->set_icon(get_theme_icon(SNAME("ScriptCreate"), SNAME("EditorIcons"))); button_detach_script->set_icon(get_theme_icon(SNAME("ScriptRemove"), SNAME("EditorIcons"))); + button_tree_menu->set_icon(get_theme_icon(SNAME("GuiTabMenuHl"), SNAME("EditorIcons"))); button_2d->set_icon(get_theme_icon(SNAME("Node2D"), SNAME("EditorIcons"))); button_3d->set_icon(get_theme_icon(SNAME("Node3D"), SNAME("EditorIcons"))); button_ui->set_icon(get_theme_icon(SNAME("Control"), SNAME("EditorIcons"))); |