@quenty/timedtween 2.1.1 → 2.2.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 +9 -9
- package/src/Shared/TimedTween.lua +18 -10
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
|
+
# [2.2.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/timedtween@2.1.1...@quenty/timedtween@2.2.0) (2023-12-14)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* TimedTween can handle immediate jump to animation state ([73dc9c8](https://github.com/Quenty/NevermoreEngine/commit/73dc9c8d73774d9c9993ebb20be087574ee9c55a))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [2.1.1](https://github.com/Quenty/NevermoreEngine/compare/@quenty/timedtween@2.1.0...@quenty/timedtween@2.1.1) (2023-10-28)
|
|
7
18
|
|
|
8
19
|
**Note:** Version bump only for package @quenty/timedtween
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/timedtween",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "Linear timed tweening model",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -25,19 +25,19 @@
|
|
|
25
25
|
"Quenty"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@quenty/basicpane": "^8.
|
|
29
|
-
"@quenty/blend": "^7.
|
|
30
|
-
"@quenty/loader": "^7.
|
|
28
|
+
"@quenty/basicpane": "^8.2.0",
|
|
29
|
+
"@quenty/blend": "^7.2.0",
|
|
30
|
+
"@quenty/loader": "^7.1.0",
|
|
31
31
|
"@quenty/maid": "^2.6.0",
|
|
32
32
|
"@quenty/math": "^2.5.0",
|
|
33
|
-
"@quenty/promise": "^7.
|
|
34
|
-
"@quenty/promisemaid": "^2.
|
|
35
|
-
"@quenty/rx": "^8.
|
|
33
|
+
"@quenty/promise": "^7.1.0",
|
|
34
|
+
"@quenty/promisemaid": "^2.1.0",
|
|
35
|
+
"@quenty/rx": "^8.2.0",
|
|
36
36
|
"@quenty/steputils": "^3.3.0",
|
|
37
|
-
"@quenty/valueobject": "^8.
|
|
37
|
+
"@quenty/valueobject": "^8.2.0"
|
|
38
38
|
},
|
|
39
39
|
"publishConfig": {
|
|
40
40
|
"access": "public"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "2c2dbbc0cb2fbb46b4f3270c559c63890fe18b26"
|
|
43
43
|
}
|
|
@@ -37,8 +37,8 @@ function TimedTween.new(transitionTime)
|
|
|
37
37
|
self:_updateState()
|
|
38
38
|
end))
|
|
39
39
|
|
|
40
|
-
self._maid:GiveTask(self.VisibleChanged:Connect(function()
|
|
41
|
-
self:_updateState()
|
|
40
|
+
self._maid:GiveTask(self.VisibleChanged:Connect(function(_, doNotAnimate)
|
|
41
|
+
self:_updateState(doNotAnimate)
|
|
42
42
|
end))
|
|
43
43
|
self:_updateState()
|
|
44
44
|
|
|
@@ -109,7 +109,7 @@ function TimedTween:PromiseFinished()
|
|
|
109
109
|
return promise
|
|
110
110
|
end
|
|
111
111
|
|
|
112
|
-
function TimedTween:_updateState()
|
|
112
|
+
function TimedTween:_updateState(doNotAnimate)
|
|
113
113
|
local transitionTime = self._transitionTime.Value
|
|
114
114
|
local target = self:IsVisible() and 1 or 0;
|
|
115
115
|
|
|
@@ -118,13 +118,21 @@ function TimedTween:_updateState()
|
|
|
118
118
|
local p0 = computed.p
|
|
119
119
|
|
|
120
120
|
local remainingDist = target - p0
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
121
|
+
if doNotAnimate then
|
|
122
|
+
self._state.Value = {
|
|
123
|
+
p0 = target;
|
|
124
|
+
p1 = target;
|
|
125
|
+
t0 = now;
|
|
126
|
+
t1 = now;
|
|
127
|
+
}
|
|
128
|
+
else
|
|
129
|
+
self._state.Value = {
|
|
130
|
+
p0 = p0;
|
|
131
|
+
p1 = target;
|
|
132
|
+
t0 = now;
|
|
133
|
+
t1 = now + Math.map(math.abs(remainingDist), 0, 1, 0, transitionTime);
|
|
134
|
+
}
|
|
135
|
+
end
|
|
128
136
|
end
|
|
129
137
|
|
|
130
138
|
function TimedTween:_computeState(now)
|