forked from rojo-rbx/rojo
Release Rojo v7.7.0-rc.1 (#1174)
This commit is contained in:
@@ -208,4 +208,30 @@ return {
|
||||
end,
|
||||
},
|
||||
},
|
||||
StyleRule = {
|
||||
PropertiesSerialize = {
|
||||
read = function(instance: StyleRule)
|
||||
return true, instance:GetProperties()
|
||||
end,
|
||||
write = function(instance: StyleRule, _, value: { [any]: any })
|
||||
if typeof(value) ~= "table" then
|
||||
return false, Error.new(Error.Kind.CannotParseBinaryString)
|
||||
end
|
||||
|
||||
local existing = instance:GetProperties()
|
||||
|
||||
for itemName, itemValue in pairs(value) do
|
||||
instance:SetProperty(itemName, itemValue)
|
||||
end
|
||||
|
||||
for existingItemName in pairs(existing) do
|
||||
if value[existingItemName] == nil then
|
||||
instance:SetProperty(existingItemName, nil)
|
||||
end
|
||||
end
|
||||
|
||||
return true
|
||||
end,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user