@quenty/racketingropeconstraint 12.43.0 → 12.44.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 +10 -0
- package/package.json +9 -8
- package/src/Shared/RacketingRopeConstraint.lua +35 -13
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,16 @@
|
|
|
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
|
+
# [12.44.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/racketingropeconstraint@12.43.1...@quenty/racketingropeconstraint@12.44.0) (2026-07-14)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- **racketingropeconstraint:** convert package to --!strict ([9060a4c](https://github.com/Quenty/NevermoreEngine/commit/9060a4cd0d6a482b67de6cbde851530c22a0748a))
|
|
11
|
+
|
|
12
|
+
## [12.43.1](https://github.com/Quenty/NevermoreEngine/compare/@quenty/racketingropeconstraint@12.43.0...@quenty/racketingropeconstraint@12.43.1) (2026-05-30)
|
|
13
|
+
|
|
14
|
+
**Note:** Version bump only for package @quenty/racketingropeconstraint
|
|
15
|
+
|
|
6
16
|
# [12.43.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/racketingropeconstraint@12.42.0...@quenty/racketingropeconstraint@12.43.0) (2026-05-29)
|
|
7
17
|
|
|
8
18
|
**Note:** Version bump only for package @quenty/racketingropeconstraint
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/racketingropeconstraint",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.44.0",
|
|
4
4
|
"description": "Tries to racket a rope constraint back down to a reasonable length",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -31,16 +31,17 @@
|
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@quenty/baseobject": "10.13.0",
|
|
34
|
-
"@quenty/binder": "14.
|
|
34
|
+
"@quenty/binder": "14.37.0",
|
|
35
35
|
"@quenty/loader": "10.11.0",
|
|
36
|
-
"@quenty/overriddenproperty": "10.
|
|
37
|
-
"@quenty/promise": "10.18.
|
|
38
|
-
"@quenty/
|
|
39
|
-
"@quenty/
|
|
40
|
-
"@quenty/
|
|
36
|
+
"@quenty/overriddenproperty": "10.15.0",
|
|
37
|
+
"@quenty/promise": "10.18.1",
|
|
38
|
+
"@quenty/rx": "13.28.3",
|
|
39
|
+
"@quenty/servicebag": "11.18.1",
|
|
40
|
+
"@quenty/tie": "10.41.0",
|
|
41
|
+
"@quenty/valueobject": "13.31.1"
|
|
41
42
|
},
|
|
42
43
|
"publishConfig": {
|
|
43
44
|
"access": "public"
|
|
44
45
|
},
|
|
45
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "13f0162f4971a77378e55e9b7236aea94f0dd3a8"
|
|
46
47
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
--!
|
|
1
|
+
--!strict
|
|
2
2
|
--[=[
|
|
3
3
|
Tries to racket a rope constraint back down to a reasonable length. Use [RopeConstraint.WinchEnabled]
|
|
4
4
|
@class RacketingRopeConstraint
|
|
@@ -10,6 +10,7 @@ local RunService = game:GetService("RunService")
|
|
|
10
10
|
|
|
11
11
|
local BaseObject = require("BaseObject")
|
|
12
12
|
local Binder = require("Binder")
|
|
13
|
+
local Observable = require("Observable")
|
|
13
14
|
local OverriddenProperty = require("OverriddenProperty")
|
|
14
15
|
local Promise = require("Promise")
|
|
15
16
|
local RacketingRopeConstraintInterface = require("RacketingRopeConstraintInterface")
|
|
@@ -23,8 +24,26 @@ local RacketingRopeConstraint = setmetatable({}, BaseObject)
|
|
|
23
24
|
RacketingRopeConstraint.ClassName = "RacketingRopeConstraint"
|
|
24
25
|
RacketingRopeConstraint.__index = RacketingRopeConstraint
|
|
25
26
|
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
export type RacketingRopeConstraint =
|
|
28
|
+
typeof(setmetatable(
|
|
29
|
+
{} :: {
|
|
30
|
+
_obj: RopeConstraint,
|
|
31
|
+
_serviceBag: ServiceBag.ServiceBag,
|
|
32
|
+
_tieRealmService: any,
|
|
33
|
+
_smallestDistance: number,
|
|
34
|
+
_targetDistance: number,
|
|
35
|
+
_isConstrained: ValueObject.ValueObject<boolean>,
|
|
36
|
+
_overriddenLength: OverriddenProperty.OverriddenProperty<number>?,
|
|
37
|
+
},
|
|
38
|
+
{} :: typeof({ __index = RacketingRopeConstraint })
|
|
39
|
+
))
|
|
40
|
+
& BaseObject.BaseObject
|
|
41
|
+
|
|
42
|
+
function RacketingRopeConstraint.new(
|
|
43
|
+
ropeConstraint: RopeConstraint,
|
|
44
|
+
serviceBag: ServiceBag.ServiceBag
|
|
45
|
+
): RacketingRopeConstraint
|
|
46
|
+
local self: RacketingRopeConstraint = setmetatable(BaseObject.new(ropeConstraint) :: any, RacketingRopeConstraint)
|
|
28
47
|
|
|
29
48
|
self._serviceBag = assert(serviceBag, "No serviceBag")
|
|
30
49
|
self._tieRealmService = self._serviceBag:GetService(TieRealmService)
|
|
@@ -57,7 +76,7 @@ function RacketingRopeConstraint.new(ropeConstraint: RopeConstraint, serviceBag:
|
|
|
57
76
|
return self
|
|
58
77
|
end
|
|
59
78
|
|
|
60
|
-
function RacketingRopeConstraint
|
|
79
|
+
function RacketingRopeConstraint.PromiseConstrained(self: RacketingRopeConstraint): Promise.Promise<()>
|
|
61
80
|
if self:_isValid() and self:_queryIsConstrained() then
|
|
62
81
|
return Promise.resolved()
|
|
63
82
|
end
|
|
@@ -71,19 +90,19 @@ function RacketingRopeConstraint:PromiseConstrained()
|
|
|
71
90
|
return promise
|
|
72
91
|
end
|
|
73
92
|
|
|
74
|
-
function RacketingRopeConstraint
|
|
93
|
+
function RacketingRopeConstraint.ObserveIsConstrained(self: RacketingRopeConstraint): Observable.Observable<boolean>
|
|
75
94
|
return self._isConstrained:Observe()
|
|
76
95
|
end
|
|
77
96
|
|
|
78
|
-
function RacketingRopeConstraint
|
|
97
|
+
function RacketingRopeConstraint._queryIsConstrained(self: RacketingRopeConstraint): boolean
|
|
79
98
|
return self._obj.Length <= self._targetDistance
|
|
80
99
|
end
|
|
81
100
|
|
|
82
|
-
function RacketingRopeConstraint
|
|
83
|
-
return self._obj.Attachment0 and self._obj.Attachment1 and self._obj.Enabled
|
|
101
|
+
function RacketingRopeConstraint._isValid(self: RacketingRopeConstraint): boolean
|
|
102
|
+
return self._obj.Attachment0 ~= nil and self._obj.Attachment1 ~= nil and self._obj.Enabled
|
|
84
103
|
end
|
|
85
104
|
|
|
86
|
-
function RacketingRopeConstraint
|
|
105
|
+
function RacketingRopeConstraint._handleActiveChanged(self: RacketingRopeConstraint): ()
|
|
87
106
|
if self:_isValid() then
|
|
88
107
|
if self._maid._updateHeartbeat and self._maid._updateHeartbeat.Connected then
|
|
89
108
|
return
|
|
@@ -105,10 +124,13 @@ function RacketingRopeConstraint:_handleActiveChanged()
|
|
|
105
124
|
end
|
|
106
125
|
end
|
|
107
126
|
|
|
108
|
-
function RacketingRopeConstraint
|
|
127
|
+
function RacketingRopeConstraint._update(self: RacketingRopeConstraint): ()
|
|
109
128
|
assert(self:_isValid(), "Not valid state")
|
|
110
129
|
|
|
111
|
-
local
|
|
130
|
+
local attachment0 = assert(self._obj.Attachment0, "No Attachment0")
|
|
131
|
+
local attachment1 = assert(self._obj.Attachment1, "No Attachment1")
|
|
132
|
+
|
|
133
|
+
local currentDistance = (attachment0.WorldPosition - attachment1.WorldPosition).Magnitude
|
|
112
134
|
self._smallestDistance = math.clamp(currentDistance, self._targetDistance, self._smallestDistance)
|
|
113
135
|
|
|
114
136
|
self:_setLength(self._smallestDistance)
|
|
@@ -129,7 +151,7 @@ function RacketingRopeConstraint:_update()
|
|
|
129
151
|
end
|
|
130
152
|
end
|
|
131
153
|
|
|
132
|
-
function RacketingRopeConstraint
|
|
154
|
+
function RacketingRopeConstraint._setLength(self: RacketingRopeConstraint, length: number): ()
|
|
133
155
|
if self._overriddenLength then
|
|
134
156
|
self._overriddenLength:Set(length)
|
|
135
157
|
else
|
|
@@ -137,4 +159,4 @@ function RacketingRopeConstraint:_setLength(length)
|
|
|
137
159
|
end
|
|
138
160
|
end
|
|
139
161
|
|
|
140
|
-
return Binder.new("RacketingRopeConstraint", RacketingRopeConstraint)
|
|
162
|
+
return Binder.new("RacketingRopeConstraint", RacketingRopeConstraint :: any) :: Binder.Binder<RacketingRopeConstraint>
|