@quenty/seatutils 7.19.0 → 7.19.1-canary.545.2374fb2.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 +11 -0
- package/package.json +8 -8
- package/src/Shared/RxSeatUtils.lua +11 -8
- package/src/Shared/SeatUtils.lua +2 -1
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.19.1-canary.545.2374fb2.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/seatutils@7.19.0...@quenty/seatutils@7.19.1-canary.545.2374fb2.0) (2025-04-05)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* Add types to packages ([2374fb2](https://github.com/Quenty/NevermoreEngine/commit/2374fb2b043cfbe0e9b507b3316eec46a4e353a0))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
# [7.19.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/seatutils@7.18.2...@quenty/seatutils@7.19.0) (2025-04-02)
|
|
7
18
|
|
|
8
19
|
**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": "7.19.0",
|
|
3
|
+
"version": "7.19.1-canary.545.2374fb2.0",
|
|
4
4
|
"description": "Holds utilities to work with Roblox seats",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -25,15 +25,15 @@
|
|
|
25
25
|
"Quenty"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@quenty/brio": "
|
|
29
|
-
"@quenty/characterutils": "
|
|
30
|
-
"@quenty/instanceutils": "
|
|
31
|
-
"@quenty/loader": "
|
|
32
|
-
"@quenty/rx": "
|
|
33
|
-
"@quenty/statestack": "
|
|
28
|
+
"@quenty/brio": "14.17.1-canary.545.2374fb2.0",
|
|
29
|
+
"@quenty/characterutils": "12.18.1-canary.545.2374fb2.0",
|
|
30
|
+
"@quenty/instanceutils": "13.17.1-canary.545.2374fb2.0",
|
|
31
|
+
"@quenty/loader": "10.8.1-canary.545.2374fb2.0",
|
|
32
|
+
"@quenty/rx": "13.17.1-canary.545.2374fb2.0",
|
|
33
|
+
"@quenty/statestack": "14.18.1-canary.545.2374fb2.0"
|
|
34
34
|
},
|
|
35
35
|
"publishConfig": {
|
|
36
36
|
"access": "public"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "2374fb2b043cfbe0e9b507b3316eec46a4e353a0"
|
|
39
39
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
--!strict
|
|
1
2
|
--[=[
|
|
2
3
|
Rx extension for seats specifically
|
|
3
4
|
@class RxSeatUtils
|
|
@@ -9,6 +10,8 @@ local RxInstanceUtils = require("RxInstanceUtils")
|
|
|
9
10
|
local RxBrioUtils = require("RxBrioUtils")
|
|
10
11
|
local RxStateStackUtils = require("RxStateStackUtils")
|
|
11
12
|
local Rx = require("Rx")
|
|
13
|
+
local _Observable = require("Observable")
|
|
14
|
+
local _Brio = require("Brio")
|
|
12
15
|
|
|
13
16
|
local RxSeatUtils = {}
|
|
14
17
|
|
|
@@ -18,7 +21,7 @@ local RxSeatUtils = {}
|
|
|
18
21
|
@param seat Seat | VehicleSeat
|
|
19
22
|
@return Observable<Brio<Humanoid>>
|
|
20
23
|
]=]
|
|
21
|
-
function RxSeatUtils.observeOccupantBrio(seat: Seat | VehicleSeat)
|
|
24
|
+
function RxSeatUtils.observeOccupantBrio(seat: Seat | VehicleSeat): _Observable.Observable<_Brio.Brio<Humanoid>>
|
|
22
25
|
return RxInstanceUtils.observeChildrenOfNameBrio(seat, "Weld", "SeatWeld"):Pipe({
|
|
23
26
|
RxBrioUtils.flatMapBrio(function(weld)
|
|
24
27
|
return RxBrioUtils.flatCombineLatest({
|
|
@@ -40,7 +43,7 @@ function RxSeatUtils.observeOccupantBrio(seat: Seat | VehicleSeat)
|
|
|
40
43
|
end),
|
|
41
44
|
}),
|
|
42
45
|
})
|
|
43
|
-
end),
|
|
46
|
+
end) :: any,
|
|
44
47
|
|
|
45
48
|
-- Reduce state to humanoid
|
|
46
49
|
RxBrioUtils.where(function(state)
|
|
@@ -50,23 +53,23 @@ function RxSeatUtils.observeOccupantBrio(seat: Seat | VehicleSeat)
|
|
|
50
53
|
RxBrioUtils.map(function(state)
|
|
51
54
|
return state.humanoid
|
|
52
55
|
end),
|
|
53
|
-
})
|
|
56
|
+
}) :: any
|
|
54
57
|
end
|
|
55
58
|
|
|
56
59
|
--[=[
|
|
57
60
|
Defines occupant as the humanoid attached to the seat.
|
|
58
61
|
|
|
59
62
|
@param seat Seat | VehicleSeat
|
|
60
|
-
@return Observable<Humanoid
|
|
63
|
+
@return Observable<Humanoid?>
|
|
61
64
|
]=]
|
|
62
|
-
function RxSeatUtils.observeOccupant(seat: Seat | VehicleSeat)
|
|
65
|
+
function RxSeatUtils.observeOccupant(seat: Seat | VehicleSeat): _Observable.Observable<Humanoid?>
|
|
63
66
|
assert(typeof(seat) == "Instance", "Bad seat")
|
|
64
67
|
|
|
65
68
|
return RxSeatUtils.observeOccupantBrio(seat):Pipe({
|
|
66
69
|
-- Switch to top
|
|
67
|
-
RxStateStackUtils.topOfStack(),
|
|
68
|
-
Rx.distinct(),
|
|
69
|
-
})
|
|
70
|
+
RxStateStackUtils.topOfStack() :: any,
|
|
71
|
+
Rx.distinct() :: any,
|
|
72
|
+
}) :: any
|
|
70
73
|
end
|
|
71
74
|
|
|
72
75
|
return RxSeatUtils
|
package/src/Shared/SeatUtils.lua
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
--!strict
|
|
1
2
|
--[=[
|
|
2
3
|
@class SeatUtils
|
|
3
4
|
]=]
|
|
@@ -17,7 +18,7 @@ local SeatUtils = {}
|
|
|
17
18
|
function SeatUtils.getPlayerOccupants(seats: { Seat | VehicleSeat }): { Player }
|
|
18
19
|
local players = {}
|
|
19
20
|
|
|
20
|
-
for _, seat in
|
|
21
|
+
for _, seat in seats do
|
|
21
22
|
local occupant = seat.Occupant
|
|
22
23
|
if occupant then
|
|
23
24
|
local player = CharacterUtils.getPlayerFromCharacter(occupant)
|