GE Lua Documentation

Press F to search!

Definition


-- @/=[C]:-1
function MenuItem1(...)

Callers

@/lua/ge/extensions/editor/util/transformUtil.lua
  if self.hasPos then
    if im.MenuItem1("Position to Camera", nil, false, true) then
      self:helperPositionToCamera()
    end
    if im.MenuItem1("Position in front of Camera", nil, false, true) then
      self:helperPositionInFrontOfToCamera()
    end
    if im.MenuItem1("Position down to Terrain", nil, false, true) then
      self:helperPositionDownToTerrain()
  if self.hasRot then
    if im.MenuItem1("Rotation to Camera", nil, false, true) then
      self:helperRotationToCamera()
  if self.hasPos then
    if im.MenuItem1("Camera to Position", nil, false, true) then
      self:helperCameraToPosition()
  if self.hasRot then
    if im.MenuItem1("Camera to Rotation", nil, false, true) then
      self:helperCameraToRotation()
  if self.hasPos and self.hasRot then
    if im.MenuItem1("Camera to Position+Rotation", nil, false, true) then
      self:helperCameraToPositionRotation()
@/lua/ge/extensions/editor/headlessEditorTest.lua
    if imgui.BeginMenu("Operations", imgui_true) then
        if imgui.MenuItem1("Exit Headless Mode...", nil, imgui_false, imgui_true) then
          -- disable headless mode
@/lua/ge/extensions/editor/vehicleEditor/staticEditor/vePartList.lua
      if im.BeginPopup('part_context_menu') then
        if im.MenuItem1("Open location in file explorer") then
          Engine.Platform.exploreFolder(tostring(rightClickedPart[3]))
@/lua/ge/extensions/editor/vehicleEditor/staticEditor/vePartTextView.lua
    if im.BeginMenuBar() then
      if im.MenuItem1("Reload") then
        vEditor.ast = nil
      end
      if im.MenuItem1("Save") then
        save()
      end
      if im.MenuItem1("Close") then
        vEditor.selectedPart = nil
      end
      if im.MenuItem1("Delete") then
        FS:removeFile(jbeamFilename)
@/lua/ge/extensions/editor/crawlEditor/paths.lua
    if im.BeginPopupContextItem("path_context_" .. i) then
      if im.MenuItem1("Delete") then
        table.remove(allPaths, i)
@/lua/ge/extensions/trackbuilder/trackBuilder.lua
    if im.BeginMenu(translateLanguage("ui.trackbuilder.menus.editorSettings", "Editor Settings")) then
      if im.MenuItem1(translateLanguage("ui.trackbuilder.menus.removeTrack","Remove Track")) then
        toggleTrackBuilder()
      end
      if im.MenuItem1(translateLanguage("ui.trackbuilder.menus.resetTrack", "Reset Track")) then
        tb.removeTrack()
@/lua/ge/extensions/editor/fileDialog.lua
          if not tableContains(favs, currentPath) then
            if im.MenuItem1("Add current path") then
              table.insert(favs, currentPath)
          else
            if im.MenuItem1("Remove current path") then
              table.remove(favs, arrayFindValueIndex(favs, currentPath))
          for i, f in ipairs(favs or {}) do
            if im.MenuItem1(f..'##'..i) then
              refreshCache(f)
@/lua/ge/extensions/editor/missionEditor.lua
      if im.BeginMenu("File") then
        if im.MenuItem1("New Mission...") then
          openNewMissionPopup = true
        if not saveable then im.BeginDisabled() end
        if im.MenuItem1("Save") then
          gameplay_missions_missions.saveMission(lastShownMission,lastShownMission.missionFolder)
        end
        if im.MenuItem1("Save All ("..changedMissioncount..")") then
          for _, m in ipairs(missionList) do
          im.Separator()
          if im.MenuItem1("PERMANENTLY delete mission") then
            for _, f in ipairs(files) do
        end
        if im.MenuItem1("Reload Mission System " .. (changedMissioncount > 0 and ("(" .. changedMissioncount .. " unsaved missions!)") or "")) then
          M.reloadMissionSystem()
        end
        if im.MenuItem1("(Debug) Print Mission Dependency Tree") then
          local currentMission = lastShownMission
      if im.BeginMenu("Tools") then
        if im.MenuItem1("Calculate Mission Issues") then
          issuesWindow:calculateMissionIssues(missionList, windows, missionTypeWindow)
        im.tooltip("Can take a few seconds.")
        if im.MenuItem1("Show All Mission Issues") then
          issuesWindow:showIssuesWindow()
              if string.startswith(funName, "customFunction") then
                if im.MenuItem1(funName) then
                  helper[funName](helper, clickedMission, M)
                end
                if im.MenuItem1("All Mission of same type: " ..funName) then
                  for _, m in ipairs(missionList) do

        if im.MenuItem1("Flowgraph Variable Check") then
          variableClicked = true
        end
        if im.MenuItem1("Translation Helper") then
          translationClicked = true
        end
        if im.MenuItem1("Translation List (Debug)") then
          getTranslatableStrings()
          if not clickedMission then im.BeginDisabled() end
          if im.MenuItem1("Generate 25 Attempts") then
            gameplay_missions_progress.generateAttempts(clickedMission.id, 25, true)
          for _, key in ipairs(instance.sortedStarKeys or {}) do
            if im.MenuItem1("Generate one attempt with star: " .. key) then
              gameplay_missions_progress.generateAttempt(clickedMission.id, {unlockedStars = {[key..''] = true}})
          if not clickedMission then im.EndDisabled() end
          if im.MenuItem1("Generate 1-5 Attempts for all Missions") then
            gameplay_missions_progress.startBatchMode()

          if im.MenuItem1("Generate 1-5 Attempts for random half of all Missions") then
            gameplay_missions_progress.startBatchMode()

        if im.MenuItem1("Export Missions with Stars") then
          exportMissionsWithStars()
        end
        if im.MenuItem1("Export Missions Simple") then
          exportMissionsSimple()
        end
        if im.MenuItem1("Import Mission Overview") then
          importMissionOverview()
        end
        if im.MenuItem1("Export Content Overview") then
          exportContentOverview()
        end
        if im.MenuItem1("Fix Start Trigger For Leagues") then
          fixStartTriggerForLeagues()
        end
        if im.MenuItem1("Remove non-attribute star rewards") then
          removeNonAttributeStarRewards()
        im.Separator()
        if im.MenuItem1("Time Updater") then
          timeUpdaterClicked = true
