Skip to content

Commit

Permalink
Get already achieved GJ trophies when game loads
Browse files Browse the repository at this point in the history
  • Loading branch information
petarov committed Jun 13, 2015
1 parent d24c72f commit 7835945
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/game.js
Original file line number Diff line number Diff line change
Expand Up @@ -1653,5 +1653,21 @@
'platinum01': {id: 30764, achieved: false},
'platinum02': {id: 30782, achieved: false}
};
(function(trophies) {
if (GJAPI && GJAPI.bActive) {
GJAPI.TrophyFetch(GJAPI.TROPHY_ONLY_ACHIEVED, function (response) {
if (!response.trophies)
return;
for(var i = 0; i < response.trophies.length; ++i) {
for(var t in trophies) {
if (trophies[t].id == response.trophies[i].id) {
trophies[t].achieved = true;
debug(t + ' is already achieved!');
}
}
}
});
}
}(trophies));
}); //eof-ready
}(Crafty));

0 comments on commit 7835945

Please sign in to comment.