Move the asset library API URLs to the Editor Settings

(cherry picked from commit 925d28e822)
This commit is contained in:
Aaron Franke 2021-01-15 01:25:23 -05:00 committed by Rémi Verschelde
parent 3a3e796485
commit 0e45fb9798
No known key found for this signature in database
GPG Key ID: C3336907360768E1

View File

@ -1423,10 +1423,18 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) {
search_hb2->add_child(memnew(Label(TTR("Site:") + " ")));
repository = memnew(OptionButton);
repository->add_item("godotengine.org");
repository->set_item_metadata(0, "https://godotengine.org/asset-library/api");
repository->add_item("localhost");
repository->set_item_metadata(1, "http://127.0.0.1/asset-library/api");
{
Dictionary default_urls;
default_urls["godotengine.org"] = "https://godotengine.org/asset-library/api";
default_urls["localhost"] = "http://127.0.0.1/asset-library/api";
Dictionary available_urls = _EDITOR_DEF("asset_library/available_urls", default_urls, true);
Array keys = available_urls.keys();
for (int i = 0; i < available_urls.size(); i++) {
String key = keys[i];
repository->add_item(key);
repository->set_item_metadata(i, available_urls[key]);
}
}
repository->connect("item_selected", this, "_repository_changed");