Separate banner and volume name getting functions. Game properties now shows the correct "banner" name in more cases.

This commit is contained in:
Jordan Woyak
2013-03-03 18:29:56 -06:00
parent a30636cb88
commit 6026b29844
4 changed files with 54 additions and 31 deletions

View File

@ -22,7 +22,6 @@
#include "NetPlay.h"
#include "NetWindow.h"
#include "Frame.h"
#include "ConfigManager.h"
#include <sstream>
#include <string>
@ -39,11 +38,14 @@ NetPlayDiag *NetPlayDiag::npd = NULL;
std::string BuildGameName(const GameListItem& game)
{
auto const selected_lang = SConfig::GetInstance().m_LocalCoreStartupParameter.SelectedLanguage;
// Lang needs to be consistent
auto const lang = 0;
// TODO: this should use the name from the volume not the banner
// (I seems banner name can sometimes depend on save contents)
return game.GetName(selected_lang) + " (" + game.GetUniqueID() + ")";
std::string name(game.GetBannerName(lang));
if (name.empty())
name = game.GetVolumeName(lang);
return name + " (" + game.GetUniqueID() + ")";
}
void FillWithGameNames(wxListBox* game_lbox, const CGameListCtrl& game_list)