Merge pull request #1614 from hydralauncher/feat/add-new-achievements-file-structure-support

feat: add support to new json achievement file structure
This commit is contained in:
Zamitto
2025-04-26 16:44:42 -03:00
committed by GitHub
3 changed files with 16 additions and 1 deletions

File diff suppressed because one or more lines are too long

View File

@@ -25,6 +25,7 @@ import cs from "./cs/translation.json";
import nb from "./nb/translation.json";
import et from "./et/translation.json";
import bg from "./bg/translation.json";
import uz from "./uz/translation.json";
export default {
"pt-BR": ptBR,
@@ -54,4 +55,5 @@ export default {
cs,
nb,
et,
uz,
};

View File

@@ -208,6 +208,19 @@ const processSkidrow = (unlockedAchievements: any): UnlockedAchievement[] => {
const processGoldberg = (unlockedAchievements: any): UnlockedAchievement[] => {
const newUnlockedAchievements: UnlockedAchievement[] = [];
if (Array.isArray(unlockedAchievements)) {
for (const achievement of unlockedAchievements) {
if (achievement?.earned) {
newUnlockedAchievements.push({
name: achievement.name,
unlockTime: achievement.earned_time * 1000,
});
}
}
return newUnlockedAchievements;
}
for (const achievement of Object.keys(unlockedAchievements)) {
const unlockedAchievement = unlockedAchievements[achievement];