summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
Diffstat (limited to 'editor')
-rw-r--r--editor/animation_bezier_editor.cpp2
-rw-r--r--editor/animation_track_editor.cpp4
-rw-r--r--editor/animation_track_editor_plugins.cpp2
-rw-r--r--editor/code_editor.cpp4
-rw-r--r--editor/editor_audio_buses.cpp2
-rw-r--r--editor/editor_file_dialog.cpp2
-rw-r--r--editor/editor_help.cpp2
-rw-r--r--editor/editor_inspector.cpp4
-rw-r--r--editor/editor_node.cpp2
-rw-r--r--editor/editor_properties.cpp2
-rw-r--r--editor/editor_spin_slider.cpp2
-rw-r--r--editor/plugins/animation_player_editor_plugin.cpp2
-rw-r--r--editor/plugins/asset_library_editor_plugin.cpp18
-rw-r--r--editor/plugins/canvas_item_editor_plugin.cpp2
-rw-r--r--editor/plugins/mesh_editor_plugin.cpp2
-rw-r--r--editor/plugins/node_3d_editor_plugin.cpp10
-rw-r--r--editor/plugins/script_editor_plugin.cpp2
-rw-r--r--editor/plugins/texture_layered_editor_plugin.cpp2
-rw-r--r--editor/project_manager.cpp18
-rw-r--r--editor/project_manager.h1
-rw-r--r--editor/scene_tree_dock.cpp4
-rw-r--r--editor/settings_config_dialog.cpp2
22 files changed, 84 insertions, 7 deletions
diff --git a/editor/animation_bezier_editor.cpp b/editor/animation_bezier_editor.cpp
index 92b4683018..ab8ae71904 100644
--- a/editor/animation_bezier_editor.cpp
+++ b/editor/animation_bezier_editor.cpp
@@ -602,6 +602,8 @@ void AnimationBezierTrackEdit::_select_at_anim(const Ref<Animation> &p_anim, int
}
void AnimationBezierTrackEdit::_gui_input(const Ref<InputEvent> &p_event) {
+ ERR_FAIL_COND(p_event.is_null());
+
if (p_event->is_pressed()) {
if (ED_GET_SHORTCUT("animation_editor/duplicate_selection")->is_shortcut(p_event)) {
duplicate_selection();
diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp
index 4274fb993f..4fe2d2bb2a 100644
--- a/editor/animation_track_editor.cpp
+++ b/editor/animation_track_editor.cpp
@@ -1641,6 +1641,8 @@ void AnimationTimelineEdit::_play_position_draw() {
}
void AnimationTimelineEdit::_gui_input(const Ref<InputEvent> &p_event) {
+ ERR_FAIL_COND(p_event.is_null());
+
Ref<InputEventMouseButton> mb = p_event;
if (mb.is_valid() && mb->is_pressed() && mb->get_button_index() == MOUSE_BUTTON_LEFT && hsize_rect.has_point(mb->get_position())) {
@@ -2522,6 +2524,8 @@ String AnimationTrackEdit::get_tooltip(const Point2 &p_pos) const {
}
void AnimationTrackEdit::_gui_input(const Ref<InputEvent> &p_event) {
+ ERR_FAIL_COND(p_event.is_null());
+
if (p_event->is_pressed()) {
if (ED_GET_SHORTCUT("animation_editor/duplicate_selection")->is_shortcut(p_event)) {
emit_signal("duplicate_request");
diff --git a/editor/animation_track_editor_plugins.cpp b/editor/animation_track_editor_plugins.cpp
index 1028d34fb2..506a327ffc 100644
--- a/editor/animation_track_editor_plugins.cpp
+++ b/editor/animation_track_editor_plugins.cpp
@@ -1036,6 +1036,8 @@ void AnimationTrackEditTypeAudio::drop_data(const Point2 &p_point, const Variant
}
void AnimationTrackEditTypeAudio::_gui_input(const Ref<InputEvent> &p_event) {
+ ERR_FAIL_COND(p_event.is_null());
+
Ref<InputEventMouseMotion> mm = p_event;
if (!len_resizing && mm.is_valid()) {
bool use_hsize_cursor = false;
diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp
index 11be365f0a..ac8bef817b 100644
--- a/editor/code_editor.cpp
+++ b/editor/code_editor.cpp
@@ -109,6 +109,8 @@ void FindReplaceBar::_notification(int p_what) {
}
void FindReplaceBar::_unhandled_input(const Ref<InputEvent> &p_event) {
+ ERR_FAIL_COND(p_event.is_null());
+
Ref<InputEventKey> k = p_event;
if (!k.is_valid() || !k->is_pressed()) {
return;
@@ -691,6 +693,8 @@ FindReplaceBar::FindReplaceBar() {
// This function should be used to handle shortcuts that could otherwise
// be handled too late if they weren't handled here.
void CodeTextEditor::_input(const Ref<InputEvent> &event) {
+ ERR_FAIL_COND(event.is_null());
+
const Ref<InputEventKey> key_event = event;
if (!key_event.is_valid() || !key_event->is_pressed() || !text_editor->has_focus()) {
return;
diff --git a/editor/editor_audio_buses.cpp b/editor/editor_audio_buses.cpp
index 3a5ebe8e85..e7934bed0a 100644
--- a/editor/editor_audio_buses.cpp
+++ b/editor/editor_audio_buses.cpp
@@ -531,6 +531,8 @@ void EditorAudioBus::_effect_add(int p_which) {
}
void EditorAudioBus::_gui_input(const Ref<InputEvent> &p_event) {
+ ERR_FAIL_COND(p_event.is_null());
+
Ref<InputEventMouseButton> mb = p_event;
if (mb.is_valid() && mb->get_button_index() == MOUSE_BUTTON_RIGHT && mb->is_pressed()) {
Vector2 pos = Vector2(mb->get_position().x, mb->get_position().y);
diff --git a/editor/editor_file_dialog.cpp b/editor/editor_file_dialog.cpp
index f78da9569f..75815fa750 100644
--- a/editor/editor_file_dialog.cpp
+++ b/editor/editor_file_dialog.cpp
@@ -125,6 +125,8 @@ void EditorFileDialog::_notification(int p_what) {
}
void EditorFileDialog::_unhandled_input(const Ref<InputEvent> &p_event) {
+ ERR_FAIL_COND(p_event.is_null());
+
Ref<InputEventKey> k = p_event;
if (k.is_valid()) {
diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp
index 283713cd3c..a747652a2f 100644
--- a/editor/editor_help.cpp
+++ b/editor/editor_help.cpp
@@ -1908,6 +1908,8 @@ void FindBar::_hide_bar() {
}
void FindBar::_unhandled_input(const Ref<InputEvent> &p_event) {
+ ERR_FAIL_COND(p_event.is_null());
+
Ref<InputEventKey> k = p_event;
if (k.is_valid()) {
if (k->is_pressed() && (rich_text_label->has_focus() || is_a_parent_of(get_focus_owner()))) {
diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp
index 70d1a514b5..236e0f1abb 100644
--- a/editor/editor_inspector.cpp
+++ b/editor/editor_inspector.cpp
@@ -682,6 +682,8 @@ bool EditorProperty::is_selected() const {
}
void EditorProperty::_gui_input(const Ref<InputEvent> &p_event) {
+ ERR_FAIL_COND(p_event.is_null());
+
if (property == StringName()) {
return;
}
@@ -1354,6 +1356,8 @@ void EditorInspectorSection::setup(const String &p_section, const String &p_labe
}
void EditorInspectorSection::_gui_input(const Ref<InputEvent> &p_event) {
+ ERR_FAIL_COND(p_event.is_null());
+
if (!foldable) {
return;
}
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index 21f1d05304..cc9080c923 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -390,6 +390,8 @@ void EditorNode::_update_title() {
}
void EditorNode::_unhandled_input(const Ref<InputEvent> &p_event) {
+ ERR_FAIL_COND(p_event.is_null());
+
Ref<InputEventKey> k = p_event;
if (k.is_valid() && k->is_pressed() && !k->is_echo()) {
EditorPlugin *old_editor = editor_plugin_screen;
diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp
index f46d677aec..7b3ab4738a 100644
--- a/editor/editor_properties.cpp
+++ b/editor/editor_properties.cpp
@@ -3282,7 +3282,7 @@ void EditorInspectorDefaultPlugin::parse_begin(Object *p_object) {
}
bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Type p_type, const String &p_path, PropertyHint p_hint, const String &p_hint_text, int p_usage, bool p_wide) {
- float default_float_step = EDITOR_GET("interface/inspector/default_float_step");
+ double default_float_step = EDITOR_GET("interface/inspector/default_float_step");
switch (p_type) {
// atomic types
diff --git a/editor/editor_spin_slider.cpp b/editor/editor_spin_slider.cpp
index c09d78826c..8577ccb9db 100644
--- a/editor/editor_spin_slider.cpp
+++ b/editor/editor_spin_slider.cpp
@@ -47,6 +47,8 @@ String EditorSpinSlider::get_text_value() const {
}
void EditorSpinSlider::_gui_input(const Ref<InputEvent> &p_event) {
+ ERR_FAIL_COND(p_event.is_null());
+
if (read_only) {
return;
}
diff --git a/editor/plugins/animation_player_editor_plugin.cpp b/editor/plugins/animation_player_editor_plugin.cpp
index 03481dfb38..612a8f30a4 100644
--- a/editor/plugins/animation_player_editor_plugin.cpp
+++ b/editor/plugins/animation_player_editor_plugin.cpp
@@ -1219,6 +1219,8 @@ void AnimationPlayerEditor::_onion_skinning_menu(int p_option) {
}
void AnimationPlayerEditor::_unhandled_key_input(const Ref<InputEvent> &p_ev) {
+ ERR_FAIL_COND(p_ev.is_null());
+
Ref<InputEventKey> k = p_ev;
if (is_visible_in_tree() && k.is_valid() && k->is_pressed() && !k->is_echo() && !k->get_alt() && !k->get_control() && !k->get_metakey()) {
switch (k->get_keycode()) {
diff --git a/editor/plugins/asset_library_editor_plugin.cpp b/editor/plugins/asset_library_editor_plugin.cpp
index 1345adc8ee..fd47d9964e 100644
--- a/editor/plugins/asset_library_editor_plugin.cpp
+++ b/editor/plugins/asset_library_editor_plugin.cpp
@@ -557,8 +557,15 @@ void EditorAssetLibrary::_notification(int p_what) {
error_label->raise();
} break;
case NOTIFICATION_VISIBILITY_CHANGED: {
- if (is_visible() && initial_loading) {
- _repository_changed(0); // Update when shown for the first time.
+ if (is_visible()) {
+ // Focus the search box automatically when switching to the Templates tab (in the Project Manager)
+ // or switching to the AssetLib tab (in the editor).
+ // The Project Manager's project filter box is automatically focused in the project manager code.
+ filter->grab_focus();
+
+ if (initial_loading) {
+ _repository_changed(0); // Update when shown for the first time.
+ }
}
} break;
case NOTIFICATION_PROCESS: {
@@ -606,6 +613,8 @@ void EditorAssetLibrary::_update_repository_options() {
}
void EditorAssetLibrary::_unhandled_key_input(const Ref<InputEvent> &p_event) {
+ ERR_FAIL_COND(p_event.is_null());
+
const Ref<InputEventKey> key = p_event;
if (key.is_valid() && key->is_pressed()) {
@@ -1332,6 +1341,11 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) {
library_main->add_theme_constant_override("separation", 10 * EDSCALE);
filter = memnew(LineEdit);
+ if (templates_only) {
+ filter->set_placeholder(TTR("Search templates, projects, and demos"));
+ } else {
+ filter->set_placeholder(TTR("Search assets (excluding templates, projects, and demos)"));
+ }
search_hb->add_child(filter);
filter->set_h_size_flags(Control::SIZE_EXPAND_FILL);
filter->connect("text_changed", callable_mp(this, &EditorAssetLibrary::_search_text_changed));
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp
index d4e06aa9ca..b678197037 100644
--- a/editor/plugins/canvas_item_editor_plugin.cpp
+++ b/editor/plugins/canvas_item_editor_plugin.cpp
@@ -472,6 +472,8 @@ float CanvasItemEditor::snap_angle(float p_target, float p_start) const {
}
void CanvasItemEditor::_unhandled_key_input(const Ref<InputEvent> &p_ev) {
+ ERR_FAIL_COND(p_ev.is_null());
+
Ref<InputEventKey> k = p_ev;
if (!is_visible_in_tree()) {
diff --git a/editor/plugins/mesh_editor_plugin.cpp b/editor/plugins/mesh_editor_plugin.cpp
index 77719104b1..9d29c31522 100644
--- a/editor/plugins/mesh_editor_plugin.cpp
+++ b/editor/plugins/mesh_editor_plugin.cpp
@@ -33,6 +33,8 @@
#include "editor/editor_scale.h"
void MeshEditor::_gui_input(Ref<InputEvent> p_event) {
+ ERR_FAIL_COND(p_event.is_null());
+
Ref<InputEventMouseMotion> mm = p_event;
if (mm.is_valid() && mm->get_button_mask() & MOUSE_BUTTON_MASK_LEFT) {
rot_x -= mm->get_relative().y * 0.01;
diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp
index 81c59fc0a9..cbe0133034 100644
--- a/editor/plugins/node_3d_editor_plugin.cpp
+++ b/editor/plugins/node_3d_editor_plugin.cpp
@@ -185,6 +185,8 @@ void ViewportRotationControl::_get_sorted_axis(Vector<Axis2D> &r_axis) {
}
void ViewportRotationControl::_gui_input(Ref<InputEvent> p_event) {
+ ERR_FAIL_COND(p_event.is_null());
+
const Ref<InputEventMouseButton> mb = p_event;
if (mb.is_valid() && mb->get_button_index() == MOUSE_BUTTON_LEFT) {
Vector2 pos = mb->get_position();
@@ -1472,7 +1474,7 @@ void Node3DEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
Vector3 ray_pos = _get_ray_pos(m->get_position());
Vector3 ray = _get_ray(m->get_position());
- float snap = EDITOR_GET("interface/inspector/default_float_step");
+ double snap = EDITOR_GET("interface/inspector/default_float_step");
int snap_step_decimals = Math::range_step_decimals(snap);
switch (_edit.mode) {
@@ -1766,7 +1768,7 @@ void Node3DEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
Vector3 y_axis = (click - _edit.center).normalized();
Vector3 x_axis = plane.normal.cross(y_axis).normalized();
- float angle = Math::atan2(x_axis.dot(intersection - _edit.center), y_axis.dot(intersection - _edit.center));
+ double angle = Math::atan2(x_axis.dot(intersection - _edit.center), y_axis.dot(intersection - _edit.center));
if (_edit.snap || spatial_editor->is_snap_enabled()) {
snap = spatial_editor->get_rotate_snap();
@@ -4192,6 +4194,8 @@ Node3DEditorViewport::~Node3DEditorViewport() {
//////////////////////////////////////////////////////////////
void Node3DEditorViewportContainer::_gui_input(const Ref<InputEvent> &p_event) {
+ ERR_FAIL_COND(p_event.is_null());
+
Ref<InputEventMouseButton> mb = p_event;
if (mb.is_valid() && mb->get_button_index() == MOUSE_BUTTON_LEFT) {
@@ -6159,6 +6163,8 @@ void Node3DEditor::snap_selected_nodes_to_floor() {
}
void Node3DEditor::_unhandled_key_input(Ref<InputEvent> p_event) {
+ ERR_FAIL_COND(p_event.is_null());
+
if (!is_visible_in_tree()) {
return;
}
diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp
index b298474406..58e6717a3d 100644
--- a/editor/plugins/script_editor_plugin.cpp
+++ b/editor/plugins/script_editor_plugin.cpp
@@ -2706,6 +2706,8 @@ void ScriptEditor::drop_data_fw(const Point2 &p_point, const Variant &p_data, Co
}
void ScriptEditor::_unhandled_key_input(const Ref<InputEvent> &p_event) {
+ ERR_FAIL_COND(p_event.is_null());
+
if (!is_visible_in_tree() || !p_event->is_pressed() || p_event->is_echo()) {
return;
}
diff --git a/editor/plugins/texture_layered_editor_plugin.cpp b/editor/plugins/texture_layered_editor_plugin.cpp
index 265d4ccc1e..89ed98d53e 100644
--- a/editor/plugins/texture_layered_editor_plugin.cpp
+++ b/editor/plugins/texture_layered_editor_plugin.cpp
@@ -35,6 +35,8 @@
#include "editor/editor_settings.h"
void TextureLayeredEditor::_gui_input(Ref<InputEvent> p_event) {
+ ERR_FAIL_COND(p_event.is_null());
+
Ref<InputEventMouseMotion> mm = p_event;
if (mm.is_valid() && mm->get_button_mask() & MOUSE_BUTTON_MASK_LEFT) {
y_rot += -mm->get_relative().x * 0.01;
diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp
index eda9499783..595110f7b3 100644
--- a/editor/project_manager.cpp
+++ b/editor/project_manager.cpp
@@ -1882,6 +1882,8 @@ void ProjectManager::_update_project_buttons() {
}
void ProjectManager::_unhandled_key_input(const Ref<InputEvent> &p_ev) {
+ ERR_FAIL_COND(p_ev.is_null());
+
Ref<InputEventKey> k = p_ev;
if (k.is_valid()) {
@@ -2331,6 +2333,17 @@ void ProjectManager::_on_order_option_changed(int p_idx) {
}
}
+void ProjectManager::_on_tab_changed(int p_tab) {
+ if (p_tab == 0) { // Projects
+ // Automatically grab focus when the user moves from the Templates tab
+ // back to the Projects tab.
+ search_box->grab_focus();
+ }
+
+ // The Templates tab's search field is focused on display in the asset
+ // library editor plugin code.
+}
+
void ProjectManager::_on_search_term_changed(const String &p_term) {
_project_list->set_search_term(p_term);
_project_list->sort_projects();
@@ -2456,6 +2469,7 @@ ProjectManager::ProjectManager() {
center_box->add_child(tabs);
tabs->set_anchors_and_offsets_preset(Control::PRESET_WIDE);
tabs->set_tab_align(TabContainer::ALIGN_LEFT);
+ tabs->connect("tab_changed", callable_mp(this, &ProjectManager::_on_tab_changed));
HBoxContainer *projects_hb = memnew(HBoxContainer);
projects_hb->set_name(TTR("Projects"));
@@ -2472,8 +2486,8 @@ ProjectManager::ProjectManager() {
search_tree_vb->add_child(hb);
search_box = memnew(LineEdit);
- search_box->set_placeholder(TTR("Search"));
- search_box->set_tooltip(TTR("The search box filters projects by name and last path component.\nTo filter projects by name and full path, the query must contain at least one `/` character."));
+ search_box->set_placeholder(TTR("Filter projects"));
+ search_box->set_tooltip(TTR("This field filters projects by name and last path component.\nTo filter projects by name and full path, the query must contain at least one `/` character."));
search_box->connect("text_changed", callable_mp(this, &ProjectManager::_on_search_term_changed));
search_box->set_h_size_flags(Control::SIZE_EXPAND_FILL);
hb->add_child(search_box);
diff --git a/editor/project_manager.h b/editor/project_manager.h
index 6dc0e67cba..49d672a8e5 100644
--- a/editor/project_manager.h
+++ b/editor/project_manager.h
@@ -116,6 +116,7 @@ class ProjectManager : public Control {
void _files_dropped(PackedStringArray p_files, int p_screen);
void _on_order_option_changed(int p_idx);
+ void _on_tab_changed(int p_tab);
void _on_search_term_changed(const String &p_term);
protected:
diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp
index 57d517b7e9..c62e9cbe5f 100644
--- a/editor/scene_tree_dock.cpp
+++ b/editor/scene_tree_dock.cpp
@@ -61,6 +61,8 @@ void SceneTreeDock::_quick_open() {
}
void SceneTreeDock::_input(Ref<InputEvent> p_event) {
+ ERR_FAIL_COND(p_event.is_null());
+
Ref<InputEventMouseButton> mb = p_event;
if (mb.is_valid() && !mb->is_pressed() && mb->get_button_index() == MOUSE_BUTTON_LEFT) {
@@ -69,6 +71,8 @@ void SceneTreeDock::_input(Ref<InputEvent> p_event) {
}
void SceneTreeDock::_unhandled_key_input(Ref<InputEvent> p_event) {
+ ERR_FAIL_COND(p_event.is_null());
+
if (get_focus_owner() && get_focus_owner()->is_text_field()) {
return;
}
diff --git a/editor/settings_config_dialog.cpp b/editor/settings_config_dialog.cpp
index 3852c389c7..3be2136a20 100644
--- a/editor/settings_config_dialog.cpp
+++ b/editor/settings_config_dialog.cpp
@@ -139,6 +139,8 @@ void EditorSettingsDialog::_notification(int p_what) {
}
void EditorSettingsDialog::_unhandled_input(const Ref<InputEvent> &p_event) {
+ ERR_FAIL_COND(p_event.is_null());
+
const Ref<InputEventKey> k = p_event;
if (k.is_valid() && k->is_pressed()) {