diff --git a/Core/Loaders.cpp b/Core/Loaders.cpp index 26328b1dd9..afd7418160 100644 --- a/Core/Loaders.cpp +++ b/Core/Loaders.cpp @@ -193,6 +193,8 @@ IdentifiedFileType Identify_File(std::string &filename) return FILETYPE_ARCHIVE_RAR; } else if (!strcasecmp(extension.c_str(),".r01")) { return FILETYPE_ARCHIVE_RAR; + } else if (!strcasecmp(extension.substr(1).c_str(), ".7z")) { + return FILETYPE_ARCHIVE_7Z; } return FILETYPE_UNKNOWN; } @@ -268,6 +270,14 @@ bool LoadFile(std::string &filename, std::string *error_string) { #endif break; + case FILETYPE_ARCHIVE_7Z: +#ifdef WIN32 + *error_string = "7z file detected (Require 7-Zip)"; +#else + *error_string = "7z file detected (Require 7-Zip)"; +#endif + break; + case FILETYPE_ISO_MODE2: *error_string = "PSX game image detected."; break; diff --git a/Core/Loaders.h b/Core/Loaders.h index 711b830396..ddf1ee5b43 100644 --- a/Core/Loaders.h +++ b/Core/Loaders.h @@ -37,6 +37,7 @@ enum IdentifiedFileType { // Try to reduce support emails... FILETYPE_ARCHIVE_RAR, FILETYPE_ARCHIVE_ZIP, + FILETYPE_ARCHIVE_7Z, FILETYPE_PSP_PS1_PBP, FILETYPE_ISO_MODE2, diff --git a/UI/GameInfoCache.cpp b/UI/GameInfoCache.cpp index 716c6ec70f..985950b5ff 100644 --- a/UI/GameInfoCache.cpp +++ b/UI/GameInfoCache.cpp @@ -445,6 +445,21 @@ handleELF: } break; + case FILETYPE_ARCHIVE_7Z: + info_->paramSFOLoaded = true; + { + // Read standard icon + size_t sz; + uint8_t *contents = VFSReadFile("7z.png", &sz); + if (contents) { + lock_guard lock(info_->lock); + info_->iconTextureData = std::string((const char *)contents, sz); + info_->iconDataLoaded = true; + } + delete[] contents; + } + break; + case FILETYPE_NORMAL_DIRECTORY: default: info_->paramSFOLoaded = true; diff --git a/UI/MainScreen.cpp b/UI/MainScreen.cpp index ea038156bc..d1a1ac738a 100644 --- a/UI/MainScreen.cpp +++ b/UI/MainScreen.cpp @@ -550,7 +550,7 @@ void GameBrowser::Refresh() { // to a flood of support email... if (allowBrowsing_) { fileInfo.clear(); - path_.GetListing(fileInfo, "zip:rar:r01:"); + path_.GetListing(fileInfo, "zip:rar:r01:7z:"); if (!fileInfo.empty()) { UI::LinearLayout *zl = new UI::LinearLayout(UI::ORIENT_VERTICAL, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT)); zl->SetSpacing(4.0f); diff --git a/assets/7z.png b/assets/7z.png new file mode 100644 index 0000000000..b49535297f Binary files /dev/null and b/assets/7z.png differ diff --git a/lang b/lang index 0644f2d429..e86e58ff66 160000 --- a/lang +++ b/lang @@ -1 +1 @@ -Subproject commit 0644f2d429ad2c3af2a80bed90bd1fe9d8240c37 +Subproject commit e86e58ff6650d6a892e5ffb477691be6961a2363 diff --git a/native b/native index faca4e72ec..428f338f28 160000 --- a/native +++ b/native @@ -1 +1 @@ -Subproject commit faca4e72ecd1f27531d635cf29420498cca36574 +Subproject commit 428f338f28a2909a444e77888ccfce4e1eb55f47 diff --git a/source_assets/image/zip.pdn b/source_assets/image/zip.pdn new file mode 100644 index 0000000000..763b069740 Binary files /dev/null and b/source_assets/image/zip.pdn differ