diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-07-13 11:17:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-13 11:17:53 +0200 |
commit | a37155153308e0e529532d5e6e1a1e6158f2c3a8 (patch) | |
tree | e76e56afe747233196c1023ad70396ef03035761 /editor/plugins | |
parent | 51b0aed4b722407c02c7685cefe6b403df7e2806 (diff) | |
parent | 2708fcf13d611a9be6e15f6bd578b0f54d8bccbf (diff) |
Merge pull request #47667 from Calinou/assetlib-auto-install-prompt
Automatically display the installer after downloading an asset
Diffstat (limited to 'editor/plugins')
-rw-r--r-- | editor/plugins/asset_library_editor_plugin.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/editor/plugins/asset_library_editor_plugin.cpp b/editor/plugins/asset_library_editor_plugin.cpp index cd61ebd418..596b2a6527 100644 --- a/editor/plugins/asset_library_editor_plugin.cpp +++ b/editor/plugins/asset_library_editor_plugin.cpp @@ -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); } |