From be03998be0f1ff32275ec2e88b104f75d42f1678 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Sat, 23 Jul 2022 13:36:53 +1000 Subject: [PATCH] System: Fix title not showing for non-database discs --- src/core/system.cpp | 6 ++++++ src/frontend-common/game_list.cpp | 2 +- src/frontend-common/imgui_overlays.cpp | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/core/system.cpp b/src/core/system.cpp index 128661cc0..94eda80f8 100644 --- a/src/core/system.cpp +++ b/src/core/system.cpp @@ -2833,6 +2833,12 @@ void System::UpdateRunningGame(const char* path, CDImage* image, bool booting) s_running_game_code = entry->serial; s_running_game_title = entry->title; } + else + { + const std::string display_name(FileSystem::GetDisplayNameFromPath(path)); + s_running_game_code = GetGameCodeForImage(image, true); + s_running_game_title = Path::GetFileTitle(display_name); + } if (image->HasSubImages() && g_settings.memory_card_use_playlist_title) { diff --git a/src/frontend-common/game_list.cpp b/src/frontend-common/game_list.cpp index f217bf596..f6bdbe05c 100644 --- a/src/frontend-common/game_list.cpp +++ b/src/frontend-common/game_list.cpp @@ -192,7 +192,7 @@ bool GameList::GetDiscListEntry(const std::string& path, Entry* entry) } else { - const std::string display_name(FileSystem::GetDisplayNameFromPath(path)); + const std::string display_name(Path::GetFileTitle(FileSystem::GetDisplayNameFromPath(path))); // no game code, so use the filename title entry->serial = System::GetGameCodeForImage(cdi.get(), true); diff --git a/src/frontend-common/imgui_overlays.cpp b/src/frontend-common/imgui_overlays.cpp index 03a0cba75..dae5776e8 100644 --- a/src/frontend-common/imgui_overlays.cpp +++ b/src/frontend-common/imgui_overlays.cpp @@ -413,7 +413,7 @@ void SaveStateSelectorUI::RefreshList() ListEntry li; if (ssi) - InitializeListEntry(&li, &ssi.value(), std::move(path), i, true); + InitializeListEntry(&li, &ssi.value(), std::move(path), i, false); else InitializePlaceholderListEntry(&li, std::move(path), i, false);