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/CMakeLists.txt b/Source/Core/DolphinQt/CMakeLists.txt index 656537f719..93c85a3997 100644 --- a/Source/Core/DolphinQt/CMakeLists.txt +++ b/Source/Core/DolphinQt/CMakeLists.txt @@ -369,6 +369,8 @@ add_executable(dolphin-emu Settings/GeneralPane.h Settings/InterfacePane.cpp Settings/InterfacePane.h + Settings/OnScreenDisplayPane.cpp + Settings/OnScreenDisplayPane.h Settings/PathPane.cpp Settings/PathPane.h Settings/USBDevicePicker.cpp diff --git a/Source/Core/DolphinQt/Config/Graphics/AdvancedWidget.cpp b/Source/Core/DolphinQt/Config/Graphics/AdvancedWidget.cpp index cfac1358b9..98089e6d3d 100644 --- a/Source/Core/DolphinQt/Config/Graphics/AdvancedWidget.cpp +++ b/Source/Core/DolphinQt/Config/Graphics/AdvancedWidget.cpp @@ -46,57 +46,25 @@ void AdvancedWidget::CreateWidgets() auto* main_layout = new QVBoxLayout; - // Performance - auto* performance_box = new QGroupBox(tr("Performance Statistics")); - auto* performance_layout = new QGridLayout(); - performance_box->setLayout(performance_layout); - - m_show_fps = new ConfigBool(tr("Show FPS"), Config::GFX_SHOW_FPS, m_game_layer); - m_show_ftimes = new ConfigBool(tr("Show Frame Times"), Config::GFX_SHOW_FTIMES, m_game_layer); - m_show_vps = new ConfigBool(tr("Show VPS"), Config::GFX_SHOW_VPS, m_game_layer); - m_show_vtimes = new ConfigBool(tr("Show VBlank Times"), Config::GFX_SHOW_VTIMES, m_game_layer); - m_show_graphs = - new ConfigBool(tr("Show Performance Graphs"), Config::GFX_SHOW_GRAPHS, m_game_layer); - m_show_speed = new ConfigBool(tr("Show % Speed"), Config::GFX_SHOW_SPEED, m_game_layer); - m_show_speed_colors = - new ConfigBool(tr("Show Speed Colors"), Config::GFX_SHOW_SPEED_COLORS, m_game_layer); - m_perf_samp_window = new ConfigInteger(0, 10000, Config::GFX_PERF_SAMP_WINDOW, m_game_layer, 100); - m_perf_samp_window->SetTitle(tr("Performance Sample Window (ms)")); - m_log_render_time = new ConfigBool(tr("Log Render Time to File"), - Config::GFX_LOG_RENDER_TIME_TO_FILE, m_game_layer); - - performance_layout->addWidget(m_show_fps, 0, 0); - performance_layout->addWidget(m_show_ftimes, 0, 1); - performance_layout->addWidget(m_show_vps, 1, 0); - performance_layout->addWidget(m_show_vtimes, 1, 1); - performance_layout->addWidget(m_show_speed, 2, 0); - performance_layout->addWidget(m_show_graphs, 2, 1); - performance_layout->addWidget(new QLabel(tr("Performance Sample Window (ms):")), 3, 0); - performance_layout->addWidget(m_perf_samp_window, 3, 1); - performance_layout->addWidget(m_log_render_time, 4, 0); - performance_layout->addWidget(m_show_speed_colors, 4, 1); - // Debugging auto* debugging_box = new QGroupBox(tr("Debugging")); auto* debugging_layout = new QGridLayout(); debugging_box->setLayout(debugging_layout); + m_log_render_time = new ConfigBool(tr("Log Render Time to File"), + Config::GFX_LOG_RENDER_TIME_TO_FILE, m_game_layer); + m_enable_wireframe = new ConfigBool(tr("Enable Wireframe"), Config::GFX_ENABLE_WIREFRAME, m_game_layer); - m_show_statistics = - new ConfigBool(tr("Show Statistics"), Config::GFX_OVERLAY_STATS, m_game_layer); - m_show_proj_statistics = new ConfigBool(tr("Show Projection Statistics"), - Config::GFX_OVERLAY_PROJ_STATS, m_game_layer); m_enable_format_overlay = new ConfigBool(tr("Texture Format Overlay"), Config::GFX_TEXFMT_OVERLAY_ENABLE, m_game_layer); m_enable_api_validation = new ConfigBool(tr("Enable API Validation Layers"), Config::GFX_ENABLE_VALIDATION_LAYER, m_game_layer); debugging_layout->addWidget(m_enable_wireframe, 0, 0); - debugging_layout->addWidget(m_show_statistics, 0, 1); - debugging_layout->addWidget(m_enable_format_overlay, 1, 0); - debugging_layout->addWidget(m_show_proj_statistics, 1, 1); - debugging_layout->addWidget(m_enable_api_validation, 2, 0); + debugging_layout->addWidget(m_enable_format_overlay, 0, 1); + debugging_layout->addWidget(m_enable_api_validation, 1, 0); + debugging_layout->addWidget(m_log_render_time, 1, 1); // Utility auto* utility_box = new QGroupBox(tr("Utility")); @@ -226,7 +194,6 @@ void AdvancedWidget::CreateWidgets() experimental_layout->addWidget(m_defer_efb_access_invalidation, 0, 0); experimental_layout->addWidget(m_manual_texture_sampling, 0, 1); - main_layout->addWidget(performance_box); main_layout->addWidget(debugging_box); main_layout->addWidget(utility_box); main_layout->addWidget(texture_dump_box); @@ -269,53 +236,9 @@ void AdvancedWidget::OnEmulationStateChanged(bool running) void AdvancedWidget::AddDescriptions() { - static const char TR_SHOW_FPS_DESCRIPTION[] = - QT_TR_NOOP("Shows the number of distinct frames rendered per second as a measure of " - "visual smoothness.

If unsure, leave this " - "unchecked."); - static const char TR_SHOW_FTIMES_DESCRIPTION[] = - QT_TR_NOOP("Shows the average time in ms between each distinct rendered frame alongside " - "the standard deviation.

If unsure, leave this " - "unchecked."); - static const char TR_SHOW_VPS_DESCRIPTION[] = - QT_TR_NOOP("Shows the number of frames rendered per second as a measure of " - "emulation speed.

If unsure, leave this " - "unchecked."); - static const char TR_SHOW_VTIMES_DESCRIPTION[] = - QT_TR_NOOP("Shows the average time in ms between each rendered frame alongside " - "the standard deviation.

If unsure, leave this " - "unchecked."); - static const char TR_SHOW_GRAPHS_DESCRIPTION[] = - QT_TR_NOOP("Shows frametime graph along with statistics as a representation of " - "emulation performance.

If unsure, leave this " - "unchecked."); - static const char TR_SHOW_SPEED_DESCRIPTION[] = - QT_TR_NOOP("Shows the % speed of emulation compared to full speed." - "

If unsure, leave this " - "unchecked."); - static const char TR_SHOW_SPEED_COLORS_DESCRIPTION[] = - QT_TR_NOOP("Changes the color of the FPS counter depending on emulation speed." - "

If unsure, leave this " - "checked."); - static const char TR_PERF_SAMP_WINDOW_DESCRIPTION[] = - QT_TR_NOOP("The amount of time the FPS and VPS counters will sample over." - "

The higher the value, the more stable the FPS/VPS counter will be, " - "but the slower it will be to update." - "

If unsure, leave this " - "at 1000ms."); - static const char TR_LOG_RENDERTIME_DESCRIPTION[] = QT_TR_NOOP( - "Logs the render time of every frame to User/Logs/render_time.txt.

Use this " - "feature to measure Dolphin's performance.

If " - "unsure, leave this unchecked."); static const char TR_WIREFRAME_DESCRIPTION[] = QT_TR_NOOP("Renders the scene as a wireframe.

If unsure, leave " "this unchecked."); - static const char TR_SHOW_STATS_DESCRIPTION[] = - QT_TR_NOOP("Shows various rendering statistics.

If unsure, " - "leave this unchecked."); - static const char TR_SHOW_PROJ_STATS_DESCRIPTION[] = - QT_TR_NOOP("Shows various projection statistics.

If unsure, " - "leave this unchecked."); static const char TR_TEXTURE_FORMAT_DESCRIPTION[] = QT_TR_NOOP("Modifies textures to show the format they're encoded in.

May require " "an emulation reset to apply.

If unsure, leave this " @@ -325,6 +248,10 @@ void AdvancedWidget::AddDescriptions() "debugging graphical issues. On the Vulkan and D3D backends, this also enables " "debug symbols for the compiled shaders.

If unsure, " "leave this unchecked."); + static const char TR_LOG_RENDERTIME_DESCRIPTION[] = QT_TR_NOOP( + "Logs the render time of every frame to User/Logs/render_time.txt.

Use this " + "feature to measure Dolphin's performance.

If " + "unsure, leave this unchecked."); static const char TR_DUMP_TEXTURE_DESCRIPTION[] = QT_TR_NOOP("Dumps decoded game textures based on the other flags to " "User/Dump/Textures/<game_id>/.

If unsure, leave " @@ -443,21 +370,10 @@ void AdvancedWidget::AddDescriptions() static const char IF_UNSURE_UNCHECKED[] = QT_TR_NOOP("If unsure, leave this unchecked."); - m_show_fps->SetDescription(tr(TR_SHOW_FPS_DESCRIPTION)); - m_show_ftimes->SetDescription(tr(TR_SHOW_FTIMES_DESCRIPTION)); - m_show_vps->SetDescription(tr(TR_SHOW_VPS_DESCRIPTION)); - m_show_vtimes->SetDescription(tr(TR_SHOW_VTIMES_DESCRIPTION)); - m_show_graphs->SetDescription(tr(TR_SHOW_GRAPHS_DESCRIPTION)); - m_show_speed->SetDescription(tr(TR_SHOW_SPEED_DESCRIPTION)); - m_log_render_time->SetDescription(tr(TR_LOG_RENDERTIME_DESCRIPTION)); - m_show_speed_colors->SetDescription(tr(TR_SHOW_SPEED_COLORS_DESCRIPTION)); - m_enable_wireframe->SetDescription(tr(TR_WIREFRAME_DESCRIPTION)); - m_show_statistics->SetDescription(tr(TR_SHOW_STATS_DESCRIPTION)); - m_show_proj_statistics->SetDescription(tr(TR_SHOW_PROJ_STATS_DESCRIPTION)); m_enable_format_overlay->SetDescription(tr(TR_TEXTURE_FORMAT_DESCRIPTION)); m_enable_api_validation->SetDescription(tr(TR_VALIDATION_LAYER_DESCRIPTION)); - m_perf_samp_window->SetDescription(tr(TR_PERF_SAMP_WINDOW_DESCRIPTION)); + m_log_render_time->SetDescription(tr(TR_LOG_RENDERTIME_DESCRIPTION)); m_dump_textures->SetDescription(tr(TR_DUMP_TEXTURE_DESCRIPTION)); m_dump_mip_textures->SetDescription(tr(TR_DUMP_MIP_TEXTURE_DESCRIPTION)); m_dump_base_textures->SetDescription(tr(TR_DUMP_BASE_TEXTURE_DESCRIPTION)); diff --git a/Source/Core/DolphinQt/Config/Graphics/AdvancedWidget.h b/Source/Core/DolphinQt/Config/Graphics/AdvancedWidget.h index 73fb5c3943..96ed3acbab 100644 --- a/Source/Core/DolphinQt/Config/Graphics/AdvancedWidget.h +++ b/Source/Core/DolphinQt/Config/Graphics/AdvancedWidget.h @@ -30,18 +30,8 @@ private: // Debugging ConfigBool* m_enable_wireframe; - ConfigBool* m_show_statistics; - ConfigBool* m_show_proj_statistics; ConfigBool* m_enable_format_overlay; ConfigBool* m_enable_api_validation; - ConfigBool* m_show_fps; - ConfigBool* m_show_ftimes; - ConfigBool* m_show_vps; - ConfigBool* m_show_vtimes; - ConfigBool* m_show_graphs; - ConfigBool* m_show_speed; - ConfigBool* m_show_speed_colors; - ConfigInteger* m_perf_samp_window; ConfigBool* m_log_render_time; // Utility diff --git a/Source/Core/DolphinQt/Config/Graphics/GeneralWidget.cpp b/Source/Core/DolphinQt/Config/Graphics/GeneralWidget.cpp index 15d25167dc..f2004ff2c4 100644 --- a/Source/Core/DolphinQt/Config/Graphics/GeneralWidget.cpp +++ b/Source/Core/DolphinQt/Config/Graphics/GeneralWidget.cpp @@ -108,22 +108,15 @@ void GeneralWidget::CreateWidgets() auto* m_options_box = new QGroupBox(tr("Other")); auto* m_options_layout = new QGridLayout(); - m_show_ping = - new ConfigBool(tr("Show NetPlay Ping"), Config::GFX_SHOW_NETPLAY_PING, m_game_layer); m_autoadjust_window_size = new ConfigBool(tr("Auto-Adjust Window Size"), Config::MAIN_RENDER_WINDOW_AUTOSIZE, m_game_layer); - m_show_messages = - new ConfigBool(tr("Show NetPlay Messages"), Config::GFX_SHOW_NETPLAY_MESSAGES, m_game_layer); m_render_main_window = new ConfigBool(tr("Render to Main Window"), Config::MAIN_RENDER_TO_MAIN, m_game_layer); m_options_box->setLayout(m_options_layout); m_options_layout->addWidget(m_render_main_window, 0, 0); - m_options_layout->addWidget(m_autoadjust_window_size, 1, 0); - - m_options_layout->addWidget(m_show_messages, 0, 1); - m_options_layout->addWidget(m_show_ping, 1, 1); + m_options_layout->addWidget(m_autoadjust_window_size, 0, 1); // Other auto* shader_compilation_box = new QGroupBox(tr("Shader Compilation")); @@ -268,13 +261,6 @@ void GeneralWidget::AddDescriptions() "if emulation speed is below 100%.

If unsure, leave " "this " "unchecked."); - static const char TR_SHOW_NETPLAY_PING_DESCRIPTION[] = QT_TR_NOOP( - "Shows the player's maximum ping while playing on " - "NetPlay.

If unsure, leave this unchecked."); - static const char TR_SHOW_NETPLAY_MESSAGES_DESCRIPTION[] = - QT_TR_NOOP("Shows chat messages, buffer changes, and desync alerts " - "while playing NetPlay.

If unsure, leave " - "this unchecked."); static const char TR_SHADER_COMPILE_SPECIALIZED_DESCRIPTION[] = QT_TR_NOOP("Ubershaders are never used. Stuttering will occur during shader " "compilation, but GPU demands are low.

Recommended for low-end hardware. " @@ -320,12 +306,8 @@ void GeneralWidget::AddDescriptions() m_enable_fullscreen->SetDescription(tr(TR_FULLSCREEN_DESCRIPTION)); - m_show_ping->SetDescription(tr(TR_SHOW_NETPLAY_PING_DESCRIPTION)); - m_autoadjust_window_size->SetDescription(tr(TR_AUTOSIZE_DESCRIPTION)); - m_show_messages->SetDescription(tr(TR_SHOW_NETPLAY_MESSAGES_DESCRIPTION)); - m_render_main_window->SetDescription(tr(TR_RENDER_TO_MAINWINDOW_DESCRIPTION)); m_shader_compilation_mode[0]->SetDescription(tr(TR_SHADER_COMPILE_SPECIALIZED_DESCRIPTION)); diff --git a/Source/Core/DolphinQt/Config/Graphics/GeneralWidget.h b/Source/Core/DolphinQt/Config/Graphics/GeneralWidget.h index e96b39d04e..50f7346daa 100644 --- a/Source/Core/DolphinQt/Config/Graphics/GeneralWidget.h +++ b/Source/Core/DolphinQt/Config/Graphics/GeneralWidget.h @@ -52,10 +52,9 @@ private: ConfigBool* m_enable_fullscreen; // Options - ConfigBool* m_show_ping; ConfigBool* m_autoadjust_window_size; - ConfigBool* m_show_messages; ConfigBool* m_render_main_window; + std::array m_shader_compilation_mode{}; ConfigBool* m_wait_for_shaders; int m_previous_backend = 0; diff --git a/Source/Core/DolphinQt/Config/SettingsWindow.cpp b/Source/Core/DolphinQt/Config/SettingsWindow.cpp index a1279c5eb5..8efae30cee 100644 --- a/Source/Core/DolphinQt/Config/SettingsWindow.cpp +++ b/Source/Core/DolphinQt/Config/SettingsWindow.cpp @@ -22,6 +22,7 @@ #include "DolphinQt/Settings/GameCubePane.h" #include "DolphinQt/Settings/GeneralPane.h" #include "DolphinQt/Settings/InterfacePane.h" +#include "DolphinQt/Settings/OnScreenDisplayPane.h" #include "DolphinQt/Settings/PathPane.h" #include "DolphinQt/Settings/WiiPane.h" @@ -129,6 +130,7 @@ SettingsWindow::SettingsWindow(MainWindow* parent) : StackedSettingsWindow{paren AddPane(new GraphicsPane{parent, nullptr}, tr("Graphics")); AddWrappedPane(new ControllersPane, tr("Controllers")); AddWrappedPane(new InterfacePane, tr("Interface")); + AddWrappedPane(new OnScreenDisplayPane, tr("On-Screen Display")); AddWrappedPane(new AudioPane, tr("Audio")); AddWrappedPane(new PathPane, tr("Paths")); AddWrappedPane(new GameCubePane, tr("GameCube")); 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/DolphinQt.vcxproj b/Source/Core/DolphinQt/DolphinQt.vcxproj index 596de91a53..eb548ae0ad 100644 --- a/Source/Core/DolphinQt/DolphinQt.vcxproj +++ b/Source/Core/DolphinQt/DolphinQt.vcxproj @@ -218,6 +218,7 @@ + @@ -268,6 +269,7 @@ + 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 39ea3efabe..152bfa648c 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/InterfacePane.cpp b/Source/Core/DolphinQt/Settings/InterfacePane.cpp index eedca67385..2c97269483 100644 --- a/Source/Core/DolphinQt/Settings/InterfacePane.cpp +++ b/Source/Core/DolphinQt/Settings/InterfacePane.cpp @@ -27,7 +27,6 @@ #include "DolphinQt/Config/ConfigControls/ConfigBool.h" #include "DolphinQt/Config/ConfigControls/ConfigChoice.h" -#include "DolphinQt/Config/ConfigControls/ConfigInteger.h" #include "DolphinQt/Config/ConfigControls/ConfigRadio.h" #include "DolphinQt/Config/ToolTipControls/ToolTipCheckBox.h" #include "DolphinQt/Config/ToolTipControls/ToolTipComboBox.h" @@ -197,16 +196,6 @@ void InterfacePane::CreateInGame() m_checkbox_confirm_on_stop = new ConfigBool(tr("Confirm on Stop"), Config::MAIN_CONFIRM_ON_STOP); m_checkbox_use_panic_handlers = new ConfigBool(tr("Use Panic Handlers"), Config::MAIN_USE_PANIC_HANDLERS); - m_checkbox_enable_osd = - new ConfigBool(tr("Show On-Screen Display Messages"), Config::MAIN_OSD_MESSAGES); - - m_osd_font_size = new ConfigInteger(12, 40, Config::MAIN_OSD_FONT_SIZE); - m_osd_font_size->setMinimumWidth(m_osd_font_size->sizeHint().width() * 2); - auto* font_size_layout = new QHBoxLayout; - font_size_layout->addWidget(new QLabel(tr("On-Screen Display Font Size: "))); - font_size_layout->addWidget(m_osd_font_size); - font_size_layout->addStretch(); - m_checkbox_show_active_title = new ConfigBool(tr("Show Active Title in Window Title"), Config::MAIN_SHOW_ACTIVE_TITLE); m_checkbox_pause_on_focus_lost = @@ -236,8 +225,6 @@ void InterfacePane::CreateInGame() groupbox_layout->addWidget(m_checkbox_top_window); groupbox_layout->addWidget(m_checkbox_confirm_on_stop); groupbox_layout->addWidget(m_checkbox_use_panic_handlers); - groupbox_layout->addWidget(m_checkbox_enable_osd); - groupbox_layout->addLayout(font_size_layout); groupbox_layout->addWidget(m_checkbox_show_active_title); groupbox_layout->addWidget(m_checkbox_pause_on_focus_lost); groupbox_layout->addWidget(mouse_groupbox); @@ -378,14 +365,6 @@ void InterfacePane::AddDescriptions() "present choices on how to proceed. With this option disabled, Dolphin will " "\"ignore\" all errors. Emulation will not be halted and you will not be notified." "

If unsure, leave this checked."); - static constexpr char TR_ENABLE_OSD_DESCRIPTION[] = - QT_TR_NOOP("Shows on-screen display messages over the render window. These messages " - "disappear after several seconds." - "

If unsure, leave this checked."); - static const char TR_OSD_FONT_SIZE_DESCRIPTION[] = - QT_TR_NOOP("Changes the font size of the On Screen Display. Affects features such as the FPS" - "display, TAS movie window, and netplay chat." - "

If unsure, leave this at 13."); static constexpr char TR_SHOW_ACTIVE_TITLE_DESCRIPTION[] = QT_TR_NOOP("Shows the active game title in the render window's title bar." "

If unsure, leave this checked."); @@ -433,10 +412,6 @@ void InterfacePane::AddDescriptions() m_checkbox_use_panic_handlers->SetDescription(tr(TR_USE_PANIC_HANDLERS_DESCRIPTION)); - m_checkbox_enable_osd->SetDescription(tr(TR_ENABLE_OSD_DESCRIPTION)); - - m_osd_font_size->SetDescription(tr(TR_OSD_FONT_SIZE_DESCRIPTION)); - m_checkbox_show_active_title->SetDescription(tr(TR_SHOW_ACTIVE_TITLE_DESCRIPTION)); m_checkbox_pause_on_focus_lost->SetDescription(tr(TR_PAUSE_ON_FOCUS_LOST_DESCRIPTION)); diff --git a/Source/Core/DolphinQt/Settings/InterfacePane.h b/Source/Core/DolphinQt/Settings/InterfacePane.h index 0a55f7ad0a..1f33e7659d 100644 --- a/Source/Core/DolphinQt/Settings/InterfacePane.h +++ b/Source/Core/DolphinQt/Settings/InterfacePane.h @@ -6,7 +6,6 @@ #include class ConfigBool; -class ConfigInteger; class ConfigRadioInt; class ConfigStringChoice; class QLabel; @@ -54,8 +53,6 @@ private: ConfigBool* m_checkbox_confirm_on_stop; ConfigBool* m_checkbox_use_panic_handlers; - ConfigBool* m_checkbox_enable_osd; - ConfigInteger* m_osd_font_size; ConfigBool* m_checkbox_show_active_title; ConfigBool* m_checkbox_pause_on_focus_lost; ConfigRadioInt* m_radio_cursor_visible_movement; diff --git a/Source/Core/DolphinQt/Settings/OnScreenDisplayPane.cpp b/Source/Core/DolphinQt/Settings/OnScreenDisplayPane.cpp new file mode 100644 index 0000000000..7c279d4437 --- /dev/null +++ b/Source/Core/DolphinQt/Settings/OnScreenDisplayPane.cpp @@ -0,0 +1,255 @@ +// Copyright 2025 Dolphin Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "DolphinQt/Settings/OnScreenDisplayPane.h" + +#include +#include +#include +#include +#include + +#include "Core/Config/GraphicsSettings.h" +#include "Core/Config/MainSettings.h" + +#include "DolphinQt/Config/ConfigControls/ConfigBool.h" +#include "DolphinQt/Config/ConfigControls/ConfigInteger.h" + +OnScreenDisplayPane::OnScreenDisplayPane(QWidget* parent) : QWidget(parent) +{ + CreateLayout(); + ConnectLayout(); + AddDescriptions(); +} + +void OnScreenDisplayPane::CreateLayout() +{ + // General + auto* general_box = new QGroupBox(tr("General")); + auto* general_layout = new QGridLayout(); + general_box->setLayout(general_layout); + + m_enable_osd = new ConfigBool(tr("Show Messages"), Config::MAIN_OSD_MESSAGES); + m_font_size = new ConfigInteger(12, 40, Config::MAIN_OSD_FONT_SIZE); + + general_layout->addWidget(m_enable_osd, 0, 0); + general_layout->addWidget(new QLabel(tr("Font Size:")), 1, 0); + general_layout->addWidget(m_font_size, 1, 1); + + // Performance + auto* performance_box = new QGroupBox(tr("Performance Statistics")); + auto* performance_layout = new QGridLayout(); + performance_box->setLayout(performance_layout); + + m_show_fps = new ConfigBool(tr("Show FPS"), Config::GFX_SHOW_FPS); + m_show_ftimes = new ConfigBool(tr("Show Frame Times"), Config::GFX_SHOW_FTIMES); + m_show_vps = new ConfigBool(tr("Show VPS"), Config::GFX_SHOW_VPS); + m_show_vtimes = new ConfigBool(tr("Show VBlank Times"), Config::GFX_SHOW_VTIMES); + m_show_speed = new ConfigBool(tr("Show % Speed"), Config::GFX_SHOW_SPEED); + m_speed_colors = new ConfigBool(tr("Show Speed Colors"), Config::GFX_SHOW_SPEED_COLORS); + m_show_graph = new ConfigBool(tr("Show Performance Graphs"), Config::GFX_SHOW_GRAPHS); + m_graph_update_label = new QLabel(tr("Graph Update Rate (ms):")); + m_graph_update_rate = new ConfigInteger(0, 10000, Config::GFX_PERF_SAMP_WINDOW, 100); + m_graph_update_rate->SetTitle(tr("Performance Sample Window (ms)")); + + performance_layout->addWidget(m_show_fps, 0, 0); + performance_layout->addWidget(m_show_ftimes, 0, 1); + performance_layout->addWidget(m_show_vps, 1, 0); + performance_layout->addWidget(m_show_vtimes, 1, 1); + performance_layout->addWidget(m_show_speed, 2, 0); + performance_layout->addWidget(m_speed_colors, 2, 1); + performance_layout->addWidget(m_show_graph, 3, 0); + performance_layout->addWidget(m_graph_update_label, 4, 0); + performance_layout->addWidget(m_graph_update_rate, 4, 1); + + // Movie + auto* movie_box = new QGroupBox(tr("Movie Window")); + 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); + m_frame_counter = new ConfigBool(tr("Show Frame Counter"), Config::MAIN_SHOW_FRAME_COUNT); + 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_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")); + auto* netplay_layout = new QGridLayout(); + netplay_box->setLayout(netplay_layout); + + m_show_ping = new ConfigBool(tr("Show NetPlay Ping"), Config::GFX_SHOW_NETPLAY_PING); + m_show_chat = new ConfigBool(tr("Show NetPlay Chat"), Config::GFX_SHOW_NETPLAY_MESSAGES); + + netplay_layout->addWidget(m_show_ping, 0, 0); + netplay_layout->addWidget(m_show_chat, 0, 1); + + // Debug + auto* debug_box = new QGroupBox(tr("Debug")); + auto* debug_layout = new QGridLayout(); + debug_box->setLayout(debug_layout); + + m_show_statistics = new ConfigBool(tr("Show Statistics"), Config::GFX_OVERLAY_STATS); + m_show_proj_statistics = + new ConfigBool(tr("Show Projection Statistics"), Config::GFX_OVERLAY_PROJ_STATS); + + debug_layout->addWidget(m_show_statistics, 0, 0); + debug_layout->addWidget(m_show_proj_statistics, 0, 1); + + // Stack GroupBoxes + auto* main_layout = new QVBoxLayout; + main_layout->addWidget(general_box); + main_layout->addWidget(performance_box); + main_layout->addWidget(movie_box); + main_layout->addWidget(netplay_box); + main_layout->addWidget(debug_box); + main_layout->addStretch(); + setLayout(main_layout); +} + +void OnScreenDisplayPane::ConnectLayout() +{ + // Disable graph options when graph is not visible. + m_graph_update_rate->setEnabled(m_show_graph->isChecked()); + m_graph_update_label->setEnabled(m_show_graph->isChecked()); + connect(m_show_graph, &QCheckBox::toggled, this, [this](bool checked) { + m_graph_update_rate->setEnabled(checked); + m_graph_update_label->setEnabled(checked); + }); + + // Disable movie window options when window is closed. + auto enable_movie_items = [this](bool checked) { + for (auto* widget : + {m_rerecord_counter, m_frame_counter, m_lag_counter, m_system_clock, m_input_display}) + { + widget->setEnabled(checked); + } + }; + + enable_movie_items(m_movie_window->isChecked()); + connect(m_movie_window, &QCheckBox::toggled, this, [this, enable_movie_items](bool checked) { + enable_movie_items(m_movie_window->isChecked()); + }); +} + +void OnScreenDisplayPane::AddDescriptions() +{ + static constexpr char TR_ENABLE_OSD_DESCRIPTION[] = + QT_TR_NOOP("Shows on-screen display messages over the render window. These messages " + "disappear after several seconds." + "

