diff options
Diffstat (limited to 'editor')
-rw-r--r-- | editor/create_dialog.cpp | 10 | ||||
-rw-r--r-- | editor/create_dialog.h | 1 | ||||
-rw-r--r-- | editor/editor_help.cpp | 75 | ||||
-rw-r--r-- | editor/export_template_manager.cpp | 16 |
4 files changed, 67 insertions, 35 deletions
diff --git a/editor/create_dialog.cpp b/editor/create_dialog.cpp index 520bf480fd..95b4f7e982 100644 --- a/editor/create_dialog.cpp +++ b/editor/create_dialog.cpp @@ -171,6 +171,9 @@ void CreateDialog::add_type(const String &p_type, HashMap<String, TreeItem *> &p bool is_search_subsequence = search_box->get_text().is_subsequence_ofi(p_type); String to_select_type = *to_select ? (*to_select)->get_text(0) : ""; bool current_item_is_preffered = ClassDB::is_parent_class(p_type, preferred_search_result_type) && !ClassDB::is_parent_class(to_select_type, preferred_search_result_type); + if (*to_select && p_type.length() < (*to_select)->get_text(0).length()) { + current_item_is_preffered = true; + } if (((!*to_select || current_item_is_preffered) && is_search_subsequence) || search_box->get_text() == p_type) { *to_select = item; @@ -211,9 +214,6 @@ void CreateDialog::_update_search() { _parse_fs(EditorFileSystem::get_singleton()->get_filesystem()); */ - List<StringName> type_list; - ClassDB::get_class_list(&type_list); - HashMap<String, TreeItem *> types; TreeItem *root = search_options->create_item(); @@ -293,6 +293,7 @@ void CreateDialog::_update_search() { if (to_select) { to_select->select(0); + search_options->scroll_to_item(to_select); favorite->set_disabled(false); favorite->set_pressed(favorite_list.find(to_select->get_text(0)) != -1); } @@ -615,6 +616,9 @@ void CreateDialog::_bind_methods() { CreateDialog::CreateDialog() { + ClassDB::get_class_list(&type_list); + type_list.sort_custom<StringName::AlphCompare>(); + set_resizable(true); HSplitContainer *hbc = memnew(HSplitContainer); diff --git a/editor/create_dialog.h b/editor/create_dialog.h index 2e4ce9b277..157c126c66 100644 --- a/editor/create_dialog.h +++ b/editor/create_dialog.h @@ -55,6 +55,7 @@ class CreateDialog : public ConfirmationDialog { String base_type; String preferred_search_result_type; EditorHelpBit *help_bit; + List<StringName> type_list; void _item_selected(); diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp index 2c4d3035a4..03cd2c9b6b 100644 --- a/editor/editor_help.cpp +++ b/editor/editor_help.cpp @@ -1045,12 +1045,17 @@ Error EditorHelp::_goto_desc(const String &p_class, int p_vscr) { class_desc->pop(); // end monofont if (cd.signals[i].description != "") { + class_desc->push_font(doc_font); class_desc->push_color(comment_color); - class_desc->add_text(" "); + class_desc->push_indent(1); + // class_desc->add_text(" "); _add_text(cd.signals[i].description); + class_desc->pop(); // indent class_desc->pop(); + class_desc->pop(); // font } class_desc->add_newline(); + class_desc->add_newline(); } class_desc->pop(); @@ -1129,11 +1134,14 @@ Error EditorHelp::_goto_desc(const String &p_class, int p_vscr) { class_desc->pop(); if (enum_list[i].description != "") { class_desc->push_font(doc_font); - class_desc->add_text(" "); + //class_desc->add_text(" "); + class_desc->push_indent(1); class_desc->push_color(comment_color); _add_text(enum_list[i].description); class_desc->pop(); class_desc->pop(); + class_desc->pop(); // indent + class_desc->add_newline(); } class_desc->add_newline(); @@ -1177,11 +1185,14 @@ Error EditorHelp::_goto_desc(const String &p_class, int p_vscr) { class_desc->pop(); if (constants[i].description != "") { class_desc->push_font(doc_font); - class_desc->add_text(" "); + class_desc->push_indent(1); + //class_desc->add_text(" "); class_desc->push_color(comment_color); _add_text(constants[i].description); class_desc->pop(); class_desc->pop(); + class_desc->pop(); // indent + class_desc->add_newline(); } class_desc->add_newline(); @@ -1231,54 +1242,62 @@ Error EditorHelp::_goto_desc(const String &p_class, int p_vscr) { method_line[cd.properties[i].name] = class_desc->get_line_count() - 2; + class_desc->push_table(2); + class_desc->set_table_column_expand(1, 1); + + class_desc->push_cell(); class_desc->push_font(doc_code_font); _add_type(cd.properties[i].type, cd.properties[i].enumeration); - class_desc->add_text(" "); + class_desc->pop(); // font + class_desc->pop(); // cell + + class_desc->push_cell(); + class_desc->push_font(doc_code_font); class_desc->push_color(headline_color); _add_text(cd.properties[i].name); - class_desc->pop(); //color - - class_desc->add_text(" "); + class_desc->pop(); // color + class_desc->pop(); // font + class_desc->pop(); // cell - class_desc->pop(); //font + //class_desc->add_text(" "); if (cd.properties[i].setter != "") { - class_desc->push_font(doc_font); - - class_desc->push_indent(2); - class_desc->push_color(comment_color); - class_desc->add_text("Setter: "); - class_desc->pop(); + class_desc->push_cell(); + class_desc->pop(); // cell + class_desc->push_cell(); + class_desc->push_font(doc_code_font); class_desc->push_color(text_color); class_desc->add_text(cd.properties[i].setter + "(value)"); - class_desc->pop(); //color - - class_desc->pop(); //indent - - class_desc->pop(); //font + class_desc->pop(); // color + class_desc->push_color(comment_color); + class_desc->add_text(" setter"); + class_desc->pop(); // color + class_desc->pop(); // font + class_desc->pop(); // cell } if (cd.properties[i].getter != "") { - class_desc->push_font(doc_font); - - class_desc->push_indent(2); - class_desc->push_color(comment_color); - class_desc->add_text("Getter: "); - class_desc->pop(); + class_desc->push_cell(); + class_desc->pop(); // cell + class_desc->push_cell(); + class_desc->push_font(doc_code_font); class_desc->push_color(text_color); class_desc->add_text(cd.properties[i].getter + "()"); class_desc->pop(); //color - - class_desc->pop(); //indent - + class_desc->push_color(comment_color); + class_desc->add_text(" getter"); + class_desc->pop(); //color class_desc->pop(); //font + class_desc->pop(); //cell } + class_desc->pop(); // table + class_desc->add_newline(); class_desc->push_color(text_color); diff --git a/editor/export_template_manager.cpp b/editor/export_template_manager.cpp index 164d02c580..8641fc7667 100644 --- a/editor/export_template_manager.cpp +++ b/editor/export_template_manager.cpp @@ -127,7 +127,7 @@ void ExportTemplateManager::_download_template(const String &p_version) { template_list_state->set_text(TTR("Retrieving mirrors, please wait..")); template_download_progress->set_max(100); template_download_progress->set_value(0); - request_mirror->request("https://www.godotengine.org/download_mirrors.php?version=" + p_version); + request_mirror->request("https://godotengine.org/mirrorlist/" + p_version + ".json"); template_list_state->show(); template_download_progress->show(); } @@ -319,8 +319,16 @@ void ExportTemplateManager::ok_pressed() { void ExportTemplateManager::_http_download_mirror_completed(int p_status, int p_code, const PoolStringArray &headers, const PoolByteArray &p_data) { - print_line("mirror complete"); - String mirror_str = "{ \"mirrors\":[{\"name\":\"Official\",\"url\":\"http://op.godotengine.org:81/downloads/2.1.4/Godot_v2.1.4-stable_linux_server.64.zip\"}] }"; + if (p_status != HTTPRequest::RESULT_SUCCESS || p_code != 200) { + EditorNode::get_singleton()->show_warning("Error getting the list of mirrors."); + return; + } + + String mirror_str; + { + PoolByteArray::Read r = p_data.read(); + mirror_str.parse_utf8((const char *)r.ptr(), p_data.size()); + } template_list_state->hide(); template_download_progress->hide(); @@ -330,7 +338,7 @@ void ExportTemplateManager::_http_download_mirror_completed(int p_status, int p_ int errline; Error err = JSON::parse(mirror_str, r, errs, errline); if (err != OK) { - EditorNode::get_singleton()->show_warning("Error parsing JSON with mirror list. Please report this issue!"); + EditorNode::get_singleton()->show_warning("Error parsing JSON of mirror list. Please report this issue!"); return; } |