Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Rojo Changelog

## Unreleased Changes
* Fixed incorrect results when serving model pivots ([#868])
* Rojo now converts any line endings to LF, preventing spurious diffs when syncing Lua files on Windows ([#854])
* Fixed Rojo plugin failing to connect when project contains certain unreadable properties ([#848])
* Added popout diff visualizer for table properties like Attributes and Tags ([#834])
Expand Down Expand Up @@ -61,6 +62,7 @@
[#847]: https://github.com/rojo-rbx/rojo/pull/847
[#848]: https://github.com/rojo-rbx/rojo/pull/848
[#854]: https://github.com/rojo-rbx/rojo/pull/854
[#868]: https://github.com/rojo-rbx/rojo/pull/868


## [7.4.0] - January 16, 2024
Expand Down
23 changes: 23 additions & 0 deletions plugin/rbx_dom_lua/EncodedValue.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
35 changes: 35 additions & 0 deletions plugin/rbx_dom_lua/allValues.json
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,41 @@
},
"ty": "NumberSequence"
},
"OptionalCFrame-None": {
"value": {
"OptionalCFrame": null
},
"ty": "OptionalCFrame"
},
"OptionalCFrame-Some": {
"value": {
"OptionalCFrame": {
"position": [
0.0,
0.0,
0.0
],
"orientation": [
[
1.0,
0.0,
0.0
],
[
0.0,
1.0,
0.0
],
[
0.0,
0.0,
1.0
]
]
}
},
"ty": "OptionalCFrame"
},
"PhysicalProperties-Custom": {
"value": {
"PhysicalProperties": {
Expand Down
12 changes: 12 additions & 0 deletions plugin/rbx_dom_lua/customProperties.lua
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,18 @@ return {
return true, instance:ScaleTo(value)
end,
},
WorldPivotData = {
read = function(instance)
return true, instance:GetPivot()
end,
write = function(instance, _, value)
if value == nil then
return true, nil
else
return true, instance:PivotTo(value)
end
end,
},
},
Terrain = {
MaterialColors = {
Expand Down
Loading
Loading