@quenty/r15utils 7.22.0 → 7.22.1-canary.417.052e8ba.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 CHANGED
@@ -3,6 +3,17 @@
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
+ ## [7.22.1-canary.417.052e8ba.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/r15utils@7.22.0...@quenty/r15utils@7.22.1-canary.417.052e8ba.0) (2023-10-11)
7
+
8
+
9
+ ### Features
10
+
11
+ * Add helper methods to RxR15Utils ([8b60f4c](https://github.com/Quenty/NevermoreEngine/commit/8b60f4c1c1e3c74efd506fdef1ee98047b5aaa3d))
12
+
13
+
14
+
15
+
16
+
6
17
  # [7.22.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/r15utils@7.21.0...@quenty/r15utils@7.22.0) (2023-09-21)
7
18
 
8
19
  **Note:** Version bump only for package @quenty/r15utils
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quenty/r15utils",
3
- "version": "7.22.0",
3
+ "version": "7.22.1-canary.417.052e8ba.0",
4
4
  "description": "Utility methods for R15 Characters",
5
5
  "keywords": [
6
6
  "Roblox",
@@ -25,12 +25,12 @@
25
25
  "Quenty"
26
26
  ],
27
27
  "dependencies": {
28
- "@quenty/brio": "^8.19.0",
29
- "@quenty/instanceutils": "^7.21.0",
30
- "@quenty/loader": "^6.3.0"
28
+ "@quenty/brio": "8.19.1-canary.417.052e8ba.0",
29
+ "@quenty/instanceutils": "7.21.1-canary.417.052e8ba.0",
30
+ "@quenty/loader": "6.3.1-canary.417.052e8ba.0"
31
31
  },
32
32
  "publishConfig": {
33
33
  "access": "public"
34
34
  },
35
- "gitHead": "fd634d0ed1918fc14bae8501aff1cc099d0537e7"
35
+ "gitHead": "052e8ba33437f71398c4c08c8dbcbf076022d388"
36
36
  }
@@ -297,6 +297,17 @@ function R15Utils.getWristToGripLength(character, side)
297
297
  end
298
298
  end
299
299
 
300
+ function R15Utils.getHumanoidScaleProperty(humanoid, scaleValueName)
301
+ assert(typeof(humanoid) == "Instance" and humanoid:IsA("Humanoid"), "Bad humanoid")
302
+
303
+ local scaleValue = humanoid:FindFirstChild(scaleValueName)
304
+ if scaleValue then
305
+ return scaleValue.Value
306
+ else
307
+ return nil
308
+ end
309
+ end
310
+
300
311
  --[=[
301
312
  Computes the length of an arm for a given character
302
313
  @param character Model
@@ -64,4 +64,32 @@ function RxR15Utils.observeCharacterPartBrio(character, partName)
64
64
  return RxInstanceUtils.observeLastNamedChildBrio(character, "BasePart", partName)
65
65
  end
66
66
 
67
+ --[=[
68
+ Observes a rig motor as a brio
69
+ @param character Model
70
+ @return Observable<Brio<Humanoid>>
71
+ ]=]
72
+ function RxR15Utils.observeHumanoidBrio(character)
73
+ assert(typeof(character) == "Instance", "Bad character")
74
+
75
+ return RxInstanceUtils.observeLastNamedChildBrio(character, "Humanoid", "Humanoid")
76
+ end
77
+
78
+ function RxR15Utils.observeHumanoidScaleValueObject(humanoid, scaleValueName)
79
+ assert(typeof(humanoid) == "Instance" and humanoid:IsA("Humanoid"), "Bad humanoid")
80
+
81
+ return RxInstanceUtils.observeLastNamedChildBrio(humanoid, "NumberValue", scaleValueName)
82
+ end
83
+
84
+ function RxR15Utils.observeHumanoidScaleProperty(humanoid, scaleValueName)
85
+ assert(typeof(humanoid) == "Instance" and humanoid:IsA("Humanoid"), "Bad humanoid")
86
+
87
+ return RxR15Utils.observeHumanoidScaleValueObject(humanoid, scaleValueName):Pipe({
88
+ RxBrioUtils.switchMapBrio(function(scaleValue)
89
+ return RxInstanceUtils.observeProperty(scaleValue, "Value")
90
+ end)
91
+ })
92
+ end
93
+
94
+
67
95
  return RxR15Utils