If unsure, leave this checked."); + static const char TR_OSD_FONT_SIZE_DESCRIPTION[] = QT_TR_NOOP( + "Changes the font size of the On-Screen Display. Affects features such as performance " + "statistics, frame counter, and netplay chat.

If " + "unsure, leave this at 13."); + + static const char TR_SHOW_FPS_DESCRIPTION[] = + QT_TR_NOOP("Shows the number of distinct frames rendered per second as a measure of " + "visual smoothness.

If unsure, leave this " + "unchecked."); + static const char TR_SHOW_FTIMES_DESCRIPTION[] = + QT_TR_NOOP("Shows the average time in ms between each distinct rendered frame alongside " + "the standard deviation.

If unsure, leave this " + "unchecked."); + static const char TR_SHOW_VPS_DESCRIPTION[] = + QT_TR_NOOP("Shows the number of frames rendered per second as a measure of " + "emulation speed.

If unsure, leave this " + "unchecked."); + static const char TR_SHOW_VTIMES_DESCRIPTION[] = + QT_TR_NOOP("Shows the average time in ms between each rendered frame alongside " + "the standard deviation.

If unsure, leave this " + "unchecked."); + static const char TR_SHOW_GRAPHS_DESCRIPTION[] = + QT_TR_NOOP("Shows frametime graph along with statistics as a representation of " + "emulation performance.

