Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed icon URLs for achievements

  • Loading branch information...
commit a8a242f129c8372e059b65eb32f2e4595348508e 1 parent 26516e6
@koraktor authored
Showing with 17 additions and 11 deletions.
  1. +17 −11 lib/steam/community/GameAchievement.php
View
28 lib/steam/community/GameAchievement.php
@@ -36,7 +36,12 @@ class GameAchievement {
/**
* @var string
*/
- private $iconUrl;
+ private $iconClosedUrl;
+
+ /**
+ * @var string
+ */
+ private $iconOpenUrl;
/**
* @var string
@@ -96,13 +101,14 @@ public static function getGlobalPercentages($appId) {
* from XML
*/
public function __construct($steamId64, $appId, $achievementData) {
- $this->apiName = (string) $achievementData->name;
- $this->appId = $appId;
- $this->description = (string) $achievementData->description;
- $this->iconUrl = substr((string) $achievementData->iconClosed, 0, -4);
- $this->name = (string) $achievementData->name;
- $this->steamId64 = $steamId64;
- $this->unlocked = (bool)(int) $achievementData->attributes()->closed;
+ $this->apiName = (string) $achievementData->name;
+ $this->appId = $appId;
+ $this->description = (string) $achievementData->description;
+ $this->iconClosedUrl = (string) $achievementData->iconClosed;
+ $this->iconOpenUrl = (string) $achievementData->iconOpen;
+ $this->name = (string) $achievementData->name;
+ $this->steamId64 = $steamId64;
+ $this->unlocked = (bool)(int) $achievementData->attributes()->closed;
if($this->unlocked && $achievementData->unlockTimestamp != null) {
$this->timestamp = (int) $achievementData->unlockTimestamp;
@@ -142,8 +148,8 @@ public function getDescription() {
*
* @return string The url of the closed achievement icon
*/
- public function icon_closed_url() {
- return "{$this->iconUrl}.jpg";
+ public function getIconClosedUrl() {
+ return $this->iconClosedUrl;
}
/**
@@ -152,7 +158,7 @@ public function icon_closed_url() {
* @return string The url of the open achievement icon
*/
public function getIconOpenUrl() {
- "{$this->iconUrl}_bw.jpg";
+ return $this->iconOpenUrl;
}
/**
Please sign in to comment.
Something went wrong with that request. Please try again.