support updating tooltip after editor description change

This commit is contained in:
jsjtxietian
2023-11-14 13:00:41 +08:00
parent 64150060f8
commit 4680ced5fa
4 changed files with 63 additions and 31 deletions
+2 -5
View File
@@ -2298,11 +2298,7 @@ void Node::set_editor_description(const String &p_editor_description) {
}
data.editor_description = p_editor_description;
if (Engine::get_singleton()->is_editor_hint() && is_inside_tree()) {
// Update tree so the tooltip in the Scene tree dock is also updated in the editor.
get_tree()->tree_changed();
}
emit_signal(SNAME("editor_description_changed"), this);
}
String Node::get_editor_description() const {
@@ -3500,6 +3496,7 @@ void Node::_bind_methods() {
ADD_SIGNAL(MethodInfo("child_order_changed"));
ADD_SIGNAL(MethodInfo("replacing_by", PropertyInfo(Variant::OBJECT, "node", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT, "Node")));
ADD_SIGNAL(MethodInfo("editor_description_changed", PropertyInfo(Variant::OBJECT, "node", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT, "Node")));
ADD_PROPERTY(PropertyInfo(Variant::STRING_NAME, "name", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NONE), "set_name", "get_name");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "unique_name_in_owner", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NO_EDITOR), "set_unique_name_in_owner", "is_unique_name_in_owner");