@quenty/modeltransparencyeffect 11.8.4 → 11.8.5-canary.11a5dcf.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 +7 -7
- package/src/Client/ModelTransparencyEffect.lua +31 -11
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
|
+
## [11.8.5-canary.11a5dcf.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/modeltransparencyeffect@11.8.4...@quenty/modeltransparencyeffect@11.8.5-canary.11a5dcf.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
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [11.8.4](https://github.com/Quenty/NevermoreEngine/compare/@quenty/modeltransparencyeffect@11.8.3...@quenty/modeltransparencyeffect@11.8.4) (2025-04-10)
|
|
7
18
|
|
|
8
19
|
**Note:** Version bump only for package @quenty/modeltransparencyeffect
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/modeltransparencyeffect",
|
|
3
|
-
"version": "11.8.
|
|
3
|
+
"version": "11.8.5-canary.11a5dcf.0",
|
|
4
4
|
"description": "Allows a model to have transparent set locally on the client",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -25,14 +25,14 @@
|
|
|
25
25
|
"Quenty"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@quenty/acceltween": "
|
|
29
|
-
"@quenty/baseobject": "
|
|
30
|
-
"@quenty/loader": "
|
|
31
|
-
"@quenty/steputils": "
|
|
32
|
-
"@quenty/transparencyservice": "
|
|
28
|
+
"@quenty/acceltween": "2.5.3",
|
|
29
|
+
"@quenty/baseobject": "10.8.4-canary.11a5dcf.0",
|
|
30
|
+
"@quenty/loader": "10.8.4-canary.11a5dcf.0",
|
|
31
|
+
"@quenty/steputils": "3.5.6-canary.11a5dcf.0",
|
|
32
|
+
"@quenty/transparencyservice": "11.8.5-canary.11a5dcf.0"
|
|
33
33
|
},
|
|
34
34
|
"publishConfig": {
|
|
35
35
|
"access": "public"
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "11a5dcf7d4c7a0bfbf3337e97d30e8346ea09d3f"
|
|
38
38
|
}
|
|
@@ -9,6 +9,7 @@ local require = require(script.Parent.loader).load(script)
|
|
|
9
9
|
|
|
10
10
|
local AccelTween = require("AccelTween")
|
|
11
11
|
local BaseObject = require("BaseObject")
|
|
12
|
+
local ServiceBag = require("ServiceBag")
|
|
12
13
|
local StepUtils = require("StepUtils")
|
|
13
14
|
local TransparencyService = require("TransparencyService")
|
|
14
15
|
|
|
@@ -17,14 +18,29 @@ ModelTransparencyEffect.ClassName = "ModelTransparencyEffect"
|
|
|
17
18
|
ModelTransparencyEffect.__index = ModelTransparencyEffect
|
|
18
19
|
|
|
19
20
|
export type TransparencyMode = "SetTransparency" | "SetLocalTransparencyModifier"
|
|
21
|
+
|
|
22
|
+
export type ModelTransparencyEffect = typeof(setmetatable(
|
|
23
|
+
{} :: {
|
|
24
|
+
_transparency: AccelTween.AccelTween,
|
|
25
|
+
_transparencyService: TransparencyService.TransparencyService,
|
|
26
|
+
_transparencyServiceMethodName: TransparencyMode,
|
|
27
|
+
_parts: { [Instance]: boolean },
|
|
28
|
+
},
|
|
29
|
+
{} :: typeof({ __index = ModelTransparencyEffect })
|
|
30
|
+
)) & BaseObject.BaseObject
|
|
31
|
+
|
|
20
32
|
--[=[
|
|
21
33
|
@param serviceBag ServiceBag
|
|
22
34
|
@param adornee Instance
|
|
23
35
|
@param transparencyServiceMethodName "SetTransparency" | "SetLocalTransparencyModifier" | nil
|
|
24
36
|
@return ModelTransparencyEffect
|
|
25
37
|
]=]
|
|
26
|
-
function ModelTransparencyEffect.new(
|
|
27
|
-
|
|
38
|
+
function ModelTransparencyEffect.new(
|
|
39
|
+
serviceBag: ServiceBag.ServiceBag,
|
|
40
|
+
adornee: Instance,
|
|
41
|
+
transparencyServiceMethodName: TransparencyMode?
|
|
42
|
+
): ModelTransparencyEffect
|
|
43
|
+
local self: ModelTransparencyEffect = setmetatable(BaseObject.new(adornee) :: any, ModelTransparencyEffect)
|
|
28
44
|
|
|
29
45
|
assert(serviceBag, "Bad serviceBag")
|
|
30
46
|
assert(adornee, "Bad adornee")
|
|
@@ -47,7 +63,7 @@ end
|
|
|
47
63
|
Sets the acceleration
|
|
48
64
|
@param acceleration number
|
|
49
65
|
]=]
|
|
50
|
-
function ModelTransparencyEffect
|
|
66
|
+
function ModelTransparencyEffect.SetAcceleration(self: ModelTransparencyEffect, acceleration: number)
|
|
51
67
|
self._transparency.a = acceleration
|
|
52
68
|
end
|
|
53
69
|
|
|
@@ -56,7 +72,11 @@ end
|
|
|
56
72
|
@param transparency number
|
|
57
73
|
@param doNotAnimate boolean?
|
|
58
74
|
]=]
|
|
59
|
-
function ModelTransparencyEffect
|
|
75
|
+
function ModelTransparencyEffect.SetTransparency(
|
|
76
|
+
self: ModelTransparencyEffect,
|
|
77
|
+
transparency: number,
|
|
78
|
+
doNotAnimate: boolean?
|
|
79
|
+
)
|
|
60
80
|
if self._transparency.t == transparency then
|
|
61
81
|
return
|
|
62
82
|
end
|
|
@@ -73,7 +93,7 @@ end
|
|
|
73
93
|
Returns true if animation is done
|
|
74
94
|
@return boolean
|
|
75
95
|
]=]
|
|
76
|
-
function ModelTransparencyEffect
|
|
96
|
+
function ModelTransparencyEffect.IsDoneAnimating(self: ModelTransparencyEffect): boolean
|
|
77
97
|
return self._transparency.rtime == 0
|
|
78
98
|
end
|
|
79
99
|
|
|
@@ -82,7 +102,7 @@ end
|
|
|
82
102
|
finish the animation.
|
|
83
103
|
@param callback function
|
|
84
104
|
]=]
|
|
85
|
-
function ModelTransparencyEffect
|
|
105
|
+
function ModelTransparencyEffect.FinishTransparencyAnimation(self: ModelTransparencyEffect, callback)
|
|
86
106
|
self:SetTransparency(0)
|
|
87
107
|
|
|
88
108
|
if self._transparency.rtime == 0 then
|
|
@@ -94,14 +114,14 @@ function ModelTransparencyEffect:FinishTransparencyAnimation(callback)
|
|
|
94
114
|
end
|
|
95
115
|
end
|
|
96
116
|
|
|
97
|
-
function ModelTransparencyEffect
|
|
117
|
+
function ModelTransparencyEffect._update(self: ModelTransparencyEffect)
|
|
98
118
|
if self._transparencyService:IsDead() then
|
|
99
119
|
return
|
|
100
120
|
end
|
|
101
121
|
|
|
102
122
|
local transparency = self._transparency.p
|
|
103
123
|
|
|
104
|
-
for part
|
|
124
|
+
for part in self:_getPartsSet() do
|
|
105
125
|
self._transparencyService[self._transparencyServiceMethodName](
|
|
106
126
|
self._transparencyService,
|
|
107
127
|
self,
|
|
@@ -113,7 +133,7 @@ function ModelTransparencyEffect:_update()
|
|
|
113
133
|
return self._transparency.rtime > 0
|
|
114
134
|
end
|
|
115
135
|
|
|
116
|
-
function ModelTransparencyEffect:
|
|
136
|
+
function ModelTransparencyEffect._getPartsSet(self: ModelTransparencyEffect)
|
|
117
137
|
if self._parts then
|
|
118
138
|
return self._parts
|
|
119
139
|
end
|
|
@@ -123,8 +143,8 @@ function ModelTransparencyEffect:_getParts()
|
|
|
123
143
|
return self._parts
|
|
124
144
|
end
|
|
125
145
|
|
|
126
|
-
function ModelTransparencyEffect
|
|
127
|
-
assert(not self._parts, "Already initialized")
|
|
146
|
+
function ModelTransparencyEffect._setupParts(self: ModelTransparencyEffect)
|
|
147
|
+
assert(not (self :: any)._parts, "Already initialized")
|
|
128
148
|
|
|
129
149
|
self._parts = {}
|
|
130
150
|
|