overlays: add dynamic switch for perf overlay

This commit is contained in:
Megamouse 2019-10-18 03:16:48 +02:00
parent b5f6b27f86
commit f2b530823b
7 changed files with 165 additions and 82 deletions

View file

@ -7,6 +7,7 @@
#include "_discord_utils.h"
#endif
#include "Emu/RSX/Overlays/overlay_perf_metrics.h"
#include "trophy_notification_helper.h"
#include "save_data_dialog.h"
#include "msg_dialog_frame.h"
@ -83,6 +84,7 @@ void gui_application::InitializeConnects()
if (m_main_window)
{
connect(m_main_window, &main_window::RequestGlobalStylesheetChange, this, &gui_application::OnChangeStyleSheetRequest);
connect(m_main_window, &main_window::NotifyEmuSettingsChange, this, &gui_application::OnEmuSettingsChange);
connect(this, &gui_application::OnEmulatorRun, m_main_window, &main_window::OnEmuRun);
connect(this, &gui_application::OnEmulatorStop, m_main_window, &main_window::OnEmuStop);
@ -318,6 +320,11 @@ void gui_application::OnChangeStyleSheetRequest(const QString& path)
}
}
void gui_application::OnEmuSettingsChange()
{
rsx::overlays::reset_performance_overlay();
}
/**
* Using connects avoids timers being unable to be used in a non-qt thread. So, even if this looks stupid to just call func, it's succinct.
*/