@quenty/playerthumbnailutils 4.0.0-canary.236.5597d0a.0 → 4.1.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.
- package/CHANGELOG.md +57 -1
- package/README.md +6 -10
- package/package.json +4 -4
- package/src/Shared/PlayerThumbnailUtils.lua +24 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,63 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
# [4.
|
|
6
|
+
# [4.1.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/playerthumbnailutils@4.0.0...@quenty/playerthumbnailutils@4.1.0) (2022-03-10)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @quenty/playerthumbnailutils
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [4.0.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/playerthumbnailutils@3.7.0...@quenty/playerthumbnailutils@4.0.0) (2022-03-06)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @quenty/playerthumbnailutils
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
# [3.7.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/playerthumbnailutils@3.6.1...@quenty/playerthumbnailutils@3.7.0) (2022-01-17)
|
|
23
|
+
|
|
24
|
+
**Note:** Version bump only for package @quenty/playerthumbnailutils
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
## [3.6.1](https://github.com/Quenty/NevermoreEngine/compare/@quenty/playerthumbnailutils@3.6.0...@quenty/playerthumbnailutils@3.6.1) (2022-01-16)
|
|
31
|
+
|
|
32
|
+
**Note:** Version bump only for package @quenty/playerthumbnailutils
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
# [3.6.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/playerthumbnailutils@3.5.0...@quenty/playerthumbnailutils@3.6.0) (2022-01-07)
|
|
39
|
+
|
|
40
|
+
**Note:** Version bump only for package @quenty/playerthumbnailutils
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
# [3.5.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/playerthumbnailutils@3.4.1...@quenty/playerthumbnailutils@3.5.0) (2022-01-03)
|
|
47
|
+
|
|
48
|
+
**Note:** Version bump only for package @quenty/playerthumbnailutils
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
## [3.4.1](https://github.com/Quenty/NevermoreEngine/compare/@quenty/playerthumbnailutils@3.4.0...@quenty/playerthumbnailutils@3.4.1) (2021-12-30)
|
|
55
|
+
|
|
56
|
+
**Note:** Version bump only for package @quenty/playerthumbnailutils
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
# [3.4.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/playerthumbnailutils@3.3.0...@quenty/playerthumbnailutils@3.4.0) (2021-12-18)
|
|
7
63
|
|
|
8
64
|
**Note:** Version bump only for package @quenty/playerthumbnailutils
|
|
9
65
|
|
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
## PlayerThumbnailUtils
|
|
2
2
|
<div align="center">
|
|
3
|
-
<a href="http://quenty.github.io/
|
|
4
|
-
<img src="https://
|
|
3
|
+
<a href="http://quenty.github.io/NevermoreEngine/">
|
|
4
|
+
<img src="https://github.com/Quenty/NevermoreEngine/actions/workflows/docs.yml/badge.svg" alt="Documentation status" />
|
|
5
5
|
</a>
|
|
6
6
|
<a href="https://discord.gg/mhtGUS8">
|
|
7
|
-
<img src="https://img.shields.io/
|
|
7
|
+
<img src="https://img.shields.io/discord/385151591524597761?color=5865F2&label=discord&logo=discord&logoColor=white" alt="Discord" />
|
|
8
8
|
</a>
|
|
9
9
|
<a href="https://github.com/Quenty/NevermoreEngine/actions">
|
|
10
10
|
<img src="https://github.com/Quenty/NevermoreEngine/actions/workflows/build.yml/badge.svg" alt="Build and release status" />
|
|
@@ -13,13 +13,9 @@
|
|
|
13
13
|
|
|
14
14
|
Reimplementation of Player:GetUserThumbnailAsync but as a promise with retry logic
|
|
15
15
|
|
|
16
|
+
<div align="center"><a href="https://quenty.github.io/NevermoreEngine/api/PlayerThumbnailUtils">View docs →</a></div>
|
|
17
|
+
|
|
16
18
|
## Installation
|
|
17
19
|
```
|
|
18
20
|
npm install @quenty/playerthumbnailutils --save
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
## Usage
|
|
22
|
-
Usage is designed to be simple.
|
|
23
|
-
|
|
24
|
-
### `PlayerThumbnailUtils.promiseUserThumbnail(userId, thumbnailType, thumbnailSize)`
|
|
25
|
-
|
|
21
|
+
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/playerthumbnailutils",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"description": "Reimplementation of Player:GetUserThumbnailAsync but as a promise with retry logic",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -25,11 +25,11 @@
|
|
|
25
25
|
"Quenty"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@quenty/loader": "
|
|
29
|
-
"@quenty/promise": "4.
|
|
28
|
+
"@quenty/loader": "^4.0.0",
|
|
29
|
+
"@quenty/promise": "^4.1.0"
|
|
30
30
|
},
|
|
31
31
|
"publishConfig": {
|
|
32
32
|
"access": "public"
|
|
33
33
|
},
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "0797de955876b050fb24875de0423453e268b2ce"
|
|
35
35
|
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
--[=[
|
|
2
|
+
Reimplementation of Player:GetUserThumbnailAsync but as a promise with
|
|
3
|
+
retry logic.
|
|
4
|
+
|
|
5
|
+
@class PlayerThumbnailUtils
|
|
6
|
+
]=]
|
|
4
7
|
|
|
5
8
|
local require = require(script.Parent.loader).load(script)
|
|
6
9
|
|
|
@@ -12,6 +15,19 @@ local MAX_TRIES = 5
|
|
|
12
15
|
|
|
13
16
|
local PlayerThumbnailUtils = {}
|
|
14
17
|
|
|
18
|
+
--[=[
|
|
19
|
+
Promises a user thumbnail with retry enabled.
|
|
20
|
+
|
|
21
|
+
```lua
|
|
22
|
+
PlayerThumbnailUtils.promiseUserThumbnail(4397833):Then(function(image)
|
|
23
|
+
imageLabel.Image = image
|
|
24
|
+
end)
|
|
25
|
+
```
|
|
26
|
+
@param userId number
|
|
27
|
+
@param thumbnailType ThumbnailType?
|
|
28
|
+
@param thumbnailSize ThumbnailSize?
|
|
29
|
+
@return Promise<string>
|
|
30
|
+
]=]
|
|
15
31
|
function PlayerThumbnailUtils.promiseUserThumbnail(userId, thumbnailType, thumbnailSize)
|
|
16
32
|
assert(type(userId) == "number", "Bad userId")
|
|
17
33
|
thumbnailType = thumbnailType or Enum.ThumbnailType.HeadShot
|
|
@@ -44,6 +60,11 @@ function PlayerThumbnailUtils.promiseUserThumbnail(userId, thumbnailType, thumbn
|
|
|
44
60
|
return promise
|
|
45
61
|
end
|
|
46
62
|
|
|
63
|
+
--[=[
|
|
64
|
+
Promises a player userName with retries enabled.
|
|
65
|
+
@param userId number
|
|
66
|
+
@return Promise<string>
|
|
67
|
+
]=]
|
|
47
68
|
function PlayerThumbnailUtils.promiseUserName(userId)
|
|
48
69
|
assert(type(userId) == "number", "Bad userId")
|
|
49
70
|
|