@quenty/accessorytypeutils 1.4.1 → 1.4.2-canary.522.b5d379b.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 +12 -0
- package/package.json +4 -3
- package/src/Shared/AccessoryTypeUtils.lua +8 -18
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,18 @@
|
|
|
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
|
+
## [1.4.2-canary.522.b5d379b.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/accessorytypeutils@1.4.1...@quenty/accessorytypeutils@1.4.2-canary.522.b5d379b.0) (2024-11-24)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* PlayerProductManagerClient queries inventory when inventory is available ([d159eea](https://github.com/Quenty/NevermoreEngine/commit/d159eeade8701bcbcd87e97126df3c3dfb155b8c))
|
|
12
|
+
* Use EnumUtils here ([0232f25](https://github.com/Quenty/NevermoreEngine/commit/0232f25f0bdcd57801e053abd3766a0dc32eeb9a))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
6
18
|
## [1.4.1](https://github.com/Quenty/NevermoreEngine/compare/@quenty/accessorytypeutils@1.4.0...@quenty/accessorytypeutils@1.4.1) (2024-11-04)
|
|
7
19
|
|
|
8
20
|
**Note:** Version bump only for package @quenty/accessorytypeutils
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/accessorytypeutils",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.2-canary.522.b5d379b.0",
|
|
4
4
|
"description": "Utility methods for accessory types",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -25,10 +25,11 @@
|
|
|
25
25
|
"Quenty"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@quenty/
|
|
28
|
+
"@quenty/enumutils": "3.3.0",
|
|
29
|
+
"@quenty/loader": "10.7.1"
|
|
29
30
|
},
|
|
30
31
|
"publishConfig": {
|
|
31
32
|
"access": "public"
|
|
32
33
|
},
|
|
33
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "b5d379b3553fb94b954870562e1bd2a57e9a1c10"
|
|
34
35
|
}
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
local require = require(script.Parent.loader).load(script)
|
|
6
6
|
|
|
7
|
+
local EnumUtils = require("EnumUtils")
|
|
8
|
+
|
|
7
9
|
local AvatarEditorService = game:GetService("AvatarEditorService")
|
|
8
10
|
|
|
9
11
|
local AccessoryTypeUtils = {}
|
|
@@ -40,34 +42,22 @@ end
|
|
|
40
42
|
@param assetTypeId number
|
|
41
43
|
@return AssetType | nl
|
|
42
44
|
]=]
|
|
43
|
-
function AccessoryTypeUtils.convertAssetTypeIdToAssetType(assetTypeId): AssetType
|
|
45
|
+
function AccessoryTypeUtils.convertAssetTypeIdToAssetType(assetTypeId: number): AssetType?
|
|
44
46
|
assert(type(assetTypeId) == "number", "Bad assetTypeId")
|
|
45
47
|
|
|
46
|
-
|
|
47
|
-
if enumItem.Value == assetTypeId then
|
|
48
|
-
return enumItem
|
|
49
|
-
end
|
|
50
|
-
end
|
|
51
|
-
|
|
52
|
-
return nil
|
|
48
|
+
return EnumUtils.toEnum(Enum.AssetType, assetTypeId)
|
|
53
49
|
end
|
|
54
50
|
|
|
55
51
|
--[=[
|
|
56
52
|
Converts an enum value (retrieved from MarketplaceService) into a proper enum if possible
|
|
57
53
|
|
|
58
|
-
@param
|
|
54
|
+
@param avatarAssetTypeId number
|
|
59
55
|
@return AvatarAssetType | nil
|
|
60
56
|
]=]
|
|
61
|
-
function AccessoryTypeUtils.convertAssetTypeIdToAvatarAssetType(
|
|
62
|
-
assert(type(
|
|
63
|
-
|
|
64
|
-
for _, enumItem in pairs(Enum.AvatarAssetType:GetEnumItems()) do
|
|
65
|
-
if enumItem.Value == assetTypeId then
|
|
66
|
-
return enumItem
|
|
67
|
-
end
|
|
68
|
-
end
|
|
57
|
+
function AccessoryTypeUtils.convertAssetTypeIdToAvatarAssetType(avatarAssetTypeId: number): AvatarAssetType?
|
|
58
|
+
assert(type(avatarAssetTypeId) == "number", "Bad avatarAssetTypeId")
|
|
69
59
|
|
|
70
|
-
return
|
|
60
|
+
return EnumUtils.toEnum(Enum.AvatarAssetType, avatarAssetTypeId)
|
|
71
61
|
end
|
|
72
62
|
|
|
73
63
|
return AccessoryTypeUtils
|