@quenty/seatutils 1.8.0 → 1.9.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,22 @@
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.9.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/seatutils@1.8.0...@quenty/seatutils@1.9.0) (2023-04-24)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * Fix missing dependencies ([3fbd817](https://github.com/Quenty/NevermoreEngine/commit/3fbd817b1fee45bda1b963b61a6ed22b0db12b82))
12
+
13
+
14
+ ### Features
15
+
16
+ * Add RxSeatUtils.observeOccupantBrio() ([c8cf2d9](https://github.com/Quenty/NevermoreEngine/commit/c8cf2d9caf971c5902419ba19bb13504dcd94fac))
17
+
18
+
19
+
20
+
21
+
6
22
  # [1.8.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/seatutils@1.7.1...@quenty/seatutils@1.8.0) (2023-04-10)
7
23
 
8
24
  **Note:** Version bump only for package @quenty/seatutils
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quenty/seatutils",
3
- "version": "1.8.0",
3
+ "version": "1.9.0",
4
4
  "description": "Holds utilities to work with Roblox seats",
5
5
  "keywords": [
6
6
  "Roblox",
@@ -26,6 +26,7 @@
26
26
  ],
27
27
  "dependencies": {
28
28
  "@quenty/brio": "^8.11.0",
29
+ "@quenty/characterutils": "^6.5.0",
29
30
  "@quenty/instanceutils": "^7.12.0",
30
31
  "@quenty/loader": "^6.2.1",
31
32
  "@quenty/rx": "^7.10.0",
@@ -34,5 +35,5 @@
34
35
  "publishConfig": {
35
36
  "access": "public"
36
37
  },
37
- "gitHead": "3306212248c310731931ad45d8b86dc7247f2a5d"
38
+ "gitHead": "a8a760988c8fd88c2581c5c496a8bad845de104c"
38
39
  }
@@ -16,11 +16,9 @@ local RxSeatUtils = {}
16
16
  Defines occupant as the humanoid attached to the seat.
17
17
 
18
18
  @param seat Seat | VehicleSeat
19
- @return Observable<Humanoid | nil>
19
+ @return Observable<Brio<Humanoid>>
20
20
  ]=]
21
- function RxSeatUtils.observeOccupant(seat)
22
- assert(typeof(seat) == "Instance", "Bad seat")
23
-
21
+ function RxSeatUtils.observeOccupantBrio(seat)
24
22
  return RxInstanceUtils.observeChildrenOfNameBrio(seat, "Weld", "SeatWeld"):Pipe({
25
23
  RxBrioUtils.flatMapBrio(function(weld)
26
24
  return RxBrioUtils.flatCombineLatest({
@@ -52,7 +50,19 @@ function RxSeatUtils.observeOccupant(seat)
52
50
  RxBrioUtils.map(function(state)
53
51
  return state.humanoid
54
52
  end);
53
+ })
54
+ end
55
+
56
+ --[=[
57
+ Defines occupant as the humanoid attached to the seat.
58
+
59
+ @param seat Seat | VehicleSeat
60
+ @return Observable<Humanoid | nil>
61
+ ]=]
62
+ function RxSeatUtils.observeOccupant(seat)
63
+ assert(typeof(seat) == "Instance", "Bad seat")
55
64
 
65
+ return RxSeatUtils.observeOccupantBrio(seat):Pipe({
56
66
  -- Switch to top
57
67
  RxStateStackUtils.topOfStack();
58
68
  Rx.distinct();