Skip to content

Commit

Permalink
Add rbx_dom_lua codec
Browse files Browse the repository at this point in the history
  • Loading branch information
kennethloeffler committed Nov 1, 2024
1 parent 8d10dc7 commit ac963cf
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions rbx_dom_lua/src/EncodedValue.lua
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,29 @@ types = {
end,
},

EnumItem = {
fromPod = function(pod)
local enumType = Enum[pod.type]
local enumItem = 0

for _, item in enumType:GetEnumItems() do
if item.Value == pod.value then
enumItem = item
break
end
end

return enumItem
end,

toPod = function(roblox)
return {
type = roblox.EnumType,
value = roblox.Value,
}
end,
},

Faces = {
fromPod = function(pod)
local faces = {}
Expand Down

0 comments on commit ac963cf

Please sign in to comment.