diff options
Diffstat (limited to 'editor/project_manager.cpp')
-rw-r--r-- | editor/project_manager.cpp | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp index 9c745e6a41..d74cfe4ec0 100644 --- a/editor/project_manager.cpp +++ b/editor/project_manager.cpp @@ -186,7 +186,8 @@ private: if (mode == MODE_IMPORT || mode == MODE_RENAME) { if (!valid_path.is_empty() && !d->file_exists("project.godot")) { if (valid_path.ends_with(".zip")) { - zlib_filefunc_def io = zipio_create_io(); + Ref<FileAccess> io_fa; + zlib_filefunc_def io = zipio_create_io(&io_fa); unzFile pkg = unzOpen2(valid_path.utf8().get_data(), &io); if (!pkg) { @@ -499,7 +500,8 @@ private: zip_path = project_path->get_text(); } - zlib_filefunc_def io = zipio_create_io(); + Ref<FileAccess> io_fa; + zlib_filefunc_def io = zipio_create_io(&io_fa); unzFile pkg = unzOpen2(zip_path.utf8().get_data(), &io); if (!pkg) { @@ -1062,7 +1064,7 @@ public: void select_first_visible_project(); void erase_selected_projects(bool p_delete_project_contents); Vector<Item> get_selected_projects() const; - const Set<String> &get_selected_project_keys() const; + const RBSet<String> &get_selected_project_keys() const; void ensure_project_visible(int p_index); int get_single_selected_index() const; bool is_any_project_missing() const; @@ -1088,7 +1090,7 @@ private: String _search_term; FilterOption _order_option; - Set<String> _selected_project_keys; + RBSet<String> _selected_project_keys; String _last_clicked; // Project key VBoxContainer *_scroll_children; int _icon_load_index; @@ -1256,7 +1258,7 @@ void ProjectList::load_projects() { List<PropertyInfo> properties; EditorSettings::get_singleton()->get_property_list(&properties); - Set<String> favorites; + RBSet<String> favorites; // Find favourites... for (const PropertyInfo &E : properties) { String property_key = E.name; @@ -1401,7 +1403,7 @@ void ProjectList::create_project_item_control(int p_index) { title->set_clip_text(true); title_hb->add_child(title); - String unsupported_features_str = Variant(item.unsupported_features).operator String().trim_prefix("[").trim_suffix("]"); + String unsupported_features_str = String(", ").join(item.unsupported_features); int length = unsupported_features_str.length(); if (length > 0) { Label *unsupported_label = memnew(Label(unsupported_features_str)); @@ -1502,7 +1504,7 @@ void ProjectList::sort_projects() { update_dock_menu(); } -const Set<String> &ProjectList::get_selected_project_keys() const { +const RBSet<String> &ProjectList::get_selected_project_keys() const { // Faster if that's all you need return _selected_project_keys; } @@ -2095,9 +2097,9 @@ void ProjectManager::_open_selected_projects() { // This is especially important for the HTML5 project manager. loading_label->set_modulate(Color(1, 1, 1)); - const Set<String> &selected_list = _project_list->get_selected_project_keys(); + const RBSet<String> &selected_list = _project_list->get_selected_project_keys(); - for (const Set<String>::Element *E = selected_list.front(); E; E = E->next()) { + for (const RBSet<String>::Element *E = selected_list.front(); E; E = E->next()) { const String &selected = E->get(); String path = EditorSettings::get_singleton()->get("projects/" + selected); String conf = path.plus_file("project.godot"); @@ -2144,7 +2146,7 @@ void ProjectManager::_open_selected_projects() { } void ProjectManager::_open_selected_projects_ask() { - const Set<String> &selected_list = _project_list->get_selected_project_keys(); + const RBSet<String> &selected_list = _project_list->get_selected_project_keys(); if (selected_list.size() < 1) { return; @@ -2207,7 +2209,7 @@ void ProjectManager::_open_selected_projects_ask() { } } if (!unsupported_features.is_empty()) { - String unsupported_features_str = Variant(unsupported_features).operator String().trim_prefix("[").trim_suffix("]"); + String unsupported_features_str = String(", ").join(unsupported_features); warning_message += vformat(TTR("Warning: This project uses the following features not supported by this build of Godot:\n\n%s\n\n"), unsupported_features_str); } warning_message += TTR("Open anyway? Project will be modified."); @@ -2259,7 +2261,7 @@ void ProjectManager::_run_project_confirm() { } void ProjectManager::_run_project() { - const Set<String> &selected_list = _project_list->get_selected_project_keys(); + const RBSet<String> &selected_list = _project_list->get_selected_project_keys(); if (selected_list.size() < 1) { return; @@ -2319,13 +2321,13 @@ void ProjectManager::_import_project() { } void ProjectManager::_rename_project() { - const Set<String> &selected_list = _project_list->get_selected_project_keys(); + const RBSet<String> &selected_list = _project_list->get_selected_project_keys(); if (selected_list.size() == 0) { return; } - for (Set<String>::Element *E = selected_list.front(); E; E = E->next()) { + for (RBSet<String>::Element *E = selected_list.front(); E; E = E->next()) { const String &selected = E->get(); String path = EditorSettings::get_singleton()->get("projects/" + selected); npdialog->set_project_path(path); @@ -2345,7 +2347,7 @@ void ProjectManager::_erase_missing_projects_confirm() { } void ProjectManager::_erase_project() { - const Set<String> &selected_list = _project_list->get_selected_project_keys(); + const RBSet<String> &selected_list = _project_list->get_selected_project_keys(); if (selected_list.size() == 0) { return; @@ -2402,7 +2404,7 @@ void ProjectManager::_files_dropped(PackedStringArray p_files) { _install_project(p_files[0], file.substr(0, file.length() - 4).capitalize()); return; } - Set<String> folders_set; + RBSet<String> folders_set; Ref<DirAccess> da = DirAccess::create(DirAccess::ACCESS_FILESYSTEM); for (int i = 0; i < p_files.size(); i++) { String file = p_files[i]; @@ -2410,7 +2412,7 @@ void ProjectManager::_files_dropped(PackedStringArray p_files) { } if (folders_set.size() > 0) { PackedStringArray folders; - for (Set<String>::Element *E = folders_set.front(); E; E = E->next()) { + for (RBSet<String>::Element *E = folders_set.front(); E; E = E->next()) { folders.push_back(E->get()); } |