Merge pull request #48609 from akien-mga/3.x-fix-tileset-signal-error

TileSet: Fix signal disconnect error in some situation
This commit is contained in:
Rémi Verschelde 2021-05-10 16:04:39 +02:00 committed by GitHub
commit 71f8b910ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -3602,11 +3602,15 @@ void TileSetEditorPlugin::make_visible(bool p_visible) {
if (p_visible) { if (p_visible) {
tileset_editor_button->show(); tileset_editor_button->show();
editor->make_bottom_panel_item_visible(tileset_editor); editor->make_bottom_panel_item_visible(tileset_editor);
get_tree()->connect("idle_frame", tileset_editor, "_on_workspace_process"); if (!get_tree()->is_connected("idle_frame", tileset_editor, "_on_workspace_process")) {
get_tree()->connect("idle_frame", tileset_editor, "_on_workspace_process");
}
} else { } else {
editor->hide_bottom_panel(); editor->hide_bottom_panel();
tileset_editor_button->hide(); tileset_editor_button->hide();
get_tree()->disconnect("idle_frame", tileset_editor, "_on_workspace_process"); if (get_tree()->is_connected("idle_frame", tileset_editor, "_on_workspace_process")) {
get_tree()->disconnect("idle_frame", tileset_editor, "_on_workspace_process");
}
} }
} }