Fix Editor Description tooltip not changing until scene is reopened

You still need to select another node to see the tooltip updated first,
but you no longer need to save and reopen the scene to view the updated
tooltip.
This commit is contained in:
Hugo Locurcio 2022-09-22 18:29:11 +02:00
parent d01ac9c736
commit 9f026d5274
No known key found for this signature in database
GPG Key ID: 39E8F8BE30B0A49C
1 changed files with 9 additions and 0 deletions

View File

@ -1987,7 +1987,16 @@ String Node::get_scene_file_path() const {
} }
void Node::set_editor_description(const String &p_editor_description) { void Node::set_editor_description(const String &p_editor_description) {
if (data.editor_description == p_editor_description) {
return;
}
data.editor_description = 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();
}
} }
String Node::get_editor_description() const { String Node::get_editor_description() const {