Skip to content

Commit 71e0e61

Browse files
committed
Qt: Order Automatic achievement scale option before OSD
And fix the help text.
1 parent 9edc3c5 commit 71e0e61

File tree

2 files changed

+15
-14
lines changed

2 files changed

+15
-14
lines changed

src/core/fullscreenui_settings.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4992,9 +4992,9 @@ void FullscreenUI::DrawAchievementsSettingsPage(std::unique_lock<std::mutex>& se
49924992
std::string_view mode_text;
49934993
if (!value.has_value())
49944994
mode_text = FSUI_VSTR("Use Global Setting");
4995-
else if (value.value() == -1)
4995+
else if (value.value() < 0)
49964996
mode_text = FSUI_VSTR("Use OSD Scale");
4997-
else if (value.value() == 0)
4997+
else if (value.value() == Settings::ACHIEVEMENT_NOTIFICATION_SCALE_AUTO)
49984998
mode_text = FSUI_VSTR("Automatic");
49994999
else
50005000
mode_text = FSUI_VSTR("Custom");
@@ -5004,8 +5004,9 @@ void FullscreenUI::DrawAchievementsSettingsPage(std::unique_lock<std::mutex>& se
50045004
ChoiceDialogOptions options;
50055005
if (game_settings)
50065006
options.emplace_back(FSUI_STR("Use Global Setting"), !value.has_value());
5007-
options.emplace_back(FSUI_STR("Use OSD Scale"), value.has_value() && value.value() == -1);
5008-
options.emplace_back(FSUI_STR("Automatic"), value.has_value() && value.value() == 0);
5007+
options.emplace_back(FSUI_STR("Automatic"),
5008+
value.has_value() && value.value() == Settings::ACHIEVEMENT_NOTIFICATION_SCALE_AUTO);
5009+
options.emplace_back(FSUI_STR("Use OSD Scale"), value.has_value() && value.value() < 0);
50095010
options.emplace_back(FSUI_STR("Custom"), is_custom);
50105011

50115012
OpenChoiceDialog(title, false, std::move(options),
@@ -5020,9 +5021,9 @@ void FullscreenUI::DrawAchievementsSettingsPage(std::unique_lock<std::mutex>& se
50205021
if (game_settings && index == 0)
50215022
bsi->DeleteValue("Cheevos", key);
50225023
else if (index == offset + 0)
5023-
bsi->SetIntValue("Cheevos", key, -1);
5024-
else if (index == offset + 1)
50255024
bsi->SetIntValue("Cheevos", key, 0);
5025+
else if (index == offset + 1)
5026+
bsi->SetIntValue("Cheevos", key, -1);
50265027
else if (index == offset + 2)
50275028
bsi->SetIntValue("Cheevos", key, 100);
50285029

src/duckstation-qt/achievementsettingswidget.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,10 @@ AchievementSettingsWidget::AchievementSettingsWidget(SettingsWindow* dialog, QWi
9393
dialog->registerWidgetHelp(m_ui.notificationLocation, tr("Notification Location"), tr("Top Left"),
9494
tr("Selects the screen location for achievement and leaderboard notifications."));
9595
dialog->registerWidgetHelp(m_ui.notificationScale, tr("Notification Scale"), tr("Automatic"),
96-
tr("Determines the size of achievement notification popups."));
96+
tr("Determines the size of achievement notification popups. Automatic will use the same "
97+
"scaling as the Big Picture UI."));
9798
dialog->registerWidgetHelp(m_ui.notificationScaleCustom, tr("Custom Notification Scale"), tr("100%"),
98-
tr("Sets the custom scale percentage for achievement notifications. Automatic will use "
99-
"the same scaling as the Big Picture UI."));
99+
tr("Sets the custom scale percentage for achievement notifications."));
100100
dialog->registerWidgetHelp(
101101
m_ui.challengeIndicatorMode, tr("Challenge Indicators"), tr("Show Notifications"),
102102
tr("Shows a notification or icons in the selected location when a challenge/primed achievement is active."));
@@ -174,8 +174,8 @@ void AchievementSettingsWidget::setupAdditionalUi()
174174
.arg((global_value < 0) ? tr("Use OSD Scale") : ((global_value == 0) ? tr("Automatic") : tr("Custom"))));
175175
}
176176

177-
cb->addItem(tr("Use OSD Scale"));
178177
cb->addItem(tr("Automatic"));
178+
cb->addItem(tr("Use OSD Scale"));
179179
cb->addItem(tr("Custom"));
180180

181181
const int option_offset = static_cast<int>(BoolToUInt32(m_dialog->isPerGameSettings()));
@@ -187,7 +187,7 @@ void AchievementSettingsWidget::setupAdditionalUi()
187187
{
188188
if (custom_scale.value() <= 0.0f)
189189
{
190-
cb->setCurrentIndex(((custom_scale.value() < 0.0f) ? 0 : 1) + option_offset);
190+
cb->setCurrentIndex(((custom_scale.value() < 0.0f) ? 1 : 0) + option_offset);
191191
sb->setVisible(false);
192192
sb->setValue(100); // good initial value for custom scale if the user switches to it
193193
}
@@ -206,14 +206,14 @@ void AchievementSettingsWidget::setupAdditionalUi()
206206
}
207207

208208
connect(cb, &QComboBox::currentIndexChanged, this, [this, key, sb, option_offset](int index) {
209-
if (index == 0 + option_offset)
209+
if (index == option_offset + 0)
210210
{
211-
m_dialog->setIntSettingValue("Cheevos", key, Settings::ACHIEVEMENT_NOTIFICATION_SCALE_OSD_SCALE);
211+
m_dialog->setIntSettingValue("Cheevos", key, Settings::ACHIEVEMENT_NOTIFICATION_SCALE_AUTO);
212212
sb->setVisible(false);
213213
}
214214
else if (index == option_offset + 1)
215215
{
216-
m_dialog->setIntSettingValue("Cheevos", key, Settings::ACHIEVEMENT_NOTIFICATION_SCALE_AUTO);
216+
m_dialog->setIntSettingValue("Cheevos", key, Settings::ACHIEVEMENT_NOTIFICATION_SCALE_OSD_SCALE);
217217
sb->setVisible(false);
218218
}
219219
else if (index == option_offset + 2)

0 commit comments

Comments
 (0)