From 3a0917371e597a754a78cf589b6a113f8b648305 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Sun, 13 Sep 2020 15:48:36 +0200 Subject: [PATCH] Android: Don't show game ID after game title --- Source/Android/jni/MainAndroid.cpp | 7 ++++++- Source/Core/Core/ConfigManager.cpp | 2 ++ Source/Core/Core/ConfigManager.h | 2 ++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Source/Android/jni/MainAndroid.cpp b/Source/Android/jni/MainAndroid.cpp index cef4deadd2..e7b3663837 100644 --- a/Source/Android/jni/MainAndroid.cpp +++ b/Source/Android/jni/MainAndroid.cpp @@ -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 diff --git a/Source/Core/Core/ConfigManager.cpp b/Source/Core/Core/ConfigManager.cpp index 77352e4b69..acc3853ccc 100644 --- a/Source/Core/Core/ConfigManager.cpp +++ b/Source/Core/Core/ConfigManager.cpp @@ -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(); diff --git a/Source/Core/Core/ConfigManager.h b/Source/Core/Core/ConfigManager.h index 731889a964..8389e8001a 100644 --- a/Source/Core/Core/ConfigManager.h +++ b/Source/Core/Core/ConfigManager.h @@ -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;