summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinWX/ISOFile.cpp
diff options
context:
space:
mode:
authorShawn Hoffman <godisgovernment@gmail.com>2016-10-03 05:35:27 -0700
committerShawn Hoffman <godisgovernment@gmail.com>2016-10-03 15:34:49 -0700
commit41e7c43d0d2809bf7f0bc99f6fac4bb4e20539ae (patch)
tree95e0615fe9ddb3228114d0843fba677e3b627e80 /Source/Core/DolphinWX/ISOFile.cpp
parent46b6a32b467f51b5e38e7f9b6c2738bc914627e1 (diff)
NetPlay: add one click host
Add a context menu entry in main game list to host a netplay game based on saved settings. Original commit: commit 91aaa958e6af0275c07b63443938a0be471e0669 Author: Aestek <thib.gilles@gmail.com> Date: Sun Jul 24 14:51:37 2016 +0200
Diffstat (limited to 'Source/Core/DolphinWX/ISOFile.cpp')
-rw-r--r--Source/Core/DolphinWX/ISOFile.cpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/Source/Core/DolphinWX/ISOFile.cpp b/Source/Core/DolphinWX/ISOFile.cpp
index 7173a6aeda..1b986c02c6 100644
--- a/Source/Core/DolphinWX/ISOFile.cpp
+++ b/Source/Core/DolphinWX/ISOFile.cpp
@@ -330,6 +330,41 @@ std::string GameListItem::GetName() const
return name + ext;
}
+std::string GameListItem::GetUniqueIdentifier() const
+{
+ const DiscIO::Language lang = DiscIO::Language::LANGUAGE_ENGLISH;
+ std::vector<std::string> info;
+ if (!GetUniqueID().empty())
+ info.push_back(GetUniqueID());
+ if (GetRevision() != 0)
+ {
+ std::string rev_str = "Revision ";
+ info.push_back(rev_str + std::to_string((long long)GetRevision()));
+ }
+
+ std::string name(GetName(lang));
+ if (name.empty())
+ name = GetName();
+
+ int disc_number = 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() + ")";
+}
+
std::vector<DiscIO::Language> GameListItem::GetLanguages() const
{
std::vector<DiscIO::Language> languages;