* Show the content list window with a given set of content * @param cv the content to show, or nullptr when it has to search for itself * @param type1 the first type to (only) show or #CONTENT_TYPE_END to show all. * @param type2 the second type to (only) show in addition to type1. If type2 is != #CONTENT_TYPE_END, then also type1 should be != #CONTENT_TYPE_END. * If type2 != #CONTENT_TYPE_E
| 1115 | * If type2 != #CONTENT_TYPE_END, then type1 != type2 must be true. |
| 1116 | */ |
| 1117 | void ShowNetworkContentListWindow(ContentVector *cv, ContentType type1, ContentType type2) |
| 1118 | { |
| 1119 | #if defined(WITH_ZLIB) |
| 1120 | ContentTypes types{}; |
| 1121 | _network_content_client.Clear(); |
| 1122 | if (cv == nullptr) { |
| 1123 | assert(type1 != CONTENT_TYPE_END || type2 == CONTENT_TYPE_END); |
| 1124 | assert(type1 == CONTENT_TYPE_END || type1 != type2); |
| 1125 | _network_content_client.RequestContentList(type1); |
| 1126 | if (type2 != CONTENT_TYPE_END) _network_content_client.RequestContentList(type2); |
| 1127 | |
| 1128 | if (type1 != CONTENT_TYPE_END) types.Set(type1); |
| 1129 | if (type2 != CONTENT_TYPE_END) types.Set(type2); |
| 1130 | } else { |
| 1131 | _network_content_client.RequestContentList(cv, true); |
| 1132 | } |
| 1133 | |
| 1134 | CloseWindowById(WC_NETWORK_WINDOW, WN_NETWORK_WINDOW_CONTENT_LIST); |
| 1135 | new NetworkContentListWindow(_network_content_list_desc, cv != nullptr, types); |
| 1136 | #else |
| 1137 | ShowErrorMessage( |
| 1138 | GetEncodedString(STR_CONTENT_NO_ZLIB), |
| 1139 | GetEncodedString(STR_CONTENT_NO_ZLIB_SUB), |
| 1140 | WL_ERROR); |
| 1141 | #endif /* WITH_ZLIB */ |
| 1142 | } |
no test coverage detected