@quenty/modeltransparencyeffect 11.8.0 → 11.8.1-canary.542.7609692.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 +8 -0
- package/package.json +7 -7
- package/src/Client/ModelTransparencyEffect.lua +17 -10
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
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.1-canary.542.7609692.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/modeltransparencyeffect@11.8.0...@quenty/modeltransparencyeffect@11.8.1-canary.542.7609692.0) (2025-03-13)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @quenty/modeltransparencyeffect
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
# [11.8.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/modeltransparencyeffect@11.7.2...@quenty/modeltransparencyeffect@11.8.0) (2025-02-18)
|
|
7
15
|
|
|
8
16
|
**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.0",
|
|
3
|
+
"version": "11.8.1-canary.542.7609692.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.0",
|
|
29
|
+
"@quenty/baseobject": "10.8.0",
|
|
30
|
+
"@quenty/loader": "10.8.0",
|
|
31
|
+
"@quenty/steputils": "3.5.3-canary.542.7609692.0",
|
|
32
|
+
"@quenty/transparencyservice": "11.8.1-canary.542.7609692.0"
|
|
33
33
|
},
|
|
34
34
|
"publishConfig": {
|
|
35
35
|
"access": "public"
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "76096921c6c965e5c4f9c796f97642d16d628c6b"
|
|
38
38
|
}
|
|
@@ -16,19 +16,22 @@ local ModelTransparencyEffect = setmetatable({}, BaseObject)
|
|
|
16
16
|
ModelTransparencyEffect.ClassName = "ModelTransparencyEffect"
|
|
17
17
|
ModelTransparencyEffect.__index = ModelTransparencyEffect
|
|
18
18
|
|
|
19
|
+
export type TransparencyMode = "SetTransparency" | "SetLocalTransparencyModifier"
|
|
19
20
|
--[=[
|
|
20
21
|
@param serviceBag ServiceBag
|
|
21
22
|
@param adornee Instance
|
|
22
23
|
@param transparencyServiceMethodName "SetTransparency" | "SetLocalTransparencyModifier" | nil
|
|
23
24
|
@return ModelTransparencyEffect
|
|
24
25
|
]=]
|
|
25
|
-
function ModelTransparencyEffect.new(serviceBag, adornee, transparencyServiceMethodName)
|
|
26
|
+
function ModelTransparencyEffect.new(serviceBag, adornee: Instance, transparencyServiceMethodName: TransparencyMode?)
|
|
26
27
|
local self = setmetatable(BaseObject.new(adornee), ModelTransparencyEffect)
|
|
27
28
|
|
|
28
29
|
assert(serviceBag, "Bad serviceBag")
|
|
29
30
|
assert(adornee, "Bad adornee")
|
|
30
|
-
assert(
|
|
31
|
-
|
|
31
|
+
assert(
|
|
32
|
+
type(transparencyServiceMethodName) == "string" or transparencyServiceMethodName == nil,
|
|
33
|
+
"Bad transparencyServiceMethodName"
|
|
34
|
+
)
|
|
32
35
|
|
|
33
36
|
self._transparencyService = serviceBag:GetService(TransparencyService)
|
|
34
37
|
|
|
@@ -44,16 +47,16 @@ end
|
|
|
44
47
|
Sets the acceleration
|
|
45
48
|
@param acceleration number
|
|
46
49
|
]=]
|
|
47
|
-
function ModelTransparencyEffect:SetAcceleration(acceleration)
|
|
50
|
+
function ModelTransparencyEffect:SetAcceleration(acceleration: number)
|
|
48
51
|
self._transparency.a = acceleration
|
|
49
52
|
end
|
|
50
53
|
|
|
51
54
|
--[=[
|
|
52
55
|
Sets the transparency
|
|
53
56
|
@param transparency number
|
|
54
|
-
@param doNotAnimate boolean
|
|
57
|
+
@param doNotAnimate boolean?
|
|
55
58
|
]=]
|
|
56
|
-
function ModelTransparencyEffect:SetTransparency(transparency, doNotAnimate)
|
|
59
|
+
function ModelTransparencyEffect:SetTransparency(transparency: number, doNotAnimate: boolean?)
|
|
57
60
|
if self._transparency.t == transparency then
|
|
58
61
|
return
|
|
59
62
|
end
|
|
@@ -70,7 +73,7 @@ end
|
|
|
70
73
|
Returns true if animation is done
|
|
71
74
|
@return boolean
|
|
72
75
|
]=]
|
|
73
|
-
function ModelTransparencyEffect:IsDoneAnimating()
|
|
76
|
+
function ModelTransparencyEffect:IsDoneAnimating(): boolean
|
|
74
77
|
return self._transparency.rtime == 0
|
|
75
78
|
end
|
|
76
79
|
|
|
@@ -91,7 +94,6 @@ function ModelTransparencyEffect:FinishTransparencyAnimation(callback)
|
|
|
91
94
|
end
|
|
92
95
|
end
|
|
93
96
|
|
|
94
|
-
|
|
95
97
|
function ModelTransparencyEffect:_update()
|
|
96
98
|
if self._transparencyService:IsDead() then
|
|
97
99
|
return
|
|
@@ -100,7 +102,12 @@ function ModelTransparencyEffect:_update()
|
|
|
100
102
|
local transparency = self._transparency.p
|
|
101
103
|
|
|
102
104
|
for part, _ in pairs(self:_getParts()) do
|
|
103
|
-
self._transparencyService[self._transparencyServiceMethodName](
|
|
105
|
+
self._transparencyService[self._transparencyServiceMethodName](
|
|
106
|
+
self._transparencyService,
|
|
107
|
+
self,
|
|
108
|
+
part,
|
|
109
|
+
transparency
|
|
110
|
+
)
|
|
104
111
|
end
|
|
105
112
|
|
|
106
113
|
return self._transparency.rtime > 0
|
|
@@ -160,4 +167,4 @@ function ModelTransparencyEffect:_setupParts()
|
|
|
160
167
|
end)
|
|
161
168
|
end
|
|
162
169
|
|
|
163
|
-
return ModelTransparencyEffect
|
|
170
|
+
return ModelTransparencyEffect
|