diff options
| author | Léo Lam <leo@leolam.fr> | 2020-10-14 12:19:53 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-10-14 12:19:53 +0200 |
| commit | b24223c1788c2a898bc5154be919fca7cbfc20d4 (patch) | |
| tree | 33a8a5f7c0d73b78d7036e2acb198698e32a0057 /Source/Core | |
| parent | 5ab95d7f6a4f6c6cd4bd520b791466eeb8967abd (diff) | |
| parent | d64fc67b043e2950674cafe736324f6cf3928711 (diff) | |
Merge pull request #9135 from JosJuice/show-nkit
Show NKitness in file format string
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/DolphinQt/Config/InfoWidget.cpp | 7 | ||||
| -rw-r--r-- | Source/Core/UICommon/GameFile.cpp | 13 | ||||
| -rw-r--r-- | Source/Core/UICommon/GameFile.h | 1 | ||||
| -rw-r--r-- | Source/Core/UICommon/GameFileCache.cpp | 2 |
4 files changed, 17 insertions, 6 deletions
diff --git a/Source/Core/DolphinQt/Config/InfoWidget.cpp b/Source/Core/DolphinQt/Config/InfoWidget.cpp index f76289c3dd..729f6216b7 100644 --- a/Source/Core/DolphinQt/Config/InfoWidget.cpp +++ b/Source/Core/DolphinQt/Config/InfoWidget.cpp @@ -54,10 +54,9 @@ QGroupBox* InfoWidget::CreateFileDetails() } else { - const QString file_format = - QStringLiteral("%1 (%2)") - .arg(QString::fromStdString(DiscIO::GetName(m_game.GetBlobType(), true))) - .arg(QString::fromStdString(file_size)); + const QString file_format = QStringLiteral("%1 (%2)") + .arg(QString::fromStdString(m_game.GetFileFormatName())) + .arg(QString::fromStdString(file_size)); layout->addRow(tr("File Format:"), CreateValueDisplay(file_format)); QString compression = QString::fromStdString(m_game.GetCompressionMethod()); diff --git a/Source/Core/UICommon/GameFile.cpp b/Source/Core/UICommon/GameFile.cpp index ff0fa84798..ba7676ae80 100644 --- a/Source/Core/UICommon/GameFile.cpp +++ b/Source/Core/UICommon/GameFile.cpp @@ -31,6 +31,7 @@ #include "Common/HttpRequest.h" #include "Common/Image.h" #include "Common/IniFile.h" +#include "Common/MsgHandler.h" #include "Common/NandPaths.h" #include "Common/StringUtil.h" #include "Common/Swap.h" @@ -124,6 +125,7 @@ GameFile::GameFile(std::string path) : m_file_path(std::move(path)) m_volume_size = volume->GetSize(); m_volume_size_is_accurate = volume->IsSizeAccurate(); m_is_datel_disc = volume->IsDatelDisc(); + m_is_nkit = volume->IsNKit(); m_internal_name = volume->GetInternalName(); m_game_id = volume->GetGameID(); @@ -146,6 +148,7 @@ GameFile::GameFile(std::string path) : m_file_path(std::move(path)) m_file_size = m_volume_size = File::GetSize(m_file_path); m_volume_size_is_accurate = true; m_is_datel_disc = false; + m_is_nkit = false; m_platform = DiscIO::Platform::ELFOrDOL; m_blob_type = DiscIO::BlobType::DIRECTORY; } @@ -308,6 +311,7 @@ void GameFile::DoState(PointerWrap& p) p.Do(m_volume_size); p.Do(m_volume_size_is_accurate); p.Do(m_is_datel_disc); + p.Do(m_is_nkit); p.Do(m_short_names); p.Do(m_long_names); @@ -659,6 +663,7 @@ std::string GameFile::GetFileFormatName() const { case DiscIO::Platform::WiiWAD: return "WAD"; + case DiscIO::Platform::ELFOrDOL: { std::string extension = GetExtension(); @@ -667,8 +672,14 @@ std::string GameFile::GetFileFormatName() const // substr removes the dot return extension.substr(std::min<size_t>(1, extension.size())); } + default: - return DiscIO::GetName(m_blob_type, true); + { + std::string name = DiscIO::GetName(m_blob_type, true); + if (m_is_nkit) + name = fmt::format(Common::GetStringT("{0} (NKit)"), name); + return name; + } } } diff --git a/Source/Core/UICommon/GameFile.h b/Source/Core/UICommon/GameFile.h index 3aa693507f..5cae441eb3 100644 --- a/Source/Core/UICommon/GameFile.h +++ b/Source/Core/UICommon/GameFile.h @@ -145,6 +145,7 @@ private: u64 m_volume_size{}; bool m_volume_size_is_accurate{}; bool m_is_datel_disc{}; + bool m_is_nkit{}; std::map<DiscIO::Language, std::string> m_short_names; std::map<DiscIO::Language, std::string> m_long_names; diff --git a/Source/Core/UICommon/GameFileCache.cpp b/Source/Core/UICommon/GameFileCache.cpp index c551016d7f..35d4fe3571 100644 --- a/Source/Core/UICommon/GameFileCache.cpp +++ b/Source/Core/UICommon/GameFileCache.cpp @@ -27,7 +27,7 @@ namespace UICommon { -static constexpr u32 CACHE_REVISION = 18; // Last changed in PR 8891 +static constexpr u32 CACHE_REVISION = 19; // Last changed in PR 9135 std::vector<std::string> FindAllGamePaths(const std::vector<std::string>& directories_to_scan, bool recursive_scan) |
