@dchighs/dc-assets 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,6 +6,7 @@ export type ChestSpriteDownloaderOptions = {
6
6
  };
7
7
  export declare class ChestSpriteDownloader extends StaticFileDownloader {
8
8
  readonly url: string;
9
+ readonly basicUrl: string;
9
10
  readonly imageQuality: ChestSpriteQuality;
10
11
  readonly imageName: string;
11
12
  constructor({ imageQuality, imageName }: ChestSpriteDownloaderOptions);
@@ -8,10 +8,16 @@ class ChestSpriteDownloader extends static_file_downloader_1.StaticFileDownloade
8
8
  super();
9
9
  this.imageQuality = imageQuality || dc_core_1.ChestSpriteQuality.Default;
10
10
  this.imageName = imageName;
11
- this.url = `https://dci-static-s1.socialpointgames.com/static/dragoncity/mobile/ui/chests/ui_basic_${imageName}${imageQuality}.png`;
11
+ this.basicUrl = `https://dci-static-s1.socialpointgames.com/static/dragoncity/mobile/ui/chests/ui_basic_${imageName}${imageQuality}.png`;
12
+ this.url = `https://dci-static-s1.socialpointgames.com/static/dragoncity/mobile/ui/chests/ui_${imageName}${imageQuality}.png`;
12
13
  }
13
14
  async download(filePath) {
14
- return await super.download(this.url, filePath);
15
+ try {
16
+ return await super.download(this.url, filePath);
17
+ }
18
+ catch (error) {
19
+ return await super.download(this.basicUrl, filePath);
20
+ }
15
21
  }
16
22
  }
17
23
  exports.ChestSpriteDownloader = ChestSpriteDownloader;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dchighs/dc-assets",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Library focused on downloading static files from the Dragon City server.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",