summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-09-02 22:05:29 +0200
committerGitHub <noreply@github.com>2019-09-02 22:05:29 +0200
commit169c1dc9ef85d4d0e4aafe7dfaa7654329b36dda (patch)
tree6a4f9a535166ae6daf15dc94723c018fab9a9a6d
parent244088c76dccf49f3d921f6540517e7075f756eb (diff)
parent6f915d386a292efdb1ba3307d6a0c4d2a592b38b (diff)
Merge pull request #31906 from Calinou/assetlib-refresh-once
Refresh the asset library only once on startup
-rw-r--r--editor/plugins/asset_library_editor_plugin.cpp5
-rw-r--r--editor/plugins/asset_library_editor_plugin.h1
2 files changed, 5 insertions, 1 deletions
diff --git a/editor/plugins/asset_library_editor_plugin.cpp b/editor/plugins/asset_library_editor_plugin.cpp
index 894e5c7298..60b5f017d2 100644
--- a/editor/plugins/asset_library_editor_plugin.cpp
+++ b/editor/plugins/asset_library_editor_plugin.cpp
@@ -586,7 +586,7 @@ void EditorAssetLibrary::_notification(int p_what) {
} break;
case NOTIFICATION_VISIBILITY_CHANGED: {
- if (is_visible()) {
+ if (is_visible() && initial_loading) {
_repository_changed(0); // Update when shown for the first time.
}
} break;
@@ -1133,6 +1133,8 @@ void EditorAssetLibrary::_http_request_completed(int p_status, int p_code, const
} break;
case REQUESTING_SEARCH: {
+ initial_loading = false;
+
// The loading text only needs to be displayed before the first page is loaded
library_loading->hide();
@@ -1328,6 +1330,7 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) {
requesting = REQUESTING_NONE;
templates_only = p_templates_only;
+ initial_loading = true;
VBoxContainer *library_main = memnew(VBoxContainer);
diff --git a/editor/plugins/asset_library_editor_plugin.h b/editor/plugins/asset_library_editor_plugin.h
index b17a6dfe54..6a3158889e 100644
--- a/editor/plugins/asset_library_editor_plugin.h
+++ b/editor/plugins/asset_library_editor_plugin.h
@@ -206,6 +206,7 @@ class EditorAssetLibrary : public PanelContainer {
HTTPRequest *request;
bool templates_only;
+ bool initial_loading;
enum Support {
SUPPORT_OFFICIAL,