@quenty/animations 8.22.4-canary.607f741.0 → 8.22.5-canary.50b03f4.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 +12 -1
- package/package.json +3 -3
- package/src/Shared/AnimationSlotPlayer.lua +38 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,18 @@
|
|
|
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
|
-
## [8.22.
|
|
6
|
+
## [8.22.5-canary.50b03f4.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/animations@8.22.4...@quenty/animations@8.22.5-canary.50b03f4.0) (2025-12-28)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* Update animation slot system ([50b03f4](https://github.com/Quenty/NevermoreEngine/commit/50b03f4c59427be54d7801ca196cf5edf1243795))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [8.22.4](https://github.com/Quenty/NevermoreEngine/compare/@quenty/animations@8.22.3...@quenty/animations@8.22.4) (2025-12-28)
|
|
7
18
|
|
|
8
19
|
**Note:** Version bump only for package @quenty/animations
|
|
9
20
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/animations",
|
|
3
|
-
"version": "8.22.
|
|
3
|
+
"version": "8.22.5-canary.50b03f4.0",
|
|
4
4
|
"description": "Utility methods for playing back animations on Roblox",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -35,10 +35,10 @@
|
|
|
35
35
|
"@quenty/rbxasset": "5.10.0",
|
|
36
36
|
"@quenty/rx": "13.20.0",
|
|
37
37
|
"@quenty/signal": "7.11.1",
|
|
38
|
-
"@quenty/valueobject": "13.21.3
|
|
38
|
+
"@quenty/valueobject": "13.21.3"
|
|
39
39
|
},
|
|
40
40
|
"publishConfig": {
|
|
41
41
|
"access": "public"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "50b03f4c59427be54d7801ca196cf5edf1243795"
|
|
44
44
|
}
|
|
@@ -30,7 +30,7 @@ export type AnimationSlotPlayer =
|
|
|
30
30
|
_defaultFadeTime: ValueObject.ValueObject<number>,
|
|
31
31
|
_defaultAnimationPriority: ValueObject.ValueObject<Enum.AnimationPriority>,
|
|
32
32
|
_currentAnimationTrackData: ValueObject.ValueObject<any>,
|
|
33
|
-
_currentAnimationId: ValueObject.ValueObject<string
|
|
33
|
+
_currentAnimationId: ValueObject.ValueObject<string?>,
|
|
34
34
|
},
|
|
35
35
|
{} :: typeof({ __index = AnimationSlotPlayer })
|
|
36
36
|
))
|
|
@@ -147,6 +147,8 @@ function AnimationSlotPlayer.AdjustSpeed(self: AnimationSlotPlayer, id: string |
|
|
|
147
147
|
assert(RbxAssetUtils.isConvertableToRbxAsset(id), "Bad id")
|
|
148
148
|
assert(type(speed) == "number", "Bad speed")
|
|
149
149
|
|
|
150
|
+
self._maid._currentSpeedAdjustment = nil
|
|
151
|
+
|
|
150
152
|
local animationId = RbxAssetUtils.toRbxAssetId(id)
|
|
151
153
|
|
|
152
154
|
local topMaid = Maid.new()
|
|
@@ -184,6 +186,15 @@ function AnimationSlotPlayer.AdjustSpeed(self: AnimationSlotPlayer, id: string |
|
|
|
184
186
|
end
|
|
185
187
|
end
|
|
186
188
|
|
|
189
|
+
--[=[
|
|
190
|
+
Gets the current animation id playing in the slot
|
|
191
|
+
|
|
192
|
+
@return string?
|
|
193
|
+
]=]
|
|
194
|
+
function AnimationSlotPlayer:GetCurrentAnimationId(): string?
|
|
195
|
+
return self._currentAnimationId.Value
|
|
196
|
+
end
|
|
197
|
+
|
|
187
198
|
--[=[
|
|
188
199
|
Adjusts the weight of the animation playing in the slot
|
|
189
200
|
|
|
@@ -192,11 +203,18 @@ end
|
|
|
192
203
|
@param fadeTime number?
|
|
193
204
|
@return () -> () -- Callback to clean things up
|
|
194
205
|
]=]
|
|
195
|
-
function AnimationSlotPlayer.AdjustWeight(
|
|
206
|
+
function AnimationSlotPlayer.AdjustWeight(
|
|
207
|
+
self: AnimationSlotPlayer,
|
|
208
|
+
id: string | number,
|
|
209
|
+
weight: number,
|
|
210
|
+
fadeTime: number?
|
|
211
|
+
)
|
|
196
212
|
assert(RbxAssetUtils.isConvertableToRbxAsset(id), "Bad id")
|
|
197
213
|
assert(type(weight) == "number", "Bad weight")
|
|
198
214
|
assert(type(fadeTime) == "number" or fadeTime == nil, "Bad fadeTime")
|
|
199
215
|
|
|
216
|
+
self._maid._currentWeightAdjustment = nil
|
|
217
|
+
|
|
200
218
|
local animationId = RbxAssetUtils.toRbxAssetId(id)
|
|
201
219
|
|
|
202
220
|
local topMaid = Maid.new()
|
|
@@ -263,6 +281,13 @@ function AnimationSlotPlayer.Play(
|
|
|
263
281
|
|
|
264
282
|
local animationId = RbxAssetUtils.toRbxAssetId(id)
|
|
265
283
|
|
|
284
|
+
self._currentAnimationId.Value = animationId
|
|
285
|
+
topMaid:GiveTask(function()
|
|
286
|
+
if self._currentAnimationId.Value == animationId then
|
|
287
|
+
self._currentAnimationId.Value = nil
|
|
288
|
+
end
|
|
289
|
+
end)
|
|
290
|
+
|
|
266
291
|
topMaid:GiveTask(self._animationTarget
|
|
267
292
|
:ObserveBrio(function(target)
|
|
268
293
|
return target ~= nil
|
|
@@ -327,8 +352,17 @@ end
|
|
|
327
352
|
--[=[
|
|
328
353
|
Stops the current animation playing
|
|
329
354
|
]=]
|
|
330
|
-
function AnimationSlotPlayer.Stop(self: AnimationSlotPlayer)
|
|
331
|
-
|
|
355
|
+
function AnimationSlotPlayer.Stop(self: AnimationSlotPlayer, id: (string | number)?)
|
|
356
|
+
if id then
|
|
357
|
+
local animationId = RbxAssetUtils.toRbxAssetId(id)
|
|
358
|
+
if self._currentAnimationId.Value == animationId then
|
|
359
|
+
self._maid._current = nil
|
|
360
|
+
end
|
|
361
|
+
|
|
362
|
+
return
|
|
363
|
+
else
|
|
364
|
+
self._maid._current = nil
|
|
365
|
+
end
|
|
332
366
|
end
|
|
333
367
|
|
|
334
368
|
return AnimationSlotPlayer
|