Skip to content

Commit

Permalink
Merge pull request #18453 from hrydgard/retroachievements-updates
Browse files Browse the repository at this point in the history
Retroachievements: Rename Challenge Mode, default to on
  • Loading branch information
hrydgard authored Nov 30, 2023
2 parents 737ec3e + b629c99 commit c3f881b
Show file tree
Hide file tree
Showing 53 changed files with 246 additions and 232 deletions.
2 changes: 1 addition & 1 deletion Core/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ static bool DefaultSasThread() {
static const ConfigSetting achievementSettings[] = {
// Core settings
ConfigSetting("AchievementsEnable", &g_Config.bAchievementsEnable, true, CfgFlag::DEFAULT),
ConfigSetting("AchievementsChallengeMode", &g_Config.bAchievementsChallengeMode, false, CfgFlag::DEFAULT),
ConfigSetting("AchievementsChallengeMode", &g_Config.bAchievementsChallengeMode, true, CfgFlag::DEFAULT),
ConfigSetting("AchievementsEncoreMode", &g_Config.bAchievementsEncoreMode, false, CfgFlag::DEFAULT),
ConfigSetting("AchievementsUnofficial", &g_Config.bAchievementsUnofficial, false, CfgFlag::DEFAULT),
ConfigSetting("AchievementsLogBadMemReads", &g_Config.bAchievementsLogBadMemReads, false, CfgFlag::DEFAULT),
Expand Down
4 changes: 2 additions & 2 deletions Core/HLE/sceDisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -362,10 +362,10 @@ static int FrameTimingLimit() {
}
};

// Note: Fast-forward is OK in challenge mode.
// Note: Fast-forward is OK in hardcore mode.
if (PSP_CoreParameter().fastForward)
return 0;
// Can't slow down in challenge mode.
// Can't slow down in hardcore mode.
if (PSP_CoreParameter().fpsLimit == FPSLimit::CUSTOM1)
return fixRate(g_Config.iFpsLimit1);
if (PSP_CoreParameter().fpsLimit == FPSLimit::CUSTOM2)
Expand Down
8 changes: 4 additions & 4 deletions Core/RetroAchievements.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ bool WarnUserIfChallengeModeActive(bool isSaveStateAction, const char *message)
const char *showMessage = message;
if (!message) {
auto ac = GetI18NCategory(I18NCat::ACHIEVEMENTS);
showMessage = ac->T("This feature is not available in Challenge Mode");
showMessage = ac->T("This feature is not available in Hardcore Mode");
}

g_OSD.Show(OSDType::MESSAGE_WARNING, showMessage, "", g_RAImageID, 3.0f);
Expand Down Expand Up @@ -237,7 +237,7 @@ static void event_handler_callback(const rc_client_event_t *event, rc_client_t *
{
// TODO: Do some zany fireworks!

// All achievements for the game have been earned. The handler should notify the player that the game was completed or mastered, depending on challenge mode.
// All achievements for the game have been earned. The handler should notify the player that the game was completed or mastered, depending on mode, hardcore or not.
auto ac = GetI18NCategory(I18NCat::ACHIEVEMENTS);

const rc_client_game_t *gameInfo = rc_client_get_game_info(g_rcClient);
Expand Down Expand Up @@ -342,7 +342,7 @@ static void event_handler_callback(const rc_client_event_t *event, rc_client_t *
break;
case RC_CLIENT_EVENT_RESET:
WARN_LOG(ACHIEVEMENTS, "Resetting game due to achievement setting change!");
// Challenge mode was enabled, or something else that forces a game reset.
// Hardcore mode was enabled, or something else that forces a game reset.
System_PostUIMessage(UIMessage::REQUEST_GAME_RESET);
break;
case RC_CLIENT_EVENT_SERVER_ERROR:
Expand Down Expand Up @@ -732,7 +732,7 @@ std::string GetGameAchievementSummary() {
summary.points_unlocked, summary.points_core);
if (ChallengeModeActive()) {
summaryString.append("\n");
summaryString.append(ac->T("Challenge Mode"));
summaryString.append(ac->T("Hardcore Mode"));
}
if (EncoreModeActive()) {
summaryString.append("\n");
Expand Down
6 changes: 3 additions & 3 deletions Core/RetroAchievements.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ bool ChallengeModeActive();

// Same as ChallengeModeActive but comes with a convenient user message. Don't use for every-frame checks or UI enablement,
// only for shortcut keys and commands. You should look up the message in I18NCat::ACHIEVEMENTS.
// If no message is specified, a standard "This feature is not available in Challenge Mode" message will be shown.
// Also returns true if challenge mode is active.
// Specify isSaveAction so we can still permit saves (but not loads) in challenge mode if that option is enabled.
// If no message is specified, a standard "This feature is not available in Hardcore Mode" message will be shown.
// Also returns true if hardcore mode is active.
// Specify isSaveAction so we can still permit saves (but not loads) in hardcore mode if that option is enabled.
bool WarnUserIfChallengeModeActive(bool isSaveStateAction, const char *message = nullptr);

// The new API is so much nicer that we can use it directly instead of wrapping it. So let's expose the client.
Expand Down
2 changes: 1 addition & 1 deletion Core/SaveState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ namespace SaveState
{
if (Achievements::ChallengeModeActive()) {
if (g_Config.bAchievementsSaveStateInChallengeMode && (op.type == SaveState::SAVESTATE_SAVE) || (op.type == SAVESTATE_SAVE_SCREENSHOT)) {
// We allow saving in challenge mode if this setting is on.
// We allow saving in hardcore mode if this setting is on.
} else {
// Operation not allowed
return;
Expand Down
7 changes: 6 additions & 1 deletion Tools/langtool/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,12 @@ fn main() {
ref section,
ref old,
ref new,
} => rename_key(&mut reference_ini, section, old, new).unwrap(),
} => {
if old == new {
println!("WARNING: old == new");
}
rename_key(&mut reference_ini, section, old, new).unwrap();
}
Command::MoveKey {
ref old,
ref new,
Expand Down
7 changes: 6 additions & 1 deletion Tools/langtool/src/section.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,12 @@ impl Section {
}
if let Some(index) = found_index {
let line = self.lines.remove(index);
let line = new.to_owned() + " =" + line.strip_prefix(&prefix).unwrap();
let mut right_part = line.strip_prefix(&prefix).unwrap().to_string();
if right_part.trim() == old.trim() {
// Was still untranslated - replace the translation too.
right_part = format!(" {}", new);
}
let line = new.to_owned() + " =" + &right_part;
self.insert_line_if_missing(&line);
} else {
let name = &self.name;
Expand Down
2 changes: 1 addition & 1 deletion UI/EmuScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ void EmuScreen::bootComplete() {

NOTICE_LOG(BOOT, "Booted %s...", PSP_CoreParameter().fileToStart.c_str());
if (!Achievements::ChallengeModeActive()) {
// Don't auto-load savestates in challenge mode.
// Don't auto-load savestates in hardcore mode.
autoLoad();
}

Expand Down
4 changes: 4 additions & 0 deletions UI/PauseScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,10 @@ void GamePauseScreen::CreateViews() {
leftColumnItems->Add(new AchievementView(achievement));
}
}

// And tack on an explanation for why savestate options are not available.
const char *notAvailable = ac->T("Save states not available in Hardcore Mode");
leftColumnItems->Add(new NoticeView(NoticeLevel::INFO, notAvailable, ""));
}

ViewGroup *rightColumn = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(vertical ? 200 : 300, FILL_PARENT, actionMenuMargins));
Expand Down
6 changes: 3 additions & 3 deletions UI/RetroAchievementScreens.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ void RetroAchievementsSettingsScreen::CreateAccountTab(UI::ViewGroup *viewGroup)
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.bAchievementsChallengeMode, ac->T("Hardcore Mode (no savestates)")))->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")));
Expand Down Expand Up @@ -380,7 +380,7 @@ void RetroAchievementsSettingsScreen::CreateDeveloperToolsTab(UI::ViewGroup *vie
viewGroup->Add(new CheckBox(&g_Config.bAchievementsEncoreMode, ac->T("Encore Mode")))->SetEnabledPtr(&g_Config.bAchievementsEnable);
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);
viewGroup->Add(new CheckBox(&g_Config.bAchievementsSaveStateInChallengeMode, ac->T("Allow Save State in Challenge Mode (but not Load State)")))->SetEnabledPtr(&g_Config.bAchievementsEnable);
viewGroup->Add(new CheckBox(&g_Config.bAchievementsSaveStateInChallengeMode, ac->T("Allow Save State in Hardcore Mode (but not Load State)")))->SetEnabledPtr(&g_Config.bAchievementsEnable);
}

void MeasureAchievement(const UIContext &dc, const rc_client_achievement_t *achievement, AchievementRenderStyle style, float *w, float *h) {
Expand Down Expand Up @@ -439,7 +439,7 @@ void RenderAchievement(UIContext &dc, const rc_client_achievement_t *achievement

if (!achievement->unlocked && !hasFocus) {
// Make the background color gray.
// TODO: Different colors in challenge mode, or even in the "re-take achievements" mode when we add that?
// TODO: Different colors in hardcore mode, or even in the "re-take achievements" mode when we add that?
background.color = (background.color & 0xFF000000) | 0x706060;
}

Expand Down
10 changes: 5 additions & 5 deletions assets/lang/ar_AE.ini
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@ Achievements = Achievements
Achievements are disabled = Achievements are disabled
Achievements enabled = Achievements enabled
Achievements with active challenges = Achievements with active challenges
Allow Save State in Challenge Mode (but not Load State) = Allow Save State in Challenge Mode (but not Load State)
Allow Save State in Hardcore Mode (but not Load State) = Allow Save State in Hardcore Mode (but not Load State)
Almost completed achievements = Almost completed achievements
Around me = Around me
Can't log in to RetroAchievements right now = Can't log in to RetroAchievements right now
Challenge indicator = Challenge indicator
Challenge Mode = Challenge Mode
Challenge Mode (no savestates) = Challenge Mode (no savestates)
Contacting RetroAchievements server... = Contacting RetroAchievements server...
Customize = Customize
Earned = You have unlocked %1 of %2 achievements, and earned %3 of %4 points
Encore Mode = Encore Mode
Failed logging in to RetroAchievements = Failed logging in to RetroAchievements
Failed to connect to RetroAchievements. Achievements will not unlock. = Failed to connect to RetroAchievements. Achievements will not unlock.
Failed to identify game. Achievements will not unlock. = Failed to identify game. Achievements will not unlock.
Hardcore Mode (no savestates) = Hardcore Mode (no savestates)
Hardcore Mode = Hardcore Mode
How to use RetroAchievements = How to use RetroAchievements
In Encore mode - listings may be wrong below = In Encore mode - listings may be wrong below
Leaderboard attempt started or failed = Leaderboard attempt started or failed
Expand All @@ -51,13 +51,13 @@ RetroAchievements are not available for this game = RetroAchievements are not av
RetroAchievements website = RetroAchievements website
Rich Presence = Rich Presence
Save state loaded without achievement data = Save state loaded without achievement data
Save states not available in Challenge Mode = Save states not available in Challenge Mode
Save states not available in Hardcore Mode = Save states not available in Hardcore Mode
Sound Effects = Sound Effects
Statistics = Statistics
Submitted %1 for %2 = Submitted %1 for %2
Syncing achievements data... = Syncing achievements data...
Test Mode = Test Mode
This feature is not available in Challenge Mode = This feature is not available in Challenge Mode
This feature is not available in Hardcore Mode = This feature is not available in Hardcore Mode
This game has no achievements = This game has no achievements
Top players = Top players
Unlocked achievements = Unlocked achievements
Expand Down
10 changes: 5 additions & 5 deletions assets/lang/az_AZ.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@ Achievements = Achievements
Achievements are disabled = Achievements are disabled
Achievements enabled = Achievements enabled
Achievements with active challenges = Achievements with active challenges
Allow Save State in Challenge Mode (but not Load State) = Allow Save State in Challenge Mode (but not Load State)
Allow Save State in Hardcore Mode (but not Load State) = Allow Save State in Hardcore Mode (but not Load State)
Almost completed achievements = Almost completed achievements
Around me = Around me
Can't log in to RetroAchievements right now = Can't log in to RetroAchievements right now
Challenge indicator = Challenge indicator
Challenge Mode = Challenge Mode
Challenge Mode (no savestates) = Challenge Mode (no savestates)
Contacting RetroAchievements server... = Contacting RetroAchievements server...
Customize = Customize
Earned = You have unlocked %1 of %2 achievements, and earned %3 of %4 points
Encore Mode = Encore Mode
Failed logging in to RetroAchievements = Failed logging in to RetroAchievements
Failed to connect to RetroAchievements. Achievements will not unlock. = Failed to connect to RetroAchievements. Achievements will not unlock.
Failed to identify game. Achievements will not unlock. = Failed to identify game. Achievements will not unlock.
Hardcore Mode (no savestates) = Hardcore Mode (no savestates)
Hardcore Mode = Hardcore Mode
How to use RetroAchievements = How to use RetroAchievements
In Encore mode - listings may be wrong below = In Encore mode - listings may be wrong below
Leaderboard attempt started or failed = Leaderboard attempt started or failed
Expand All @@ -43,13 +43,13 @@ RetroAchievements are not available for this game = RetroAchievements are not av
RetroAchievements website = RetroAchievements website
Rich Presence = Rich Presence
Save state loaded without achievement data = Save state loaded without achievement data
Save states not available in Challenge Mode = Save states not available in Challenge Mode
Save states not available in Hardcore Mode = Save states not available in Hardcore Mode
Sound Effects = Sound Effects
Statistics = Statistics
Submitted %1 for %2 = Submitted %1 for %2
Syncing achievements data... = Syncing achievements data...
Test Mode = Test Mode
This feature is not available in Challenge Mode = This feature is not available in Challenge Mode
This feature is not available in Hardcore Mode = This feature is not available in Hardcore Mode
This game has no achievements = This game has no achievements
Top players = Top players
Unlocked achievements = Unlocked achievements
Expand Down
10 changes: 5 additions & 5 deletions assets/lang/bg_BG.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@ Achievements = Achievements
Achievements are disabled = Achievements are disabled
Achievements enabled = Achievements enabled
Achievements with active challenges = Achievements with active challenges
Allow Save State in Challenge Mode (but not Load State) = Allow Save State in Challenge Mode (but not Load State)
Allow Save State in Hardcore Mode (but not Load State) = Allow Save State in Hardcore Mode (but not Load State)
Almost completed achievements = Almost completed achievements
Around me = Around me
Can't log in to RetroAchievements right now = Can't log in to RetroAchievements right now
Challenge indicator = Challenge indicator
Challenge Mode = Challenge Mode
Challenge Mode (no savestates) = Challenge Mode (no savestates)
Contacting RetroAchievements server... = Contacting RetroAchievements server...
Customize = Customize
Earned = You have unlocked %1 of %2 achievements, and earned %3 of %4 points
Encore Mode = Encore Mode
Failed logging in to RetroAchievements = Failed logging in to RetroAchievements
Failed to connect to RetroAchievements. Achievements will not unlock. = Failed to connect to RetroAchievements. Achievements will not unlock.
Failed to identify game. Achievements will not unlock. = Failed to identify game. Achievements will not unlock.
Hardcore Mode (no savestates) = Hardcore Mode (no savestates)
Hardcore Mode = Hardcore Mode
How to use RetroAchievements = How to use RetroAchievements
In Encore mode - listings may be wrong below = In Encore mode - listings may be wrong below
Leaderboard attempt started or failed = Leaderboard attempt started or failed
Expand All @@ -43,13 +43,13 @@ RetroAchievements are not available for this game = RetroAchievements are not av
RetroAchievements website = RetroAchievements website
Rich Presence = Rich Presence
Save state loaded without achievement data = Save state loaded without achievement data
Save states not available in Challenge Mode = Save states not available in Challenge Mode
Save states not available in Hardcore Mode = Save states not available in Hardcore Mode
Sound Effects = Sound Effects
Statistics = Statistics
Submitted %1 for %2 = Submitted %1 for %2
Syncing achievements data... = Syncing achievements data...
Test Mode = Test Mode
This feature is not available in Challenge Mode = This feature is not available in Challenge Mode
This feature is not available in Hardcore Mode = This feature is not available in Hardcore Mode
This game has no achievements = This game has no achievements
Top players = Top players
Unlocked achievements = Unlocked achievements
Expand Down
10 changes: 5 additions & 5 deletions assets/lang/ca_ES.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@ Achievements = Achievements
Achievements are disabled = Achievements are disabled
Achievements enabled = Achievements enabled
Achievements with active challenges = Achievements with active challenges
Allow Save State in Challenge Mode (but not Load State) = Allow Save State in Challenge Mode (but not Load State)
Allow Save State in Hardcore Mode (but not Load State) = Allow Save State in Hardcore Mode (but not Load State)
Almost completed achievements = Almost completed achievements
Around me = Around me
Can't log in to RetroAchievements right now = Can't log in to RetroAchievements right now
Challenge indicator = Challenge indicator
Challenge Mode = Challenge Mode
Challenge Mode (no savestates) = Challenge Mode (no savestates)
Contacting RetroAchievements server... = Contacting RetroAchievements server...
Customize = Customize
Earned = You have unlocked %1 of %2 achievements, and earned %3 of %4 points
Encore Mode = Encore Mode
Failed logging in to RetroAchievements = Failed logging in to RetroAchievements
Failed to connect to RetroAchievements. Achievements will not unlock. = Failed to connect to RetroAchievements. Achievements will not unlock.
Failed to identify game. Achievements will not unlock. = Failed to identify game. Achievements will not unlock.
Hardcore Mode (no savestates) = Hardcore Mode (no savestates)
Hardcore Mode = Hardcore Mode
How to use RetroAchievements = How to use RetroAchievements
In Encore mode - listings may be wrong below = In Encore mode - listings may be wrong below
Leaderboard attempt started or failed = Leaderboard attempt started or failed
Expand All @@ -43,13 +43,13 @@ RetroAchievements are not available for this game = RetroAchievements are not av
RetroAchievements website = RetroAchievements website
Rich Presence = Rich Presence
Save state loaded without achievement data = Save state loaded without achievement data
Save states not available in Challenge Mode = Save states not available in Challenge Mode
Save states not available in Hardcore Mode = Save states not available in Hardcore Mode
Sound Effects = Sound Effects
Statistics = Statistics
Submitted %1 for %2 = Submitted %1 for %2
Syncing achievements data... = Syncing achievements data...
Test Mode = Test Mode
This feature is not available in Challenge Mode = This feature is not available in Challenge Mode
This feature is not available in Hardcore Mode = This feature is not available in Hardcore Mode
This game has no achievements = This game has no achievements
Top players = Top players
Unlocked achievements = Unlocked achievements
Expand Down
Loading

0 comments on commit c3f881b

Please sign in to comment.