Achievements: Purge first-disc-from-playlist option

Unnecessary since all disc's hashes are registered.
This commit is contained in:
Stenzek 2024-11-19 20:13:20 +10:00
parent 4b71428846
commit 5a948800b7
No known key found for this signature in database
5 changed files with 15 additions and 30 deletions

View File

@ -955,8 +955,7 @@ void Achievements::IdentifyGame(const std::string& path, CDImage* image)
} }
std::unique_ptr<CDImage> temp_image; std::unique_ptr<CDImage> temp_image;
if (!path.empty() && (!image || (g_settings.achievements_use_first_disc_from_playlist && image->HasSubImages() && if (!path.empty() && !image)
image->GetCurrentSubImage() != 0)))
{ {
temp_image = CDImage::Open(path.c_str(), g_settings.cdrom_load_image_patches, nullptr); temp_image = CDImage::Open(path.c_str(), g_settings.cdrom_load_image_patches, nullptr);
image = temp_image.get(); image = temp_image.get();

View File

@ -416,7 +416,6 @@ void Settings::Load(const SettingsInterface& si, const SettingsInterface& contro
achievements_encore_mode = si.GetBoolValue("Cheevos", "EncoreMode", false); achievements_encore_mode = si.GetBoolValue("Cheevos", "EncoreMode", false);
achievements_spectator_mode = si.GetBoolValue("Cheevos", "SpectatorMode", false); achievements_spectator_mode = si.GetBoolValue("Cheevos", "SpectatorMode", false);
achievements_unofficial_test_mode = si.GetBoolValue("Cheevos", "UnofficialTestMode", false); achievements_unofficial_test_mode = si.GetBoolValue("Cheevos", "UnofficialTestMode", false);
achievements_use_first_disc_from_playlist = si.GetBoolValue("Cheevos", "UseFirstDiscFromPlaylist", true);
achievements_use_raintegration = si.GetBoolValue("Cheevos", "UseRAIntegration", false); achievements_use_raintegration = si.GetBoolValue("Cheevos", "UseRAIntegration", false);
achievements_notification_duration = achievements_notification_duration =
si.GetIntValue("Cheevos", "NotificationsDuration", DEFAULT_ACHIEVEMENT_NOTIFICATION_TIME); si.GetIntValue("Cheevos", "NotificationsDuration", DEFAULT_ACHIEVEMENT_NOTIFICATION_TIME);
@ -678,7 +677,6 @@ void Settings::Save(SettingsInterface& si, bool ignore_base) const
si.SetBoolValue("Cheevos", "EncoreMode", achievements_encore_mode); si.SetBoolValue("Cheevos", "EncoreMode", achievements_encore_mode);
si.SetBoolValue("Cheevos", "SpectatorMode", achievements_spectator_mode); si.SetBoolValue("Cheevos", "SpectatorMode", achievements_spectator_mode);
si.SetBoolValue("Cheevos", "UnofficialTestMode", achievements_unofficial_test_mode); si.SetBoolValue("Cheevos", "UnofficialTestMode", achievements_unofficial_test_mode);
si.SetBoolValue("Cheevos", "UseFirstDiscFromPlaylist", achievements_use_first_disc_from_playlist);
si.SetBoolValue("Cheevos", "UseRAIntegration", achievements_use_raintegration); si.SetBoolValue("Cheevos", "UseRAIntegration", achievements_use_raintegration);
si.SetIntValue("Cheevos", "NotificationsDuration", achievements_notification_duration); si.SetIntValue("Cheevos", "NotificationsDuration", achievements_notification_duration);
si.SetIntValue("Cheevos", "LeaderboardsDuration", achievements_leaderboard_duration); si.SetIntValue("Cheevos", "LeaderboardsDuration", achievements_leaderboard_duration);

View File

@ -213,7 +213,6 @@ struct Settings
bool achievements_encore_mode : 1 = false; bool achievements_encore_mode : 1 = false;
bool achievements_spectator_mode : 1 = false; bool achievements_spectator_mode : 1 = false;
bool achievements_unofficial_test_mode : 1 = false; bool achievements_unofficial_test_mode : 1 = false;
bool achievements_use_first_disc_from_playlist : 1 = true;
bool achievements_use_raintegration : 1 = false; bool achievements_use_raintegration : 1 = false;
s32 achievements_notification_duration = DEFAULT_ACHIEVEMENT_NOTIFICATION_TIME; s32 achievements_notification_duration = DEFAULT_ACHIEVEMENT_NOTIFICATION_TIME;
s32 achievements_leaderboard_duration = DEFAULT_LEADERBOARD_NOTIFICATION_TIME; s32 achievements_leaderboard_duration = DEFAULT_LEADERBOARD_NOTIFICATION_TIME;

View File

@ -34,8 +34,6 @@ AchievementSettingsWidget::AchievementSettingsWidget(SettingsWindow* dialog, QWi
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.spectatorMode, "Cheevos", "SpectatorMode", false); SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.spectatorMode, "Cheevos", "SpectatorMode", false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.unofficialAchievements, "Cheevos", "UnofficialTestMode", SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.unofficialAchievements, "Cheevos", "UnofficialTestMode",
false); false);
SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.useFirstDiscFromPlaylist, "Cheevos",
"UseFirstDiscFromPlaylist", true);
SettingWidgetBinder::BindWidgetToFloatSetting(sif, m_ui.achievementNotificationsDuration, "Cheevos", SettingWidgetBinder::BindWidgetToFloatSetting(sif, m_ui.achievementNotificationsDuration, "Cheevos",
"NotificationsDuration", "NotificationsDuration",
Settings::DEFAULT_ACHIEVEMENT_NOTIFICATION_TIME); Settings::DEFAULT_ACHIEVEMENT_NOTIFICATION_TIME);
@ -68,16 +66,15 @@ AchievementSettingsWidget::AchievementSettingsWidget(SettingsWindow* dialog, QWi
m_ui.unofficialAchievements, tr("Test Unofficial Achievements"), tr("Unchecked"), m_ui.unofficialAchievements, tr("Test Unofficial Achievements"), tr("Unchecked"),
tr("When enabled, DuckStation will list achievements from unofficial sets. Please note that these achievements are " tr("When enabled, DuckStation will list achievements from unofficial sets. Please note that these achievements are "
"not tracked by RetroAchievements, so they unlock every time.")); "not tracked by RetroAchievements, so they unlock every time."));
dialog->registerWidgetHelp(
m_ui.useFirstDiscFromPlaylist, tr("Use First Disc From Playlist"), tr("Unchecked"),
tr(
"When enabled, the first disc in a playlist will be used for achievements, regardless of which disc is active."));
connect(m_ui.enable, &QCheckBox::checkStateChanged, this, &AchievementSettingsWidget::updateEnableState); connect(m_ui.enable, &QCheckBox::checkStateChanged, this, &AchievementSettingsWidget::updateEnableState);
connect(m_ui.hardcoreMode, &QCheckBox::checkStateChanged, this, &AchievementSettingsWidget::updateEnableState); connect(m_ui.hardcoreMode, &QCheckBox::checkStateChanged, this, &AchievementSettingsWidget::updateEnableState);
connect(m_ui.hardcoreMode, &QCheckBox::checkStateChanged, this, &AchievementSettingsWidget::onHardcoreModeStateChanged); connect(m_ui.hardcoreMode, &QCheckBox::checkStateChanged, this,
connect(m_ui.achievementNotifications, &QCheckBox::checkStateChanged, this, &AchievementSettingsWidget::updateEnableState); &AchievementSettingsWidget::onHardcoreModeStateChanged);
connect(m_ui.leaderboardNotifications, &QCheckBox::checkStateChanged, this, &AchievementSettingsWidget::updateEnableState); connect(m_ui.achievementNotifications, &QCheckBox::checkStateChanged, this,
&AchievementSettingsWidget::updateEnableState);
connect(m_ui.leaderboardNotifications, &QCheckBox::checkStateChanged, this,
&AchievementSettingsWidget::updateEnableState);
connect(m_ui.achievementNotificationsDuration, &QSlider::valueChanged, this, connect(m_ui.achievementNotificationsDuration, &QSlider::valueChanged, this,
&AchievementSettingsWidget::onAchievementsNotificationDurationSliderChanged); &AchievementSettingsWidget::onAchievementsNotificationDurationSliderChanged);
connect(m_ui.leaderboardNotificationsDuration, &QSlider::valueChanged, this, connect(m_ui.leaderboardNotificationsDuration, &QSlider::valueChanged, this,
@ -128,7 +125,6 @@ void AchievementSettingsWidget::updateEnableState()
m_ui.encoreMode->setEnabled(enabled); m_ui.encoreMode->setEnabled(enabled);
m_ui.spectatorMode->setEnabled(enabled); m_ui.spectatorMode->setEnabled(enabled);
m_ui.unofficialAchievements->setEnabled(enabled); m_ui.unofficialAchievements->setEnabled(enabled);
m_ui.useFirstDiscFromPlaylist->setEnabled(enabled);
} }
void AchievementSettingsWidget::onHardcoreModeStateChanged() void AchievementSettingsWidget::onHardcoreModeStateChanged()

