diff options
| author | JosJuice <josjuice@gmail.com> | 2017-11-02 17:34:04 +0100 |
|---|---|---|
| committer | JosJuice <josjuice@gmail.com> | 2017-11-03 23:17:36 +0100 |
| commit | 6902bbb696ea7089daded57569cca637a5e69eae (patch) | |
| tree | 55770a92c545cb2aa7914b93d75da47cf4ae9512 /Source/Core/DolphinWX/FrameTools.cpp | |
| parent | 5a6d90900ec2dcf8ebec4182c29019ca5537c89f (diff) | |
When NAND is damaged, show title names from save files
The earlier code always tried to use TitleDatabase for getting
title names, but that didn't work for disc-based games, because
there was no way to get the maker ID.
Diffstat (limited to 'Source/Core/DolphinWX/FrameTools.cpp')
| -rw-r--r-- | Source/Core/DolphinWX/FrameTools.cpp | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/Source/Core/DolphinWX/FrameTools.cpp b/Source/Core/DolphinWX/FrameTools.cpp index c714c7f12c..3c6e21386a 100644 --- a/Source/Core/DolphinWX/FrameTools.cpp +++ b/Source/Core/DolphinWX/FrameTools.cpp @@ -57,11 +57,13 @@ #include "Core/PowerPC/PPCSymbolDB.h" #include "Core/PowerPC/PowerPC.h" #include "Core/State.h" +#include "Core/TitleDatabase.h" #include "Core/WiiUtils.h" #include "DiscIO/Enums.h" #include "DiscIO/NANDImporter.h" #include "DiscIO/VolumeWad.h" +#include "DiscIO/WiiSaveBanner.h" #include "DolphinWX/AboutDolphin.h" #include "DolphinWX/Cheats/CheatsWindow.h" @@ -1331,10 +1333,25 @@ void CFrame::OnCheckNAND(wxCommandEvent&) Core::TitleDatabase title_db; for (const u64 title_id : result.titles_to_remove) { - const std::string name = title_db.GetTitleName(title_id); - title_listings += !name.empty() ? - StringFromFormat("%s (%016" PRIx64 ")", name.c_str(), title_id) : - StringFromFormat("%016" PRIx64, title_id); + title_listings += StringFromFormat("%016" PRIx64, title_id); + + const std::string database_name = title_db.GetChannelName(title_id); + if (!database_name.empty()) + { + title_listings += " - " + database_name; + } + else + { + DiscIO::WiiSaveBanner banner(title_id); + if (banner.IsValid()) + { + title_listings += " - " + banner.GetName(); + const std::string description = banner.GetDescription(); + if (!StripSpaces(description).empty()) + title_listings += " - " + description; + } + } + title_listings += "\n"; } @@ -1344,7 +1361,7 @@ void CFrame::OnCheckNAND(wxCommandEvent&) "By continuing, the following title(s) will be removed:\n\n" "%s" "\nLaunching these titles may also fix the issues."), - title_listings.c_str()); + StrToWxStr(title_listings)); } if (wxMessageBox(message, _("NAND Check"), wxYES_NO) != wxYES) |
