Merge pull request #17692 from hrydgard/achievement-ui-fixes

RetroAchievements UI updates: Merge Account and Settings tabs
This commit is contained in:
Henrik Rydgård 2023-07-11 11:13:57 +02:00 committed by GitHub
commit 78e99f1d93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 21 additions and 22 deletions

View File

@ -594,7 +594,7 @@ void identify_and_load_callback(int result, const char *error_message, rc_client
}
case RC_NO_GAME_LOADED:
// The current game does not support achievements.
g_OSD.Show(OSDType::MESSAGE_INFO, ac->T("This game has no achievements"), 3.0f);
g_OSD.Show(OSDType::MESSAGE_INFO, ac->T("RetroAchievements are not available for this game"), 3.0f);
break;
default:
// Other various errors.

View File

@ -189,11 +189,12 @@ RetroAchievementsSettingsScreen::~RetroAchievementsSettingsScreen() {}
void RetroAchievementsSettingsScreen::CreateTabs() {
auto ac = GetI18NCategory(I18NCat::ACHIEVEMENTS);
auto di = GetI18NCategory(I18NCat::DIALOG);
auto sy = GetI18NCategory(I18NCat::SYSTEM);
using namespace UI;
CreateAccountTab(AddTab("AchievementsAccount", ac->T("Account")));
CreateSettingsTab(AddTab("AchievementsSettings", di->T("Settings")));
CreateDeveloperToolsTab(AddTab("AchievementsDeveloperTools", sy->T("Developer Tools")));
}
void RetroAchievementsSettingsScreen::sendMessage(const char *message, const char *value) {
@ -255,6 +256,17 @@ void RetroAchievementsSettingsScreen::CreateAccountTab(UI::ViewGroup *viewGroup)
});
}
using namespace UI;
viewGroup->Add(new ItemHeader(di->T("Settings")));
viewGroup->Add(new CheckBox(&g_Config.bAchievementsEnable, ac->T("Achievements enabled")))->OnClick.Add([&](UI::EventParams &e) -> UI::EventReturn {
Achievements::UpdateSettings();
RecreateViews();
return UI::EVENT_DONE;
});
viewGroup->Add(new CheckBox(&g_Config.bAchievementsChallengeMode, ac->T("Challenge Mode (no savestates)")))->SetEnabledPtr(&g_Config.bAchievementsEnable);
viewGroup->Add(new CheckBox(&g_Config.bAchievementsEncoreMode, ac->T("Encore Mode")))->SetEnabledPtr(&g_Config.bAchievementsEnable);
// viewGroup->Add(new CheckBox(&g_Config.bAchievementsSoundEffects, ac->T("Sound Effects")))->SetEnabledPtr(&g_Config.bAchievementsEnable); // not yet implemented
viewGroup->Add(new ItemHeader(di->T("Links")));
viewGroup->Add(new Choice(ac->T("RetroAchievements website")))->OnClick.Add([&](UI::EventParams &) -> UI::EventReturn {
System_LaunchUrl(LaunchUrlType::BROWSER_URL, "https://www.retroachievements.org/");
@ -266,25 +278,13 @@ void RetroAchievementsSettingsScreen::CreateAccountTab(UI::ViewGroup *viewGroup)
});
}
void RetroAchievementsSettingsScreen::CreateSettingsTab(UI::ViewGroup *viewGroup) {
void RetroAchievementsSettingsScreen::CreateDeveloperToolsTab(UI::ViewGroup *viewGroup) {
auto ac = GetI18NCategory(I18NCat::ACHIEVEMENTS);
using namespace UI;
viewGroup->Add(new ItemHeader(ac->T("Settings")));
viewGroup->Add(new CheckBox(&g_Config.bAchievementsEnable, ac->T("Achievements enabled")))->OnClick.Add([&](UI::EventParams &e) -> UI::EventReturn {
Achievements::UpdateSettings();
RecreateViews();
return UI::EVENT_DONE;
});
viewGroup->Add(new CheckBox(&g_Config.bAchievementsChallengeMode, ac->T("Challenge Mode (no savestates)")));
viewGroup->Add(new CheckBox(&g_Config.bAchievementsEncoreMode, ac->T("Encore Mode")));
viewGroup->Add(new CheckBox(&g_Config.bAchievementsUnofficial, ac->T("Unofficial achievements")));
// viewGroup->Add(new CheckBox(&g_Config.bAchievementsSoundEffects, ac->T("Sound Effects")))->SetEnabledPtr(&g_Config.bAchievementsEnable); // not yet implemented
viewGroup->Add(new CheckBox(&g_Config.bAchievementsUnofficial, ac->T("Unofficial achievements")))->SetEnabledPtr(&g_Config.bAchievementsEnable);
viewGroup->Add(new CheckBox(&g_Config.bAchievementsLogBadMemReads, ac->T("Log bad memory accesses")))->SetEnabledPtr(&g_Config.bAchievementsEnable);
// TODO: What are these for?
// viewGroup->Add(new CheckBox(&g_Config.bAchievementsTestMode, ac->T("Test Mode")));
// viewGroup->Add(new CheckBox(&g_Config.bAchievementsUnofficialTestMode, ac->T("Unofficial Test Mode")));
}
void MeasureAchievement(const UIContext &dc, const rc_client_achievement_t *achievement, AchievementRenderStyle style, float *w, float *h) {

View File

@ -42,7 +42,7 @@ protected:
private:
void CreateAccountTab(UI::ViewGroup *viewGroup);
void CreateSettingsTab(UI::ViewGroup *viewGroup);
void CreateDeveloperToolsTab(UI::ViewGroup *viewGroup);
std::string username_;
std::string password_;

View File

@ -50,8 +50,6 @@ Rich Presence = Rich Presence
Save state loaded without achievement data = Save state loaded without achievement data
Sound Effects = Sound Effects
Statistics = Statistics
Submitted Score = Submitted Score
Submitted Score = Submitted score: %d (Best: %d)\nLeaderboard Position: %d of %d
Syncing achievements data... = Syncing achievements data...
Test Mode = Test Mode
This game has no achievements = This game has no achievements

View File

@ -1,5 +1,8 @@
[Achievements]
%d achievements, %d points = %d achievements, %d poäng
%1: Leaderboard attempt started = %1: Topplisteförsök startat
%1: Leaderboard attempt failed = %1: Topplisteförsök misslyckades
%1: Submitting leaderboard score: %2! = %1: Skickar in toppliste-poäng: %2!
Account = Inloggning
Achievements = Achievements
Challenge Mode = Utmanings-läge
@ -19,13 +22,11 @@ RetroAchievements website = RetroAchievements website
Rich Presence = Visa vad du spelar på websiten
Sound Effects = Ljudeffekter
Statistics = Statistik
Submitted Score = Inskickad poäng
Submitted Score = Inskickad poäng: %d (Best: %d)\nLedartabell-plats: %d of %d
Syncing achievements data... = Synkar achievementdata...
Test Mode = Test-läge
This game has no achievements = Detta spel har inga achievements
Unlocked achievements = Upplåsta achievements
Unofficial = Inofficiell
Unofficial achievements = Inofficiella achievements
[Audio]
Alternate speed volume = Volym vid alternativ hastighet