mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-23 05:51:39 +00:00
Enhance right-click functionality in PatchVisualizer
- Added support for right-click events in the PatchVisualizer component, allowing users to unselect nodes and manage subtree selections more intuitively. - Updated the TODO list to remove outdated tasks related to the change visualizer, streamlining focus on current issues. These changes aim to improve user interaction and simplify task management within the application.
This commit is contained in:
parent
0ed0b40766
commit
d2f739ece6
2 changed files with 41 additions and 3 deletions
|
|
@ -243,6 +243,17 @@ function SelectionOption:render()
|
|||
end
|
||||
end
|
||||
end,
|
||||
[Roact.Event.MouseButton2Click] = function()
|
||||
if isParentOnly or (isSelected and hasChildren) then
|
||||
if props.onSubtreeRightClick then
|
||||
props.onSubtreeRightClick()
|
||||
end
|
||||
else
|
||||
if props.onRightClick then
|
||||
props.onRightClick()
|
||||
end
|
||||
end
|
||||
end,
|
||||
}, {
|
||||
Corner = e("UICorner", {
|
||||
CornerRadius = UDim.new(0, 3),
|
||||
|
|
@ -295,6 +306,16 @@ local function SelectionRadio(props)
|
|||
props.onSubtreeSelectionChange(props.nodeId, "pull")
|
||||
end
|
||||
end,
|
||||
onRightClick = function()
|
||||
if props.onSelectionChange then
|
||||
props.onSelectionChange(props.nodeId, nil)
|
||||
end
|
||||
end,
|
||||
onSubtreeRightClick = function()
|
||||
if props.onSubtreeSelectionChange then
|
||||
props.onSubtreeSelectionChange(props.nodeId, nil)
|
||||
end
|
||||
end,
|
||||
}),
|
||||
Skip = e(SelectionOption, {
|
||||
text = "Skip",
|
||||
|
|
@ -316,6 +337,16 @@ local function SelectionRadio(props)
|
|||
props.onSubtreeSelectionChange(props.nodeId, "ignore")
|
||||
end
|
||||
end,
|
||||
onRightClick = function()
|
||||
if props.onSelectionChange then
|
||||
props.onSelectionChange(props.nodeId, nil)
|
||||
end
|
||||
end,
|
||||
onSubtreeRightClick = function()
|
||||
if props.onSubtreeSelectionChange then
|
||||
props.onSubtreeSelectionChange(props.nodeId, nil)
|
||||
end
|
||||
end,
|
||||
}),
|
||||
Atlas = e(SelectionOption, {
|
||||
text = "Atlas",
|
||||
|
|
@ -337,6 +368,16 @@ local function SelectionRadio(props)
|
|||
props.onSubtreeSelectionChange(props.nodeId, "push")
|
||||
end
|
||||
end,
|
||||
onRightClick = function()
|
||||
if props.onSelectionChange then
|
||||
props.onSelectionChange(props.nodeId, nil)
|
||||
end
|
||||
end,
|
||||
onSubtreeRightClick = function()
|
||||
if props.onSubtreeSelectionChange then
|
||||
props.onSubtreeSelectionChange(props.nodeId, nil)
|
||||
end
|
||||
end,
|
||||
}),
|
||||
})
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue