@quenty/idleservice 13.23.3 → 13.23.4-canary.559.339cfa7.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 +16 -0
- package/package.json +12 -12
- package/src/Client/IdleServiceClient.lua +10 -10
- package/src/Client/IdleTargetCalculator.lua +21 -9
- package/src/Server/IdleService.lua +3 -3
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
|
+
## [13.23.4-canary.559.339cfa7.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/idleservice@13.23.3...@quenty/idleservice@13.23.4-canary.559.339cfa7.0) (2025-05-10)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* Additional type checking updates ([05ba29a](https://github.com/Quenty/NevermoreEngine/commit/05ba29a03efc9f3feed74b34f1d9dfb237496214))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* Add even more types ([b31717d](https://github.com/Quenty/NevermoreEngine/commit/b31717d8c9f7620c457f5018a2affa760a65334a))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
6
22
|
## [13.23.3](https://github.com/Quenty/NevermoreEngine/compare/@quenty/idleservice@13.23.2...@quenty/idleservice@13.23.3) (2025-04-10)
|
|
7
23
|
|
|
8
24
|
**Note:** Version bump only for package @quenty/idleservice
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/idleservice",
|
|
3
|
-
"version": "13.23.
|
|
3
|
+
"version": "13.23.4-canary.559.339cfa7.0",
|
|
4
4
|
"description": "Helps track whether or not a player is idle and if so, then can show UI or other cute things.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -27,19 +27,19 @@
|
|
|
27
27
|
"Quenty"
|
|
28
28
|
],
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@quenty/baseobject": "
|
|
31
|
-
"@quenty/humanoidtracker": "
|
|
32
|
-
"@quenty/loader": "
|
|
33
|
-
"@quenty/maid": "
|
|
34
|
-
"@quenty/ragdoll": "
|
|
35
|
-
"@quenty/rx": "
|
|
36
|
-
"@quenty/servicebag": "
|
|
37
|
-
"@quenty/statestack": "
|
|
38
|
-
"@quenty/valuebaseutils": "
|
|
39
|
-
"@quenty/valueobject": "
|
|
30
|
+
"@quenty/baseobject": "10.8.4-canary.559.339cfa7.0",
|
|
31
|
+
"@quenty/humanoidtracker": "13.17.4-canary.559.339cfa7.0",
|
|
32
|
+
"@quenty/loader": "10.8.4-canary.559.339cfa7.0",
|
|
33
|
+
"@quenty/maid": "3.4.4-canary.559.339cfa7.0",
|
|
34
|
+
"@quenty/ragdoll": "15.23.4-canary.559.339cfa7.0",
|
|
35
|
+
"@quenty/rx": "13.17.4-canary.559.339cfa7.0",
|
|
36
|
+
"@quenty/servicebag": "11.11.5-canary.559.339cfa7.0",
|
|
37
|
+
"@quenty/statestack": "14.18.4-canary.559.339cfa7.0",
|
|
38
|
+
"@quenty/valuebaseutils": "13.17.4-canary.559.339cfa7.0",
|
|
39
|
+
"@quenty/valueobject": "13.17.4-canary.559.339cfa7.0"
|
|
40
40
|
},
|
|
41
41
|
"publishConfig": {
|
|
42
42
|
"access": "public"
|
|
43
43
|
},
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "339cfa778736f08768ed7305041f6221faa35bfc"
|
|
45
45
|
}
|
|
@@ -13,9 +13,9 @@ local VRService = game:GetService("VRService")
|
|
|
13
13
|
local Maid = require("Maid")
|
|
14
14
|
local RagdollClient = require("RagdollClient")
|
|
15
15
|
local Rx = require("Rx")
|
|
16
|
+
local ServiceBag = require("ServiceBag")
|
|
16
17
|
local StateStack = require("StateStack")
|
|
17
18
|
local ValueObject = require("ValueObject")
|
|
18
|
-
local _ServiceBag = require("ServiceBag")
|
|
19
19
|
|
|
20
20
|
local IdleServiceClient = {}
|
|
21
21
|
IdleServiceClient.ServiceName = "IdleServiceClient"
|
|
@@ -27,7 +27,7 @@ local MOVE_DISTANCE_REQUIRED = 2.5
|
|
|
27
27
|
Initializes the idle service on the client. Should be done via [ServiceBag].
|
|
28
28
|
@param serviceBag ServiceBag
|
|
29
29
|
]=]
|
|
30
|
-
function IdleServiceClient:Init(serviceBag:
|
|
30
|
+
function IdleServiceClient:Init(serviceBag: ServiceBag.ServiceBag)
|
|
31
31
|
assert(not self._maid, "Already initialized")
|
|
32
32
|
|
|
33
33
|
self._maid = Maid.new()
|
|
@@ -85,22 +85,22 @@ function IdleServiceClient:ObserveHumanoidMoveFromCurrentPosition(minimumTimeVis
|
|
|
85
85
|
assert(type(minimumTimeVisible) == "number", "Bad minimumTimeVisible")
|
|
86
86
|
|
|
87
87
|
return Rx.of(true):Pipe({
|
|
88
|
-
Rx.delay(minimumTimeVisible)
|
|
88
|
+
Rx.delay(minimumTimeVisible),
|
|
89
89
|
Rx.flatMap(function()
|
|
90
90
|
return self._lastPosition:Observe()
|
|
91
|
-
end)
|
|
91
|
+
end),
|
|
92
92
|
Rx.where(function(value)
|
|
93
93
|
return value ~= nil
|
|
94
|
-
end)
|
|
95
|
-
Rx.first()
|
|
94
|
+
end),
|
|
95
|
+
Rx.first(),
|
|
96
96
|
Rx.flatMap(function(initialPosition)
|
|
97
97
|
return self._lastPosition:Observe():Pipe({
|
|
98
98
|
Rx.where(function(position)
|
|
99
99
|
return position == nil or (initialPosition - position).magnitude >= MOVE_DISTANCE_REQUIRED
|
|
100
|
-
end)
|
|
100
|
+
end),
|
|
101
101
|
})
|
|
102
|
-
end)
|
|
103
|
-
Rx.first()
|
|
102
|
+
end),
|
|
103
|
+
Rx.first(),
|
|
104
104
|
})
|
|
105
105
|
end
|
|
106
106
|
|
|
@@ -229,4 +229,4 @@ function IdleServiceClient:Destroy()
|
|
|
229
229
|
self._maid:DoCleaning()
|
|
230
230
|
end
|
|
231
231
|
|
|
232
|
-
return IdleServiceClient
|
|
232
|
+
return IdleServiceClient
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
--!strict
|
|
1
2
|
--[=[
|
|
2
3
|
Assets in calculating whether the player is idle while moving the camera around or
|
|
3
4
|
aiming a gun.
|
|
@@ -7,6 +8,8 @@
|
|
|
7
8
|
local require = require(script.Parent.loader).load(script)
|
|
8
9
|
|
|
9
10
|
local BaseObject = require("BaseObject")
|
|
11
|
+
local Observable = require("Observable")
|
|
12
|
+
local Signal = require("Signal")
|
|
10
13
|
local ValueObject = require("ValueObject")
|
|
11
14
|
|
|
12
15
|
local DIST_BEFORE_MOVEMENT = 0.15
|
|
@@ -16,26 +19,35 @@ local IdleTargetCalculator = setmetatable({}, BaseObject)
|
|
|
16
19
|
IdleTargetCalculator.ClassName = "IdleTargetCalculator"
|
|
17
20
|
IdleTargetCalculator.__index = IdleTargetCalculator
|
|
18
21
|
|
|
19
|
-
|
|
20
|
-
|
|
22
|
+
export type IdleTargetCalculator = typeof(setmetatable(
|
|
23
|
+
{} :: {
|
|
24
|
+
_lastTargetPosition: Vector3?,
|
|
25
|
+
_lastMoveTime: number?,
|
|
26
|
+
_disableContextUI: ValueObject.ValueObject<boolean>,
|
|
27
|
+
Changed: Signal.Signal<()>,
|
|
28
|
+
},
|
|
29
|
+
{} :: typeof({ __index = IdleTargetCalculator })
|
|
30
|
+
)) & BaseObject.BaseObject
|
|
31
|
+
|
|
32
|
+
function IdleTargetCalculator.new(): IdleTargetCalculator
|
|
33
|
+
local self: IdleTargetCalculator = setmetatable(BaseObject.new() :: any, IdleTargetCalculator)
|
|
21
34
|
|
|
22
35
|
self._disableContextUI = self._maid:Add(ValueObject.new(false, "boolean"))
|
|
23
36
|
|
|
24
|
-
self.Changed = self._disableContextUI.Changed
|
|
37
|
+
self.Changed = self._disableContextUI.Changed :: any
|
|
25
38
|
|
|
26
39
|
return self
|
|
27
40
|
end
|
|
28
41
|
|
|
29
|
-
function IdleTargetCalculator
|
|
42
|
+
function IdleTargetCalculator.GetShouldDisableContextUI(self: IdleTargetCalculator): boolean
|
|
30
43
|
return self._disableContextUI.Value
|
|
31
44
|
end
|
|
32
45
|
|
|
33
|
-
|
|
34
|
-
function IdleTargetCalculator:ObserveShouldDisableContextUI()
|
|
46
|
+
function IdleTargetCalculator.ObserveShouldDisableContextUI(self: IdleTargetCalculator): Observable.Observable<boolean>
|
|
35
47
|
return self._disableContextUI:Observe()
|
|
36
48
|
end
|
|
37
49
|
|
|
38
|
-
function IdleTargetCalculator
|
|
50
|
+
function IdleTargetCalculator.SetTarget(self: IdleTargetCalculator, targetPosition: Vector3): ()
|
|
39
51
|
if not targetPosition then
|
|
40
52
|
self._disableContextUI.Value = false
|
|
41
53
|
return
|
|
@@ -43,7 +55,7 @@ function IdleTargetCalculator:SetTarget(targetPosition)
|
|
|
43
55
|
|
|
44
56
|
-- Show UI if no movement for a while
|
|
45
57
|
if self._lastTargetPosition then
|
|
46
|
-
local dist = (self._lastTargetPosition - targetPosition).
|
|
58
|
+
local dist = (self._lastTargetPosition - targetPosition).Magnitude
|
|
47
59
|
if dist >= DIST_BEFORE_MOVEMENT then
|
|
48
60
|
self._lastMoveTime = os.clock()
|
|
49
61
|
self._disableContextUI.Value = true
|
|
@@ -61,4 +73,4 @@ function IdleTargetCalculator:SetTarget(targetPosition)
|
|
|
61
73
|
self._lastTargetPosition = targetPosition
|
|
62
74
|
end
|
|
63
75
|
|
|
64
|
-
return IdleTargetCalculator
|
|
76
|
+
return IdleTargetCalculator
|
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
|
|
5
5
|
local require = require(script.Parent.loader).load(script)
|
|
6
6
|
|
|
7
|
-
local
|
|
7
|
+
local ServiceBag = require("ServiceBag")
|
|
8
8
|
|
|
9
9
|
local IdleService = {}
|
|
10
10
|
IdleService.ServiceName = "IdleService"
|
|
11
11
|
|
|
12
|
-
function IdleService:Init(serviceBag:
|
|
12
|
+
function IdleService:Init(serviceBag: ServiceBag.ServiceBag)
|
|
13
13
|
assert(not self._serviceBag, "Already initialized")
|
|
14
14
|
self._serviceBag = assert(serviceBag, "No serviceBag")
|
|
15
15
|
|
|
@@ -17,4 +17,4 @@ function IdleService:Init(serviceBag: _ServiceBag.ServiceBag)
|
|
|
17
17
|
self._serviceBag:GetService(require("HumanoidTrackerService"))
|
|
18
18
|
end
|
|
19
19
|
|
|
20
|
-
return IdleService
|
|
20
|
+
return IdleService
|