If unsure, leave this " + "unchecked."); + static const char TR_SHOW_SPEED_DESCRIPTION[] = + QT_TR_NOOP("Shows the % speed of emulation compared to full speed." + "

If unsure, leave this " + "unchecked."); + static const char TR_SHOW_SPEED_COLORS_DESCRIPTION[] = + QT_TR_NOOP("Changes the color of the FPS counter depending on emulation speed." + "

If unsure, leave this " + "checked."); + static const char TR_PERF_SAMP_WINDOW_DESCRIPTION[] = + QT_TR_NOOP("The amount of time the FPS and VPS counters will sample over." + "

The higher the value, the more stable the FPS/VPS counter will be, " + "but the slower it will be to update." + "

If unsure, leave this " + "at 1000ms."); + static const char TR_LOG_RENDERTIME_DESCRIPTION[] = QT_TR_NOOP( + "Logs the render time of every frame to User/Logs/render_time.txt.

Use this " + "feature to measure Dolphin's performance.

If " + "unsure, leave this unchecked."); + + static const char TR_SHOW_NETPLAY_PING_DESCRIPTION[] = QT_TR_NOOP( + "Shows the player's maximum ping while playing on " + "NetPlay.

If unsure, leave this unchecked."); + static const char TR_SHOW_NETPLAY_MESSAGES_DESCRIPTION[] = + QT_TR_NOOP("Shows chat messages, buffer changes, and desync alerts " + "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 " + "this unchecked."); + static const char TR_LAG_COUNTER_DESCRIPTION[] = QT_TR_NOOP( + "Shows how many frames have occured without controller inputs being checked. Resets to 1 " + "when inputs are processed.

