@dchighs/dc-assets 0.0.3 → 0.0.5
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.
- package/dist/chest-sprite-downloader.d.ts +13 -0
- package/dist/chest-sprite-downloader.js +16 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5 -0
- package/package.json +1 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ChestSpriteQuality } from "@dchighs/dc-core";
|
|
2
|
+
import { StaticFileDownloader } from "./static-file-downloader";
|
|
3
|
+
export type ChestSpriteDownloaderOptions = {
|
|
4
|
+
imageQuality: ChestSpriteQuality;
|
|
5
|
+
imageName: string;
|
|
6
|
+
};
|
|
7
|
+
export declare class ChestSpriteDownloader extends StaticFileDownloader {
|
|
8
|
+
readonly url: string;
|
|
9
|
+
readonly imageQuality: ChestSpriteQuality;
|
|
10
|
+
readonly imageName: string;
|
|
11
|
+
constructor({ imageQuality, imageName }: ChestSpriteDownloaderOptions);
|
|
12
|
+
download(filePath: string): Promise<string>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ChestSpriteDownloader = void 0;
|
|
4
|
+
const static_file_downloader_1 = require("./static-file-downloader");
|
|
5
|
+
class ChestSpriteDownloader extends static_file_downloader_1.StaticFileDownloader {
|
|
6
|
+
constructor({ imageQuality, imageName }) {
|
|
7
|
+
super();
|
|
8
|
+
this.imageQuality = imageQuality;
|
|
9
|
+
this.imageName = imageName;
|
|
10
|
+
this.url = `https://dci-static-s1.socialpointgames.com/static/dragoncity/mobile/ui/chests/ui_basic_${imageName}${imageQuality}.png`;
|
|
11
|
+
}
|
|
12
|
+
async download(filePath) {
|
|
13
|
+
return await super.download(this.url, filePath);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.ChestSpriteDownloader = ChestSpriteDownloader;
|
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { DragonSpriteDownloader, DragonSpriteDownloaderOptions } from "./dragon-
|
|
|
4
4
|
import { DragonThumbnailDownloader, DragonThumbnailDownloaderOptions } from "./dragon-thumbnail-downloader";
|
|
5
5
|
import { IslandPackageDownloader, IslandPackageDownloaderOptions } from "./island-package-downloader";
|
|
6
6
|
import { MusicDownloader, MusicDownloaderOptions } from "./music-downloader";
|
|
7
|
+
import { ChestSpriteDownloader, ChestSpriteDownloaderOptions } from "./chest-sprite-downloader";
|
|
7
8
|
declare const dcAssets: {
|
|
8
9
|
dragons: {
|
|
9
10
|
animations: {
|
|
@@ -19,11 +20,15 @@ declare const dcAssets: {
|
|
|
19
20
|
sounds: {
|
|
20
21
|
music: (options: MusicDownloaderOptions) => MusicDownloader;
|
|
21
22
|
};
|
|
23
|
+
chests: {
|
|
24
|
+
sprite: (options: ChestSpriteDownloaderOptions) => ChestSpriteDownloader;
|
|
25
|
+
};
|
|
22
26
|
};
|
|
23
27
|
export * from "./dragon-flash-animation-downloader";
|
|
24
28
|
export * from "./static-file-downloader";
|
|
25
29
|
export * from "./dragon-spine-animation-downloader";
|
|
26
30
|
export * from "./dragon-sprite-downloader";
|
|
27
31
|
export * from "./island-package-downloader";
|
|
32
|
+
export * from "./chest-sprite-downloader";
|
|
28
33
|
export * from "./music-downloader";
|
|
29
34
|
export default dcAssets;
|
package/dist/index.js
CHANGED
|
@@ -20,6 +20,7 @@ const dragon_sprite_downloader_1 = require("./dragon-sprite-downloader");
|
|
|
20
20
|
const dragon_thumbnail_downloader_1 = require("./dragon-thumbnail-downloader");
|
|
21
21
|
const island_package_downloader_1 = require("./island-package-downloader");
|
|
22
22
|
const music_downloader_1 = require("./music-downloader");
|
|
23
|
+
const chest_sprite_downloader_1 = require("./chest-sprite-downloader");
|
|
23
24
|
const dcAssets = {
|
|
24
25
|
dragons: {
|
|
25
26
|
animations: {
|
|
@@ -34,6 +35,9 @@ const dcAssets = {
|
|
|
34
35
|
},
|
|
35
36
|
sounds: {
|
|
36
37
|
music: (options) => new music_downloader_1.MusicDownloader(options)
|
|
38
|
+
},
|
|
39
|
+
chests: {
|
|
40
|
+
sprite: (options) => new chest_sprite_downloader_1.ChestSpriteDownloader(options)
|
|
37
41
|
}
|
|
38
42
|
};
|
|
39
43
|
__exportStar(require("./dragon-flash-animation-downloader"), exports);
|
|
@@ -41,5 +45,6 @@ __exportStar(require("./static-file-downloader"), exports);
|
|
|
41
45
|
__exportStar(require("./dragon-spine-animation-downloader"), exports);
|
|
42
46
|
__exportStar(require("./dragon-sprite-downloader"), exports);
|
|
43
47
|
__exportStar(require("./island-package-downloader"), exports);
|
|
48
|
+
__exportStar(require("./chest-sprite-downloader"), exports);
|
|
44
49
|
__exportStar(require("./music-downloader"), exports);
|
|
45
50
|
exports.default = dcAssets;
|