コード例 #1
0
ファイル: NetWindow.cpp プロジェクト: FioraAeterna/dolphin
static std::string BuildGameName(const GameListItem& game)
{
	// Lang needs to be consistent
	DiscIO::IVolume::ELanguage const lang = DiscIO::IVolume::LANGUAGE_ENGLISH;

	std::string name(game.GetName(lang));

	if (game.GetRevision() != 0)
		return name + " (" + game.GetUniqueID() + ", Revision " + std::to_string((long long)game.GetRevision()) + ")";
	else
		return name + " (" + game.GetUniqueID() + ")";
}
コード例 #2
0
ファイル: NetWindow.cpp プロジェクト: crudelios/dolphin
static std::string BuildGameName(const GameListItem& game)
{
	// Lang needs to be consistent
	auto const lang = 0;

	std::string name(game.GetName(lang));

	if (game.GetRevision() != 0)
		return name + " (" + game.GetUniqueID() + ", Revision " + std::to_string((long long)game.GetRevision()) + ")";
	else
		return name + " (" + game.GetUniqueID() + ")";
}
コード例 #3
0
ファイル: NetWindow.cpp プロジェクト: CarlKenner/dolphin
static std::string BuildGameName(const GameListItem& game)
{
    // Lang needs to be consistent
    DiscIO::IVolume::ELanguage const lang = DiscIO::IVolume::LANGUAGE_ENGLISH;
    std::vector<std::string> info;
    if (!game.GetUniqueID().empty())
        info.push_back(game.GetUniqueID());
    if (game.GetRevision() != 0)
    {
        std::string rev_str = "Revision ";
        info.push_back(rev_str + std::to_string((long long)game.GetRevision()));
    }

    std::string name(game.GetName(lang));
    if (name.empty())
        name = game.GetName();

    int disc_number = game.GetDiscNumber() + 1;

    std::string lower_name = name;
    std::transform(lower_name.begin(), lower_name.end(), lower_name.begin(), ::tolower);
    if (disc_number > 1 &&
            lower_name.find(std::string(wxString::Format("disc %i", disc_number))) == std::string::npos &&
            lower_name.find(std::string(wxString::Format("disc%i", disc_number))) == std::string::npos)
    {
        std::string disc_text = "Disc ";
        info.push_back(disc_text + std::to_string(disc_number));
    }
    if (info.empty())
        return name;
    std::ostringstream ss;
    std::copy(info.begin(), info.end() - 1, std::ostream_iterator<std::string>(ss, ", "));
    ss << info.back();
    return name + " (" + ss.str() + ")";
}