@quenty/humanoiddescriptionutils 3.2.1-canary.8533eea.0 → 3.3.1
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 +9 -1
- package/README.md +6 -20
- package/package.json +6 -6
- package/src/Shared/HumanoidDescriptionUtils.lua +36 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,15 @@
|
|
|
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
|
-
## [3.
|
|
6
|
+
## [3.3.1](https://github.com/Quenty/NevermoreEngine/compare/@quenty/humanoiddescriptionutils@3.3.0...@quenty/humanoiddescriptionutils@3.3.1) (2021-12-30)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @quenty/humanoiddescriptionutils
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [3.3.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/humanoiddescriptionutils@3.2.0...@quenty/humanoiddescriptionutils@3.3.0) (2021-12-18)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @quenty/humanoiddescriptionutils
|
|
9
17
|
|
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
## HumanoidDescriptionUtils
|
|
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,23 +13,9 @@
|
|
|
13
13
|
|
|
14
14
|
Handles actions involving HumanoidDescription objects, including loading character appearance.
|
|
15
15
|
|
|
16
|
+
<div align="center"><a href="https://quenty.github.io/NevermoreEngine/api/HumanoidDescriptionUtils">View docs →</a></div>
|
|
17
|
+
|
|
16
18
|
## Installation
|
|
17
19
|
```
|
|
18
20
|
npm install @quenty/humanoiddescriptionutils --save
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
## Usage
|
|
22
|
-
Usage is designed to be simple.
|
|
23
|
-
|
|
24
|
-
### `HumanoidDescriptionUtils.promiseApplyDescription(humanoid, description)`
|
|
25
|
-
|
|
26
|
-
### `HumanoidDescriptionUtils.promiseApplyFromUserName(humanoid, userName)`
|
|
27
|
-
|
|
28
|
-
### `HumanoidDescriptionUtils.promiseFromUserName(userName)`
|
|
29
|
-
|
|
30
|
-
### `HumanoidDescriptionUtils.promiseFromUserId(userId)`
|
|
31
|
-
|
|
32
|
-
### `HumanoidDescriptionUtils.getAssetIdsFromString(assetString)`
|
|
33
|
-
|
|
34
|
-
### `HumanoidDescriptionUtils.getAssetPromisesFromString(assetString)`
|
|
35
|
-
|
|
21
|
+
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/humanoiddescriptionutils",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.1",
|
|
4
4
|
"description": "Handles actions involving HumanoidDescription objects, including loading character appearance.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -25,13 +25,13 @@
|
|
|
25
25
|
"Quenty"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@quenty/insertserviceutils": "3.
|
|
29
|
-
"@quenty/loader": "3.1.
|
|
30
|
-
"@quenty/playersservicepromises": "3.
|
|
31
|
-
"@quenty/promise": "3.
|
|
28
|
+
"@quenty/insertserviceutils": "^3.3.1",
|
|
29
|
+
"@quenty/loader": "^3.1.2",
|
|
30
|
+
"@quenty/playersservicepromises": "^3.3.1",
|
|
31
|
+
"@quenty/promise": "^3.3.1"
|
|
32
32
|
},
|
|
33
33
|
"publishConfig": {
|
|
34
34
|
"access": "public"
|
|
35
35
|
},
|
|
36
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "d146c77d0a8e452824de0ab0b4b03ba0370bcc1b"
|
|
37
37
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
--[=[
|
|
2
|
+
Handles actions involving HumanoidDescription objects, including loading character appearance.
|
|
3
|
+
@class HumanoidDescriptionUtils
|
|
4
|
+
]=]
|
|
4
5
|
|
|
5
6
|
local require = require(script.Parent.loader).load(script)
|
|
6
7
|
|
|
@@ -12,6 +13,12 @@ local PlayersServicePromises = require("PlayersServicePromises")
|
|
|
12
13
|
|
|
13
14
|
local HumanoidDescriptionUtils = {}
|
|
14
15
|
|
|
16
|
+
--[=[
|
|
17
|
+
Promises to apply a humaoid descrition
|
|
18
|
+
@param humanoid Humanoid
|
|
19
|
+
@param description HumanoidDescription
|
|
20
|
+
@return Promise
|
|
21
|
+
]=]
|
|
15
22
|
function HumanoidDescriptionUtils.promiseApplyDescription(humanoid, description)
|
|
16
23
|
assert(typeof(humanoid) == "Instance" and humanoid:IsA("Humanoid"), "Bad humanoid")
|
|
17
24
|
assert(typeof(description) == "Instance" and description:IsA("HumanoidDescription"), "Bad description")
|
|
@@ -28,6 +35,12 @@ function HumanoidDescriptionUtils.promiseApplyDescription(humanoid, description)
|
|
|
28
35
|
end)
|
|
29
36
|
end
|
|
30
37
|
|
|
38
|
+
--[=[
|
|
39
|
+
Applies humanoid description from userName.
|
|
40
|
+
@param humanoid Humanoid
|
|
41
|
+
@param userName string
|
|
42
|
+
@return Promise
|
|
43
|
+
]=]
|
|
31
44
|
function HumanoidDescriptionUtils.promiseApplyFromUserName(humanoid, userName)
|
|
32
45
|
return HumanoidDescriptionUtils.promiseFromUserName(userName)
|
|
33
46
|
:Then(function(description)
|
|
@@ -35,6 +48,11 @@ function HumanoidDescriptionUtils.promiseApplyFromUserName(humanoid, userName)
|
|
|
35
48
|
end)
|
|
36
49
|
end
|
|
37
50
|
|
|
51
|
+
--[=[
|
|
52
|
+
Retrieves a humanoid description from username
|
|
53
|
+
@param userName string
|
|
54
|
+
@return Promise<HumanoidDescription>
|
|
55
|
+
]=]
|
|
38
56
|
function HumanoidDescriptionUtils.promiseFromUserName(userName)
|
|
39
57
|
return PlayersServicePromises.promiseUserIdFromName(userName)
|
|
40
58
|
:Then(function(userId)
|
|
@@ -42,6 +60,11 @@ function HumanoidDescriptionUtils.promiseFromUserName(userName)
|
|
|
42
60
|
end)
|
|
43
61
|
end
|
|
44
62
|
|
|
63
|
+
--[=[
|
|
64
|
+
Retrieves a humanoid description from userId
|
|
65
|
+
@param userId number
|
|
66
|
+
@return Promise<HumanoidDescription>
|
|
67
|
+
]=]
|
|
45
68
|
function HumanoidDescriptionUtils.promiseFromUserId(userId)
|
|
46
69
|
assert(type(userId) == "number", "Bad userId")
|
|
47
70
|
|
|
@@ -63,6 +86,11 @@ function HumanoidDescriptionUtils.promiseFromUserId(userId)
|
|
|
63
86
|
end)
|
|
64
87
|
end
|
|
65
88
|
|
|
89
|
+
--[=[
|
|
90
|
+
Retrieves the assetIds from an assetId, in the format that is known to us.
|
|
91
|
+
@param assetString string -- A comma seperated value of asset ids which should be numbers
|
|
92
|
+
@return { number }
|
|
93
|
+
]=]
|
|
66
94
|
function HumanoidDescriptionUtils.getAssetIdsFromString(assetString)
|
|
67
95
|
if assetString == "" then
|
|
68
96
|
return {}
|
|
@@ -82,6 +110,11 @@ function HumanoidDescriptionUtils.getAssetIdsFromString(assetString)
|
|
|
82
110
|
return assetIds
|
|
83
111
|
end
|
|
84
112
|
|
|
113
|
+
--[=[
|
|
114
|
+
From stuff like [HumanoidDescription.HatAccessory].
|
|
115
|
+
@param assetString string -- A comma seperated value of asset ids which should be numbers
|
|
116
|
+
@return { Promise<Instance> }
|
|
117
|
+
]=]
|
|
85
118
|
function HumanoidDescriptionUtils.getAssetPromisesFromString(assetString)
|
|
86
119
|
local promises = {}
|
|
87
120
|
for _, assetId in pairs(HumanoidDescriptionUtils.getAssetIdsFromString(assetString)) do
|