summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/yuzu/main.cpp27
-rw-r--r--src/yuzu/main.h3
2 files changed, 17 insertions, 13 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index f65cc20b4..663ba5632 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -1081,17 +1081,19 @@ void GMainWindow::BootGame(const QString& filename) {
1081 const u64 title_id = Core::System::GetInstance().CurrentProcess()->GetTitleID(); 1081 const u64 title_id = Core::System::GetInstance().CurrentProcess()->GetTitleID();
1082 1082
1083 std::string title_name; 1083 std::string title_name;
1084 std::string title_version;
1084 const auto res = Core::System::GetInstance().GetGameName(title_name); 1085 const auto res = Core::System::GetInstance().GetGameName(title_name);
1085 if (res != Loader::ResultStatus::Success) {
1086 const auto metadata = FileSys::PatchManager(title_id).GetControlMetadata();
1087 if (metadata.first != nullptr)
1088 title_name = metadata.first->GetApplicationName();
1089 1086
1090 if (title_name.empty()) 1087 const auto metadata = FileSys::PatchManager(title_id).GetControlMetadata();
1091 title_name = FileUtil::GetFilename(filename.toStdString()); 1088 if (metadata.first != nullptr) {
1089 title_version = metadata.first->GetVersionString();
1090 title_name = metadata.first->GetApplicationName();
1092 } 1091 }
1093 LOG_INFO(Frontend, "Booting game: {:016X} | {}", title_id, title_name); 1092 if (res != Loader::ResultStatus::Success || title_name.empty()) {
1094 UpdateWindowTitle(QString::fromStdString(title_name)); 1093 title_name = FileUtil::GetFilename(filename.toStdString());
1094 }
1095 LOG_INFO(Frontend, "Booting game: {:016X} | {} | {}", title_id, title_name, title_version);
1096 UpdateWindowTitle(title_name, title_version);
1095 1097
1096 loading_screen->Prepare(Core::System::GetInstance().GetAppLoader()); 1098 loading_screen->Prepare(Core::System::GetInstance().GetAppLoader());
1097 loading_screen->show(); 1099 loading_screen->show();
@@ -2064,7 +2066,8 @@ void GMainWindow::OnCaptureScreenshot() {
2064 OnStartGame(); 2066 OnStartGame();
2065} 2067}
2066 2068
2067void GMainWindow::UpdateWindowTitle(const QString& title_name) { 2069void GMainWindow::UpdateWindowTitle(const std::string& title_name,
2070 const std::string& title_version) {
2068 const auto full_name = std::string(Common::g_build_fullname); 2071 const auto full_name = std::string(Common::g_build_fullname);
2069 const auto branch_name = std::string(Common::g_scm_branch); 2072 const auto branch_name = std::string(Common::g_scm_branch);
2070 const auto description = std::string(Common::g_scm_desc); 2073 const auto description = std::string(Common::g_scm_desc);
@@ -2073,7 +2076,7 @@ void GMainWindow::UpdateWindowTitle(const QString& title_name) {
2073 const auto date = 2076 const auto date =
2074 QDateTime::currentDateTime().toString(QStringLiteral("yyyy-MM-dd")).toStdString(); 2077 QDateTime::currentDateTime().toString(QStringLiteral("yyyy-MM-dd")).toStdString();
2075 2078
2076 if (title_name.isEmpty()) { 2079 if (title_name.empty()) {
2077 const auto fmt = std::string(Common::g_title_bar_format_idle); 2080 const auto fmt = std::string(Common::g_title_bar_format_idle);
2078 setWindowTitle(QString::fromStdString(fmt::format(fmt.empty() ? "yuzu {0}| {1}-{2}" : fmt, 2081 setWindowTitle(QString::fromStdString(fmt::format(fmt.empty() ? "yuzu {0}| {1}-{2}" : fmt,
2079 full_name, branch_name, description, 2082 full_name, branch_name, description,
@@ -2081,8 +2084,8 @@ void GMainWindow::UpdateWindowTitle(const QString& title_name) {
2081 } else { 2084 } else {
2082 const auto fmt = std::string(Common::g_title_bar_format_running); 2085 const auto fmt = std::string(Common::g_title_bar_format_running);
2083 setWindowTitle(QString::fromStdString( 2086 setWindowTitle(QString::fromStdString(
2084 fmt::format(fmt.empty() ? "yuzu {0}| {3} | {1}-{2}" : fmt, full_name, branch_name, 2087 fmt::format(fmt.empty() ? "yuzu {0}| {3} | {6} | {1}-{2}" : fmt, full_name, branch_name,
2085 description, title_name.toStdString(), date, build_id))); 2088 description, title_name, date, build_id, title_version)));
2086 } 2089 }
2087} 2090}
2088 2091
diff --git a/src/yuzu/main.h b/src/yuzu/main.h
index a48d6436b..66c84e5c0 100644
--- a/src/yuzu/main.h
+++ b/src/yuzu/main.h
@@ -218,7 +218,8 @@ private slots:
218 218
219private: 219private:
220 std::optional<u64> SelectRomFSDumpTarget(const FileSys::ContentProvider&, u64 program_id); 220 std::optional<u64> SelectRomFSDumpTarget(const FileSys::ContentProvider&, u64 program_id);
221 void UpdateWindowTitle(const QString& title_name = {}); 221 void UpdateWindowTitle(const std::string& title_name = {},
222 const std::string& title_version = {});
222 void UpdateStatusBar(); 223 void UpdateStatusBar();
223 void HideMouseCursor(); 224 void HideMouseCursor();
224 void ShowMouseCursor(); 225 void ShowMouseCursor();