Skip to content

Commit ce4c5bf

Browse files
authored
Patch ScaleFactor to Scale in reflection database (#252)
* Patch ScaleFactor in reflection database * Adds ScaleFactor via reflection patch * Marks Scale as alias for ScaleFactor * Add custom setter and no getter for Scale Signed-off-by: Dekkonot <[email protected]> * Set Scriptability of Scale to Custom and implement Getter for it Signed-off-by: Dekkonot <[email protected]> --------- Signed-off-by: Dekkonot <[email protected]>
1 parent 3a3563e commit ce4c5bf

File tree

4 files changed

+2371
-313
lines changed

4 files changed

+2371
-313
lines changed

patches/model.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Add:
2+
Model:
3+
ScaleFactor:
4+
AliasFor: Scale
5+
DataType:
6+
Value: Float32
7+
Scriptability: None
8+
9+
Change:
10+
Model:
11+
Scale:
12+
Serialization:
13+
Type: SerializesAs
14+
As: ScaleFactor
15+
Scriptability: Custom

rbx_dom_lua/src/customProperties.lua

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,14 @@ return {
6161
end,
6262
},
6363
},
64+
Model = {
65+
Scale = {
66+
read = function(instance, _, _)
67+
return true, instance:GetScale()
68+
end,
69+
write = function(instance, _, value)
70+
return true, instance:ScaleTo(value)
71+
end,
72+
},
73+
},
6474
}

0 commit comments

Comments
 (0)