diff --git a/src/core/host_interface.cpp b/src/core/host_interface.cpp index 81b53e2ea..8ffcf2880 100644 --- a/src/core/host_interface.cpp +++ b/src/core/host_interface.cpp @@ -492,7 +492,6 @@ void HostInterface::SetDefaultSettings(SettingsInterface& si) si.SetBoolValue("Main", "ApplyGameSettings", true); si.SetBoolValue("Main", "AutoLoadCheats", true); si.SetBoolValue("Main", "DisableAllEnhancements", false); - si.SetBoolValue("Main", "ShowSpeedIcons", true); si.SetBoolValue("Main", "RewindEnable", false); si.SetFloatValue("Main", "RewindFrequency", 10.0f); si.SetIntValue("Main", "RewindSaveSlots", 10); diff --git a/src/core/settings.cpp b/src/core/settings.cpp index 3cae44eda..0abcbe901 100644 --- a/src/core/settings.cpp +++ b/src/core/settings.cpp @@ -166,7 +166,6 @@ void Settings::Load(SettingsInterface& si) apply_game_settings = si.GetBoolValue("Main", "ApplyGameSettings", true); auto_load_cheats = si.GetBoolValue("Main", "AutoLoadCheats", true); disable_all_enhancements = si.GetBoolValue("Main", "DisableAllEnhancements", false); - show_speed_icons = si.GetBoolValue("Main", "ShowSpeedIcons", true); rewind_enable = si.GetBoolValue("Main", "RewindEnable", false); rewind_save_frequency = si.GetFloatValue("Main", "RewindFrequency", 10.0f); rewind_save_slots = static_cast(si.GetIntValue("Main", "RewindSaveSlots", 10)); @@ -359,7 +358,6 @@ void Settings::Save(SettingsInterface& si) const si.SetBoolValue("Main", "ApplyGameSettings", apply_game_settings); si.SetBoolValue("Main", "AutoLoadCheats", auto_load_cheats); si.SetBoolValue("Main", "DisableAllEnhancements", disable_all_enhancements); - si.SetBoolValue("Main", "ShowSpeedIcons", show_speed_icons); si.SetBoolValue("Main", "RewindEnable", rewind_enable); si.SetFloatValue("Main", "RewindFrequency", rewind_save_frequency); si.SetIntValue("Main", "RewindSaveSlots", rewind_save_slots); diff --git a/src/core/settings.h b/src/core/settings.h index 021fb5abc..534f1d17a 100644 --- a/src/core/settings.h +++ b/src/core/settings.h @@ -96,7 +96,6 @@ struct Settings bool apply_game_settings = true; bool auto_load_cheats = false; bool disable_all_enhancements = false; - bool show_speed_icons = false; bool rewind_enable = false; float rewind_save_frequency = 10.0f; diff --git a/src/duckstation-qt/advancedsettingswidget.cpp b/src/duckstation-qt/advancedsettingswidget.cpp index 53702bd46..c7baaac0a 100644 --- a/src/duckstation-qt/advancedsettingswidget.cpp +++ b/src/duckstation-qt/advancedsettingswidget.cpp @@ -136,7 +136,6 @@ AdvancedSettingsWidget::AdvancedSettingsWidget(QtHostInterface* host_interface, SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.logToFile, "Logging", "LogToFile"); SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.showDebugMenu, "Main", "ShowDebugMenu"); - SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.showSpeedIcons, "Main", "ShowSpeedIcons", true); connect(m_ui.resetToDefaultButton, &QPushButton::clicked, this, &AdvancedSettingsWidget::onResetToDefaultClicked); connect(m_ui.showDebugMenu, &QCheckBox::toggled, m_host_interface->getMainWindow(), @@ -146,6 +145,8 @@ AdvancedSettingsWidget::AdvancedSettingsWidget(QtHostInterface* host_interface, addBooleanTweakOption(m_host_interface, m_ui.tweakOptionTable, tr("Disable All Enhancements"), "Main", "DisableAllEnhancements", false); + addBooleanTweakOption(m_host_interface, m_ui.tweakOptionTable, tr("Show Fullscreen Status Indicators"), "Display", + "ShowStatusIndicators", true); addIntRangeTweakOption(m_host_interface, m_ui.tweakOptionTable, tr("Display FPS Limit"), "Display", "MaxFPS", 0, 1000, 0); @@ -209,8 +210,6 @@ AdvancedSettingsWidget::AdvancedSettingsWidget(QtHostInterface* host_interface, tr("Logs messages to duckstation.log in the user directory.")); dialog->registerWidgetHelp(m_ui.showDebugMenu, tr("Show Debug Menu"), tr("Unchecked"), tr("Shows a debug menu bar with additional statistics and quick settings.")); - dialog->registerWidgetHelp(m_ui.showSpeedIcons, tr("Show Speed Icons"), tr("Checked"), - tr("Shows persistent icons when turbo is active or when paused while using the fullscreen UI.")); } AdvancedSettingsWidget::~AdvancedSettingsWidget() = default; @@ -218,24 +217,25 @@ AdvancedSettingsWidget::~AdvancedSettingsWidget() = default; void AdvancedSettingsWidget::onResetToDefaultClicked() { setBooleanTweakOption(m_ui.tweakOptionTable, 0, false); - setIntRangeTweakOption(m_ui.tweakOptionTable, 1, 0); - setBooleanTweakOption(m_ui.tweakOptionTable, 2, false); - setFloatRangeTweakOption(m_ui.tweakOptionTable, 3, -1.0f); - setFloatRangeTweakOption(m_ui.tweakOptionTable, 4, Settings::DEFAULT_GPU_PGXP_DEPTH_THRESHOLD); - setBooleanTweakOption(m_ui.tweakOptionTable, 5, false); - setChoiceTweakOption(m_ui.tweakOptionTable, 6, Settings::DEFAULT_CPU_FASTMEM_MODE); - setBooleanTweakOption(m_ui.tweakOptionTable, 7, false); + setBooleanTweakOption(m_ui.tweakOptionTable, 1, true); + setIntRangeTweakOption(m_ui.tweakOptionTable, 2, 0); + setBooleanTweakOption(m_ui.tweakOptionTable, 3, false); + setFloatRangeTweakOption(m_ui.tweakOptionTable, 4, -1.0f); + setFloatRangeTweakOption(m_ui.tweakOptionTable, 5, Settings::DEFAULT_GPU_PGXP_DEPTH_THRESHOLD); + setBooleanTweakOption(m_ui.tweakOptionTable, 6, false); + setChoiceTweakOption(m_ui.tweakOptionTable, 7, Settings::DEFAULT_CPU_FASTMEM_MODE); setBooleanTweakOption(m_ui.tweakOptionTable, 8, false); setBooleanTweakOption(m_ui.tweakOptionTable, 9, false); setBooleanTweakOption(m_ui.tweakOptionTable, 10, false); setBooleanTweakOption(m_ui.tweakOptionTable, 11, false); - setIntRangeTweakOption(m_ui.tweakOptionTable, 12, Settings::DEFAULT_VRAM_WRITE_DUMP_WIDTH_THRESHOLD); - setIntRangeTweakOption(m_ui.tweakOptionTable, 13, Settings::DEFAULT_VRAM_WRITE_DUMP_HEIGHT_THRESHOLD); - setIntRangeTweakOption(m_ui.tweakOptionTable, 14, static_cast(Settings::DEFAULT_DMA_MAX_SLICE_TICKS)); - setIntRangeTweakOption(m_ui.tweakOptionTable, 15, static_cast(Settings::DEFAULT_DMA_HALT_TICKS)); - setIntRangeTweakOption(m_ui.tweakOptionTable, 16, static_cast(Settings::DEFAULT_GPU_FIFO_SIZE)); - setIntRangeTweakOption(m_ui.tweakOptionTable, 17, static_cast(Settings::DEFAULT_GPU_MAX_RUN_AHEAD)); - setBooleanTweakOption(m_ui.tweakOptionTable, 18, false); - setBooleanTweakOption(m_ui.tweakOptionTable, 19, true); - setBooleanTweakOption(m_ui.tweakOptionTable, 20, false); + setBooleanTweakOption(m_ui.tweakOptionTable, 12, false); + setIntRangeTweakOption(m_ui.tweakOptionTable, 13, Settings::DEFAULT_VRAM_WRITE_DUMP_WIDTH_THRESHOLD); + setIntRangeTweakOption(m_ui.tweakOptionTable, 14, Settings::DEFAULT_VRAM_WRITE_DUMP_HEIGHT_THRESHOLD); + setIntRangeTweakOption(m_ui.tweakOptionTable, 15, static_cast(Settings::DEFAULT_DMA_MAX_SLICE_TICKS)); + setIntRangeTweakOption(m_ui.tweakOptionTable, 16, static_cast(Settings::DEFAULT_DMA_HALT_TICKS)); + setIntRangeTweakOption(m_ui.tweakOptionTable, 17, static_cast(Settings::DEFAULT_GPU_FIFO_SIZE)); + setIntRangeTweakOption(m_ui.tweakOptionTable, 18, static_cast(Settings::DEFAULT_GPU_MAX_RUN_AHEAD)); + setBooleanTweakOption(m_ui.tweakOptionTable, 19, false); + setBooleanTweakOption(m_ui.tweakOptionTable, 20, true); + setBooleanTweakOption(m_ui.tweakOptionTable, 21, false); } diff --git a/src/duckstation-qt/advancedsettingswidget.ui b/src/duckstation-qt/advancedsettingswidget.ui index 7f8ec578d..80047ccc3 100644 --- a/src/duckstation-qt/advancedsettingswidget.ui +++ b/src/duckstation-qt/advancedsettingswidget.ui @@ -104,13 +104,6 @@ - - - - Show Speed Icons - - - diff --git a/src/frontend-common/common_host_interface.cpp b/src/frontend-common/common_host_interface.cpp index 3c22c0a5a..074970636 100644 --- a/src/frontend-common/common_host_interface.cpp +++ b/src/frontend-common/common_host_interface.cpp @@ -2616,6 +2616,7 @@ void CommonHostInterface::SetDefaultSettings(SettingsInterface& si) ControllerInterface::GetBackendName(ControllerInterface::GetDefaultBackend())); si.SetBoolValue("Display", "InternalResolutionScreenshots", false); + si.SetBoolValue("Display", "ShowStatusIndicators", true); #ifdef WITH_DISCORD_PRESENCE si.SetBoolValue("Main", "EnableDiscordPresence", false); @@ -2699,6 +2700,10 @@ void CommonHostInterface::LoadSettings(SettingsInterface& si) } } } + else if (m_fullscreen_ui_enabled) + { + FullscreenUI::UpdateSettings(); + } const bool input_display_enabled = si.GetBoolValue("Display", "ShowInputs", false); const bool input_display_state = static_cast(s_input_overlay_ui); diff --git a/src/frontend-common/fullscreen_ui.cpp b/src/frontend-common/fullscreen_ui.cpp index 5f39b40a9..62f2336f2 100644 --- a/src/frontend-common/fullscreen_ui.cpp +++ b/src/frontend-common/fullscreen_ui.cpp @@ -79,6 +79,7 @@ namespace FullscreenUI { ////////////////////////////////////////////////////////////////////////// // Main ////////////////////////////////////////////////////////////////////////// +static void LoadSettings(); static void ClearImGuiFocus(); static void ReturnToMainWindow(); static void DrawLandingWindow(); @@ -106,6 +107,7 @@ static MainWindowType s_current_main_window = MainWindowType::Landing; static std::bitset(FrontendCommon::ControllerNavigationButton::Count)> s_nav_input_values{}; static bool s_debug_menu_enabled = false; static bool s_debug_menu_allowed = false; +static bool s_show_status_indicators = false; static bool s_quick_menu_was_open = false; static bool s_was_paused_on_quick_menu_open = false; static bool s_about_window_open = false; @@ -214,6 +216,7 @@ bool Initialize(CommonHostInterface* host_interface) return false; s_settings_copy.Load(*s_host_interface->GetSettingsInterface()); + LoadSettings(); UpdateDebugMenuVisibility(); ImGuiFullscreen::UpdateLayoutScale(); @@ -234,6 +237,16 @@ bool HasActiveWindow() ImGuiFullscreen::IsChoiceDialogOpen() || ImGuiFullscreen::IsFileSelectorOpen(); } +void LoadSettings() +{ + s_show_status_indicators = s_host_interface->GetBoolSettingValue("Display", "ShowStatusIndicators", true); +} + +void UpdateSettings() +{ + LoadSettings(); +} + void SystemCreated() { s_current_main_window = MainWindowType::None; @@ -353,6 +366,7 @@ void SaveAndApplySettings() s_settings_copy.Save(*s_host_interface->GetSettingsInterface()); s_host_interface->GetSettingsInterface()->Save(); s_host_interface->ApplySettings(false); + UpdateSettings(); } void ClearImGuiFocus() @@ -2280,10 +2294,6 @@ void DrawSettingsWindow() s_host_interface->RunLater([debug_menu]() { SetDebugMenuEnabled(debug_menu); }); } - settings_changed |= ToggleButton("Show Speed Icons", - "Shows persistent icons when turbo is active or when paused.", - &s_settings_copy.show_speed_icons); - settings_changed |= ToggleButton("Disable All Enhancements", "Temporarily disables all enhancements, useful when testing.", &s_settings_copy.disable_all_enhancements); @@ -2299,6 +2309,9 @@ void DrawSettingsWindow() #endif MenuHeading("Display Settings"); + settings_changed |= ToggleButtonForNonSetting("Show Status Indicators", + "Shows persistent icons when turbo is active or when paused.", + "Display", "ShowStatusIndicators", true); settings_changed |= RangeButton( "Display FPS Limit", "Limits how many frames are displayed to the screen. These frames are still rendered.", &s_settings_copy.display_max_fps, 0.0f, 500.0f, 1.0f, "%.2f FPS"); @@ -3126,14 +3139,13 @@ void DrawStatsOverlay() DRAW_LINE(g_large_font, g_large_font->FontSize, 0.0f, IM_COL32(255, 255, 255, 255)); } - if (g_settings.show_speed_icons && - (s_host_interface->IsFastForwardEnabled() || s_host_interface->IsTurboEnabled())) + if (s_show_status_indicators && (s_host_interface->IsFastForwardEnabled() || s_host_interface->IsTurboEnabled())) { text.Assign(ICON_FA_FAST_FORWARD); DRAW_LINE(g_large_font, g_large_font->FontSize * 2.0f, margin, IM_COL32(255, 255, 255, 255)); } } - else if (g_settings.show_speed_icons && state == System::State::Paused) + else if (s_show_status_indicators && state == System::State::Paused) { text.Assign(ICON_FA_PAUSE); DRAW_LINE(g_large_font, g_large_font->FontSize * 2.0f, margin, IM_COL32(255, 255, 255, 255)); diff --git a/src/frontend-common/fullscreen_ui.h b/src/frontend-common/fullscreen_ui.h index 9ef0f5c69..5b58da80c 100644 --- a/src/frontend-common/fullscreen_ui.h +++ b/src/frontend-common/fullscreen_ui.h @@ -41,6 +41,7 @@ enum class SettingsPage bool Initialize(CommonHostInterface* host_interface); bool HasActiveWindow(); +void UpdateSettings(); void SystemCreated(); void SystemDestroyed(); void SystemPaused(bool paused);