Custom User Tools Menu Item

To add a new tool, you write an extension with imgui code for the editor and to see the tool in the Tools menu, you need to add the item with editor.addToolsMenuItem like so:

Adding a tool to Tools menu
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
-- this function will be called by editor when it constructs the Tools menu
local function onToolsMenuItem()
        -- here you enable/disable your tool's window/gui, show/hide it, toggle
        showMyWindow = not showMyWindow
end

local function onEditorInitialized()
    local editorExtensionInfo = {
      experimental = true
    }
    -- add an entry in the Tools menu
        editor.addToolsMenuItem("My Tool", onToolsMenuItem, editorExtensionInfo)
end

M.onEditorInitialized = onEditorInitialized