1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-06 12:20:30 +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.
This commit is contained in:
Hugo Locurcio
2021-04-06 17:37:55 +02:00
parent b27683111b
commit 2708fcf13d
3 changed files with 41 additions and 8 deletions

View File

@@ -369,6 +369,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<Texture2D> &p_preview, const String &p_download_url, const String &p_sha256_hash) {
@@ -456,6 +459,7 @@ void EditorAssetLibraryItemDownload::_install() {
return;
}
asset_installer->set_asset_name(title->get_text());
asset_installer->open(file, 1);
}
@@ -1296,6 +1300,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);
}