Show NKitness in file format string

To make people more aware that they're not using a normal disc image.
This commit is contained in:
JosJuice
2020-10-06 13:00:58 +02:00
parent dcaf2b9625
commit d64fc67b04
7 changed files with 22 additions and 11 deletions

View File

@ -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;
}
}
}