If unsure, leave " + "this unchecked."); + static const char TR_FRAME_COUNTER_DESCRIPTION[] = + QT_TR_NOOP("Shows how many frames have passed.

If unsure, leave " + "this unchecked."); + static const char TR_INPUT_DISPLAY_DESCRIPTION[] = QT_TR_NOOP( + "Shows the controls currently being input.

If unsure, leave " + "this unchecked."); + static const char TR_SYSTEM_CLOCK_DESCRIPTION[] = + QT_TR_NOOP("Shows current system time.

If unsure, leave " + "this unchecked."); + + static const char TR_SHOW_STATS_DESCRIPTION[] = + QT_TR_NOOP("Shows various rendering statistics.

If unsure, " + "leave this unchecked."); + static const char TR_SHOW_PROJ_STATS_DESCRIPTION[] = + QT_TR_NOOP("Shows various projection statistics.

If unsure, " + "leave this unchecked."); + + m_enable_osd->SetDescription(tr(TR_ENABLE_OSD_DESCRIPTION)); + m_font_size->SetDescription(tr(TR_OSD_FONT_SIZE_DESCRIPTION)); + + m_show_fps->SetDescription(tr(TR_SHOW_FPS_DESCRIPTION)); + m_show_ftimes->SetDescription(tr(TR_SHOW_FTIMES_DESCRIPTION)); + m_show_vps->SetDescription(tr(TR_SHOW_VPS_DESCRIPTION)); + m_show_vtimes->SetDescription(tr(TR_SHOW_VTIMES_DESCRIPTION)); + m_show_graph->SetDescription(tr(TR_SHOW_GRAPHS_DESCRIPTION)); + m_show_speed->SetDescription(tr(TR_SHOW_SPEED_DESCRIPTION)); + m_graph_update_rate->SetDescription(tr(TR_PERF_SAMP_WINDOW_DESCRIPTION)); + m_speed_colors->SetDescription(tr(TR_SHOW_SPEED_COLORS_DESCRIPTION)); + + 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)); + m_input_display->SetDescription(tr(TR_INPUT_DISPLAY_DESCRIPTION)); + m_system_clock->SetDescription(tr(TR_SYSTEM_CLOCK_DESCRIPTION)); + + m_show_statistics->SetDescription(tr(TR_SHOW_STATS_DESCRIPTION)); + m_show_proj_statistics->SetDescription(tr(TR_SHOW_PROJ_STATS_DESCRIPTION)); +} diff --git a/Source/Core/DolphinQt/Settings/OnScreenDisplayPane.h b/Source/Core/DolphinQt/Settings/OnScreenDisplayPane.h new file mode 100644 index 0000000000..59e30d802d --- /dev/null +++ b/Source/Core/DolphinQt/Settings/OnScreenDisplayPane.h @@ -0,0 +1,52 @@ +// Copyright 2025 Dolphin Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include + +class QLabel; +class ConfigBool; +class ConfigInteger; + +class OnScreenDisplayPane final : public QWidget +{ +public: + explicit OnScreenDisplayPane(QWidget* parent = nullptr); + +private: + void CreateLayout(); + void ConnectLayout(); + void AddDescriptions(); + + // General + ConfigBool* m_enable_osd; + ConfigInteger* m_font_size; + + // Performance + ConfigBool* m_show_fps; + ConfigBool* m_show_ftimes; + ConfigBool* m_show_vps; + ConfigBool* m_show_vtimes; + ConfigBool* m_show_graph; + ConfigBool* m_show_speed; + ConfigBool* m_speed_colors; + QLabel* m_graph_update_label; + ConfigInteger* m_graph_update_rate; + + // Movie window + ConfigBool* m_movie_window; + ConfigBool* m_rerecord_counter; + ConfigBool* m_lag_counter; + ConfigBool* m_frame_counter; + ConfigBool* m_input_display; + ConfigBool* m_system_clock; + + // Netplay + ConfigBool* m_show_ping; + ConfigBool* m_show_chat; + + // Debug + ConfigBool* m_show_statistics; + ConfigBool* m_show_proj_statistics; +}; diff --git a/Source/Core/VideoCommon/OnScreenUI.cpp b/Source/Core/VideoCommon/OnScreenUI.cpp index 834971fa0b..bca12bccdd 100644 --- a/Source/Core/VideoCommon/OnScreenUI.cpp +++ b/Source/Core/VideoCommon/OnScreenUI.cpp @@ -256,11 +256,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(