From 5eacca38fe1c2be6263692418d90d88872fea7e6 Mon Sep 17 00:00:00 2001 From: Michael Alexsander Date: Thu, 23 Apr 2026 15:29:58 -0300 Subject: [PATCH] Move asset store repo list to the editor settings file and rename it --- doc/classes/EditorSettings.xml | 5 ++++- editor/asset_library/asset_library_editor_plugin.cpp | 7 ++----- editor/settings/editor_settings.cpp | 11 +++++++++-- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/doc/classes/EditorSettings.xml b/doc/classes/EditorSettings.xml index 80d4a751ab..7d35af0b42 100644 --- a/doc/classes/EditorSettings.xml +++ b/doc/classes/EditorSettings.xml @@ -244,7 +244,10 @@ - + + A list of the available URLs that can be chosen in the Asset Store to fetch asset data. With the key being the name, and the value being the URL. + + If [code]true[/code], the Asset Store uses multiple threads for its HTTP requests. This prevents the Asset Store from blocking the main thread for every loaded asset. diff --git a/editor/asset_library/asset_library_editor_plugin.cpp b/editor/asset_library/asset_library_editor_plugin.cpp index 5cd8ed22f0..d403f5ec40 100644 --- a/editor/asset_library/asset_library_editor_plugin.cpp +++ b/editor/asset_library/asset_library_editor_plugin.cpp @@ -55,7 +55,7 @@ #include "scene/resources/style_box_flat.h" static inline void setup_http_request(HTTPRequest *request) { - request->set_use_threads(EDITOR_GET("asset_library/use_threads")); + request->set_use_threads(EDITOR_GET("asset_store/use_threads")); const String proxy_host = EDITOR_GET("network/http_proxy/host"); const int proxy_port = EDITOR_GET("network/http_proxy/port"); @@ -1106,10 +1106,7 @@ void EditorAssetLibrary::_notification(int p_what) { } void EditorAssetLibrary::_update_repository_options() { - // TODO: Move to editor_settings.cpp - Dictionary default_urls; - default_urls["godotengine.org (Official)"] = "https://store.godotengine.org/api/v1"; - Dictionary available_urls = _EDITOR_DEF("asset_library/available_urls", default_urls, true); + Dictionary available_urls = EDITOR_GET("asset_store/available_urls"); repository->clear(); int i = 0; for (const KeyValue &kv : available_urls) { diff --git a/editor/settings/editor_settings.cpp b/editor/settings/editor_settings.cpp index 348ed5d340..36a7a19790 100644 --- a/editor/settings/editor_settings.cpp +++ b/editor/settings/editor_settings.cpp @@ -455,8 +455,13 @@ void EditorSettings::_load_defaults(Ref p_extra_config) { EDITOR_SETTING_USAGE(Variant::STRING, PROPERTY_HINT_ENUM, "interface/editor/localization/editor_language", "auto", lang_hint, PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED | PROPERTY_USAGE_EDITOR_BASIC_SETTING); } - // Asset store - _initial_set("asset_library/use_threads", true); + /* Asset Store */ + + _initial_set("asset_store/use_threads", true); + + Dictionary default_urls; + default_urls["godotengine.org (Official)"] = "https://store.godotengine.org/api/v1"; + _initial_set("asset_store/available_urls", default_urls, true); /* Interface */ @@ -1273,6 +1278,7 @@ void EditorSettings::_handle_setting_compatibility() { erase("run/output/always_close_output_on_stop"); erase("text_editor/theme/line_spacing"); // See GH-106137. erase("interface/editors/show_scene_tree_root_selection"); + erase("asset_library/available_urls"); // Workaround bugged settings treating the previous default as a modified value (see GH-118755). // Handle renamed settings. _rename_setting("interface/editor/editor_language", "interface/editor/localization/editor_language"); @@ -1319,6 +1325,7 @@ void EditorSettings::_handle_setting_compatibility() { _rename_setting("interface/editor/vsync_mode", "interface/editor/display/vsync_mode"); _rename_setting("interface/editor/update_continuously", "interface/editor/display/update_continuously"); _rename_setting("interface/editor/collapse_main_menu", "interface/editor/appearance/collapse_main_menu"); + _rename_setting("asset_library/use_threads", "asset_store/use_threads"); } void EditorSettings::_rename_setting(const String &p_old_name, const String &p_new_name) {