summaryrefslogtreecommitdiff
path: root/editor/scene_tree_editor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/scene_tree_editor.cpp')
-rw-r--r--editor/scene_tree_editor.cpp28
1 files changed, 23 insertions, 5 deletions
diff --git a/editor/scene_tree_editor.cpp b/editor/scene_tree_editor.cpp
index 43f540e688..f1fc4eb950 100644
--- a/editor/scene_tree_editor.cpp
+++ b/editor/scene_tree_editor.cpp
@@ -299,16 +299,34 @@ bool SceneTreeEditor::_add_nodes(Node *p_node, TreeItem *p_parent) {
if (p_node == get_scene_node() && p_node->get_scene_inherited_state().is_valid()) {
item->add_button(0, get_icon("InstanceOptions", "EditorIcons"), BUTTON_SUBSCENE, false, TTR("Open in Editor"));
- item->set_tooltip(0, TTR("Inherits:") + " " + p_node->get_scene_inherited_state()->get_path() + "\n" + TTR("Type:") + " " + p_node->get_class());
- } else if (p_node != get_scene_node() && p_node->get_filename() != "" && can_open_instance) {
+ String tooltip = TTR("Inherits:") + " " + p_node->get_scene_inherited_state()->get_path() + "\n" + TTR("Type:") + " " + p_node->get_class();
+ if (p_node->get_editor_description() != String()) {
+ tooltip += "\n\n" + p_node->get_editor_description();
+ }
+
+ item->set_tooltip(0, tooltip);
+ } else if (p_node != get_scene_node() && p_node->get_filename() != "" && can_open_instance) {
item->add_button(0, get_icon("InstanceOptions", "EditorIcons"), BUTTON_SUBSCENE, false, TTR("Open in Editor"));
- item->set_tooltip(0, TTR("Instance:") + " " + p_node->get_filename() + "\n" + TTR("Type:") + " " + p_node->get_class());
+
+ String tooltip = TTR("Instance:") + " " + p_node->get_filename() + "\n" + TTR("Type:") + " " + p_node->get_class();
+ if (p_node->get_editor_description() != String()) {
+ tooltip += "\n\n" + p_node->get_editor_description();
+ }
+
+ item->set_tooltip(0, tooltip);
} else {
StringName type = EditorNode::get_singleton()->get_object_custom_type_name(p_node);
- if (type == StringName())
+ if (type == StringName()) {
type = p_node->get_class();
- item->set_tooltip(0, String(p_node->get_name()) + "\n" + TTR("Type:") + " " + type);
+ }
+
+ String tooltip = TTR("Type:") + " " + type;
+ if (p_node->get_editor_description() != String()) {
+ tooltip += "\n\n" + p_node->get_editor_description();
+ }
+
+ item->set_tooltip(0, tooltip);
}
if (can_open_instance && undo_redo) { //Show buttons only when necessary(SceneTreeDock) to avoid crashes