1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-09 12:50:35 +00:00

Automatically display the installer after downloading an asset

- To make things easier to follow, display the asset name in
  confirmation dialogs.
- Display the number of conflicting files in the asset extraction dialog.

This reduces the number of clicks required to install an asset.

(cherry picked from commit 2708fcf13d)
This commit is contained in:
Hugo Locurcio
2021-04-06 17:37:55 +02:00
committed by Rémi Verschelde
parent 86e5893755
commit 9343ee5c2b
3 changed files with 41 additions and 8 deletions

View File

@@ -374,6 +374,9 @@ void EditorAssetLibraryItemDownload::_http_download_completed(int p_status, int
progress->set_modulate(Color(0, 0, 0, 0));
set_process(false);
// Automatically prompt for installation once the download is completed.
_install();
}
void EditorAssetLibraryItemDownload::configure(const String &p_title, int p_asset_id, const Ref<Texture> &p_preview, const String &p_download_url, const String &p_sha256_hash) {
@@ -460,6 +463,7 @@ void EditorAssetLibraryItemDownload::_install() {
return;
}
asset_installer->set_asset_name(title->get_text());
asset_installer->open(file, 1);
}
@@ -1276,6 +1280,7 @@ void EditorAssetLibrary::_asset_file_selected(const String &p_file) {
}
asset_installer = memnew(EditorAssetInstaller);
asset_installer->set_asset_name(p_file.get_basename());
add_child(asset_installer);
asset_installer->open(p_file);
}