Android: Don't show game ID after game title

This commit is contained in:
JosJuice 2020-09-13 15:48:36 +02:00
parent 0dc29c743b
commit 3a0917371e
3 changed files with 10 additions and 1 deletions

View File

@ -780,7 +780,12 @@ JNIEXPORT jstring JNICALL
Java_org_dolphinemu_dolphinemu_NativeLibrary_GetCurrentTitleDescriptionUnchecked(JNIEnv* env,
jobject obj)
{
return ToJString(env, SConfig::GetInstance().GetTitleDescription());
// Prefer showing just the name. If no name is available, show just the game ID.
std::string description = SConfig::GetInstance().GetTitleName();
if (description.empty())
description = SConfig::GetInstance().GetTitleDescription();
return ToJString(env, description);
}
#ifdef __cplusplus

View File

@ -681,12 +681,14 @@ void SConfig::SetRunningGameMetadata(const std::string& game_id, const std::stri
if (game_id == "00000000")
{
m_title_name.clear();
m_title_description.clear();
return;
}
const Core::TitleDatabase title_database;
const DiscIO::Language language = GetLanguageAdjustedForRegion(bWii, region);
m_title_name = title_database.GetTitleName(m_gametdb_id, language);
m_title_description = title_database.Describe(m_gametdb_id, language);
NOTICE_LOG(CORE, "Active title: %s", m_title_description.c_str());
Host_TitleChanged();

View File

@ -188,6 +188,7 @@ struct SConfig
bool m_disc_booted_from_game_list = false;
const std::string& GetGameID() const { return m_game_id; }
const std::string& GetTitleName() const { return m_title_name; }
const std::string& GetTitleDescription() const { return m_title_description; }
u64 GetTitleID() const { return m_title_id; }
u16 GetRevision() const { return m_revision; }
@ -360,6 +361,7 @@ private:
std::string m_game_id;
std::string m_gametdb_id;
std::string m_title_name;
std::string m_title_description;
u64 m_title_id;
u16 m_revision;