mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-11 13:56:16 +00:00
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:
File diff suppressed because one or more lines are too long
@@ -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,
|
||||
};
|
||||
|
||||
@@ -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];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user