@quenty/particles 5.10.0 → 5.11.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 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
+ # [5.11.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/particles@5.10.0...@quenty/particles@5.11.0) (2025-09-16)
7
+
8
+
9
+ ### Features
10
+
11
+ * Add more particle playback stuff, and fix emit count ([#586](https://github.com/Quenty/NevermoreEngine/issues/586)) ([2ce536a](https://github.com/Quenty/NevermoreEngine/commit/2ce536a824741cc8569738d8e0822bd42d916be6))
12
+
13
+
14
+
15
+
16
+
6
17
  # [5.10.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/particles@5.9.4...@quenty/particles@5.10.0) (2025-05-10)
7
18
 
8
19
  **Note:** Version bump only for package @quenty/particles
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quenty/particles",
3
- "version": "5.10.0",
3
+ "version": "5.11.0",
4
4
  "description": "Holds utilitity for playing back particles",
5
5
  "keywords": [
6
6
  "Roblox",
@@ -32,5 +32,5 @@
32
32
  "publishConfig": {
33
33
  "access": "public"
34
34
  },
35
- "gitHead": "20cff952c2cf06b959f2f11d2293bdef38acc604"
35
+ "gitHead": "fe7a10aabcebee5e409f06d7819b98f5f28f4828"
36
36
  }
@@ -38,25 +38,46 @@ function ParticleEmitterUtils.playFromTemplate(template: Instance, attachment: A
38
38
  newEmitter.Parent = attachment
39
39
  maid:GiveTask(newEmitter)
40
40
 
41
- local emitDelay = newEmitter:GetAttribute("EmitDelay")
42
- local unparsedEmitCount = newEmitter:GetAttribute("EmitCount")
43
- local emitCount: number?
44
- if type(unparsedEmitCount) ~= "number" then
45
- emitCount = nil
46
- end
41
+ maid:GiveTask(ParticleEmitterUtils.playEmitter(newEmitter))
42
+ end
47
43
 
48
- if type(emitDelay) == "number" then
49
- maid:GiveTask(task.delay(emitDelay, function()
50
- newEmitter:Emit(emitCount)
51
- end))
52
- else
53
- newEmitter:Emit(emitCount)
54
- end
44
+ return maid
45
+ end
46
+
47
+ function ParticleEmitterUtils.playAllEmitters(adornee: Instance): Maid.Maid
48
+ local maid = Maid.new()
49
+
50
+ for _, emitter in ParticleEmitterUtils.getParticleEmitters(adornee) do
51
+ maid:GiveTask(ParticleEmitterUtils.playEmitter(emitter))
55
52
  end
56
53
 
57
54
  return maid
58
55
  end
59
56
 
57
+ function ParticleEmitterUtils.playEmitter(emitter: ParticleEmitter): () -> ()
58
+ local emitDelay = emitter:GetAttribute("EmitDelay")
59
+ local unparsedEmitCount = emitter:GetAttribute("EmitCount")
60
+ local emitCount: number?
61
+ if type(unparsedEmitCount) == "number" then
62
+ emitCount = unparsedEmitCount
63
+ else
64
+ emitCount = nil
65
+ end
66
+
67
+ if type(emitDelay) == "number" then
68
+ local delayedEmitTask = task.delay(emitDelay, function()
69
+ emitter:Emit(emitCount)
70
+ end)
71
+ return function()
72
+ task.cancel(delayedEmitTask)
73
+ end
74
+ else
75
+ emitter:Emit(emitCount)
76
+
77
+ return function() end
78
+ end
79
+ end
80
+
60
81
  --[=[
61
82
  Retrieves particle emitters for the given adornee
62
83
  ]=]