@/lua/ge/extensions/editor/camPathEditor.lua
    if im.BeginMenuBar() then
      if im.MenuItem1('New') then
        editor.history:commitAction('CreatePath', {}, createPathActionUndo, createPathActionRedo)
      end
      if im.MenuItem1('Load...') then
        local currentLevelPath = (path.split(getMissionFilename()) or '') .. 'camPaths'
      end
      if im.MenuItem1('Save') and M.currentPath.dirty then
        if M.currentPath.filename then
      end
      if im.MenuItem1('Delete') then
        editor.history:commitAction('DeletePath', { path = M.currentPath }, deletePathActionUndo, deletePathActionRedo)

      if im.MenuItem1('Render Options') then
        editor.showWindow('rendererComponents')
@/lua/ge/extensions/editor/dragRaceEditor.lua
  if im.BeginMenu("File") then
    if im.MenuItem1("New Drag Settings") then
      dragSettings.setDragSettings({

    if im.MenuItem1("Load Drag Settings...") then
      editor_fileDialog.openFile(function(data)

    if im.MenuItem1("Save Drag Settings...") then
      editor_fileDialog.saveFile(function(data)

    if im.MenuItem1("New Mission") then
      utils.saveToUndoStack()

    if im.MenuItem1("Load Mission...") then
      editor_fileDialog.openFile(function(data)

    if im.MenuItem1("Save Mission as...") then
      extensions.editor_fileDialog.saveFile(function(data)

    if im.MenuItem1("Undo") then
      utils.undo()

    if im.MenuItem1("Redo") then
      utils.redo()
  if im.BeginMenu("Edit") then
    if im.MenuItem1("Add Lane") then
      -- This will be handled by lanes module

    if im.MenuItem1("Remove Selected Lane") then
      -- This will be handled by lanes module

    if im.MenuItem1("Clear All") then
      utils.saveToUndoStack()
  if im.BeginMenu("View") then
    if im.MenuItem1("Show Transforms") then
    end

    if im.MenuItem1("Show Waypoints") then
    end
  if im.BeginMenu("Help") then
    if im.MenuItem1("Documentation") then
    end

    if im.MenuItem1("About") then
    end
@/lua/ge/extensions/editor/raceEditor.lua
        im.Separator()
        if im.MenuItem1("Load...") then
          editor_fileDialog.openFile(function(data) loadRace(data.filepath) end, {{"Race files",".race.json"}}, false, previousFilepath)
        local canSave = currentPath and previousFilepath
        if im.MenuItem1("Save") then
          saveRace(currentPath, previousFilepath .. previousFilename)
        end
        if im.MenuItem1("Save as...") then
          extensions.editor_fileDialog.saveFile(function(data) saveRace(currentPath, data.filepath) end,
        end
        if im.MenuItem1("Clear") then
          local path = require('/lua/ge/extensions/gameplay/race/path')("New Race")
          im.Separator()
          if im.MenuItem1("Copy from current Time Trials") then
            copyFromTimeTrials()
          for _,f in ipairs(allFiles) do
            if im.MenuItem1(f.name..'##'..f.file) then
              loadRace(f.file)
        local add = nil
        if im.MenuItem1("Add Missing Recovery Positions") then
          add = 'newOnly'
        end
        if im.MenuItem1("Re-Add All Recovery Positions") then
          add = 'all'
        end
        if im.MenuItem1("Recalculate AI Route Distance") then
          recalculateAiRouteDistance()
        end
        if im.MenuItem1("Organize Pathnode and Segment Names") then
          organizePathnodeAndSegmentNames()
        end
        if im.MenuItem1("Recalculate Segments") then
          recalculateSegments()
          for i, issue in ipairs(issues) do
            if im.MenuItem1(issue[1]) then
              --issue[2]()
@/lua/ge/extensions/editor/flowgraph/overview.lua
  if im.BeginPopup("nodeOverviewPopup") then
    if self.contextMenuNode and im.MenuItem1('Focus##' .. tostring("self_id")) then
      self:selectNode(self.contextMenuNode, false)
    end
    if self.contextMenuNode and im.MenuItem1('Delete##' .. tostring("self_id")) then
      self.mgr.graph:deleteNode(self.contextMenuNode)
    im.Separator()
    if im.MenuItem1('Copy##' .. tostring("self_id")) then
    end
    if im.MenuItem1('Paste##' .. tostring("self_id")) then
@/lua/ge/extensions/editor/missionPlaybook.lua
      if im.BeginMenu("File...") then
        if im.MenuItem1("Clear") then
          M.book = newBook()
        end
        if im.MenuItem1("Save as...") then
          extensions.editor_fileDialog.saveFile(function(data) savePlaybook(M.book, data.filepath) end, {{"missionPlaybook Files",".missionPlaybook.json"}}, false, defaultPlaybookPath)
        end
        if im.MenuItem1("Load") then
          editor_fileDialog.openFile(function(data) M.book = loadPlaybook(data.filepath) or M.book.instructions end, {{"missionPlaybook Files",".missionPlaybook.json"}}, false, defaultPlaybookPath)
      if im.BeginMenu("Util...") then
        if im.MenuItem1("Clear Testing Slot") then
          career_career.deactivateCareer()
      if im.BeginMenu("Run...") then
        if im.MenuItem1("Play") then
          play()
        im.tooltip("Runs all the elements with the current career slot.")
        if im.MenuItem1("Play with Empty Slot") then
          career_career.deactivateCareer()
        im.EndDisabled()
        im.MenuItem1("(?)")
        im.tooltip("Load career manually the first time and stay in the level.")
      if im.BeginMenu("Generate...") then
        if im.MenuItem1("All Missions") then
          generateAndPlaybook({})
          for _, tier in ipairs({1, 2, 3}) do
            if im.MenuItem1("All Missions, only Tier " .. tier) then
              generateAndPlaybook({onlyTier = {[tier] = true}})
          for _, amount in ipairs({1,5,10,25,50,100}) do
            if im.MenuItem1("All Missions, only ".. amount.." stars") then
              generateAndPlaybook({count = amount})

          if im.MenuItem1("All Missions, only Default Stars") then
            generateAndPlaybook({onlyDefaultStars=true})
          end
          if im.MenuItem1("All Missions, only Bonus Stars") then
            generateAndPlaybook({onlyBonusStars=true})
          im.Separator()
          if im.MenuItem1("Only " .. branch.name) then
            generateAndPlaybook({onlyBranch = {[branch.id] = true}})
          for _, tier in ipairs({1, 2, 3}) do
            if im.MenuItem1("Only " .. branch.name..", only Tier " .. tier) then
              generateAndPlaybook({onlyBranch = {[branch.id] = true}, onlyTier = {[tier] = true}})
@/lua/ge/extensions/editor/scriptAIManager.lua
      if im.BeginPopup('controlsPopup##'..vehId) then
        im.MenuItem1(vehIdtxt, nil, false, false)
        im.Checkbox('Loop##loop'..vehId, loopRecordingBoolPtr[vehId])

        if im.MenuItem1('Reset Recording##'..vehId) then
          bo:queueLuaCommand('ai.scriptStop()')

        if im.MenuItem1('Reset Vehicle##'..vehId) then
          bo:queueLuaCommand('obj:requestReset(RESET_PHYSICS)')
@/lua/ge/extensions/editor/sitesEditor.lua
      if im.BeginMenu("File") then
        if im.MenuItem1("New") then
          currentSites = require('/lua/ge/extensions/gameplay/sites/sites')("New Sites")
        end
        if im.MenuItem1("Load...") then
          editor_fileDialog.openFile(function(data) currentSites = loadSites(data.filepath) end, {{"Sites Files",".sites.json"}}, false, previousFilepath)
        end
        if im.MenuItem1("Save") then
        saveSites(currentSites, currentSites.dir..currentSites.name)
        end
        if im.MenuItem1("Save as...") then
          extensions.editor_fileDialog.saveFile(function(data) saveSites(currentSites, data.filepath) end,

        if im.MenuItem1("Sort Locations by Name") then
          table.sort(currentSites.locations.sorted, function(a,b)
        end
        if im.MenuItem1("Sort Zones by Name") then
          table.sort(currentSites.zones.sorted, function(a,b)
        end
        if im.MenuItem1("Sort Parking Spots by Name") then
          table.sort(currentSites.parkingSpots.sorted, function(a,b)
        end
        if im.MenuItem1("Enumerate Parking Spots") then
          local spotsByName = {}
        end
        if im.MenuItem1("Parkingspot Names by Zone Containment (can take long)") then
          for _, zone in ipairs(currentSites.zones.sorted) do

    if im.MenuItem1("Refresh") then
      extensions.gameplay_sites_sitesManager.getAllLevelSites()
      for _, name in ipairs(emptyLevelNamesSorted) do
        im.MenuItem1(name)
      end
          local _, siteName = path.split(site)
          if im.MenuItem1(siteName) then
            currentSites = extensions.gameplay_sites_sitesManager.loadSites(site)
@/lua/ge/extensions/editor/mainMenu.lua
  if loggedIn then
    if imgui.MenuItem1("Logout", nil, imgui_false, imgui_true) then
      editor_auth.logOut()
    end
  elseif imgui.MenuItem1("Login...", nil, imgui_false, imgui_true) then
    editor_auth.openWindow()
  if imgui.BeginMenu("File", imgui_true) then
    if imgui.MenuItem1("New Level", "Ctrl+N", imgui_false, imgui_true) then
      editor.doNewLevel()
    end
    if imgui.MenuItem1("Open Level...", "Ctrl+O", imgui_false, imgui_true) then
      editor.doOpenLevel()
    imgui.Separator()
    if imgui.MenuItem1("Save Level", "Ctrl+S", imgui_false, imgui_true) then
      editor.doSaveLevel()
    -- in all of the assets json. Will be added after a proper asset system is in place
    -- if imgui.MenuItem1("Save Level As...", "Ctrl+Shift+S", imgui_false, imgui_true) then
    --   editor.doSaveLevelAs()
    if editor.getLevelPath() ~= "" and showRevertLevelToOriginalButton then
      if imgui.MenuItem1("Delete This Level's User Folder Files", "", imgui_false, imgui_true) then
        editor.showWindow(revertLevelToOriginalWindowName)
    imgui.Separator()
    if imgui.MenuItem1("Export Selected as Collada", "", imgui_false, imgui_true) then
      editor_fileDialog.saveFile(
    renderLoginMenuItem()
    if imgui.MenuItem1("Exit Editor", "F11", imgui_false, imgui_true) then
      editor.toggleActive()
  if imgui.BeginMenu("Edit", imgui_true) then
    if imgui.MenuItem1("Undo", "Ctrl+Z", imgui_false, imgui_true) then
      editor.undo()
    end
    if imgui.MenuItem1("Redo", "Ctrl+Y", imgui_false, imgui_true) then
      editor.redo()
    imgui.Separator()
    if imgui.MenuItem1("Cut", "Ctrl+X", imgui_false, imgui_true) then
      editor.cut()
    end
    if imgui.MenuItem1("Copy", "Ctrl+C", imgui_false, imgui_true) then
      editor.copy()
    end
    if imgui.MenuItem1("Paste", "Ctrl+V", imgui_false, imgui_true) then
      editor.paste()
    end
    if imgui.MenuItem1("Duplicate", "Ctrl+D", imgui_false, imgui_true) then
      editor.duplicate()
    imgui.Separator()
    if imgui.MenuItem1("Select All", "Ctrl+A", imgui_false, imgui_true) then
      editor.selectAll()
    end
    if imgui.MenuItem1("Deselect", "X", imgui_false, imgui_true) then
      editor.deselect()
    end
    if imgui.MenuItem1("Delete Selection", "Delete", imgui_false, imgui_true) then
      editor.deleteSelection()
    imgui.Separator()
    if imgui.MenuItem1("Rebuild Collision", "Ctrl+F7") then
      -- we force the rebuild
    end
    if imgui.MenuItem1("Reload Navgraph") then
      if map then
    end
    if imgui.MenuItem1("Toggle Mute Game Audio", nil, imgui_false, imgui_true) then
      editor.muteAudio(not editor.muted)
    imgui.Separator()
    if imgui.MenuItem1("Editor Preferences...", nil, imgui_false, imgui_true) then
      editor.showPreferences()
  if imgui.BeginMenu("Camera", imgui_true) then
    if imgui.MenuItem1("Game Camera", "Ctrl+1", imgui_false, imgui_true) then
      editor.selectCamera(editor.CameraType_Game)
    end
    if imgui.MenuItem1("Free Camera", "Ctrl+2", imgui_false, imgui_true) then
      editor.selectCamera(editor.CameraType_Free)
    end
    if imgui.MenuItem1("Toggle Free Camera", "Shift+C", imgui_false, imgui_true) then
      editor.toggleFreeCamera()
    end
    if imgui.MenuItem1("Place Camera at Selection", "Ctrl+Q", imgui_false, imgui_true) then
      editor.placeCameraAtSelection()
    end
    if imgui.MenuItem1("Place Camera at Player", "Alt+Q", imgui_false, imgui_true) then
      editor.placeCameraAtPlayer()
    end
    if imgui.MenuItem1("Place Player at Camera", "Alt+W", imgui_false, imgui_true) then
      editor.placePlayerAtCamera()
    end
    if imgui.MenuItem1("Fit View to Selection", "F", imgui_false, imgui_true) then
      editor.fitViewToSelectionSmooth()
  if imgui.BeginMenu("Object", imgui_true) then
    if imgui.MenuItem1("Lock Selection", "Ctrl+Alt+L", imgui_false, imgui_true) then
      editor.lockObjectSelection()
    end
    if imgui.MenuItem1("Unlock Selection", "Ctrl+Shift+L", imgui_false, imgui_true) then
      editor.unlockObjectSelection()
    imgui.Separator()
    if imgui.MenuItem1("Hide Selection", "Ctrl+H", imgui_false, imgui_true) then
      editor.hideObjectSelection()
    end
    if imgui.MenuItem1("Show Selection", "Ctrl+Shift+H", imgui_false, imgui_true) then
      editor.showObjectSelection()
    if imgui.BeginMenu("Align Bounds", imgui_true) then
      if imgui.MenuItem1("-X Axis") then
        editor.alignObjectSelectionByBounds(0)
      end
      if imgui.MenuItem1("+X Axis") then
        editor.alignObjectSelectionByBounds(1)
      end
      if imgui.MenuItem1("-Y Axis") then
        editor.alignObjectSelectionByBounds(2)
      end
      if imgui.MenuItem1("+Y Axis") then
        editor.alignObjectSelectionByBounds(3)
      end
      if imgui.MenuItem1("-Z Axis") then
        editor.alignObjectSelectionByBounds(4)
      end
      if imgui.MenuItem1("+Z Axis") then
        editor.alignObjectSelectionByBounds(5)
    if imgui.BeginMenu("Align Center", nil, imgui_false, imgui_true) then
      if imgui.MenuItem1("X Axis") then
        editor.alignObjectSelectionByCenter(0)
      end
      if imgui.MenuItem1("Y Axis") then
        editor.alignObjectSelectionByCenter(1)
      end
      if imgui.MenuItem1("Z Axis") then
        editor.alignObjectSelectionByCenter(2)

    if imgui.MenuItem1("Move Selection in Front of Camera", "Ctrl+Shift+J", imgui_false, imgui_true) then
      editor.moveSelectionAtCamera()

    if imgui.MenuItem1("Set Selection Transform from Camera", "Ctrl+Shift+K", imgui_false, imgui_true) then
      editor.setObjectSelectionTransformFromCamera()
    imgui.Separator()
    if imgui.MenuItem1("Reset Selected Transforms", "Ctrl+Alt+R", imgui_false, imgui_true) then
      editor.resetObjectSelectionTransform()
    end
    if imgui.MenuItem1("Reset Selected Rotations", "Ctrl+Shift+R", imgui_false, imgui_true) then
      editor.resetObjectSelectionRotation()
    end
    if imgui.MenuItem1("Reset Selected Scale", nil, imgui_false, imgui_true) then
      editor.resetObjectSelectionScale()
              for _, subitem in ipairs(menuGroups[item.itemText]) do
                if imgui.MenuItem1(subitem.itemText, nil, imgui_false, imgui_true) then
                  if subitem.actionFunc then subitem.actionFunc() end
          else
            if imgui.MenuItem1(item.itemText, nil, imgui_false, imgui_true) then
              if item.actionFunc then item.actionFunc() end
      for _, item in ipairs(windowSearchResults) do
        if imgui.MenuItem1(item.name, nil, imgui_false, imgui_true) then
          ffi.fill(windowSearchTxt, imgui.ArraySize(windowSearchTxt))
  if imgui.BeginMenu("Help", imgui_true) then
    if imgui.MenuItem1("Editor Documentation...", "F1", imgui_false, imgui_true) then
      editor.openHelp()
    end
    if imgui.MenuItem1("Editor Coding Documentation...", nil, imgui_false, imgui_true) then
      editor.openCodingHelp()
    end
    if imgui.MenuItem1("News/Release Notes", nil, imgui_false, imgui_true) then
      editor.setPreference("newsMessage.general.newsMessageShown", false)
    end
    if imgui.MenuItem1("About", nil, imgui_false, imgui_true) then
      editor.openModalWindow(aboutDlgName)
      for _, layoutPath in ipairs(editor_layoutManager.getWindowLayouts()) do
        if imgui.MenuItem1(string.match(layoutPath, ".+/(.+)"), nil, imgui_false, imgui_true) then
          editor_layoutManager.loadWindowLayout(layoutPath)
      imgui.Separator()
      if imgui.MenuItem1("Save Layout...", nil, imgui_false, imgui_true) then
        editor.showWindow(saveLayoutWindowName)
      end
      if imgui.MenuItem1("Delete Layout...", nil, imgui_false, imgui_true) then
        editor.showWindow(deleteLayoutWindowName)
      end
      if imgui.MenuItem1("Revert to Factory Settings...", nil, imgui_false, imgui_true) then
        editor.showWindow(resetLayoutsWindowName)

    if imgui.MenuItem1("Visualization Settings...") then
      editor.showWindow("visualization")
    for _, layoutPath in ipairs(editor_layoutManager.getWindowLayouts()) do
      if imgui.MenuItem1(string.match(layoutPath, ".+/(.+)"), nil, imgui_false, imgui_true) then
        editor_layoutManager.deleteWindowLayout(layoutPath)
@/lua/ge/extensions/editor/flowgraph/main.lua
    if im.BeginMenu("File") then
      if im.MenuItem1("New Project") then
        local m = self.fgMgr.addManager()
      end
      if im.MenuItem1("Load Project...") then
        extensions.editor_fileDialog.openFile(function(data)self.fgEditor.openFile(data, true)end, {{"Any files", "*"},{"Node graph Files",".flow.json"}}, false, self.fgEditor.lastOpenedFolder)
            if FS:fileExists(file) then
              if im.MenuItem1(idx.." - " .. file) then
                self.fgEditor.openFile({filepath = file}, true)
      im.Separator()
      if im.MenuItem1("Encode Clipboard") then
        local txt = lpack.encode(self.fgEditor.copyData)
      end
      if im.MenuItem1("Decode Clipboard") then
        local dec
      im.Separator()
      if im.MenuItem1("Save", nil, nil, self.mgr.allowEditing) then
        self.fgEditor.save()
      end
      if im.MenuItem1("Save as...", nil, nil, self.mgr.allowEditing) then
        extensions.editor_fileDialog.saveFile(function(data)self.fgEditor.saveAsFile(data)end, {{"Node graph Files",".flow.json"}}, false, self.fgEditor.lastOpenedFolder)
      end
      if im.MenuItem1("Save as Scenario...") then
        extensions.editor_fileDialog.saveFile(function(data)
      im.Separator()
      if im.MenuItem1("New Graph", nil, nil, self.mgr.allowEditing) then
        self.mgr:createGraph()
      end
      if im.MenuItem1("New Node", nil, nil, self.mgr.allowEditing) then
        local dirToOpen = self.fgMgr.nodePath
      im.Separator()
      if im.MenuItem1("Close Project") then
        self.fgEditor.closeCurrent()
      im.Separator()
      if im.MenuItem1("Load into current...") then
        extensions.editor_fileDialog.openFile(function(data)self.fgEditor.openFile(data, false)end, {{"Any files", "*"},{"Node graph Files",".flow.json"}}, false, self.fgEditor.lastOpenedFolder)
      ui_flowgraph_editor.tooltip("Replaces the current projects contents with a loaded one.")
      if im.MenuItem1("Load Macro from file...") then
        extensions.editor_fileDialog.openFile(function(data)self.mgr:createNewMacroNode(data.filepath)end, {{"Any files", "*"},{"Node graph Files",".macro.flow.json"}}, false, self.fgEditor.lastOpenedFolder)
    end
    if im.MenuItem1("Focus Selection") then
      self.fgEditor.uiFocusNodesShortcut()
    --TODO: replace this settings window and point the menu to Preferences window with Flowgraph page selected
    if im.MenuItem1("Preferences...") then
      editor.showPreferences('flowgraph')
@/lua/ge/extensions/editor/crawlEditor.lua
      if im.BeginMenu("File") then
        if im.MenuItem1("Save All") then
          local savedCount = 0

        if im.MenuItem1("Reload All") then
          loadAllObjects()

        if im.MenuItem1("Clear Cache") then
          gameplay_crawl_saveSystem.clearCache()
      if im.BeginMenu("View") then
        if im.MenuItem1("Refresh Lists") then
          loadAllObjects()
      if im.BeginMenu("Tools") then
        if im.MenuItem1("Port Mission to New System") then
          log('D', 'crawl_editor', 'Port Mission menu item clicked')
@/lua/ge/extensions/editor/crawlEditor/startingPositions.lua
    if im.BeginPopupContextItem("starting_position_context_" .. i) then
      if im.MenuItem1("Delete") then
        table.remove(allStartingPositions, i)
@/lua/ge/extensions/flowgraph/nodes/states/transition.lua
        end
        if im.MenuItem1(name) then
          target = lnk.targetNode.targetGraph
@/lua/ge/extensions/ui/console.lua

      if interestingLines.currentDisplayLines and im.MenuItem1("Copy displayed lines") then
        putLogLinesInClipboard(interestingLines.currentDisplayLines, true)

      if interestingLines.currentDisplayWarn and #interestingLines.currentDisplayWarn>0 and im.MenuItem1("Copy displayed Warnings only") then
        putLogLinesInClipboard(interestingLines.currentDisplayWarn)

      if interestingLines.currentDisplayError and #interestingLines.currentDisplayError>0 and im.MenuItem1("Copy displayed Errors and Warnings") then
        putLogLinesInClipboard(interestingLines.currentDisplayError)

      if interestingLines.currentDisplayLines and im.MenuItem1("Copy all filtered lines") then
        putLogLinesInClipboard(logFiltered)

      if interestingLines.allFilteredWarn and #interestingLines.allFilteredWarn>0 and im.MenuItem1("Copy all filtered Warnings only") then
        putLogLinesInClipboard(interestingLines.allFilteredWarn)

      if interestingLines.allFilteredError and #interestingLines.allFilteredError>0 and im.MenuItem1("Copy all filtered Errors and Warnings") then
        putLogLinesInClipboard(interestingLines.allFilteredError)
@/lua/ge/extensions/editor/multiSpawnManager.lua
    if im.BeginMenu("File") then
      if im.MenuItem1("New") then
        createGroup()
      end
      if im.MenuItem1("Load...") then
        editor_fileDialog.openFile(function(data) loadGroup(data.filepath) end, {{"Vehicle Group Files", ".vehGroup.json"}}, false, prevFilePath)
      end
      if im.MenuItem1("Save") then
        if commonGroups[options.groupListIdx].file then
      end
      if im.MenuItem1("Save as...") then
        editor_fileDialog.saveFile(function(data) saveGroup(nil, data.filepath) end, {{"Vehicle Group Files", ".vehGroup.json"}}, false, prevFilePath)
    if im.BeginMenu("Tools") then
      if im.MenuItem1("Shuffle Group") then
        if next(currGroup) and currGroup.data then
      end
      if im.MenuItem1("Duplicate Group") then
        if next(currGroup) then
      end
      if im.MenuItem1("Set Scene Vehicles to Group") then
        if next(currGroup) then
@/lua/ge/extensions/editor/perfProfiler.lua
    if im.BeginMenuBar() then
      if im.MenuItem1("Record...") then
        openRecordPopup = true
      end
      if im.MenuItem1("Load...") then
      end
      if im.MenuItem1("New Chart Window") then
        newChartWindow()
@/lua/ge/extensions/editor/vehicleEditor/veToolbar.lua
    else
      if im.MenuItem1(item.menuEntry) then
        item.menuOpen()
    for _, layoutPath in ipairs(editor_layoutManager.getWindowLayouts(vEditor.getEditorName())) do
      if im.MenuItem1(string.match(layoutPath, ".+/(.+)"), nil, imgui_false, imgui_true) then
        editor_layoutManager.loadWindowLayout(layoutPath)
    im.Separator()
    if im.MenuItem1("Save Layout...", nil, imgui_false, imgui_true) then
      editor.showWindow(saveLayoutWindowName)
    end
    if im.MenuItem1("Delete Layout...", nil, imgui_false, imgui_true) then
      editor.showWindow(deleteLayoutWindowName)
    end
    if im.MenuItem1("Revert to Factory Settings...", nil, imgui_false, imgui_true) then
      editor.showWindow(resetLayoutsWindowName)
    for _, layoutPath in ipairs(editor_layoutManager.getWindowLayouts(vEditor.getEditorName())) do
      if im.MenuItem1(string.match(layoutPath, ".+/(.+)"), nil, imgui_false, imgui_true) then
        editor_layoutManager.deleteWindowLayout(layoutPath)
          else
            if im.MenuItem1(item.menuEntry) then
              item.menuOpen()
        layoutsMenu()
        if im.MenuItem1("Add View") then
          extensions.editor_vehicleEditor_staticEditor_veStaticRenderView.createRenderViewUI()
          else
            if im.MenuItem1(item.menuEntry) then
              item.menuOpen()
        layoutsMenu()
        if im.MenuItem1("Add View") then
          extensions.editor_vehicleEditor_liveEditor_veView.addSceneView()
          for k, vehData in ipairs(vehsList) do
            if im.MenuItem1(vehData.model.key) then
              local spawnPos = core_camera.getPosition()
            local name = veh:getJBeamFilename() .. " (" .. veh:getID() .. ")"
            if im.MenuItem1(name) then
              veh:delete()
        end
        if im.MenuItem1("Remove All") then
          local currVehs = getAllVehicles()
@/lua/ge/extensions/editor/rallyEditor.lua
        end
        if im.MenuItem1("Clear") then
          clearNotebook()
      if im.BeginMenu("Tools") then
        if im.MenuItem1("Dev Tools") then
          devTools = nil
        end
        if im.MenuItem1("Rally Toolbox") then
          rallyToolbox = nil -- start fresh every time
        end
        if im.MenuItem1("Clear Pacenote AudioMode Overrides") then
          currentPath:clearPacenoteAudioModeOverrides()

        if im.MenuItem1("Generate All Freeform") then
          generateAllFreeformPopup = true
@/lua/ge/extensions/editor/crawlEditor/boundaries.lua
    if im.BeginPopupContextItem("boundary_context_" .. i) then
      if im.MenuItem1("Delete") then
        table.remove(allBoundaries, i)
@/lua/ge/extensions/editor/driftDataEditor.lua

      if im.MenuItem1("Load...") then
        editor_fileDialog.openFile(function(data) loadDriftData(data.filepath) end, {{"driftData Files",".driftData.json"}}, false, currentFileDir)
      if not canSave then im.BeginDisabled() end
      if im.MenuItem1("Save") then
        saveDriftData(currentFileDir .. currentFileName)
      if not canSave then im.EndDisabled() end
      if im.MenuItem1("Save as...") then
        extensions.editor_fileDialog.saveFile(function(data) saveDriftData(data.filepath) end, {{"driftData Files",".driftData.json"}}, false, currentFileDir)
      end
      if im.MenuItem1("Clear") then
        clearStuntZonesEditor()
      end
      if im.MenuItem1("Create Stunt Zones around Vehicle") then
        local obj = scenetree.findObjectById(be:getPlayerVehicleID(0))
    if im.BeginMenu("Add new stunt zone...") then
      if im.MenuItem1("Add Donut") then
        local obj = scenetree.findObjectById(be:getPlayerVehicleID(0))
      end
      if im.MenuItem1("Add Drift Through") then
        local obj = scenetree.findObjectById(be:getPlayerVehicleID(0))
      end
      if im.MenuItem1("Add Hit Pole") then
        local obj = scenetree.findObjectById(be:getPlayerVehicleID(0))
@/lua/ge/extensions/flowgraph/link.lua
  im.SetWindowFontScale(editor.getPreference("ui.general.scale"))
  if im.MenuItem1("Toggle Hide") then
    self.hidden = not self.hidden
  if self.graph.mgr.allowEditing then
    if im.MenuItem1("Delete") then
      self.graph.mgr:deleteSelection()
@/lua/ge/extensions/editor/missionEditor/issues.lua
      if im.BeginMenu("Issues") then
        if im.MenuItem1("Attempt to fix all Missiontype issues for all missions") then
          for _, mission in ipairs(gameplay_missions_missions.getFilesData()) do
        end
        if im.MenuItem1("Attempt to remove all additional data from missionTypeData") then
          for _, mission in ipairs(gameplay_missions_missions.getFilesData()) do
@/lua/ge/extensions/editor/trafficSignalsEditor.lua
    if im.BeginMenu("File") then
      if im.MenuItem1("Load") then
        loadFile() -- only loads the default signal file (should this support other files?)
      end
      if im.MenuItem1("Save") then
        saveFile() -- only saves the default signal file
      end
      if im.MenuItem1("Clear") then
        windowFlags.clear = true
    if im.BeginMenu("Tools") then
      if im.MenuItem1("Check Signal Errors") then
        checkSignalErrors()
@/lua/ge/extensions/editor/terrainEditor.lua
  if im.BeginMenuBar() then
    if im.MenuItem1("Load preset") then
      editor_fileDialog.openFile(function(data) selectPreset(data) end, {{"Any files", "*"},{"Terrain Data", "terrainPreset.json"}}, false, var.lastPath)
    end
    if im.MenuItem1("Save Preset") then
      editor_fileDialog.saveFile(function(data) savePreset(data) end, {{"Terrain Data", "terrainPreset.json"}}, false, var.lastPath)
@/lua/ge/extensions/editor/crawlEditor/trails.lua
    if im.BeginPopupContextItem("trail_context_" .. i) then
      if im.MenuItem1("Delete") then
        local trail = allTrails[i]
@/lua/ge/extensions/core/ropeVisualTest.lua
      if im.BeginMenu("Rope") then
        if im.MenuItem1("Create Rope", nil, false, true) then
          createRopeFromUI()

        if im.MenuItem1("Focus Camera", nil, false, selectedRope ~= nil) then
          if selectedRope then

        if im.MenuItem1("Rebuild Selected", nil, false, selectedRope ~= nil) then
          if selectedRope then
      if im.BeginMenu("Management") then
        if im.MenuItem1("Delete Selected", nil, false, selectedRope ~= nil) then
          if selectedRope then

        if im.MenuItem1("Clone 10", nil, false, selectedRope ~= nil) then
          if selectedRope then

        if im.MenuItem1("Clear All", nil, false, true) then
          clearAllRopeVisuals()

        if im.MenuItem1("Keep First", nil, false, true) then
          local allRopes = getAllRopeVisuals()

        if im.MenuItem1("Reset All", nil, false, true) then
          clearAllRopeVisuals()

        if im.MenuItem1("Quit", nil, false, true) then
          --clearAllRopeVisuals()
      if im.BeginMenu("File") then
        if im.MenuItem1("Save Parameters", nil, false, true) then
          if editor_fileDialog and editor and editor.active then

        if im.MenuItem1("Load Parameters", nil, false, true) then
          if editor_fileDialog and editor and editor.active then
@/lua/common/extensions/ui/imgui_gen_luaintf.lua
function M.EndMenu() imgui.EndMenu() end
function M.MenuItem1(string_label, string_shortcut, bool_selected, bool_enabled)
  -- string_shortcut is optional and can be nil
  if string_label == nil then log("E", "", "Parameter 'string_label' of function 'MenuItem1' cannot be nil, as the c type is 'const char *'") ; return end
  return imgui.MenuItem1(string_label, string_shortcut, bool_selected, bool_enabled)
end
@/lua/ge/extensions/editor/vehicleEditor/staticEditor/vePartTree.lua
  if im.BeginPopup('part_tree_ctx_menu') then
    if im.MenuItem1("Open location in file explorer") then
      Engine.Platform.exploreFolder(tostring(rightClickedPart[3]))
@/lua/ge/extensions/editor/iconOverview.lua
  if imgui.BeginMenuBar() then
    if imgui.MenuItem1("Re-create icon atlas") then
      editor.createIconAtlas()
@/lua/ge/extensions/editor/vehicleEditor/liveEditor/veView.lua
    if im.BeginMenu('Mode') then
      if im.MenuItem1('3D') then
        view.ortho[0] = false
      end
      if im.MenuItem1('Left') then
        view.ortho[0] = true
      end
      if im.MenuItem1('Right') then
        view.ortho[0] = true
      end
      if im.MenuItem1('Front') then
        view.ortho[0] = true
      end
      if im.MenuItem1('Back') then
        view.ortho[0] = true
      end
      if im.MenuItem1('Top') then
        view.ortho[0] = true
      end
      if im.MenuItem1('Bottom') then
        view.ortho[0] = true
    im.Separator()
    if im.MenuItem1('Add New View') then
      addSceneView()
    end
    if im.MenuItem1('Delete This View') then
      if view.control then
@/lua/ge/extensions/editor/barriersEditor.lua
        local level = getCurrentLevelIdentifier()
        if im.MenuItem1("Find for level " .. level) then
          loadPrefabs(level, ffi.string(searchText))
        end
        if im.MenuItem1("Clear results") then
          prefabList = {}
          if not editor_raceEditor.isVisible() then
            if im.MenuItem1("Open Race Editor") then
              editor_raceEditor.show()
          else
            if im.MenuItem1("Add Selection to Race Editor") then
              local path = editor_raceEditor.getCurrentPath()
            end im.tooltip("Adds all selected prefabs to the race, if they are not contained already.")
            if im.MenuItem1("Set Selection exactly to Race Editor") then
              local path = editor_raceEditor.getCurrentPath()
            end im.tooltip("Adds all selected prefabs to the race and removed non-selected prefabs from the race")
            if im.MenuItem1("Copy Selection from Race Editor") then
              local path = editor_raceEditor.getCurrentPath()
        if im.BeginMenu("Prefabs") then
          if im.MenuItem1("Load Selected Prefabs") then
            for _, elem in ipairs(prefabList) do
@/lua/ge/extensions/editor/crawlEditor/presets.lua
      for _, component in ipairs(trailComponents) do
        if im.MenuItem1(component.name) then
          local loadedTrail = self:loadTrailComponent(component.id)
    im.Separator()
    if im.MenuItem1("Save Current Trail as Component...") then
      self:setShowSaveTrailDialog(true)
      for _, component in ipairs(boundaryComponents) do
        if im.MenuItem1(component.name) then
          if trails:getSelectedTrailIndex() > 0 and trails:getSelectedTrailIndex() <= #crawlData.trails then
    im.Separator()
    if im.MenuItem1("Save Current Boundary as Component...") then
      self:setShowSaveBoundaryDialog(true)
      for _, component in ipairs(pathnodeComponents) do
        if im.MenuItem1(component.name) then
          if trails:getSelectedTrailIndex() > 0 and trails:getSelectedTrailIndex() <= #crawlData.trails then
    im.Separator()
    if im.MenuItem1("Save Current Pathnodes as Component...") then
      self:setShowSavePathnodeDialog(true)
  im.Separator()
  if im.MenuItem1("Manage Components...") then
    self:setShowPresetManager(true)
@/lua/ge/extensions/editor/vehicleEditor/staticEditor/veStaticRenderView.lua
    if im.BeginMenu('Mode') then
      if im.MenuItem1('3D') then
        _enterViewMode(wndID, VIEW_MODE_3D)
      end
      if im.MenuItem1('Left') then
        _enterViewMode(wndID, VIEW_MODE_LEFT)
      end
      if im.MenuItem1('Right') then
        _enterViewMode(wndID, VIEW_MODE_RIGHT)
      end
      if im.MenuItem1('Front') then
        _enterViewMode(wndID, VIEW_MODE_FRONT)
      end
      if im.MenuItem1('Back') then
        _enterViewMode(wndID, VIEW_MODE_BACK)
      end
      if im.MenuItem1('Top') then
        _enterViewMode(wndID, VIEW_MODE_TOP)
      end
      if im.MenuItem1('Bottom') then
        _enterViewMode(wndID, VIEW_MODE_BOTTOM)
    im.Separator()
    if im.MenuItem1('Add New View') then
      createRenderViewUI()
    end
    if im.MenuItem1('Delete This View') then
      removeRenderViewUI(wndID)
@/lua/ge/extensions/editor/sceneView.lua
        if im.BeginMenu('Mode') then
          if im.MenuItem1('3D') then
            view.ortho[0] = false
          end
          if im.MenuItem1('Last Selected Camera') then
            view.ortho[0] = false
          end
          if im.MenuItem1('Camera Path') then
            view.ortho[0] = false
          end
          if im.MenuItem1('Left') then
            view.ortho[0] = true
          end
          if im.MenuItem1('Right') then
            view.ortho[0] = true
          end
          if im.MenuItem1('Front') then
            view.ortho[0] = true
          end
          if im.MenuItem1('Back') then
            view.ortho[0] = true
          end
          if im.MenuItem1('Top') then
            view.ortho[0] = true
          end
          if im.MenuItem1('Bottom') then
            view.ortho[0] = true
        im.Separator()
        if im.MenuItem1('Add New View') then createNewViewNextFrame = true ; im.CloseCurrentPopup() end
        if im.MenuItem1('Delete This View') then sceneViews[sceneViewName] = nil ; im.CloseCurrentPopup() end
        if im.MenuItem1('Add New View') then createNewViewNextFrame = true ; im.CloseCurrentPopup() end
        if im.MenuItem1('Delete This View') then sceneViews[sceneViewName] = nil ; im.CloseCurrentPopup() end
        im.EndPopup()
@/lua/ge/extensions/editor/rendererComponents.lua
      if im.BeginMenu("File", imgui_true) then
        if im.MenuItem1("Load Preset...",nil,imgui_false,imgui_true) then
           postfxUtils.loadPresets()
        end
        if im.MenuItem1("Save Preset...",nil,imgui_false,imgui_true) then
          postfxUtils.savePresets()
      end
      if im.MenuItem1("Reset All", nil, imgui_true) then
        postFxModule.loadPresetFile("lua/ge/client/postFx/presets/defaultPostfxPreset.postfx")
@/lua/ge/extensions/editor/veMain.lua
  if im.BeginMenu("File", imgui_true) then
    if im.MenuItem1("Exit Vehicle Editor...", nil, imgui_false, imgui_true) then
      deactivateEditor(true)
@/lua/ge/extensions/util/groundModelDebug.lua
      if im.BeginMenu("Menu") then
        if im.MenuItem1("Save groundmodels") then saveGroundmodels() end
        if im.MenuItem1("Restore default") then core_environment.reloadGroundModels() setup() end
        if im.MenuItem1("Save groundmodels") then saveGroundmodels() end
        if im.MenuItem1("Restore default") then core_environment.reloadGroundModels() setup() end
        im.EndMenu()
@/lua/ge/extensions/editor/flowgraphEditor.lua
      if im.BeginMenuBar() then
        if im.MenuItem1("New Project") then
          local m = core_flowgraphManager.addManager()
        end
        if im.MenuItem1("Load Project...") then
          extensions.editor_fileDialog.openFile(function(data)M.openFile(data, true)end, {{"Any files", "*"},{"Node graph Files",".flow.json"}}, false, M.lastOpenedFolder)
              if FS:fileExists(file) then
                if im.MenuItem1(idx.." - " .. file) then
                  M.openFile({filepath = file}, true)
        im.Separator()
        if im.MenuItem1("Encode Clipboard...") then
          dump(lpack.encode(M.copyData))
      for idx, elem in ipairs(restoreFiles.newest) do
        if im.MenuItem1(idx.." - " ..elem.shortName.." - " .. elem.dateFormatted) then
          M.openFile({filepath = elem.fileName}, true, true)
          for idx, elem in ipairs(restoreFiles.filesByName[name].list) do
            if im.MenuItem1(idx.." - " .. elem.dateFormatted) then
              M.openFile({filepath = elem.fileName}, true, true)
    if win.windowName and win.windowDescription then
      if im.MenuItem1(win.windowDescription, nil, editor.isWindowVisible(win.windowName)) then
        win:toggle()
  im.Separator()
  if im.MenuItem1("Open All") then
    for _, win in ipairs(windows) do
  end
    if im.MenuItem1("Close All") then
    for _, win in ipairs(windows) do
@/lua/ge/extensions/flowgraph/basenode.lua
  if self.mgr.allowEditing then
    if im.MenuItem1("Copy") then
      self.mgr:copyNodes()
    end
    if im.MenuItem1("Delete") then
      self.mgr:deleteSelection()

    if im.MenuItem1("Show all pins", nil, false, true) then
      for _, pin in ipairs(self.pinList) do

    if im.MenuItem1("Hide unused pins", nil, false, true) then
      for _, pin in ipairs(self.pinList) do
    if self.graphType == "instance" then
      if im.MenuItem1('Revert to Subgraph') then
        self.mgr:createSubgraphFromMacroInstance()
    if self:representsGraph() and self.mgr.selectedNodeCount == 1 and self.graph.isStateGraph == self:representsGraph().isStateGraph then
      if im.MenuItem1("Ungroup") then
        self.mgr.groupHelper:ungroupSelection()
      im.SetWindowFontScale(1/editor.getPreference("ui.general.scale"))
      if im.MenuItem1("Open Source File") then
        Engine.Platform.openFile(self.sourcePath)
      end
      if im.MenuItem1("Show File Location") then
        Engine.Platform.exploreFolder(self.sourcePath)
      end
      if im.MenuItem1("Show References") then
        editor_flowgraphEditor.showNodeReferences(self)
        for i = 1, 5 do
          if im.MenuItem1("Depth " .. i) then
            dumpz(self, i)
@/lua/ge/extensions/flowgraph/pin.lua
    if next(self.links) then
      im.MenuItem1("Hide this pin", nil, false, false)
    else
    else
      if im.MenuItem1("Hide this pin") then
        self.hidden = true
  end
  if im.MenuItem1("Show all links") then
    for _, link in ipairs(self.links) do
  end
  if im.MenuItem1("Hide all links") then
    for _, link in ipairs(self.links) do
      for i = 1, 5 do
        if im.MenuItem1("Depth " .. i) then
          dumpz(self, i)