فهرست منبع

Merge pull request #31906 from Calinou/assetlib-refresh-once

Refresh the asset library only once on startup
Rémi Verschelde 6 سال پیش
والد
کامیت
169c1dc9ef
2فایلهای تغییر یافته به همراه5 افزوده شده و 1 حذف شده
  1. 4 1
      editor/plugins/asset_library_editor_plugin.cpp
  2. 1 0
      editor/plugins/asset_library_editor_plugin.h

+ 4 - 1
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);
 

+ 1 - 0
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,