From 55cfb958c7016c32f0f690169c06301e38b63e59 Mon Sep 17 00:00:00 2001 From: Dentomologist Date: Sat, 28 Sep 2024 17:26:46 -0700 Subject: [PATCH] GeneralPane: Add Hardcore Mode tooltip clarification When Hardcore Mode is active, clarify in the Speed Limit tooltip that values less than 100% won't slow emulation. --- .../Core/DolphinQt/Settings/GeneralPane.cpp | 36 +++++++++++++++---- Source/Core/DolphinQt/Settings/GeneralPane.h | 1 + 2 files changed, 30 insertions(+), 7 deletions(-) diff --git a/Source/Core/DolphinQt/Settings/GeneralPane.cpp b/Source/Core/DolphinQt/Settings/GeneralPane.cpp index 0ab3b263a2..ff49053888 100644 --- a/Source/Core/DolphinQt/Settings/GeneralPane.cpp +++ b/Source/Core/DolphinQt/Settings/GeneralPane.cpp @@ -96,6 +96,8 @@ void GeneralPane::OnEmulationStateChanged(Core::State state) m_checkbox_discord_presence->setEnabled(!running); #endif m_combobox_fallback_region->setEnabled(!running); + + UpdateDescriptionsUsingHardcoreStatus(); } void GeneralPane::ConnectLayout() @@ -399,12 +401,6 @@ void GeneralPane::AddDescriptions() "

This setting cannot be changed while emulation is active." "

If unsure, leave this checked."); #endif - static constexpr char TR_SPEEDLIMIT_DESCRIPTION[] = - QT_TR_NOOP("Controls how fast emulation runs relative to the original hardware." - "

Values higher than 100% will emulate faster than the original hardware " - "can run, if your hardware is able to keep up. Values lower than 100% will slow " - "emulation instead. Unlimited will emulate as fast as your hardware is able to." - "

If unsure, select 100%."); static constexpr char TR_UPDATE_TRACK_DESCRIPTION[] = QT_TR_NOOP( "Selects which update track Dolphin uses when checking for updates at startup. If a new " "update is available, Dolphin will show a list of changes made since your current version " @@ -452,7 +448,6 @@ void GeneralPane::AddDescriptions() #endif m_combobox_speedlimit->SetTitle(tr("Speed Limit")); - m_combobox_speedlimit->SetDescription(tr(TR_SPEEDLIMIT_DESCRIPTION)); if (AutoUpdateChecker::SystemSupportsAutoUpdates()) { @@ -470,3 +465,30 @@ void GeneralPane::AddDescriptions() m_button_generate_new_identity->SetDescription(tr(TR_GENERATE_NEW_IDENTITY_DESCRIPTION)); #endif } + +void GeneralPane::UpdateDescriptionsUsingHardcoreStatus() +{ + const bool hardcore_enabled = AchievementManager::GetInstance().IsHardcoreModeActive(); + + static constexpr char TR_SPEEDLIMIT_DESCRIPTION[] = + QT_TR_NOOP("Controls how fast emulation runs relative to the original hardware." + "

Values higher than 100% will emulate faster than the original hardware " + "can run, if your hardware is able to keep up. Values lower than 100% will slow " + "emulation instead. Unlimited will emulate as fast as your hardware is able to." + "

If unsure, select 100%."); + static constexpr char TR_SPEEDLIMIT_RESTRICTION_IN_HARDCORE_DESCRIPTION[] = + QT_TR_NOOP("When Hardcore Mode is enabled, Speed Limit values less than " + "100% will be treated as 100%."); + + if (hardcore_enabled) + { + m_combobox_speedlimit->SetDescription( + tr("%1

%2") + .arg(tr(TR_SPEEDLIMIT_DESCRIPTION)) + .arg(tr(TR_SPEEDLIMIT_RESTRICTION_IN_HARDCORE_DESCRIPTION))); + } + else + { + m_combobox_speedlimit->SetDescription(tr(TR_SPEEDLIMIT_DESCRIPTION)); + } +} diff --git a/Source/Core/DolphinQt/Settings/GeneralPane.h b/Source/Core/DolphinQt/Settings/GeneralPane.h index ffe850491b..17d80f7c38 100644 --- a/Source/Core/DolphinQt/Settings/GeneralPane.h +++ b/Source/Core/DolphinQt/Settings/GeneralPane.h @@ -39,6 +39,7 @@ private: void LoadConfig(); void OnSaveConfig(); void OnEmulationStateChanged(Core::State state); + void UpdateDescriptionsUsingHardcoreStatus(); // Widgets QVBoxLayout* m_main_layout;