summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorBojidar Marinov <bojidar.marinov.bg@gmail.com>2016-06-21 17:10:02 +0300
committerBojidar Marinov <bojidar.marinov.bg@gmail.com>2016-06-21 17:10:02 +0300
commit1e08387ce032f1af5d60a0af6c05f83c2c7fc1f4 (patch)
treea859d1949f6c6811a1a7957d1d024f403470c009 /tools
parenta2e39c8da00e0c8a1015a6dea8d0989a551ee016 (diff)
Fix project manager category list, small enchancements as well
Diffstat (limited to 'tools')
-rw-r--r--tools/editor/asset_library_editor_plugin.cpp24
-rw-r--r--tools/editor/asset_library_editor_plugin.h1
2 files changed, 22 insertions, 3 deletions
diff --git a/tools/editor/asset_library_editor_plugin.cpp b/tools/editor/asset_library_editor_plugin.cpp
index e6667b1a81..a2448921d7 100644
--- a/tools/editor/asset_library_editor_plugin.cpp
+++ b/tools/editor/asset_library_editor_plugin.cpp
@@ -842,19 +842,33 @@ void EditorAssetLibrary::_request_image(ObjectID p_for,String p_image_url,ImageT
void EditorAssetLibrary::_repository_changed(int p_repository_id) {
host=repository->get_item_metadata(p_repository_id);
print_line(".." + host);
- _api_request("configure", REQUESTING_CONFIG);
+ if(templates_only) {
+ _api_request("configure", REQUESTING_CONFIG, "?type=project");
+ } else {
+ _api_request("configure", REQUESTING_CONFIG);
+ }
}
void EditorAssetLibrary::_support_toggled(int p_support) {
- print_line(support_key[p_support]);
support->get_popup()->set_item_checked(p_support, !support->get_popup()->is_item_checked(p_support));
+ _search();
+}
+
+void EditorAssetLibrary::_rerun_search(int p_ignore) {
+ _search();
}
void EditorAssetLibrary::_search(int p_page) {
String args;
- args=String()+"?sort="+sort_key[sort->get_selected()];
+ if(templates_only) {
+ args += "?type=project&";
+ } else {
+ args += "?";
+ }
+ args+=String()+"sort="+sort_key[sort->get_selected()];
+
String support_list;
for(int i = 0; i < SUPPORT_MAX; i++) {
@@ -1258,6 +1272,7 @@ void EditorAssetLibrary::_bind_methods() {
ObjectTypeDB::bind_method("_asset_file_selected",&EditorAssetLibrary::_asset_file_selected);
ObjectTypeDB::bind_method("_repository_changed",&EditorAssetLibrary::_repository_changed);
ObjectTypeDB::bind_method("_support_toggled",&EditorAssetLibrary::_support_toggled);
+ ObjectTypeDB::bind_method("_rerun_search",&EditorAssetLibrary::_rerun_search);
}
@@ -1325,9 +1340,11 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) {
search_hb2->add_child(sort);
sort->set_h_size_flags(SIZE_EXPAND_FILL);
+ sort->connect("item_selected", this, "_rerun_search");
reverse = memnew( ToolButton );
reverse->set_toggle_mode(true);
+ reverse->connect("toggled", this, "_rerun_search");
//reverse->set_text(TTR("Reverse"));
search_hb2->add_child(reverse);
@@ -1341,6 +1358,7 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) {
search_hb2->add_child(categories);
categories->set_h_size_flags(SIZE_EXPAND_FILL);
//search_hb2->add_spacer();
+ categories->connect("item_selected", this, "_rerun_search");
search_hb2->add_child(memnew(VSeparator));
diff --git a/tools/editor/asset_library_editor_plugin.h b/tools/editor/asset_library_editor_plugin.h
index 7f9514019e..89663aa00b 100644
--- a/tools/editor/asset_library_editor_plugin.h
+++ b/tools/editor/asset_library_editor_plugin.h
@@ -293,6 +293,7 @@ class EditorAssetLibrary : public PanelContainer {
void _manage_plugins();
void _search(int p_page=0);
+ void _rerun_search(int p_ignore);
void _api_request(const String& p_request, RequestType p_request_type, const String &p_arguments="");
void _http_request_completed(int p_status, int p_code, const StringArray& headers, const ByteArray& p_data);
void _http_download_completed(int p_status, int p_code, const StringArray& headers, const ByteArray& p_data);