summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZach Hilman <zachhilman@gmail.com>2018-08-23 20:12:56 +0200
committerZach Hilman <zachhilman@gmail.com>2018-08-23 20:12:56 +0200
commit67fa51ea2f54355bcf49bed36658151e6153bb44 (patch)
treee066bd93a6d72de7011cabcd096db6ae8bfb8873
parentMerge pull request #1160 from bunnei/surface-reserve (diff)
downloadyuzu-67fa51ea2f54355bcf49bed36658151e6153bb44.tar
yuzu-67fa51ea2f54355bcf49bed36658151e6153bb44.tar.gz
yuzu-67fa51ea2f54355bcf49bed36658151e6153bb44.tar.bz2
yuzu-67fa51ea2f54355bcf49bed36658151e6153bb44.tar.lz
yuzu-67fa51ea2f54355bcf49bed36658151e6153bb44.tar.xz
yuzu-67fa51ea2f54355bcf49bed36658151e6153bb44.tar.zst
yuzu-67fa51ea2f54355bcf49bed36658151e6153bb44.zip
Diffstat (limited to '')
-rw-r--r--src/core/core.h7
-rw-r--r--src/yuzu/main.cpp11
2 files changed, 18 insertions, 0 deletions
diff --git a/src/core/core.h b/src/core/core.h
index 790e23cae..7188dabdc 100644
--- a/src/core/core.h
+++ b/src/core/core.h
@@ -187,6 +187,13 @@ public:
return current_process;
}
+ /// Gets the name of the current game
+ Loader::ResultStatus GetGameName(std::string& out) const {
+ if (app_loader == nullptr)
+ return Loader::ResultStatus::ErrorNotInitialized;
+ return app_loader->ReadTitle(out);
+ }
+
PerfStats perf_stats;
FrameLimiter frame_limiter;
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index c62360bd4..b3a7bba0c 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -545,6 +545,15 @@ void GMainWindow::BootGame(const QString& filename) {
}
status_bar_update_timer.start(2000);
+ std::string title_name;
+ const auto res = Core::System::GetInstance().GetGameName(title_name);
+ if (res != Loader::ResultStatus::Success)
+ title_name = FileUtil::GetFilename(filename.toStdString());
+
+ setWindowTitle(QString("yuzu %1| %4 | %2-%3")
+ .arg(Common::g_build_name, Common::g_scm_branch, Common::g_scm_desc,
+ QString::fromStdString(title_name)));
+
render_window->show();
render_window->setFocus();
@@ -576,6 +585,8 @@ void GMainWindow::ShutdownGame() {
render_window->hide();
game_list->show();
game_list->setFilterFocus();
+ setWindowTitle(QString("yuzu %1| %2-%3")
+ .arg(Common::g_build_name, Common::g_scm_branch, Common::g_scm_desc));
// Disable status bar updates
status_bar_update_timer.stop();