rbx_dom_lua rojo-rbx/rbx-dom@6ccd30f (custom pivot get/set) (#868)

This commit is contained in:
Kenneth Loeffler
2024-02-20 12:08:55 -08:00
committed by GitHub
parent 8ff064fe28
commit ddb26c73bd
5 changed files with 518 additions and 97 deletions

View File

@@ -493,9 +493,32 @@ types = {
},
}
types.OptionalCFrame = {
fromPod = function(pod)
if pod == nil then
return nil
else
return types.CFrame.fromPod(pod)
end
end,
toPod = function(roblox)
if roblox == nil then
return nil
else
return types.CFrame.toPod(roblox)
end
end,
}
function EncodedValue.decode(encodedValue)
local ty, value = next(encodedValue)
if ty == nil then
-- If the encoded pair is empty, assume it is an unoccupied optional value
return true, nil
end
local typeImpl = types[ty]
if typeImpl == nil then
return false, "Couldn't decode value " .. tostring(ty)