diff --git a/Source/Core/Core/Config/MainSettings.cpp b/Source/Core/Core/Config/MainSettings.cpp index 9c16c451c4..2a9bad56e0 100644 --- a/Source/Core/Core/Config/MainSettings.cpp +++ b/Source/Core/Core/Config/MainSettings.cpp @@ -512,6 +512,7 @@ const Info MAIN_MOVIE_DUMP_FRAMES_SILENT{{System::Main, "Movie", "DumpFram const Info MAIN_MOVIE_SHOW_INPUT_DISPLAY{{System::Main, "Movie", "ShowInputDisplay"}, false}; const Info MAIN_MOVIE_SHOW_RTC{{System::Main, "Movie", "ShowRTC"}, false}; const Info MAIN_MOVIE_SHOW_RERECORD{{System::Main, "Movie", "ShowRerecord"}, false}; +const Info MAIN_MOVIE_SHOW_OSD{{System::Main, "Movie", "ShowMovieWindow"}, false}; // Main.Input diff --git a/Source/Core/Core/Config/MainSettings.h b/Source/Core/Core/Config/MainSettings.h index 98d360b0e2..2355508f9f 100644 --- a/Source/Core/Core/Config/MainSettings.h +++ b/Source/Core/Core/Config/MainSettings.h @@ -327,6 +327,7 @@ extern const Info MAIN_MOVIE_DUMP_FRAMES_SILENT; extern const Info MAIN_MOVIE_SHOW_INPUT_DISPLAY; extern const Info MAIN_MOVIE_SHOW_RTC; extern const Info MAIN_MOVIE_SHOW_RERECORD; +extern const Info MAIN_MOVIE_SHOW_OSD; // Main.Input diff --git a/Source/Core/DolphinQt/Config/SettingsWindow.h b/Source/Core/DolphinQt/Config/SettingsWindow.h index 3ee0785fe4..be8a85d103 100644 --- a/Source/Core/DolphinQt/Config/SettingsWindow.h +++ b/Source/Core/DolphinQt/Config/SettingsWindow.h @@ -38,6 +38,7 @@ enum class SettingsWindowPaneIndex : int Graphics, Controllers, Interface, + OnScreenDisplay, Audio, Paths, GameCube, diff --git a/Source/Core/DolphinQt/MainWindow.cpp b/Source/Core/DolphinQt/MainWindow.cpp index b5cc0813a3..55dcb321b8 100644 --- a/Source/Core/DolphinQt/MainWindow.cpp +++ b/Source/Core/DolphinQt/MainWindow.cpp @@ -583,6 +583,7 @@ void MainWindow::ConnectMenuBar() connect(m_menu_bar, &MenuBar::StopRecording, this, &MainWindow::OnStopRecording); connect(m_menu_bar, &MenuBar::ExportRecording, this, &MainWindow::OnExportRecording); connect(m_menu_bar, &MenuBar::ShowTASInput, this, &MainWindow::ShowTASInput); + connect(m_menu_bar, &MenuBar::ConfigureOSD, this, &MainWindow::ShowOSDWindow); // View connect(m_menu_bar, &MenuBar::ShowList, m_game_list, &GameList::SetListView); @@ -1327,6 +1328,12 @@ void MainWindow::ShowGeneralWindow() m_settings_window->SelectPane(SettingsWindowPaneIndex::General); } +void MainWindow::ShowOSDWindow() +{ + ShowSettingsWindow(); + m_settings_window->SelectPane(SettingsWindowPaneIndex::OnScreenDisplay); +} + void MainWindow::ShowAboutDialog() { AboutDialog about{this}; diff --git a/Source/Core/DolphinQt/MainWindow.h b/Source/Core/DolphinQt/MainWindow.h index 0442fa28d4..c01da7f5d3 100644 --- a/Source/Core/DolphinQt/MainWindow.h +++ b/Source/Core/DolphinQt/MainWindow.h @@ -208,6 +208,7 @@ private: void OnActivateChat(); void OnRequestGolfControl(); void ShowTASInput(); + void ShowOSDWindow(); void ChangeDisc(); void EjectDisc(); diff --git a/Source/Core/DolphinQt/MenuBar.cpp b/Source/Core/DolphinQt/MenuBar.cpp index 35223131b2..23725f5066 100644 --- a/Source/Core/DolphinQt/MenuBar.cpp +++ b/Source/Core/DolphinQt/MenuBar.cpp @@ -14,7 +14,6 @@ #include #include #include -#include #include #include @@ -66,6 +65,7 @@ #include "DolphinQt/QtUtils/NonAutodismissibleMenu.h" #include "DolphinQt/QtUtils/ParallelProgressDialog.h" #include "DolphinQt/QtUtils/QueueOnObject.h" +#include "DolphinQt/QtUtils/SignalBlocking.h" #include "DolphinQt/Settings.h" #include "DolphinQt/Updater.h" @@ -176,8 +176,9 @@ void MenuBar::OnEmulationStateChanged(Core::State state) void MenuBar::OnConfigChanged() { - const QSignalBlocker blocker(m_jit_profile_blocks); - m_jit_profile_blocks->setChecked(Config::Get(Config::MAIN_DEBUG_JIT_ENABLE_PROFILING)); + SignalBlocking(m_jit_profile_blocks) + ->setChecked(Config::Get(Config::MAIN_DEBUG_JIT_ENABLE_PROFILING)); + SignalBlocking(m_movie_window)->setChecked(Config::Get(Config::MAIN_MOVIE_SHOW_OSD)); } void MenuBar::OnDebugModeToggled(bool enabled) @@ -845,36 +846,13 @@ void MenuBar::AddMovieMenu() connect(pause_at_end, &QAction::toggled, [](bool value) { Config::SetBaseOrCurrent(Config::MAIN_MOVIE_PAUSE_MOVIE, value); }); - auto* rerecord_counter = movie_menu->addAction(tr("Show Rerecord Counter")); - rerecord_counter->setCheckable(true); - rerecord_counter->setChecked(Config::Get(Config::MAIN_MOVIE_SHOW_RERECORD)); - connect(rerecord_counter, &QAction::toggled, - [](bool value) { Config::SetBaseOrCurrent(Config::MAIN_MOVIE_SHOW_RERECORD, value); }); + m_movie_window = movie_menu->addAction(tr("Enable Movie Window")); + m_movie_window->setCheckable(true); + m_movie_window->setChecked(Config::Get(Config::MAIN_MOVIE_SHOW_OSD)); + connect(m_movie_window, &QAction::toggled, + [](bool value) { Config::SetBaseOrCurrent(Config::MAIN_MOVIE_SHOW_OSD, value); }); - auto* lag_counter = movie_menu->addAction(tr("Show Lag Counter")); - lag_counter->setCheckable(true); - lag_counter->setChecked(Config::Get(Config::MAIN_SHOW_LAG)); - connect(lag_counter, &QAction::toggled, - [](bool value) { Config::SetBaseOrCurrent(Config::MAIN_SHOW_LAG, value); }); - - auto* frame_counter = movie_menu->addAction(tr("Show Frame Counter")); - frame_counter->setCheckable(true); - frame_counter->setChecked(Config::Get(Config::MAIN_SHOW_FRAME_COUNT)); - connect(frame_counter, &QAction::toggled, - [](bool value) { Config::SetBaseOrCurrent(Config::MAIN_SHOW_FRAME_COUNT, value); }); - - auto* input_display = movie_menu->addAction(tr("Show Input Display")); - input_display->setCheckable(true); - input_display->setChecked(Config::Get(Config::MAIN_MOVIE_SHOW_INPUT_DISPLAY)); - connect(input_display, &QAction::toggled, [](bool value) { - Config::SetBaseOrCurrent(Config::MAIN_MOVIE_SHOW_INPUT_DISPLAY, value); - }); - - auto* system_clock = movie_menu->addAction(tr("Show System Clock")); - system_clock->setCheckable(true); - system_clock->setChecked(Config::Get(Config::MAIN_MOVIE_SHOW_RTC)); - connect(system_clock, &QAction::toggled, - [](bool value) { Config::SetBaseOrCurrent(Config::MAIN_MOVIE_SHOW_RTC, value); }); + movie_menu->addAction(tr("Customize Movie Window"), this, &MenuBar::ConfigureOSD); movie_menu->addSeparator(); diff --git a/Source/Core/DolphinQt/MenuBar.h b/Source/Core/DolphinQt/MenuBar.h index 647870b440..5a1a95dc37 100644 --- a/Source/Core/DolphinQt/MenuBar.h +++ b/Source/Core/DolphinQt/MenuBar.h @@ -132,6 +132,8 @@ signals: void RecordingStatusChanged(bool recording); void ReadOnlyModeChanged(bool read_only); + void ConfigureOSD(); + private: void OnEmulationStateChanged(Core::State state); void OnConfigChanged(); @@ -251,6 +253,7 @@ private: QAction* m_recording_start; QAction* m_recording_stop; QAction* m_recording_read_only; + QAction* m_movie_window; // Options QAction* m_boot_to_pause; diff --git a/Source/Core/DolphinQt/Settings/OnScreenDisplayPane.cpp b/Source/Core/DolphinQt/Settings/OnScreenDisplayPane.cpp index 5076eba710..7c279d4437 100644 --- a/Source/Core/DolphinQt/Settings/OnScreenDisplayPane.cpp +++ b/Source/Core/DolphinQt/Settings/OnScreenDisplayPane.cpp @@ -67,6 +67,7 @@ void OnScreenDisplayPane::CreateLayout() auto* movie_layout = new QGridLayout(); movie_box->setLayout(movie_layout); + m_movie_window = new ConfigBool(tr("Show Movie Window"), Config::MAIN_MOVIE_SHOW_OSD); m_rerecord_counter = new ConfigBool(tr("Show Rerecord Counter"), Config::MAIN_MOVIE_SHOW_RERECORD); m_lag_counter = new ConfigBool(tr("Show Lag Counter"), Config::MAIN_SHOW_LAG); @@ -74,11 +75,12 @@ void OnScreenDisplayPane::CreateLayout() m_input_display = new ConfigBool(tr("Show Input Display"), Config::MAIN_MOVIE_SHOW_INPUT_DISPLAY); m_system_clock = new ConfigBool(tr("Show System Clock"), Config::MAIN_MOVIE_SHOW_RTC); - movie_layout->addWidget(m_rerecord_counter, 0, 0); - movie_layout->addWidget(m_lag_counter, 0, 1); - movie_layout->addWidget(m_frame_counter, 1, 0); - movie_layout->addWidget(m_input_display, 1, 1); - movie_layout->addWidget(m_system_clock, 2, 0); + movie_layout->addWidget(m_movie_window, 0, 0); + movie_layout->addWidget(m_rerecord_counter, 1, 0); + movie_layout->addWidget(m_lag_counter, 1, 1); + movie_layout->addWidget(m_frame_counter, 2, 0); + movie_layout->addWidget(m_input_display, 2, 1); + movie_layout->addWidget(m_system_clock, 3, 0); // NetPlay auto* netplay_box = new QGroupBox(tr("Netplay")); @@ -197,6 +199,10 @@ void OnScreenDisplayPane::AddDescriptions() "while playing NetPlay.

If unsure, leave " "this unchecked."); + static const char TR_MOVIE_WINDOW_DESCRIPTION[] = + QT_TR_NOOP("Shows a window that can be filled with information related to movie recordings. " + "The other options in this group determine what appears in the window. " + "

If unsure, leave this unchecked."); static const char TR_RERECORD_COUNTER_DESCRIPTION[] = QT_TR_NOOP("Shows how many times the input recording has been overwritten by using " "savestates.

If unsure, leave " @@ -237,6 +243,7 @@ void OnScreenDisplayPane::AddDescriptions() m_show_ping->SetDescription(tr(TR_SHOW_NETPLAY_PING_DESCRIPTION)); m_show_chat->SetDescription(tr(TR_SHOW_NETPLAY_MESSAGES_DESCRIPTION)); + m_movie_window->SetDescription(tr(TR_MOVIE_WINDOW_DESCRIPTION)); m_rerecord_counter->SetDescription(tr(TR_RERECORD_COUNTER_DESCRIPTION)); m_lag_counter->SetDescription(tr(TR_LAG_COUNTER_DESCRIPTION)); m_frame_counter->SetDescription(tr(TR_FRAME_COUNTER_DESCRIPTION)); diff --git a/Source/Core/DolphinQt/Settings/OnScreenDisplayPane.h b/Source/Core/DolphinQt/Settings/OnScreenDisplayPane.h index 89bbadef02..59e30d802d 100644 --- a/Source/Core/DolphinQt/Settings/OnScreenDisplayPane.h +++ b/Source/Core/DolphinQt/Settings/OnScreenDisplayPane.h @@ -35,6 +35,7 @@ private: ConfigInteger* m_graph_update_rate; // Movie window + ConfigBool* m_movie_window; ConfigBool* m_rerecord_counter; ConfigBool* m_lag_counter; ConfigBool* m_frame_counter; diff --git a/Source/Core/VideoCommon/OnScreenUI.cpp b/Source/Core/VideoCommon/OnScreenUI.cpp index 4689bb6321..e741691417 100644 --- a/Source/Core/VideoCommon/OnScreenUI.cpp +++ b/Source/Core/VideoCommon/OnScreenUI.cpp @@ -255,11 +255,7 @@ void OnScreenUI::DrawImGui() // Create On-Screen-Messages void OnScreenUI::DrawDebugText() { - const bool show_movie_window = - Config::Get(Config::MAIN_SHOW_FRAME_COUNT) || Config::Get(Config::MAIN_SHOW_LAG) || - Config::Get(Config::MAIN_MOVIE_SHOW_INPUT_DISPLAY) || - Config::Get(Config::MAIN_MOVIE_SHOW_RTC) || Config::Get(Config::MAIN_MOVIE_SHOW_RERECORD); - if (show_movie_window) + if (Config::Get(Config::MAIN_MOVIE_SHOW_OSD)) { // Position under the FPS display. ImGui::SetNextWindowPos(