View File

@ -64,13 +64,6 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="1">
<widget class="QCheckBox" name="useFirstDiscFromPlaylist">
<property name="text">
<string>Use First Disc From Playlist</string>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
</item> </item>
@ -97,13 +90,13 @@
<number>5</number> <number>5</number>
</property> </property>
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Orientation::Horizontal</enum>
</property> </property>
<property name="invertedAppearance"> <property name="invertedAppearance">
<bool>false</bool> <bool>false</bool>
</property> </property>
<property name="tickPosition"> <property name="tickPosition">
<enum>QSlider::TicksBelow</enum> <enum>QSlider::TickPosition::TicksBelow</enum>
</property> </property>
<property name="tickInterval"> <property name="tickInterval">
<number>1</number> <number>1</number>
@ -143,13 +136,13 @@
<number>5</number> <number>5</number>
</property> </property>
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Orientation::Horizontal</enum>
</property> </property>
<property name="invertedAppearance"> <property name="invertedAppearance">
<bool>false</bool> <bool>false</bool>
</property> </property>
<property name="tickPosition"> <property name="tickPosition">
<enum>QSlider::TicksBelow</enum> <enum>QSlider::TickPosition::TicksBelow</enum>
</property> </property>
<property name="tickInterval"> <property name="tickInterval">
<number>1</number> <number>1</number>
@ -202,7 +195,7 @@
Login token generated at:</string> Login token generated at:</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> <set>Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignTop</set>
</property> </property>
</widget> </widget>
</item> </item>
@ -242,7 +235,7 @@ Login token generated at:</string>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="gameInfo"> <widget class="QLabel" name="gameInfo">
<property name="alignment"> <property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> <set>Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignTop</set>
</property> </property>
</widget> </widget>
</item> </item>
@ -252,7 +245,7 @@ Login token generated at:</string>
<item> <item>
<spacer name="verticalSpacer"> <spacer name="verticalSpacer">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Orientation::Vertical</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
@ -265,7 +258,7 @@ Login token generated at:</string>
</layout> </layout>
</widget> </widget>
<resources> <resources>
<include location="resources/resources.qrc"/> <include location="resources/duckstation-qt.qrc"/>
</resources> </resources>
<connections/> <connections/>
</ui> </ui>