Skip to content

Commit

Permalink
Merge pull request #16 from jasonclemons/master
Browse files Browse the repository at this point in the history
Colored Achievements Fix
  • Loading branch information
Jason Clemons committed Jul 12, 2013
2 parents 04bb150 + d98d968 commit 0f19523
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion source/2.0/includes/classes/api.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,14 @@ public function fetch_achievements($gamertag, $gameid, $region) {
$achievements['achievements'][$i]['id'] = $achievement['Id'];
$achievements['achievements'][$i]['title'] = '';
$achievements['achievements'][$i]['artwork']['locked'] = $achievement['IsHidden'] ? 'https://live.xbox.com/Content/Images/HiddenAchievement.png' : $achievement['TileUrl'];
$achievements['achievements'][$i]['artwork']['unlocked'] = '';
// figure out the colored achievement tile (still hit or miss...)
preg_match('~/.*/.*/(.*?)\.jpg~si', $achievement['TileUrl'], $base64);
preg_match('~/ach/0/[0-9][0-9a-z]?[0-9a-z]?[0-9a-z]?~', base64_decode($base64[1]), $coloredtile);
if(empty($coloredtile[0])) {
$achievements['achievements'][$i]['artwork']['unlocked'] = '';
} else {
$achievements['achievements'][$i]['artwork']['unlocked'] = 'https://image-ssl.xboxlive.com/global/t.' . dechex($json['Game']['Id']) . $coloredtile[0];
}

if(!empty($achievement['Name'])) {
$achievements['achievements'][$i]['title'] = $this->clean($achievement['Name']);
Expand Down

0 comments on commit 0f19523

Please sign in to comment.