Qt: Add option to hide primed/challenge achievements

This commit is contained in:
Connor McLaughlin 2022-10-06 19:38:53 +10:00 committed by refractionpcsx2
parent c0965f7205
commit 0cc665a26b
5 changed files with 28 additions and 10 deletions

View File

@ -47,6 +47,8 @@ AchievementSettingsWidget::AchievementSettingsWidget(SettingsDialog* dialog, QWi
"UnofficialTestMode", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.soundEffects, "Achievements",
"SoundEffects", true);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.primedIndicators, "Achievements",
"PrimedIndicators", true);
dialog->registerWidgetHelp(m_ui.enable, tr("Enable Achievements"), tr("Unchecked"),
tr("When enabled and logged in, PCSX2 will scan for achievements on game load."));
@ -68,6 +70,9 @@ AchievementSettingsWidget::AchievementSettingsWidget(SettingsDialog* dialog, QWi
dialog->registerWidgetHelp(
m_ui.soundEffects, tr("Enable Sound Effects"), tr("Checked"),
tr("Plays sound effects for events such as achievement unlocks and leaderboard submissions."));
dialog->registerWidgetHelp(
m_ui.primedIndicators, tr("Show Challenge Indicators"), tr("Checked"),
tr("Shows icons in the lower-right corner of the screen when a challenge/primed achievement is active."));
connect(m_ui.enable, &QCheckBox::stateChanged, this, &AchievementSettingsWidget::updateEnableState);
connect(m_ui.challengeMode, &QCheckBox::stateChanged, this, &AchievementSettingsWidget::updateEnableState);

View File

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>648</width>
<height>456</height>
<height>470</height>
</rect>
</property>
<property name="windowTitle">
@ -60,13 +60,6 @@
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QCheckBox" name="testMode">
<property name="text">
<string>Enable Test Mode</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="soundEffects">
<property name="text">
@ -81,6 +74,20 @@
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QCheckBox" name="testMode">
<property name="text">
<string>Enable Test Mode</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QCheckBox" name="primedIndicators">
<property name="text">
<string>Show Challenge Indicators</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>

View File

@ -955,7 +955,8 @@ struct Pcsx2Config
RichPresence : 1,
ChallengeMode : 1,
Leaderboards : 1,
SoundEffects : 1;
SoundEffects : 1,
PrimedIndicators : 1;
BITFIELD_END
AchievementsOptions();

View File

@ -785,7 +785,7 @@ void FullscreenUI::Render()
#ifdef ENABLE_ACHIEVEMENTS
// Primed achievements must come first, because we don't want the pause screen to be behind them.
if (Achievements::GetPrimedAchievementCount() > 0)
if (EmuConfig.Achievements.PrimedIndicators && Achievements::GetPrimedAchievementCount() > 0)
DrawPrimedAchievements();
#endif
@ -5729,6 +5729,9 @@ void FullscreenUI::DrawAchievementsSettingsPage()
DrawToggleSetting(bsi, ICON_FA_HEADPHONES " Sound Effects",
"Plays sound effects for events such as achievement unlocks and leaderboard submissions.", "Achievements", "SoundEffects", true,
enabled);
DrawToggleSetting(bsi, ICON_FA_MAGIC " Show Challenge Indicators",
"Shows icons in the lower-right corner of the screen when a challenge/primed achievement is active.", "Achievements",
"PrimedIndicators", true, enabled);
DrawToggleSetting(bsi, ICON_FA_MEDAL " Test Unofficial Achievements",
"When enabled, PCSX2 will list achievements from unofficial sets. These achievements are not tracked by RetroAchievements.",
"Achievements", "UnofficialTestMode", false, enabled);

View File

@ -1024,6 +1024,7 @@ Pcsx2Config::AchievementsOptions::AchievementsOptions()
ChallengeMode = false;
Leaderboards = true;
SoundEffects = true;
PrimedIndicators = true;
}
void Pcsx2Config::AchievementsOptions::LoadSave(SettingsWrapper& wrap)
@ -1037,6 +1038,7 @@ void Pcsx2Config::AchievementsOptions::LoadSave(SettingsWrapper& wrap)
SettingsWrapBitBool(ChallengeMode);
SettingsWrapBitBool(Leaderboards);
SettingsWrapBitBool(SoundEffects);
SettingsWrapBitBool(PrimedIndicators);
}
#endif