From a89e05b5607887739d19aa84806ac095758e29c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sat, 9 Mar 2024 12:25:14 +0700 Subject: [PATCH 1/2] Don't gate the RA customize tab on the availability of a file chooser --- UI/RetroAchievementScreens.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/UI/RetroAchievementScreens.cpp b/UI/RetroAchievementScreens.cpp index cc67bba679..cbe798a6e9 100644 --- a/UI/RetroAchievementScreens.cpp +++ b/UI/RetroAchievementScreens.cpp @@ -254,10 +254,8 @@ void RetroAchievementsSettingsScreen::CreateTabs() { using namespace UI; CreateAccountTab(AddTab("AchievementsAccount", ac->T("Account"))); - if (System_GetPropertyBool(SYSPROP_HAS_FILE_BROWSER)) { - // Don't bother creating this tab if we don't have a file browser. - CreateCustomizeTab(AddTab("AchievementsCustomize", ac->T("Customize"))); - } + // Don't bother creating this tab if we don't have a file browser. + CreateCustomizeTab(AddTab("AchievementsCustomize", ac->T("Customize"))); CreateDeveloperToolsTab(AddTab("AchievementsDeveloperTools", sy->T("Developer Tools"))); } @@ -358,12 +356,14 @@ void RetroAchievementsSettingsScreen::CreateCustomizeTab(UI::ViewGroup *viewGrou auto a = GetI18NCategory(I18NCat::AUDIO); using namespace UI; - viewGroup->Add(new ItemHeader(ac->T("Sound Effects"))); - viewGroup->Add(new AudioFileChooser(GetRequesterToken(), &g_Config.sAchievementsUnlockAudioFile, ac->T("Achievement unlocked"), UISound::ACHIEVEMENT_UNLOCKED)); - viewGroup->Add(new AudioFileChooser(GetRequesterToken(), &g_Config.sAchievementsLeaderboardSubmitAudioFile, ac->T("Leaderboard score submission"), UISound::LEADERBOARD_SUBMITTED)); - PopupSliderChoice *volume = viewGroup->Add(new PopupSliderChoice(&g_Config.iAchievementSoundVolume, VOLUME_OFF, VOLUME_FULL, VOLUME_FULL, a->T("Achievement sound volume"), screenManager())); - volume->SetEnabledPtr(&g_Config.bEnableSound); - volume->SetZeroLabel(a->T("Mute")); + if (System_GetPropertyBool(SYSPROP_HAS_FILE_BROWSER)) { + viewGroup->Add(new ItemHeader(ac->T("Sound Effects"))); + viewGroup->Add(new AudioFileChooser(GetRequesterToken(), &g_Config.sAchievementsUnlockAudioFile, ac->T("Achievement unlocked"), UISound::ACHIEVEMENT_UNLOCKED)); + viewGroup->Add(new AudioFileChooser(GetRequesterToken(), &g_Config.sAchievementsLeaderboardSubmitAudioFile, ac->T("Leaderboard score submission"), UISound::LEADERBOARD_SUBMITTED)); + PopupSliderChoice *volume = viewGroup->Add(new PopupSliderChoice(&g_Config.iAchievementSoundVolume, VOLUME_OFF, VOLUME_FULL, VOLUME_FULL, a->T("Achievement sound volume"), screenManager())); + volume->SetEnabledPtr(&g_Config.bEnableSound); + volume->SetZeroLabel(a->T("Mute")); + } static const char *positions[] = { "None", "Bottom Left", "Bottom Center", "Bottom Right", "Top Left", "Top Center", "Top Right", "Center Left", "Center Right" }; From 40ff5dea363f941b6ba26cbe9c99969b4c37ab97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sat, 9 Mar 2024 12:29:46 +0700 Subject: [PATCH 2/2] Let's also allow the volume setting --- UI/RetroAchievementScreens.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/UI/RetroAchievementScreens.cpp b/UI/RetroAchievementScreens.cpp index cbe798a6e9..71535bc81a 100644 --- a/UI/RetroAchievementScreens.cpp +++ b/UI/RetroAchievementScreens.cpp @@ -356,14 +356,14 @@ void RetroAchievementsSettingsScreen::CreateCustomizeTab(UI::ViewGroup *viewGrou auto a = GetI18NCategory(I18NCat::AUDIO); using namespace UI; + viewGroup->Add(new ItemHeader(ac->T("Sound Effects"))); if (System_GetPropertyBool(SYSPROP_HAS_FILE_BROWSER)) { - viewGroup->Add(new ItemHeader(ac->T("Sound Effects"))); viewGroup->Add(new AudioFileChooser(GetRequesterToken(), &g_Config.sAchievementsUnlockAudioFile, ac->T("Achievement unlocked"), UISound::ACHIEVEMENT_UNLOCKED)); viewGroup->Add(new AudioFileChooser(GetRequesterToken(), &g_Config.sAchievementsLeaderboardSubmitAudioFile, ac->T("Leaderboard score submission"), UISound::LEADERBOARD_SUBMITTED)); - PopupSliderChoice *volume = viewGroup->Add(new PopupSliderChoice(&g_Config.iAchievementSoundVolume, VOLUME_OFF, VOLUME_FULL, VOLUME_FULL, a->T("Achievement sound volume"), screenManager())); - volume->SetEnabledPtr(&g_Config.bEnableSound); - volume->SetZeroLabel(a->T("Mute")); } + PopupSliderChoice *volume = viewGroup->Add(new PopupSliderChoice(&g_Config.iAchievementSoundVolume, VOLUME_OFF, VOLUME_FULL, VOLUME_FULL, a->T("Achievement sound volume"), screenManager())); + volume->SetEnabledPtr(&g_Config.bEnableSound); + volume->SetZeroLabel(a->T("Mute")); static const char *positions[] = { "None", "Bottom Left", "Bottom Center", "Bottom Right", "Top Left", "Top Center", "Top Right", "Center Left", "Center Right" };