@quenty/modeltransparencyeffect 11.13.0 → 11.14.0-canary.679.24427386875.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
|
+
# [11.14.0-canary.679.24427386875.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/modeltransparencyeffect@11.13.0...@quenty/modeltransparencyeffect@11.14.0-canary.679.24427386875.0) (2026-04-14)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* Expand LocalTransparencyModifier support ([1d2bc4d](https://github.com/Quenty/NevermoreEngine/commit/1d2bc4d75a954486c0b8a9c160d06476ca47e2e6))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
# [11.13.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/modeltransparencyeffect@11.12.0...@quenty/modeltransparencyeffect@11.13.0) (2026-02-20)
|
|
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.
|
|
3
|
+
"version": "11.14.0-canary.679.24427386875.0",
|
|
4
4
|
"description": "Allows a model to have transparent set locally on the client",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -30,6 +30,9 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@quenty/acceltween": "2.7.0",
|
|
32
32
|
"@quenty/baseobject": "10.12.0",
|
|
33
|
+
"@quenty/enums": "1.2.0",
|
|
34
|
+
"@quenty/hide": "11.35.0-canary.679.24427386875.0",
|
|
35
|
+
"@quenty/instanceutils": "13.28.0-canary.679.24427386875.0",
|
|
33
36
|
"@quenty/loader": "10.10.0",
|
|
34
37
|
"@quenty/servicebag": "11.16.0",
|
|
35
38
|
"@quenty/steputils": "3.6.3",
|
|
@@ -38,5 +41,5 @@
|
|
|
38
41
|
"publishConfig": {
|
|
39
42
|
"access": "public"
|
|
40
43
|
},
|
|
41
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "0b16bd3c448061f208ea8fae7caba3dc484ba83f"
|
|
42
45
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
--!nonstrict
|
|
2
2
|
--[=[
|
|
3
|
-
Allows a model to have
|
|
3
|
+
Allows a model to have transparency set locally on the client
|
|
4
4
|
|
|
5
5
|
@client
|
|
6
6
|
@class ModelTransparencyEffect
|
|
@@ -10,6 +10,9 @@ local require = require(script.Parent.loader).load(script)
|
|
|
10
10
|
|
|
11
11
|
local AccelTween = require("AccelTween")
|
|
12
12
|
local BaseObject = require("BaseObject")
|
|
13
|
+
local HideUtils = require("HideUtils")
|
|
14
|
+
local ModelTransparencyMode = require("ModelTransparencyMode")
|
|
15
|
+
local RxInstanceUtils = require("RxInstanceUtils")
|
|
13
16
|
local ServiceBag = require("ServiceBag")
|
|
14
17
|
local StepUtils = require("StepUtils")
|
|
15
18
|
local TransparencyService = require("TransparencyService")
|
|
@@ -18,15 +21,13 @@ local ModelTransparencyEffect = setmetatable({}, BaseObject)
|
|
|
18
21
|
ModelTransparencyEffect.ClassName = "ModelTransparencyEffect"
|
|
19
22
|
ModelTransparencyEffect.__index = ModelTransparencyEffect
|
|
20
23
|
|
|
21
|
-
export type TransparencyMode = "SetTransparency" | "SetLocalTransparencyModifier"
|
|
22
|
-
|
|
23
24
|
export type ModelTransparencyEffect =
|
|
24
25
|
typeof(setmetatable(
|
|
25
26
|
{} :: {
|
|
26
27
|
_serviceBag: ServiceBag.ServiceBag,
|
|
27
28
|
_transparency: AccelTween.AccelTween,
|
|
28
29
|
_transparencyService: TransparencyService.TransparencyService,
|
|
29
|
-
_transparencyServiceMethodName:
|
|
30
|
+
_transparencyServiceMethodName: ModelTransparencyMode.ModelTransparencyMode,
|
|
30
31
|
_parts: { [Instance]: boolean },
|
|
31
32
|
_startAnimation: (self: ModelTransparencyEffect) -> (),
|
|
32
33
|
},
|
|
@@ -43,7 +44,7 @@ export type ModelTransparencyEffect =
|
|
|
43
44
|
function ModelTransparencyEffect.new(
|
|
44
45
|
serviceBag: ServiceBag.ServiceBag,
|
|
45
46
|
adornee: Instance,
|
|
46
|
-
transparencyServiceMethodName:
|
|
47
|
+
transparencyServiceMethodName: ModelTransparencyMode.ModelTransparencyMode?
|
|
47
48
|
): ModelTransparencyEffect
|
|
48
49
|
assert(adornee, "Bad adornee")
|
|
49
50
|
|
|
@@ -52,14 +53,14 @@ function ModelTransparencyEffect.new(
|
|
|
52
53
|
self._serviceBag = assert(serviceBag, "No serviceBag")
|
|
53
54
|
|
|
54
55
|
assert(
|
|
55
|
-
|
|
56
|
+
ModelTransparencyMode:IsValue(transparencyServiceMethodName) or transparencyServiceMethodName == nil,
|
|
56
57
|
"Bad transparencyServiceMethodName"
|
|
57
58
|
)
|
|
58
59
|
|
|
59
60
|
self._transparencyService = self._serviceBag:GetService(TransparencyService :: any)
|
|
60
61
|
|
|
61
62
|
self._transparency = AccelTween.new(20)
|
|
62
|
-
self._transparencyServiceMethodName = transparencyServiceMethodName or
|
|
63
|
+
self._transparencyServiceMethodName = transparencyServiceMethodName or ModelTransparencyMode.TRANSPARENCY
|
|
63
64
|
|
|
64
65
|
self._startAnimation, self._maid._stop = StepUtils.bindToRenderStep(self._update)
|
|
65
66
|
|
|
@@ -155,32 +156,36 @@ function ModelTransparencyEffect._setupParts(self: ModelTransparencyEffect)
|
|
|
155
156
|
|
|
156
157
|
self._parts = {}
|
|
157
158
|
|
|
158
|
-
|
|
159
|
-
self._parts[self._obj] = true
|
|
160
|
-
end
|
|
159
|
+
local transparencyServiceMethod = self._transparencyService[self._transparencyServiceMethodName]
|
|
161
160
|
|
|
162
|
-
|
|
163
|
-
if
|
|
164
|
-
|
|
165
|
-
|
|
161
|
+
local function canHide(part: Instance): boolean
|
|
162
|
+
return if (self._transparencyServiceMethodName == ModelTransparencyMode.LOCAL_TRANSPARENCY)
|
|
163
|
+
then HideUtils.hasLocalTransparencyModifier(part)
|
|
164
|
+
else (part:IsA("BasePart") or part:IsA("Decal"))
|
|
166
165
|
end
|
|
167
166
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
self:_startAnimation()
|
|
172
|
-
end
|
|
173
|
-
end))
|
|
167
|
+
if canHide(self._obj) then
|
|
168
|
+
self._parts[self._obj] = true
|
|
169
|
+
end
|
|
174
170
|
|
|
175
|
-
self._maid:GiveTask(self._obj
|
|
176
|
-
if
|
|
171
|
+
self._maid:GiveTask(RxInstanceUtils.observeDescendantsBrio(self._obj, canHide):Subscribe(function(brio)
|
|
172
|
+
if brio:IsDead() then
|
|
177
173
|
return
|
|
178
174
|
end
|
|
179
175
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
176
|
+
local maid, part = brio:ToMaidAndValue()
|
|
177
|
+
|
|
178
|
+
self._parts[part] = true
|
|
179
|
+
self:_startAnimation()
|
|
180
|
+
|
|
181
|
+
maid:GiveTask(function()
|
|
182
|
+
if self._transparencyService:IsDead() or not self._parts[part] then
|
|
183
|
+
return
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
self._parts[part] = nil
|
|
187
|
+
transparencyServiceMethod(self._transparencyService, self, part, nil)
|
|
188
|
+
end)
|
|
184
189
|
end))
|
|
185
190
|
|
|
186
191
|
self._maid:GiveTask(function()
|
|
@@ -188,8 +193,8 @@ function ModelTransparencyEffect._setupParts(self: ModelTransparencyEffect)
|
|
|
188
193
|
return
|
|
189
194
|
end
|
|
190
195
|
|
|
191
|
-
for part
|
|
192
|
-
|
|
196
|
+
for part in self._parts do
|
|
197
|
+
transparencyServiceMethod(self._transparencyService, self, part, nil)
|
|
193
198
|
end
|
|
194
199
|
end)
|
|
195
200
|
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
--!strict
|
|
2
|
+
--[=[
|
|
3
|
+
@class ModelTransparencyMode
|
|
4
|
+
]=]
|
|
5
|
+
|
|
6
|
+
local require = require(script.Parent.loader).load(script)
|
|
7
|
+
|
|
8
|
+
local SimpleEnum = require("SimpleEnum")
|
|
9
|
+
|
|
10
|
+
export type ModelTransparencyMode = "SetTransparency" | "SetLocalTransparencyModifier"
|
|
11
|
+
|
|
12
|
+
return SimpleEnum.new({
|
|
13
|
+
TRANSPARENCY = "SetTransparency" :: "SetTransparency",
|
|
14
|
+
LOCAL_TRANSPARENCY = "SetLocalTransparencyModifier" :: "SetLocalTransparencyModifier",
|
|
15
|
+
})
|