Skip to content

armgit / godot

Public Imported from GitHub
0

Godot Engine – Multi-platform 2D and 3D game engine

Fix and improve `EditorObjectSelector`'s tooltip

Michael Alexsander246713be5622
diff --git a/editor/gui/editor_object_selector.cpp b/editor/gui/editor_object_selector.cpp
index 82bb00d235a..8430336aff4 100644
--- a/editor/gui/editor_object_selector.cpp
+++ b/editor/gui/editor_object_selector.cpp
@@ -155,7 +155,7 @@ void EditorObjectSelector::update_path() {
}
current_object_label->set_text(name);
- set_tooltip_text(obj->get_class());
+ set_tooltip_text(name + "\n" + vformat(TTR("Type: %s"), obj->get_class()) + "\n" + TTR("Click to open a list of sub-resources."));
}
}
}
@@ -198,6 +198,10 @@ void EditorObjectSelector::_notification(int p_what) {
sub_objects_menu->add_theme_constant_override("icon_max_width", icon_size);
} break;
+ case NOTIFICATION_TRANSLATION_CHANGED: {
+ update_path();
+ } break;
+
case NOTIFICATION_READY: {
connect(SceneStringName(pressed), callable_mp(this, &EditorObjectSelector::_show_popup));
} break;
@@ -241,5 +245,5 @@ EditorObjectSelector::EditorObjectSelector(EditorSelectionHistory *p_history) {
sub_objects_menu->connect("about_to_popup", callable_mp(this, &EditorObjectSelector::_about_to_show));
sub_objects_menu->connect(SceneStringName(id_pressed), callable_mp(this, &EditorObjectSelector::_id_pressed));
- set_tooltip_text(TTR("Open a list of sub-resources."));
+ set_auto_translate(false);
}