| 345 | |
| 346 | |
| 347 | void Achievements::DownloadImage(std::string url, std::string cache_filename) |
| 348 | { |
| 349 | auto callback = [cache_filename = std::move(cache_filename)](s32 status_code, const std::string& content_type, HTTPDownloader::Request::Data data) { |
| 350 | if (status_code != HTTPDownloader::HTTP_STATUS_OK) |
| 351 | return; |
| 352 | |
| 353 | if (!FileSystem::WriteBinaryFile(cache_filename.c_str(), data.data(), data.size())) |
| 354 | { |
| 355 | Console.Error("Failed to write badge image to '%s'", cache_filename.c_str()); |
| 356 | return; |
| 357 | } |
| 358 | |
| 359 | ImGuiFullscreen::InvalidateCachedTexture(cache_filename); |
| 360 | }; |
| 361 | |
| 362 | s_http_downloader->CreateRequest(std::move(url), std::move(callback)); |
| 363 | } |
| 364 | |
| 365 | bool Achievements::IsActive() |
| 366 | { |
nothing calls this directly
no test coverage detected