diff options
Diffstat (limited to 'Source/Core/DolphinWX/ISOFile.cpp')
| -rw-r--r-- | Source/Core/DolphinWX/ISOFile.cpp | 46 |
1 files changed, 28 insertions, 18 deletions
diff --git a/Source/Core/DolphinWX/ISOFile.cpp b/Source/Core/DolphinWX/ISOFile.cpp index 3312394dda..886837af52 100644 --- a/Source/Core/DolphinWX/ISOFile.cpp +++ b/Source/Core/DolphinWX/ISOFile.cpp @@ -124,27 +124,19 @@ GameListItem::GameListItem(const std::string& _rFileName, const std::unordered_m if (IsValid()) { - IniFile ini = SConfig::LoadGameIni(m_UniqueID, m_Revision); - ini.GetIfExists("EmuState", "EmulationStateId", &m_emu_state); - ini.GetIfExists("EmuState", "EmulationIssues", &m_issues); - m_has_custom_name = ini.GetIfExists("EmuState", "Title", &m_custom_name); + std::string game_id = m_UniqueID; - if (!m_has_custom_name) + // Ignore publisher ID for WAD files + if (m_Platform == DiscIO::IVolume::WII_WAD && game_id.size() > 4) + game_id.erase(4); + + auto it = custom_titles.find(game_id); + if (it != custom_titles.end()) { - std::string game_id = m_UniqueID; - - // Ignore publisher ID for WAD files - if (m_Platform == DiscIO::IVolume::WII_WAD && game_id.size() > 4) - game_id.erase(4); - - auto end = custom_titles.end(); - auto it = custom_titles.find(game_id); - if (it != end) - { - m_custom_name = it->second; - m_has_custom_name = true; - } + m_custom_name_titles_txt = it->second; } + + ReloadINI(); } if (!IsValid() && IsElfOrDol()) @@ -183,6 +175,24 @@ GameListItem::~GameListItem() { } +void GameListItem::ReloadINI() +{ + if (!IsValid()) + return; + + IniFile ini = SConfig::LoadGameIni(m_UniqueID, m_Revision); + ini.GetIfExists("EmuState", "EmulationStateId", &m_emu_state, 0); + ini.GetIfExists("EmuState", "EmulationIssues", &m_issues, std::string()); + + m_custom_name.clear(); + m_has_custom_name = ini.GetIfExists("EmuState", "Title", &m_custom_name); + if (!m_has_custom_name && !m_custom_name_titles_txt.empty()) + { + m_custom_name = m_custom_name_titles_txt; + m_has_custom_name = true; + } +} + bool GameListItem::LoadFromCache() { return CChunkFileReader::Load<GameListItem>(CreateCacheFilename(), CACHE_REVISION, *this); |
