
Code: Select all
# catch the IDE's context menu message
on revHookBuildObjectEditorContextMenu pMenuTarget, pMenuName, @pMenu, pModifiedMenu
local tMenu, tSelected, tBehavior
# custom menu item
repeat for each line tSelected in selObj()
put the behavior of tSelected into tBehavior
if tBehavior <> empty and exists(tBehavior) then
put "Edit Behavior" & LF after tMenu
exit repeat
end if
end repeat
# prepend the standard context menu
if tMenu <> empty then
put tMenu & "-" & LF before pMenu
end if
pass revHookBuildObjectEditorContextMenu
end revHookBuildObjectEditorContextMenu
# catch the IDE's message when an item is selected from the context menu
function dispatchContextMenuPick pMenuName, pItem
local tSelected, tBehavior
switch word 1 to -1 of pItem
case "Edit Behavior"
repeat for each line tSelected in selObj()
put the behavior of tSelected into tBehavior
if tBehavior <> empty and exists(tBehavior) then
edit the script of tBehavior
end if
end repeat
exit to top
break
end switch
pass dispatchContextMenuPick
end dispatchContextMenuPick
Enjoy the rest of the holiday period!