GE Lua Documentation

Press F to search!

Button

Definition


-- @/lua/common/extensions/ui/imgui_gen_luaintf.lua:328
function M.Button(string_label, ImVec2_size)
  if ImVec2_size == nil then ImVec2_size = M.ImVec2(0,0) end
  if string_label == nil then log("E", "", "Parameter 'string_label' of function 'Button' cannot be nil, as the c type is 'const char *'") ; return end
  return imgui.Button(string_label, ImVec2_size)
end

Callers

@/lua/ge/extensions/editor/rallyEditor/drivelineTab.lua
    if hasRecording then
      if im.Button("Load from Recording", im.ImVec2(-1, 30)) then
        self:loadFromRecording()
      im.BeginDisabled()
      im.Button("Load from Recording (Not Found)", im.ImVec2(-1, 30))
      im.EndDisabled()
    local buttonLabel = hasFinal and "Existing Final Driveline" or "Create New Driveline"
    if im.Button(buttonLabel, im.ImVec2(-1, 30)) then
      self:loadFromFinal()
    -- Create from Race button
    if im.Button("Create from Race", im.ImVec2(-1, 30)) then
      self:loadFromRace()
    if self.drivelineV3.spline and #self.drivelineV3.spline.nodes > 2 then
      if im.Button("Simplify Spline") then
        local preDrag = self.drivelineV3:deepCopySpline()
      -- Calculate Race Distance button
      if im.Button("Calculate Race Distance") then
        self:calculateRaceDistance()
      -- Save button
      if im.Button("Save Final Driveline") then
        self:saveFinalDriveline()
      if not self.bufferEnabled then
        if im.Button("Generate Buffer (30m)", im.ImVec2(-1, 30)) then
          self:generateBuffer()

        if im.Button("Clear Buffer") then
          self.bufferEnabled = false
@/lua/ge/extensions/editor/textEditor.lua

    if imgui.Button("Cancel") then
      editor.hideWindow(wndName)
    imgui.SameLine()
    if imgui.Button("Ok") then
      objectHistoryActions.changeObjectFieldWithUndo(instance.objIds, instance.fieldName, ffi.string(instance.textInput), 0)
@/lua/ge/extensions/editor/materialEditor.lua
        im.PushItemWidth(im.GetContentRegionAvailWidth() - 10)
        if im.Button(cubemap) then
          selectCubemap(index)

      if im.Button("Select") then
        if currentMaterial:getField("cubemap", 0) ~= selectedCubemapObj:getName() then
      im.SameLine()
      if im.Button("Cancel") then
        editor.hideWindow(createCubemapWindowName)
    local cubemapName = currentMaterial:getField("cubemap", 0)
    if im.Button("Choose") then
      refreshCubemaps()
  if o.layer[0] > 0 then
    if im.Button("Move Up") then
      swapLayersWithUndo(o.layer[0] - 1, o.layer[0])
    if o.layer[0] > 0 then im.SameLine() end
    if im.Button("Move Down") then
      swapLayersWithUndo(o.layer[0], o.layer[0] + 1)
    end
    if im.Button("Cancel") then
      im.CloseCurrentPopup()
    im.SameLine()
    if im.Button("Save") then
      local oldMaterialName = currentMaterial:getField('name', 0)
      im.PushStyleColor2(im.Col_ButtonActive, im.ImVec4(0, .8, 0, 0.7))
      if im.Button("Switch to V1.5 (PBR)") then
        -- Disabled deprecated 'glow' feature when switching to new materials
    if version and version > 1 then
      if im.Button("Revert to V1") then
        currentMaterial:setField('version', 0, '1')
      if disabled then im.BeginDisabled() end
      if im.Button("+") then
        if currentMaterial.activeLayers < maxLayers then
      if disabled then im.BeginDisabled() end
      if im.Button("-") then
        if currentMaterial.activeLayers > 1 then
      if lyr > 0 then
        if im.Button("Move Up##layer"..tostring(lyr)) then
          swapLayersWithUndo(lyr - 1, lyr)
        if lyr > 0 then im.SameLine() end
        if im.Button("Move Down##layer"..tostring(lyr)) then
          swapLayersWithUndo(lyr, lyr + 1)
        materialPreview()
        if im.Button("Open in dedicated window") then
          editor.showWindow(materialPreviewWindowName)
    im.TextUnformatted("Are you sure you want to delete the current material?")
    if im.Button("Cancel") then
      im.CloseCurrentPopup()
    im.SameLine()
    if im.Button("Ok") then
      editor.deleteMaterial(currentMaterial)
      im.PushStyleColor2(im.Col_Button, pickMaterialFromObject and im.GetStyleColorVec4(im.Col_ButtonActive) or im.GetStyleColorVec4(im.Col_Button))
      if im.Button("Pick from TSStatic") then
        pickMaterialFromObject = true
    im.SameLine()
    if im.Button("...") then
      editor_fileDialog.saveFile(
    if createMaterialError then im.BeginDisabled() end
    if im.Button("Create") then
      if editor.createMaterial(ffi.string(newMatName), ffi.string(newMatPath), (newMatMapToLocked == true and ffi.string(newMatName) or ffi.string(newMatMapTo))) then
    im.SameLine()
    if im.Button("Cancel") then
      editor.hideWindow(createMaterialWindowName)
@/lua/ge/extensions/ui/messagesTasksAppContainers.lua
      local buttonText = (isVisible and "Hide " or "Show ") .. appId
      if im.Button(buttonText .. "##" .. containerId .. "_" .. appId) then
        setAppVisibility(containerId, appId, not isVisible)
    im.Separator()
    if im.Button("Hide All##" .. containerId) then
      hideAllApps(containerId)
    im.SameLine()
    if im.Button("Show All##" .. containerId) then
      for appId, _ in pairs(container.apps) do
@/lua/ge/extensions/editor/terrainEditor.lua

        if im.Button("Close") then
          editor.closeModalWindow("autoPaintModal")
        im.SameLine()
        if im.Button("Auto Paint##doAutoPaint") then
          terrainEditor:autoMaterialLayer(autoPaint.heightMin, autoPaint.heightMax, autoPaint.slopeMin, autoPaint.slopeMax, autoPaint.coverage)
        local autoPaintButtonPosX = im.GetCursorPosX() + im.GetContentRegionAvailWidth() - im.GetStyle().ItemSpacing.x - im.GetStyle().FramePadding.x - im.GetStyle().ItemInnerSpacing.x - im.CalcTextSize("Auto Paint").x
        if im.Button("Terrain Material Library...") then
          editor.showTerrainMaterialsEditor()
        im.SetCursorPosX(autoPaintButtonPosX)
        if im.Button("Auto Paint##OpenModal") then
          editor.openModalWindow("autoPaintModal")
    im.SameLine()
    if im.Button("...##HeightMapImage", im.ImVec2(var.inputWidgetHeight, var.inputWidgetHeight)) then
      editor_fileDialog.openFile(function(data) terrainImpExp.heightMapTexture = im.ArrayChar(128, data.filepath) end, {{"Any files", "*"},{"Images",{".png", ".dds", ".jpg"}},{"PNG", ".png"}, {"JPG", ".jpg"}, {"DDS", ".dds"}}, false, var.lastPath, true)
    im.SameLine()
    if im.Button("...##HoleMapImage", im.ImVec2(var.inputWidgetHeight, var.inputWidgetHeight)) then
      editor_fileDialog.openFile(function(data) terrainImpExp.holeMapTexture = im.ArrayChar(128, data.filepath) end, {{"Any files", "*"},{"Images",{".png", ".dds", ".jpg"}},{"PNG", ".png"}, {"JPG", ".jpg"}, {"DDS", ".dds"}}, false, var.lastPath, true)
        local btnWidth = im.GetContentRegionAvailWidth() - (var.channelComboWidth + var.materialComboWidth + 2*var.style.ItemSpacing.x)
        if im.Button(map.path, im.ImVec2(btnWidth, var.inputWidgetHeight)) then
          if im.GetIO().KeyCtrl == true then
      im.Separator()
      if im.Button("+##AddTextureMap", im.ImVec2(var.inputWidgetHeight, var.inputWidgetHeight)) then
        editor_fileDialog.openFile(function(data) addTextureMap(data.filepath) end, {{"Any files", "*"},{"Images",{".png", ".dds", ".jpg"}},{"PNG", ".png"}, {"JPG", ".jpg"}, {"DDS", ".dds"}}, false, var.lastPath, true)
      im.SameLine()
      if im.Button("-##RemoveTextureMap", im.ImVec2(var.inputWidgetHeight, var.inputWidgetHeight)) then
        removeTextureMap()
    im.Separator()
    if im.Button("Import##ImportTerrainAccept", im.ImVec2(0, var.inputWidgetHeight)) then
      terrainImporter_Accept()
    im.SameLine()
    if im.Button("Cancel##ImportTerrainCancel", im.ImVec2(0, var.inputWidgetHeight)) then
      terrainImporter_Cancel()

    if im.Button("...##TerrainExportPath", im.ImVec2(var.inputWidgetHeight, var.inputWidgetHeight)) then
      editor_fileDialog.openFile(function(data) terrainImpExp.exportPath=im.ArrayChar(128, data.path) end, nil, true, var.lastPath)

    if im.Button("Export##ExportTerrainAccept", im.ImVec2(0, var.inputWidgetHeight)) then
      terrainExporter_Accept()
      im.PushStyleColor1(im.Col_ButtonActive, var.sc_knotColorActive)
      im.Button(
        "##softSelectButton" .. i,
    im.SetCursorPosY(im.GetCursorPosY() + 2*var.style.ItemSpacing.y)
    if im.Button("Cancel##brushSoftnessCurve", im.ImVec2(0.5*((var.sc_curveWidgetSize + textWidthLeftBound)-var.style.ItemSpacing.x),var.inputWidgetHeight)) then
      brushSoftnessCurve_Cancel()
@/lua/ge/extensions/editor/vehicleEditor/liveEditor/veFlexbodyDebug.lua

  if im.Button("Favorite") then
    table.insert(state.settings.favoriteFlexmeshes, state.selectedFlexbody)

    if im.Button("Show picked flexbody") then
      showPickedFlexbody()
    local pickNodeBtnText = state.mode == MODE_PICKING_NODE and "Picking Node..." or "Pick Node"
    if im.Button(pickNodeBtnText) then
      table.clear(state.pickedNodesID)
    local pickVertBtnText = state.mode == MODE_PICKING_VERTEX and "Picking Vertex..." or "Pick Vertex"
    if im.Button(pickVertBtnText) then
      table.clear(state.pickedVerticesID)

    if im.Button("Deselect All") then
      state.mode = MODE_DEFAULT

    if im.Button(name) then
      selectFlexbody(id)
    im.SameLine()
    if im.Button("X##" .. name) then
      table.remove(state.settings.favoriteFlexmeshes, i)
local function renderAllFlexmeshesUI()
  if im.Button("Find vertices lacking nearby nodes") then
    state.verticesLackingNodesData = getVerticesLackingNodes()
  end
  if im.Button("(EXPERT!) Find vertices with 'Out of Bounds' coords") then
    state.verticesOOBCoordsData = getVerticesWithOOBCoords()

              if im.Button(text) then
                selectFlexbody(flexID)

            if im.Button(flexmesh.mesh .. "##" .. tostring(k)) then
              selectFlexbody(flexID, 0.5)
@/lua/ge/extensions/editor/assetDeduplicator.lua

    if im.Button("Select All") then
      for i = 1, #sortedKeys do selection[sortedKeys[i]] = true end
    im.SameLine()
    if im.Button("Clear All") then
      for i = 1, #sortedKeys do selection[sortedKeys[i]] = nil end
    im.Text("Warning: This action is not reversible, double check selected file list before proceeding further.")
    if im.Button("Abort") then im.CloseCurrentPopup() end
    im.SameLine()
    im.SameLine()
    if im.Button("Accept") then
      rebuildSelectedLinks()
      im.Separator()
      if im.Button("Close") then im.CloseCurrentPopup() end
      im.EndPopup()
      im.SameLine()
      if im.Button("Resource Checker") then editor.showWindow("resourceChecker") end
      im.Separator()
      end
      if im.Button("Run assessment") then
        local jobData = {}
        popUp("Preview Changes", popupData)
        if im.Button("Preview and apply") then
          im.OpenPopup("Preview Changes")
            im.Separator()
            if im.Button("Close") then
              cacheData['currentLevel'] = nil
            im.Separator()
            if im.Button("Close") then im.CloseCurrentPopup() generateLinksJob = nil end
            im.EndPopup()
      im.Separator()
      if im.Button("Reset current level asset cache") then
        cacheData['currentLevel'] = nil
      im.SameLine()
      if im.Button("Deep clean asset cache") then
        cacheData = nil
@/lua/ge/extensions/editor/util/searchUtil.lua
    im.SameLine()
    if im.Button("X") then
      self.searchChanged = true
@/lua/ge/extensions/gameplay/drift/stuntZones.lua
      im.Text("Gymkhana options")
      if im.Button("Spawn stunt zones around me") then
        M.setStuntZones({
      end
      if im.Button("Remove stunt zones") then
        M.clear()
      end
      if im.Button("Reset stunt zones") then
        M.reset()
      im.InputInt("Spawn n stunt zones", benchmarkCount)
      if im.Button("Spawn donut zones") then
        for i = 1, benchmarkCount[0], 1 do
      end
      if im.Button("Spawn drift throughs") then
        for i = 1, benchmarkCount[0], 1 do
      end
      if im.Button("Spawn hit poles") then
        for i = 1, benchmarkCount[0], 1 do
      end
      if im.Button("Spawn near poles") then
        for i = 1, benchmarkCount[0], 1 do
          im.SameLine()
          if im.Button("Score ##"..stuntZone.data.id) then
            stuntZone:accomplish()
@/lua/ge/extensions/editor/vehicleEditor/staticEditor/veJBeamModifierLeakVis.lua

    if im.Button("Start Analysis") then
      analyze()
        if setBtnColFlag then im.PushStyleColor2(im.Col_Button, im.GetStyleColorVec4(im.Col_ButtonHovered)) end
        if im.Button(sectionName) then
          sectionViewing = i
@/lua/ge/extensions/flowgraph/nodes/ui/endScreen.lua
  end
  if im.Button("add") then
    table.insert(self.options, "btn_"..(#self.options+1))
  im.SameLine()
  if im.Button("rem") then
    self.options[#self.options] = nil
@/lua/ge/extensions/editor/trafficManager.lua
      end
      if im.Button("Use Vehicle Groups Manager...##trafficManager") then
        if editor_multiSpawnManager then
  im.PushStyleColor2(im.Col_ButtonHovered, imColors.accept)
  if im.Button("Spawn Here##trafficManagerVehicles", im.ImVec2(140, im.GetFrameHeight())) then
    spawnDelayFrames = 3
  end
  if im.Button("Spawn on Click##trafficManagerVehicles", im.ImVec2(140, im.GetFrameHeight())) then
    if mouseMode ~= "spawn" then
        -- maybe there should be a way to click and set the target position
        if im.Button("Set Target Position Here##trafficManagerAi") then
          sessionData.aiData.targetPos = core_camera.getPosition()

        if im.Button("Check Variables") then
          local tempFg = jsonReadFile(sessionData.aiData.flowgraphFile)

      if im.Button("AI Parameters...") then
        im.OpenPopup("AI Parameters##trafficManager")
      im.SameLine()
      if im.Button(speedUnits[options.speedUnits[0]]) then
        options.speedUnits[0] = options.speedUnits[0] + 1
      im.SameLine()
      if im.Button(distanceUnits[options.distanceUnits[0]]) then
        options.distanceUnits[0] = options.distanceUnits[0] + 1
      if not options.fullStats[0] then
        if im.Button("Show More Stats") then
          options.fullStats[0] = true

  if im.Button("More Options...##trafficManagerAllVehicles") then -- dropdown with special functions
    im.OpenPopup("Advanced Functions##trafficManagerAllVehicles")
          im.SameLine()
          if im.Button("Use Default") then -- NOTE: only works for right side of road
            local pos = vec3(currInstance.road and currInstance.road.pos or currInstance.pos)
          for _, id in ipairs(currInstance.tempSignalObjects) do
            if im.Button(tostring(id).."##signalObject", im.ImVec2(columnWidth - im.GetStyle().ItemSpacing.x, 20 * im.uiscale[0])) then
              editor.clearObjectSelection()

    if im.Button("Use Advanced Editor...##trafficManager") then
      if editor_trafficSignalsEditor then
    im.PushStyleColor2(im.Col_ButtonHovered, imColors.accept)
    if im.Button("Spawn Here##trafficManagerSigns", im.ImVec2(140, im.GetFrameHeight())) then
      spawnReady = true
    end
    if im.Button("Spawn on Click##trafficManagerSigns", im.ImVec2(140, im.GetFrameHeight())) then
      if mouseMode ~= "spawn" then

    if not shipping_build and im.Button("Dump Data (Debug)") then
      dump(session)

      if im.Button("YES", im.ImVec2(inputWidth, 20 * im.uiscale[0])) then
        confirmData.yesFunc()
      im.SameLine()
      if im.Button("NO", im.ImVec2(inputWidth, 20 * im.uiscale[0])) then
        confirmData.noFunc()
@/lua/ge/extensions/editor/driftDataEditor.lua
    -- header bar
    if im.Button("Delete") then
      table.remove(driftData.stuntZones, selectedStuntZoneIndex)
    if selectedStuntZoneIndex - 1 >= 1 then
      if im.Button("Move Up") then
        moveStuntZoneOrder(driftData.stuntZones, selectedStuntZoneIndex, selectedStuntZoneIndex - 1)
    if selectedStuntZoneIndex + 1 <= #driftData.stuntZones then
      if im.Button("Move Down") then
        moveStuntZoneOrder(driftData.stuntZones, selectedStuntZoneIndex, selectedStuntZoneIndex + 1)
  end
  if im.Button("Save changes") then
    saveCurrentDriftSpots()
  im.InputText("Spot id", newDriftSpotId)
  if im.Button("Create new drift spot") then
    if #ffi.string(newDriftSpotId) > 0 then
  if selectedDriftSpotId then
    if im.Button("TP player to drift spot") then
      local player = scenetree.findObjectById(be:getPlayerVehicleID(0))
    end
    if im.Button("Delete") then
      deleteDriftSpot(selectedDriftSpotId)
    im.SameLine()
    if im.Button("Open Race Editor") then
      if editor_raceEditor then
    im.SameLine()
    if im.Button("Open Sites Editor") then
      if editor_sitesEditor then
      -- Add new marker object button
      if im.Button("Add Marker Object##" .. lineName) then
        table.insert(lineData.markerObjects, "")
        im.SameLine()
        if im.Button("Delete##" .. i .. lineName) then
          table.remove(lineData.markerObjects, i)
@/lua/ge/extensions/editor/vehicleEditor/liveEditor/veAdjustableTechCarTuner.lua
    im.PushFont3("cairo_semibold_large")
    if im.Button("Apply") then
      applyTuning()
@/lua/ge/extensions/editor/mainMenu.lua

      if imgui.Button("OK", imgui.ImVec2(120, 0)) then editor.closeModalWindow(safeModeDlgName) end
    end
      end
      if imgui.Button("OK", imgui.ImVec2(120, 0)) then editor.closeModalWindow(aboutDlgName) end
    end
    imgui.TextColored(imgui.ImVec4(1, 1, 0, 1), "Warning: You will lose all your changes to the level!")
    if imgui.Button("Yes") then
      editor.hideWindow(revertLevelToOriginalWindowName)
    imgui.SameLine()
    if imgui.Button("No") then
      editor.hideWindow(revertLevelToOriginalWindowName)
      end
      if imgui.Button("Save") then
        editor.hideWindow(saveLayoutWindowName)
    imgui.Text("This will delete all window layouts files and set the Default factory layout.")
    if imgui.Button("Continue") then
      editor.hideWindow(resetLayoutsWindowName)
    imgui.SameLine()
    if imgui.Button("Cancel") then
      editor.hideWindow(resetLayoutsWindowName)
@/lua/ge/extensions/flowgraph/nodes/util/perlinNoise.lua

  if im.Button("Smooth preset") then
    self:_setHardcodedDummyInputPin(self.pinInLocal.frequency, 0.15)
  end
  if im.Button("Natural preset") then
    self:_setHardcodedDummyInputPin(self.pinInLocal.frequency, 0.5)
@/lua/ge/extensions/core/metrics.lua
      im.PushStyleColor2(im.Col_Button, im.GetStyleColorVec4(im.Col_ButtonHovered))
      if im.Button("Open Performance Graph ") then
        togglePerformanceGraph()
@/lua/ge/extensions/flowgraph/nodes/gameplay/sites/parkingspot.lua
function C:drawCustomProperties()
  if im.Button("Open Sites Editor") then
    if editor_sitesEditor then
  end
  if im.Button("add") then
    table.insert(self.options, "btn_"..(#self.options+1))
  im.SameLine()
  if im.Button("rem") then
    self.options[#self.options] = nil
@/lua/ge/extensions/editor/prefabInstanceEditor.lua
    if differsFromParent then
      if imgui.Button("Make new template") then
      end
      -- imgui.PushStyleColor2(imgui.Col_Text, imgui.ImVec4(1,1,1,1))
      if imgui.Button("Apply to parent", imgui.ImVec2(availWidth, 0)) then
      end
@/lua/ge/extensions/editor/windows.lua
          im.NextColumn()
          if im.Button("Set position to 0,0##" .. name) then
            im.SetWindowPos2(name, im.ImVec2(0, 0))
@/lua/ge/extensions/flowgraph/nodes/input/blacklistAction.lua
  im.SameLine()
  if im.Button("X") then
    self.searchChanged = true
      im.SameLine()
      if im.Button("Set##setact" .. self.id) then
        self.list = deepcopy(preset.list)
      im.SameLine()
      if im.Button("Add##addact" .. self.id) then
        for _, a in ipairs(preset.list) do
      im.SameLine()
      if im.Button("Remove##rmact" .. self.id) then
        for _, a in ipairs(preset.list) do
@/lua/ge/extensions/editor/dynamicDecals/export.lua

    if im.Button("Export Skin##Button") then
      api.exportSkin(skinExport_VehicleName, skinExport_Name)

    if im.Button("Export Textures") then
      exportTextures(texturesExport_DirectoryPath, texturesExport_Name, texturesExport_exportFormatId)
@/lua/ge/extensions/util/stepHandler.lua
      if debugApprove and i==taskData.currentStep and step.complete then
        if im.Button("Approve##"..i) then
          step.approved = true
@/lua/ge/extensions/editor/resourceChecker.lua
      im.SameLine()
      if im.Button("Save changes and close window", im.ImVec2(220* im.uiscale[0],0)) then
        for k,v in pairs(duplicateTable) do
      im.SameLine()
      if im.Button("Cancel") then
        resourceUtil.stopProgress()
    popUp("Progress")
    if im.Button("Ok ("..btnpress..")") then
      if btnpress > 1 then
    im.SameLine()
    if im.Button("Cancel") then
      im.CloseCurrentPopup()
    if not tableIsEmpty(isSelected) then
      if im.Button("Remove selected files ("..cnt..")", im.ImVec2(buttonWidth,0)) then
        im.OpenPopup("Remove only selected files")
      im.SameLine()
      if im.Button("Invert selection" , im.ImVec2(buttonWidth,0)) then
        local tempSel = isSelected
    im.SameLine()
    if im.Button("Remove all unused files", im.ImVec2(buttonWidth,0)) then
      im.OpenPopup("Remove all unused files")
    im.SameLine()
    if im.Button("Save output to user folder", im.ImVec2(200* im.uiscale[0],0)) then
      local path = filepath.."/resourceChecker_"..testName..".json"
      if useVeh == true then btnText = "Check current level" else btnText = "Check current vehicle" end
      if im.Button(btnText, im.ImVec2(220* im.uiscale[0],0)) then
        if useVeh == false then useVeh = true else useVeh = false end

    if im.Button("Scan Assets", im.ImVec2(140* im.uiscale[0],0)) then
      im.OpenPopup("Progress")
      if useVeh == true then btnText = "Check current level" else btnText = "Check current vehicle" end
      if im.Button(btnText, im.ImVec2(220* im.uiscale[0],0)) then
        if useVeh == false then useVeh = true else useVeh = false end
    im.Text("Select one of these tools to generate information about materials loaded by this level.")
    if im.Button("Check materials version", im.ImVec2(152* im.uiscale[0],0)) then
      im.OpenPopup("Progress")
    im.SameLine()
    if im.Button("Verify duplicates", im.ImVec2(120* im.uiscale[0],0)) then
      im.OpenPopup("Progress")
    im.SameLine()
    if im.Button("Remove pid", im.ImVec2(121* im.uiscale[0],0)) then
      im.OpenPopup("Progress")
    im.SameLine()
    if im.Button("Convert to PNG", im.ImVec2(121* im.uiscale[0],0)) then
      editor_fileDialog.openFile(
    end
    if im.Button("Check texture map", im.ImVec2(131* im.uiscale[0],0)) then
      im.OpenPopup("Progress")
    im.SameLine()
    if im.Button("Check texture files", im.ImVec2(131* im.uiscale[0],0)) then
      im.OpenPopup("Progress")
    im.SameLine()
    if im.Button("Check missing mats", im.ImVec2(131* im.uiscale[0],0)) then
      im.OpenPopup("Progress")
      im.SameLine()
      if im.Button("Remove dummy mats", im.ImVec2(140* im.uiscale[0],0)) then
        im.OpenPopup("Progress")
    local buttonSize = 140* im.uiscale[0]
    if im.Button("Loaded TSStatics", im.ImVec2(buttonSize,0)) then
      im.OpenPopup("Progress")
    im.SameLine()
    if im.Button("Available ForestItems", im.ImVec2(buttonSize,0)) then
      im.OpenPopup("Progress")
    im.SameLine()
    if im.Button("Loaded Terrains", im.ImVec2(buttonSize,0)) then
      im.OpenPopup("Progress")
    im.SameLine()
    if im.Button("Used Materials", im.ImVec2(buttonSize,0)) then
      im.OpenPopup("Progress")
    end
    if im.Button("Unused Materials", im.ImVec2(buttonSize,0)) then
      im.OpenPopup("Progress")
    im.SameLine()
    if im.Button("Unused Meshes", im.ImVec2(buttonSize,0)) then
      im.OpenPopup("Progress")
    im.SameLine()
    if im.Button("Unused Textures", im.ImVec2(buttonSize,0)) then
      im.OpenPopup("Progress")
    im.SameLine()
    if im.Button("Collision Data", im.ImVec2(buttonSize,0)) then
      im.OpenPopup("Progress")
@/lua/ge/extensions/flowgraph/nodes/ui/imgui/imDialogue.lua
  end
  if im.Button("add##" .. self.id) then
    table.insert(self.options, "btn_" .. (#self.options + 1))
  im.SameLine()
  if im.Button("rem##" .. self.id) then
    self.options[#self.options] = nil
      self.pinOut[btn].value = false
      if im.Button((self.pinIn[btn].value or btn) .. "##" .. self.id .. "-" .. i) then
        self:closeDialogue()
@/lua/ge/extensions/editor/dynamicDecals/brushes.lua
local function inspectorGui(brush)
  if im.Button("Use") then
    loadBrush(brush)
  im.SameLine()
  if im.Button("Delete") then
    editor.selection["dynamicDecalBrush"] = nil
  if not brush.dirty then im.BeginDisabled() end
  local saveBrushButtonPressed = im.Button("Save##BrushInspector")
  if not brush.dirty then im.EndDisabled() end
    im.SameLine()
    if im.Button("dump") then
      dump(brush)
  if im.BeginPopup("DynDecal_Browser_BrushesTab_BrushPopup") then
    if im.Button("Select Brush##BrushContextModal") then
      selectBrush(brushContextModal_brushId, brushesData[brushContextModal_brushId])
    end
    if im.Button("Load Brush##BrushContextModal") then
      loadBrush(brushesData[brushContextModal_brushId])
    end
    if im.Button("Delete Brush##BrushContextModal") then
      deleteBrush(brushContextModal_brushId)
    if editor.getPreference("dynamicDecalsTool.general.debug") then
      if im.Button("Dump Brush##BrushContextModal") then
        dump(brushesData[brushContextModal_brushId])
@/lua/ge/extensions/gameplay/drift/display.lua
    if im.Begin("Drift display") then
      if im.Button("Toggle drift ui layout") then
        setDriftUILayout(not driftDebugUILayout)
@/lua/ge/extensions/editor/api/gui.lua
  imgui.SetCursorPosX(imgui.GetCursorPosX() + imgui.GetContentRegionAvailWidth() - ((ImVec2_size and ImVec2_size.x > 0) and ImVec2_size.x or (imgui.CalcTextSize(string_label).x +  2*imgui.GetStyle().FramePadding.x)) + ((offset) and offset or 0))
  if imgui.Button((id) and string_label .. "##" .. id or string_label, ImVec2_size) then
    return true
  imgui.PushItemWidth(40)
  if imgui.Button(" ... ##fileButton_"..label) then
    if not dir then
  end
  imgui.Button(string.format("Metal: %0.1f | Rough: %0.1f | Coat: %0.1f | CoatRough: %0.1f", col.pbr[1][0], col.pbr[2][0], col.pbr[3][0], col.pbr[4][0]))
  if imgui.IsItemClicked() then
    imgui.SameLine()
    if imgui.Button("-" .. widgetId .. "_decreasebtn", stepButtonSize) then
      res = true
    imgui.SameLine()
    if imgui.Button("+" .. widgetId .. "_increasebtn", stepButtonSize) then
      res = true
@/lua/ge/extensions/career/modules/linearTutorial.lua
        im.SameLine()
        if im.Button("Edit##"..folder) then
          Engine.Platform.exploreFolder("/gameplay/tutorials/pages/"..file[1].."/content.html")
@/lua/ge/extensions/editor/missionEditor/objectives.lua
    if not self._editing then
      if im.Button("Edit") then
        self._editing = true
    else
      if im.Button("Finish Editing") then
        local progressString = ffi.string(self._text[1])
      im.SameLine()
      if im.Button("Cancel") then
        self._editing = false
@/lua/ge/extensions/editor/headlessEditorTest.lua
  if editor.beginWindow(toolWindowName, "Headless Test Tool Window") then
    if imgui.Button("Test") then
      print("This is a test for headless editor")
        end
        if imgui.Button("Open Test Window") then
          editor.showWindow(toolWindowName)
        end
        if imgui.Button("Open Toolbar Window") then
          editor.showWindow(toolbarWindowName)
@/lua/ge/extensions/editor/util/vehicleFilterUtil.lua
  im.Text("Probability Settings:")
  if im.Button("+ Add Probability Setting##"..e._id.."addSetting") then
    table.insert(e.probabilitySettings, {
      im.SameLine()
      if im.Button("Add##"..e._id.."addManual") and selectedConfig and selectedConfig ~= "" then
        -- Check if already exists in manual additions
@/lua/ge/extensions/editor/vehicleEditor/staticEditor/veJBeamBeautifier.lua
    im.InputText("##directoryToBeautify", directoryToBeautifyPtr)
    if im.Button("Select Folder to Beautify") then
      -- Opens a file dialog to choose JBeam file to load
    im.SameLine()
    if im.Button("Select File to Beautify") then
      -- Opens a file dialog to choose JBeam file to load
    im.PushFont3("cairo_semibold_large")
    if im.Button("Beautify JBeam Files") then
      beautifyJBeamFiles(directoryToBeautify)
@/lua/ge/extensions/gameplay/missions/missionManager.lua
      if debugApprove and i==taskData.currentStep and step.complete then
        if im.Button("Approve##"..i) then
          step.approved = true
@/lua/ge/extensions/editor/physicsReloader.lua
  if editor.beginWindow(toolWindowName, "Physics Reloader") then
    if BeamEngine and im.Button("destroyPhysics") then
      Engine.destroyPhysics()
    end
    if not BeamEngine and im.Button("createPhysics") then
      im.TextUnformatted("Please replace libbeamng.dll now")
@/lua/ge/extensions/editor/util/editorElementHelper.lua
  end im.SameLine()
  if im.Button(" ... ##file"..e.label.."...") then
    extensions.editor_fileDialog.openFile(
  end
  if im.Button("...##..." .. e._id) then
    im.OpenPopup("Editor Helper File Context Menu " .. e._id)
  fileDraw(e, ctd, container)
  if im.Button("Open Race Editor") then
    if editor_raceEditor then
  end
  if im.Button("Load Race into Race Editor") then
    if editor_raceEditor then
  end
  if im.Button("Save Race Editor Race to File") then
    if editor_raceEditor then
  fileDraw(e, ctd, container)
  if im.Button("Open Sites Editor") then
    if editor_sitesEditor then
  end
  if im.Button("Load Sites into Sites Editor") then
    if editor_sitesEditor then
  end
  if im.Button("Save Sites Editor Sites to File") then
    if editor_sitesEditor then
@/lua/ge/extensions/editor/aiTests.lua
      im.SameLine()
      if im.Button("Remove##"..marker.objectName) then
        table.remove(routeMarkers, i)

    if im.Button("Player Vehicle##"..marker.objectName) then
      if getPlayerVehicle(0) then
    im.SameLine()
    if im.Button("Camera##"..marker.objectName) then
      marker:set(core_camera.getPosition() - vec3(0, 0, 1))
    if i == count then
      if im.Button("Add Waypoint") then
        table.insert(routeMarkers, count, newRouteMarker("Waypoint "..getNextUniqueIdentifier()))
  im.Separator()
  if im.Button("Set Ground Markers") then
    local path = {}
  im.SameLine()
  if im.Button("Dump Route") then
    dump(route)
    im.SameLine()
    if im.Button("Remove From List##aiParams") then
      removeVehicle(currId)
    if options.dynamicCollisions[0] or not vehicleIds[2] then im.BeginDisabled() end
    if im.Button("Merge Positions##aiParams") then
      local firstVeh = getObjectByID(vehicleIds[1])
    if not aiTracking then
      if im.Button("Start##aiParams") then
        local path
    else
      if im.Button("Stop##aiParams") then
        for k, v in pairs(vehicles) do
    end
    if im.Button("Reset##aiParams") then
      for k, v in pairs(vehicles) do
    im.SameLine()
    if im.Button("Reload##aiParams") then
      for k, v in pairs(vehicles) do
@/lua/ge/extensions/editor/rallyEditor/pacenotes/customForm.lua

  if im.Button("Open Audio File") then
    editor_fileDialog.openFile(
@/lua/ge/extensions/editor/vehicleEditor/liveEditor/veAeroDebug.lua

      if im.Button("Set Wheels", im.ImVec2(150, 25)) then
        setWheels()
@/lua/ge/extensions/editor/missionEditor/progressSetup.lua
    if not self._editing then
      if im.Button("Edit") then
        self._editing = true
    else
      if im.Button("Finish Editing") then
        local progressString = ffi.string(self._text[1])
      im.SameLine()
      if im.Button("Cancel") then
        self._editing = false
@/lua/ge/extensions/editor/rendererComponents.lua
  im.TextUnformatted(string.format("Estimated In-Focus Width: %.2f units", inFocusWidth))
  if im.Button("Reset to defaults") then
    postFxModule.loadPresetFile("lua/ge/client/postFx/presets/defaultPostfxPreset.postfx")
  im.Dummy(im.ImVec2(0, 15))
  if im.Button("Reset to defaults") then
    postFxModule.loadPresetFile("lua/ge/client/postFx/presets/defaultPostfxPreset.postfx")
  local buttonSize = im.ImVec2(im.GetContentRegionAvailWidth(), 42)
  if im.Button("Load Preset...", buttonSize) then
    postfxUtils.loadPresets()
  im.NextColumn()
  if im.Button("Save Preset...", buttonSize) then
    postfxUtils.savePresets()
  im.NextColumn()
  if im.Button("Revert", buttonSize) then
  end
  im.NextColumn()
  if im.Button("Save", buttonSize) then
  end
@/lua/ge/extensions/c2/panelPlugins/tileManager.lua
    if im.Begin("Tile Manager Debug", p_showWindow) then
      if im.Button("Rebuild Index") then buildTileIndex(debugState.tileSize) end
      im.SameLine()
      im.SameLine()
      if im.Button("Rebuild Map Graph") then
         log("I", "tileManager", "Forcing map.lua rebuild...")
      im.SameLine()
      if im.Button("Clear Cache") then activeTileCache = {} end
@/lua/ge/extensions/editor/sensorConfigurationEditor.lua
      im.Separator()
      if im.Button('Export Python code...') then
        getPythonCode()
        im.Separator()
        if im.Button("Copy to clipboard") then
          setClipboard(ffi.string(pythonCodePtr))
        im.SameLine()
        if im.Button("Close popup") then
          im.CloseCurrentPopup()
@/lua/ge/extensions/editor/mainToolbar.lua
      im.Spacing()
      if im.Button("Edit Sets...") then
        availableModesList = {}
      im.BeginGroup()
      if im.Button("New Set") then
        local newSetName = string.format("Edit Mode Set %d", #editModeSets + 1)
      if isDefaultSet then im.BeginDisabled() end
      if im.Button("Delete Set") then
        deleteEditModeSet(selectedSetIndex)
      if not anyModeSelected then im.BeginDisabled() end
      if im.Button("Deselect All##Available", im.ImVec2(120, 25)) then
        deselectAllAvailableModes()
        if not hasSelectedSelected then im.BeginDisabled() end
        if im.Button("Deselect All##Selected", im.ImVec2(120, 25)) then
          deselectAllSelectedModes()
      im.Spacing()
      if im.Button("Close", im.ImVec2(120, 0)) then
        modesManagerOpen[0] = false

          if im.Button(skippedEditMode.iconTooltip, im.ImVec2(120, iconButtonWidth)) and skippedEditMode ~= editor.editMode then
            editor.selectEditMode(skippedEditMode)
@/lua/ge/extensions/editor/dragRaceEditor/facilities.lua
  im.SameLine()
  if im.Button("Add##facilities_add") then
    M.addFacility()
  im.SameLine()
  if im.Button("Remove##facilities_remove") then
    M.removeSelectedFacility()
  im.SameLine()
  if im.Button("Save##facilities_save") then
    M.saveAllFacilities()
  im.SameLine()
  if im.Button("Refresh##facilities_refresh") then
    M.loadAllFacilities()

  if im.Button("Add Strip") then
    -- This would open strip creation dialog
@/lua/ge/extensions/editor/missionPlaybook.lua
      if not condensed then
        if im.Button("Remove") then
          remIdx = i
        end
        if i > 1 and im.Button("Up") then
          upIdx = i
        end
        if i < #M.book.instructions and im.Button("Down") then
          downIdx = i

    if im.Button("Add...") then
      table.insert(M.book.instructions, {type = "missionAttempt", missionId = "italy/delivery/001-mattress", stars = {piecesBronze = true}})
@/lua/ge/extensions/editor/flowgraph/main.lua
                im.PushStyleColor2(im.Col_Button, im.ImVec4((os.clock()*3)%1,0,0,1))
                if im.Button("Duplicate id!!: " ..#duplicateIds) then
                  print("-------------")
                im.PushStyleColor2(im.Col_Button, im.ImVec4(0.2,0.75,0.25,0.6))
                if im.Button("All OK :) " .. table.getn(ids)) then
                  dump(ids)
    if pin.quickAccess  then
      if im.Button("Remove Quick Access",im.ImVec2(200*editor.getPreference("ui.general.scale"),0)) then
        pin.quickAccess = nil
@/lua/ge/extensions/editor/dynamicDecals/loadSave.lua
  -- SAVE
  if im.Button("Save as...") then
    saveAsFileDialog()
  if ext == "" then im.BeginDisabled() end
  if im.Button("Save") then
    api.saveLayerStackToFile(lastProjectFilePath)
  -- LOAD
  if im.Button("Load from file") then
    loadFileDialog()
@/lua/ge/extensions/editor/biomeTool.lua
    imgui.TextUnformatted("No Central Forest Item Selected!")
    if imgui.Button("OK") then
      imgui.CloseCurrentPopup()

    if imgui.Button(buttonText) then
      var.forestBrushTool:quitBiomeProcess()

    if imgui.Button(buttonText) then
      var.forestBrushTool:quitBiomeProcess()

    if imgui.Button("Ok") then
      imgui.CloseCurrentPopup()

    if imgui.Button("Ok") then
      imgui.CloseCurrentPopup()
  end
  if imgui.Button("Generate Layer", imgui.ImVec2(150, 30)) then
    local isAddBlending = (getBlendingMethod(layerType, layerID) == blending_enum.add)
    imgui.SameLine()
    if imgui.Button("Clear", imgui.ImVec2(40, 30)) then
      setTerrLayerMask(layerID, "")
    local textPos = imgui.GetCursorPos()
    if imgui.Button("##CentralBrush"..item.id, imgui.ImVec2(imgui.GetContentRegionAvailWidth(), math.ceil(imgui.GetFontSize()))) then
      selectForestTempBrush(layerType, layerID, item.internalName, enum_forestBrushItemZone.central)
  imgui.SameLine()
  if imgui.Button("Select Brush##Central", imgui.ImVec2(100, 30)) then
    imgui.OpenPopup("Select Forest Brush (Central)")
    local textPos = imgui.GetCursorPos()
    if imgui.Button("##FalloffBrush"..item.id, imgui.ImVec2(imgui.GetContentRegionAvailWidth(), math.ceil(imgui.GetFontSize()))) then
      selectForestTempBrush(layerType, layerID, item.internalName, enum_forestBrushItemZone.falloff)
  imgui.SameLine()
  if imgui.Button("Select Brush##Falloff", imgui.ImVec2(100, 30)) then
    imgui.OpenPopup("Select Forest Brush (Falloff)")
    local textPos = imgui.GetCursorPos()
    if imgui.Button("##NoneCentral", imgui.ImVec2(imgui.GetContentRegionAvailWidth(), math.ceil(imgui.GetFontSize()))) then
      clearForestBrushTempSelection()
      local textPos = imgui.GetCursorPos()
      if imgui.Button("##Falloff"..item.id, imgui.ImVec2(imgui.GetContentRegionAvailWidth(), math.ceil(imgui.GetFontSize()))) then
        if isBrushSelected then
    imgui.EndChild()
    if imgui.Button("OK") then
      imgui.CloseCurrentPopup()
    imgui.SameLine()
    if imgui.Button("Cancel") then
      imgui.CloseCurrentPopup()
    local textPos = imgui.GetCursorPos()
    if imgui.Button("##NoneFalloff", imgui.ImVec2(imgui.GetContentRegionAvailWidth(), math.ceil(imgui.GetFontSize()))) then
      clearForestBrushTempSelection()
      local textPos = imgui.GetCursorPos()
      if imgui.Button("##Falloff"..item.id, imgui.ImVec2(imgui.GetContentRegionAvailWidth(), math.ceil(imgui.GetFontSize()))) then
        if isBrushSelected then
    imgui.EndChild()
    if imgui.Button("OK") then
      imgui.CloseCurrentPopup()
    imgui.SameLine()
    if imgui.Button("Cancel") then
      imgui.CloseCurrentPopup()

      if imgui.Button("Ok") then
        imgui.CloseCurrentPopup()
    imgui.SetCursorPos(imgui.ImVec2(panelWidth - 180, cursorPosY))
    if imgui.Button("Create Edges", imgui.ImVec2(150, 30)) then
      local edgeElements = getForestBrushElementsFromSelection(layerType, layerID, enum_forestBrushItemZone.edge)
      local textPos = imgui.GetCursorPos()
      if imgui.Button("##EdgeBrush"..item.id, imgui.ImVec2(imgui.GetContentRegionAvailWidth(), math.ceil(imgui.GetFontSize()))) then
        selectForestTempBrush(layerType, layerID, item.internalName, enum_forestBrushItemZone.edge)
      local textPos = imgui.GetCursorPos()
      if imgui.Button("##NoneEdge", imgui.ImVec2(imgui.GetContentRegionAvailWidth(), math.ceil(imgui.GetFontSize()))) then
        clearForestBrushTempSelection()
        local textPos = imgui.GetCursorPos()
        if imgui.Button("##Edge"..item.id, imgui.ImVec2(imgui.GetContentRegionAvailWidth(), math.ceil(imgui.GetFontSize()))) then
          if isBrushSelected then
      imgui.EndChild()
      if imgui.Button("OK") then
        imgui.CloseCurrentPopup()
      imgui.SameLine()
      if imgui.Button("Cancel") then
        imgui.CloseCurrentPopup()
    imgui.SameLine()
    if imgui.Button("Select Brush##Edge", imgui.ImVec2(100, 30)) then
      imgui.OpenPopup("Select Forest Brush (Edge)")
      if area.zoneType == var.enum_lassoDrawType.inclusionZone then
        if imgui.Button("Area "..area.lassoAreaID, buttonSize) then
          highlighAnimation.isHighligthing = true
      elseif area.zoneType == var.enum_lassoDrawType.exclusionZone then
        if imgui.Button("Exclusion Zone "..area.lassoAreaID, buttonSize) then
          highlighAnimation.isHighligthing = true
        imgui.TextUnformatted("Are you sure you want to delete \"".."Area "..area.lassoAreaID.."\"?")
        if imgui.Button("Cancel") then
          imgui.CloseCurrentPopup()
        imgui.SameLine()
        if imgui.Button("OK") then
          deleteItemsInArea(layerType_enum.area, layer.layerID)

      if imgui.Button("Delete##Area"..layer.layerID..area.lassoAreaID, imgui.ImVec2(50, 30)) then
        if area.zoneType == var.enum_lassoDrawType.inclusionZone then
  local cursorPosMsg = imgui.GetCursorPosX()
  if imgui.Button("Add New Lasso Area", buttonSize) then
    var.lassoDrawInfo.layerType = layerType
  imgui.SameLine()
  if imgui.Button("Add Exclusion Zone", buttonSize) then
    var.lassoDrawInfo.layerType = layerType
      local cursorPosX = imgui.GetCursorPosX()
      if imgui.Button("Rename Layer", buttonSize) then
        isRenamingLayer = true
      imgui.SameLine()
      if imgui.Button("Delete Layer", buttonSize) then
        imgui.OpenPopup("Delete Layer")
        imgui.TextUnformatted("Are you sure you want to delete \""..layer.layerName.."\"?")
        if imgui.Button("Cancel") then
          imgui.CloseCurrentPopup()
        imgui.SameLine()
        if imgui.Button("OK") then
          local isDeletingLayer = true
      --imgui.SetCursorPosX(cursorPosX)
      --if imgui.Button("Duplicate Layer", buttonSize) then
      --end
  imgui.BeginChild1("MainToolbar", imgui.ImVec2((imgui.GetContentRegionAvail().x - 2), levelBiomeToolbarHeight), true)
  if imgui.Button("(Re)generate all layers", buttonSize) then
  end
  imgui.SameLine()
  if imgui.Button("Undo", buttonSize) then
  end
  imgui.SameLine()
  if imgui.Button("Redo", buttonSize) then
  end

  if imgui.Button("New Terrain Layer", buttonSize) then
    local layer = addLayerWithType(layerType_enum.terrain)
  imgui.BeginChild1("MainToolbar", imgui.ImVec2((imgui.GetContentRegionAvail().x - 2), biomeAreasToolbarHeight), true)
  if imgui.Button("(Re)generate all layers", buttonSize) then
  end
  imgui.SameLine()
  if imgui.Button("Undo", buttonSize) then
  end
  imgui.SameLine()
  if imgui.Button("Redo", buttonSize) then
  end

  if imgui.Button("New Area Layer", buttonSize) then
    local layer = addLayerWithType(layerType_enum.area)
  imgui.BeginChild1("MainToolbar", imgui.ImVec2((imgui.GetContentRegionAvail().x - 6), 50), true)
  if imgui.Button("Open Project", buttonSize) then
  end
  imgui.SameLine()
  if imgui.Button("Save", buttonSize) then
  end
  imgui.SameLine()
  if imgui.Button("Exit", buttonSize) then
    imgui.OpenPopup("Exit Confirmation")
    imgui.Spacing()
    if imgui.Button("OK") then
      editor.closeModalWindow("NoForestObjDialog")

    if imgui.Button(buttonText) then
      var.forestBrushTool:quitBiomeProcess()
@/lua/ge/extensions/editor/rallyEditor/notebookInfo.lua
    im.Separator()
    if im.Button("Delete") then
      self:deleteCodriver(codriver.id)
      im.SameLine()
      if im.Button("Delete Codriver and Pacenotes") then
        self:deleteCodriver(codriver.id)
    im.SameLine()
    if im.Button("Cancel", im.ImVec2(120,0)) then
      im.CloseCurrentPopup()

  if im.Button("Use Codriver") then
    self:useCodriver(codriver)
  im.SameLine()
  if im.Button("Delete") then
    deleteCodriverPopupShow = true
@/lua/ge/extensions/util/vehicleRopeDebug.lua
      -- Manual rebuild button
      if im.Button("Rebuild Rope") then
        selectedRope:rebuild()
@/lua/ge/extensions/gameplay/discover/discover_037.lua
          local im = ui_imgui
          if im.Button("Explode Vehicles") then
            step.complete = true
@/lua/ge/extensions/flowgraph/nodes/gameplay/sites/locationByName.lua
function C:drawCustomProperties()
  if im.Button("Open Sites Editor") then
    if editor_sitesEditor then
      im.Text(loc.name)
      if im.Button("Hardcode to locationName Pin") then
        self:_setHardcodedDummyInputPin(self.pinInLocal.locationName, loc.name)
@/lua/ge/extensions/editor/rallyEditor/static.lua
  -- Refresh button to regenerate system pacenotes
  if im.Button("Refresh System Pacenotes") then
    -- Get the current compositor name before clearing
@/lua/ge/extensions/editor/api/genericInspector.lua
    if copyPasteMenu.customData and copyPasteMenu.customData.defaultValue ~= nil then
      if imgui.Button("Reset Value") then
        copyPasteMenu.open = false
@/lua/ge/extensions/editor/roadNetworkExporter.lua
    else
      if im.Button("Export OpenDrive '" .. getCurrentLevelIdentifier() .. "'...") then
        exportedFilename = nil
    else
      if im.Button("Export OpenStreetMap '" .. getCurrentLevelIdentifier() .. "'...") then
        osmExportedFilename = nil
    else
      if im.Button("Export SUMO '" .. getCurrentLevelIdentifier() .. "'...") then
        sumoExportedFilename = nil
@/lua/ge/extensions/editor/terrainMaterialsEditor.lua

    if im.Button("Close") then
      bulkChange = {}
    im.SameLine()
    if im.Button("Bulk Change") then
      doBulkChange()

      if im.Button("Close") then
        upgradeFileFormatMaterials = {}
      im.SameLine()
      if im.Button("Upgrade##upgradeFileFormat") then
        if upgradeFileFormatMaterials and upgradeFileFormatMaterials.terrainMaterials then

      if im.Button("Close") then
        editor.closeModalWindow("upgradeTerrainMaterialsModal")
      im.SameLine()
      if im.Button("Upgrade##upgradeTerrainMaterials") then
        if editor_terrainEditor.getTerrainBlock() then
          im.Dummy(im.ImVec2(0,10))
          if im.Button("Upgrade Terrain Materials", im.ImVec2(im.GetContentRegionAvailWidth(), 0)) then
            editor.openModalWindow("upgradeTerrainMaterialsModal")
              im.SetCursorPosX(im.GetContentRegionAvailWidth() - ((2 * im.GetStyle().FramePadding.x) + im.CalcTextSize("Apply Changes").x))
              if im.Button("Apply Changes") then
                editor.logInfo("Applying changes to Terrain Material Texture Set")
        im.TextColored(editor.color.warning.Value, "The Terrain Materials reside in a file with a deprecated format.")
        if im.Button("Upgrade Terrain Material file format", im.ImVec2(im.GetContentRegionAvailWidth(), 0)) then
          upgradeTerrainMaterialFileFormat()
      if not terrainMtlCopyProxy.isNew then
        if im.Button("Save Changes To File") then
          terrainMaterialEditor_Accept()
@/lua/ge/extensions/flowgraph/nodes/ui/imgui/elemental/imButton.lua
  local avail = im.GetContentRegionAvail()
  im.Button(tostring(self.pinIn.text.value or "Button")  ..'##'.. tostring(self.id), im.ImVec2(avail.x, 0))
@/lua/ge/extensions/editor/vehicleEditor/staticEditor/veJBeamVariablesChecker.lua
  if im.Begin(wndName, windowOpen) then
    if im.Button("Start Analysis") then
      analyze()
@/lua/ge/extensions/editor/vehicleBridgeTest.lua

    if im.Button("Get Value!") then
      core_vehicleBridge.requestValue(scenetree.findObjectById(vehId),function(...) editor_vehicleBridgeTest.callback(...) end, key)
@/lua/ge/extensions/flowgraph/nodes/scene/camera/setCameraRotation.lua
    end
    if im.Button("Set from camera") then
      self.rotation = core_camera.getQuat()
    im.SameLine()
    if im.Button("Preview") then
      self:SetCamera()
@/lua/ge/extensions/editor/missionEditor/genericTypeData.lua
      end
      if im.Button("Add all "..#self._sortedVars.missing.." missing Variables", im.ImVec2(-1,0)) then
        for _, elem in ipairs(self._sortedVars.missing) do
      end
      if im.Button("Fix all "..#self._sortedVars.mismatch.." type-mismatched Variables", im.ImVec2(-1,0)) then
        for _, elem in ipairs(self._sortedVars.mismatch) do
        for i, elem in ipairs(self._sortedVars.missing) do
          if im.Button("Add##"..elem.fieldName.."--"..i) then
            mgr.variables:addVariable(elem.fieldName, fg_utils.getDefaultValueForType(elem.type), elem.type)
        for i, elem in ipairs(self._sortedVars.mismatch) do
          if im.Button("Fix##"..elem.fieldName.."--"..i) then
            mgr.variables:updateType(elem.fieldName, elem.type)
  if self.mtdIssues and #self.mtdIssues > 0 then
    if im.Button("Auto fix "..#self.mtdIssues .. " issues") then
      self.missionTypeEditors[self.mission.missionType]:checkContainer(self.mission, true)
    if not self._editing then
      if im.Button("Edit") then
        self._editing = true
    else
      if im.Button("Finish Editing") then
        local progressString = ffi.string(self._text[1])
      im.SameLine()
      if im.Button("Cancel") then
        self._editing = false
@/lua/ge/extensions/editor/objectToSplineEditor.lua
    im.SameLine()
    if im.Button("Get From Selection##objectMode") then
      objId = getSelection()
    im.SameLine()
    if im.Button("Get From Selection##splineMode") then
      guideId = getSelection(guideTypes)
    -- procedure
    if im.Button("Preview") then
      work(guideId, objId, savedParams, false)
    im.SameLine()
    if im.Button("Create") then
      work(guideId, objId, savedParams, true, not _changed)
@/lua/ge/extensions/flowgraph/nodes/ui/missionEndScreen.lua
  end
  if im.Button("add") then
    table.insert(self.options, "btn_"..(#self.options+1))
  im.SameLine()
  if im.Button("rem") then
    self.options[#self.options] = nil
@/lua/ge/extensions/editor/rallyEditor/measurementsTab.lua
  -- Create new measurement button
  if im.Button("Create New Measurement") then
    self:createMeasurement()
  im.SameLine()
  if im.Button("Delete Measurement") then
    if self.selectedMeasurementId then
  -- im.PushStyleColor2(im.Col_Button, im.ImColorByRGB(0,100,0,255).Value)
  -- if im.Button("Save") then
  --   self:saveMeasurements()
  -- im.SameLine()
  -- if im.Button("Load") then
  --   self:loadMeasurements()
      im.HeaderText("Points")
      if im.Button("Move Up") then
        if self.selectedPointIndex then
      im.SameLine()
      if im.Button("Move Down") then
        if self.selectedPointIndex then
      im.SameLine()
      if im.Button("Delete Point") then
        if self.selectedPointIndex then
@/lua/ge/extensions/util/maptiles.lua
    end
    if im.Button("Export Navgraph") then
      calcBounds()
      im.Text(string.format("Generating tiles... Zoom Level %d, Tile %d / %d", currentZoomLevel, currentTileIndex, #tilePositions))
      if im.Button('Stop Tile Generation') then
        isGeneratingTiles = false
    else
      if im.Button('Start Tile Generation') then
        currentLevelName = core_levels.getLevelName(getMissionFilename())

      if im.Button('Advance to Next Tile') then
        currentTileIndex = currentTileIndex + 1
@/lua/common/extensions/ui/flowgraph/editor.lua
          -- delete
          if not variable.undeletable and im.Button("Delete Variable") then
            source:removeVariable(name)
          -- rename
          if im.Button("Rename Variable") then
            im.OpenPopup(source.id .. "-rename-" .. name)
  if self.models == nil or next(self.models) == nil then
    if im.Button("Load Models and Configs") then
      self.models = core_vehicles.getModelList(true).models
@/lua/ge/extensions/gameplay/drift/sounds.lua

        if im.Button("Do a drift transition") then
          currentlyDoingATransition = true

        if im.Button("Simulate a crash") then
          isCrashing = true

        if im.Button("Trigger a new tier") then
          extensions.hook("onNewDriftTierReached", { minScore =     0, continuousScore = 10, id = "drift", order = 1, name = "A test tier!" })
@/lua/ge/extensions/core/groundMarkerArrows.lua
          im.TableNextColumn()
          if im.Button("Hide##"..id) then
            proxy.state = "fadeout"
          im.TableNextColumn()
          if im.Button("Delete##"..id) then
            local arrow = scenetree.findObjectById(id)
@/lua/ge/extensions/editor/dynamicDecals/colorHistory.lua
    im.SameLine()
    if im.Button(string.format("Set as decal color##colorHistory_%s_%d", guiId, k)) then
      api.setDecalColor(Point4F(color[1], color[2], color[3], color[4]))
    im.SameLine()
    if im.Button(string.format("Set as fill layer color##colorHistory_%s_%d", guiId, k)) then
      api.setFillLayerColor(Point4F(color[1], color[2], color[3], color[4]))
@/lua/ge/extensions/flowgraph/nodes/vehicle/ai/scriptAI/pathStored.lua
  im.Separator()
  if im.Button("Open ScriptAIManager") then
    if editor_scriptAIManager then
      im.Text("Path with " .. tostring(#rec.path).. " elements.")
      if im.Button("Load Selected Recording into node.") then
        self.aiPath = rec.path
@/lua/ge/extensions/gameplay/rally/tools/loopToolbox.lua
  im.SameLine()
  if im.Button("Load") then
    gameplay_rallyLoop.setup(self.selectedMissionId, self.selectedMissionDir)

  if im.Button("Unload Mission") then
    gameplay_rallyLoop.unload()

  if im.Button("Unload Extension") then
    if extensions.isExtensionLoaded('gameplay_rallyLoop') then
  end
  if im.Button("Skip") then
    extensions.hook('onGameplayInteract')
  im.SameLine()
  if im.Button("-1m") then
    manager:adjustClock(-60)
  im.SameLine()
  if im.Button("-10s") then
    manager:adjustClock(-10)
  im.SameLine()
  if im.Button("+10s") then
    manager:adjustClock(10)
  im.SameLine()
  if im.Button("+1m") then
    manager:adjustClock(60)
  end
  if im.Button(isPaused and "Resume Clock" or "Pause Clock") then
    manager:setClockPaused(not isPaused)
  -- Signboard finder
  -- if im.Button("Find Signboards") then
  --   local count = self:findSignboards()
  -- if stallPos and type(stallPos) == "table" then
  --   if im.Button("Focus on Service Stall") then
  --     local center = vec3(stallPos[1], stallPos[2], stallPos[3])
  -- if outTriggerPos and type(outTriggerPos) == "table" then
  --   if im.Button("Focus on Service Out Trigger") then
  --     local center = vec3(outTriggerPos[1], outTriggerPos[2], outTriggerPos[3])

    if im.Button(buttonText) then
      if manager then
@/lua/ge/extensions/editor/flowgraph/history.lua
  self:Begin('History')
  if im.Button("Undo") then
    self.mgr:undo()
  im.SameLine()
  if im.Button("Redo") then
    self.mgr:redo()
@/lua/ge/extensions/gameplay/drift/drift.lua

      if im.Button("Toggle Imgui Crash Window") then
        showImguiCrashWindow = not showImguiCrashWindow
        im.SameLine()
        if im.Button("Reset Drift Smoothness") then
          newDriftSmoothnessData()
@/lua/ge/extensions/gameplay/missions/missionTypes/editorHelper.lua
  end im.SameLine()
  if im.Button(" ... ##file"..e.label.."...") then
    extensions.editor_fileDialog.openFile(
  end
  if im.Button("...##..." .. e._id) then
    --print("Editor Helper File Context Menu " .. e._id)
  fileDraw(e, mtd, mission)
  if im.Button("Open Race Editor") then
    if editor_raceEditor then
  end
  if im.Button("Load Race into Race Editor") then
    if editor_raceEditor then
  end
  if im.Button("Save Race Editor Race to File") then
    if editor_raceEditor then
  fileDraw(e, mtd, mission)
  if im.Button("Open Sites Editor") then
    if editor_sitesEditor then
  end
  if im.Button("Load Sites into Sites Editor") then
    if editor_sitesEditor then
  end
  if im.Button("Save Sites Editor Sites to File") then
    if editor_sitesEditor then
@/lua/ge/extensions/editor/createObjectTool.lua
    end
    if imgui.Button(btnText) then
      imgui.OpenPopup("CreateSimObjectPopup")

    if imgui.Button("Create") then
      --  Creates object under current selected node in scenetree
@/lua/ge/extensions/editor/scriptAIManager.lua

        if im.Button('OK') then
          local filename = ffi.string(tmpSaveFilename)
        im.SameLine()
        if im.Button('Cancel') then im.CloseCurrentPopup() end
          fn_short = string.sub(fn_short, 1, string.len(fn_short) - string.len(trackFileExt))
          if im.Button(fn_short) then
            loadRecording(bo, vehId, filename)

        if im.Button('Cancel') then im.CloseCurrentPopup() end
      im.SameLine()
      if im.Button('More##'..vehId) then
        im.OpenPopup('controlsPopup##'..vehId)
@/lua/ge/extensions/editor/dynamicDecals/docs.lua
  verticalSpacing()
  if im.Button("Dynamic Decals Thread [Link]", im.ImVec2(im.GetContentRegionAvailWidth(), 0)) then openWebBrowser("https://www.beamng.com/threads/experimental-dynamic-decals.95559/") end
  verticalSpacing()
@/lua/ge/extensions/editor/gen/ui.lua
		im.Dummy(im.ImVec2(0, 0))
		if im.Button(lbl) then
			env.onVal(key, lbl)
					colText, nil) then
	--            if im.Button(t) then
	--                lo('?? pressed:'..i..':'..t)
@/lua/ge/extensions/editor/rallyEditor.lua
      im.Separator()
      if im.Button("Ok", im.ImVec2(120,0)) then
        currentPath:generateAllFreeform()
      im.SameLine()
      if im.Button("Cancel", im.ImVec2(120,0)) then
        im.CloseCurrentPopup()
      if currentWindow ~= missionSettingsWindow then
        if im.Button("Save") then
          saveNotebook()
        im.BeginDisabled()
        if im.Button("Save") then end
        im.EndDisabled()
      -- im.SameLine()
      -- if im.Button("Refresh") then
      --   currentPath:reload()
        im.PushStyleColor2(im.Col_Text, im.ImColorByRGB(0,0,0,255).Value)
        if im.Button("Switch to Rally Editor Editmode", im.ImVec2(im.GetContentRegionAvailWidth(),0)) then
          editor.selectEditMode(editor.editModes.notebookEditMode)
      -- im.SameLine()
      -- if im.Button("Open Mission Editor") then
      --   openMission()
@/lua/ge/extensions/editor/missionEditor/prefabs.lua
    im.SameLine()
    if im.Button(" ... ##prefab"..i) then
      extensions.editor_fileDialog.openFile(
      im.SameLine()
      if im.Button("Spawn##prefab"..i) then
        local dir, filename, ext = path.split(file)
  end
  if im.Button("Add##prefabs") then
    table.insert(self.filenames, im.ArrayChar(2048, "/"))
@/lua/ge/extensions/editor/raceEditor.lua
    if not editor.editMode or editor.editMode.displayName ~= editModeName then
      if im.Button("Switch to Race Editor Editmode", im.ImVec2(im.GetContentRegionAvailWidth(),0)) then
        editor.selectEditMode(editor.editModes.raceEditMode)
@/lua/ge/extensions/editor/dynamicDecals/colorPresets.lua

  if im.Button(string.format("Add color preset##colorPreset_%s", guiId), im.ImVec2(im.GetContentRegionAvailWidth(), 0)) then
    table.insert(data, {value = newPreset.value})

  -- if im.Button(string.format("Add color preset##colorPreset_%s", guiId), im.ImVec2(im.GetContentRegionAvailWidth(), 0)) then
  --   table.insert(data, {value = newPreset.value})
@/lua/ge/extensions/editor/dynamicDecals/notification.lua

      if im.Button("Remove all") then
        notifications = {}
      im.SameLine()
      if im.Button("Close") then
        editor.hideWindow(dynamicDecal_notification_windowName)
@/lua/ge/extensions/editor/techServerManager.lua
    im.EndDisabled()
    if im.Button('Stop server') then
      tech_techCore.closeServer()
  else
    if im.Button('Start server') then
      local ip
@/lua/ge/extensions/flowgraph/nodes/scene/storeStatics.lua
  end
  if im.Button("Store "..#sortedObjectIds.." Selected Objects") then
    self:updateStoredObjects(sortedObjectIds)

  if im.Button("Spawn All") then
    self:spawnObjects(true)
  im.SameLine()
  if im.Button("Despawn All") then
    self:clearObjects()

  if im.Button("Select All") then
    local ids = {}
  im.SameLine()
  if im.Button("Clear Storage") then
    self.storedObjects = {}
@/lua/ge/extensions/ui/gameplayAppContainers.lua
        local buttonText = (isVisible and "Hide " or "Show ") .. appId
        if im.Button(buttonText .. "##" .. containerId .. "_" .. appId) then
          setAppVisibility(containerId, appId, not isVisible)
      im.Separator()
      if im.Button("Hide All##" .. containerId) then
        hideAllApps(containerId)
      im.SameLine()
      if im.Button("Show All##" .. containerId) then
        for appId, _ in pairs(container.apps) do

        if im.Button("Test Drift Message (3s)##" .. containerId) then
          -- Simulate drift app visible and send test message
        im.SameLine()
        if im.Button("Test Drag Message (5s)##" .. containerId) then
          -- Simulate drag app visible and send test message

        if im.Button("Quick Message (1s)##" .. containerId) then
          showApp(containerId, 'drift')
        im.SameLine()
        if im.Button("Long Message (8s)##" .. containerId) then
          showApp(containerId, 'drift')

        if im.Button("Clear Queue##" .. containerId) then
          clearAllFlashMessages()
        im.SameLine()
        if im.Button("Clear Drag Messages##" .. containerId) then
          clearMessagesFromSource('drag')
@/lua/ge/extensions/editor/cosimulationSignalEditor.lua
        --       for j, mode in ipairs(modes) do
        --           if im.Button(mode) then
        --               if currentMode[0] ~= (j - 1) then -- Only log if mode actually changes
@/lua/ge/extensions/editor/audioEventsList.lua
    im.SetCursorPosX(im.GetContentRegionAvail().x / 2 - stopButtonSize.x / 2)
    if im.Button("Stop Current Sound") then
      stopCurrentSFX()
@/lua/ge/extensions/editor/missionEditor/conditions.lua
  im.Dummy(im.ImVec2(depth * padPerDepth, 1)) im.SameLine()
  if im.Button("Add##"..index) then
    table.insert(condition.nested,{type = 'always'})
@/lua/ge/extensions/flowgraph/nodes/gameplay/race/filePath.lua
function C:drawCustomProperties()
  if im.Button("Open Race Editor") then
    if editor_raceEditor then
      im.Text(fn)
      if im.Button("Hardcode to File Pin") then
        self:_setHardcodedDummyInputPin(self.pinInLocal.file, fn)
@/lua/ge/extensions/gameplay/rally/tools/devTools.lua
    im.SameLine()
    if im.Button("Enumerate") then
      self:enumerate()

    if im.Button("Detect Corners from Driveline") then
      self:calculateCorners()

    if im.Button("Generate Pacenotes") then
      if editor_rallyEditor and editor_rallyEditor.getCurrentPath() then
      im.Separator()
      if im.Button("Ok", im.ImVec2(120,0)) then
        local currentPath = editor_rallyEditor.getCurrentPath()
      im.SameLine()
      if im.Button("Cancel", im.ImVec2(120,0)) then
        im.CloseCurrentPopup()

      if im.Button("Clear Driveline Points") then
        self:clearDrivelinePoints()

    if im.Button("Generate Elevation Profile") then
      if editor_rallyEditor and editor_rallyEditor.getCurrentPath() then

      if im.Button("Export to JSON") then
        self:exportElevationProfileToJson()

      if im.Button("Clear Data") then
        self.pacenotesTools.elevationProfile = nil

      if im.Button("Update Navgraph") then
        local mission = gameplay_missions_missions.getMissionById(missionId)

      if im.Button("Clear Traffic Zones") then
        --map.clearTrafficExclusionZones() -- TODO temporarily commented out for v0.38 release due to crashes we don't have time to fix

  -- if im.Button("Load Route") then
  --   self:loadRoute()
@/lua/ge/extensions/flowgraph/nodes/gameplay/traffic/signals/fileTrafficSignals.lua
function C:drawCustomProperties()
  if im.Button('Open Traffic Signals Editor') then
    if editor_trafficSignalsEditor then
@/lua/ge/extensions/editor/missionEditor/progressSingle.lua
  end
  if im.Button("Reload") then
    self:setMission(self.mission)
    if not self._editing then
      if im.Button("Edit") then
        self._editing = true
    else
      if im.Button("Finish Editing") then
        local progressString = ffi.string(self._text[1])
      im.SameLine()
      if im.Button("Cancel") then
        self._editing = false
@/lua/ge/extensions/editor/raceEditor/pathnodes.lua
      im.SameLine()
      if im.Button("Delete") then
        editor.history:commitAction("Delete Node",
      im.SameLine()
      if im.Button("Move Up") then
        editor.history:commitAction("Move Pathnode in List",
      im.SameLine()
      if im.Button("Move Down") then
        editor.history:commitAction("Move Pathnode in List",
      im.SameLine()
      if im.Button("Toggle Mode") then
        if node.mode == 'navgraph' then
      if node.mode == "navgraph" then
        if im.Button("Load Navgraph") then
          table.clear(sortedWaypointsNames)
        end
        if scenetree.findClassObjects("TerrainBlock") and im.Button("Down to Terrain") then
          editor.history:commitAction("Drop Node to Ground",
        end
        if scenetree.findClassObjects("TerrainBlock") and im.Button("Align Normal with Terrain") then
          local normalTip = node.pos + node.normal*node.radius
  editor.uiInputText("##new", self.addFieldText)
  if im.Button("New String") then
    fields:add(ffi.string(self.addFieldText),'string',"value")
  im.SameLine()
  if im.Button("New Number") then
    fields:add(ffi.string(self.addFieldText),'number',0)
  im.Separator()
  if im.Button("Copy Fields") then
    self.cfData = fields:onSerialize()
  end
  if im.Button("Paste Fields") then
    fields:onDeserialized(self.cfData)
  if node.hasNormal and node[fieldName] == -1 then
    if im.Button("Auto-Place "..name) then
      self:autoRecoverPos(fieldName == 'reverseRecovery')
@/lua/ge/extensions/flowgraph/nodes/macro/integrated.lua
  local reason
  if im.Button("Manually Refresh Pins [Debug]") then
    self.mgr:refreshIntegratedPins(self)
@/lua/ge/extensions/career/modules/fuel.lua
    for i, energyType in ipairs(energyTypes) do
      if imgui.Button(string.format("Start Fueling %s ##%d", energyType, i)) then
        uiButtonStartFueling(energyType)
      imgui.SameLine()
      if imgui.Button(string.format("Stop Fueling %s ##%d", energyType, i)) then
        uiButtonStopFueling(energyType)
    if overallPrice <= career_modules_playerAttributes.getAttributeValue("money") then
      if imgui.Button(string.format("Pay")) then
        payPrice()
@/lua/ge/extensions/editor/newsMessage.lua
    imgui.Spacing()
    if imgui.Button("Close##newsCloseBtn", imgui.ImVec2(120, 0)) then editor.closeModalWindow(newsDlgName) end
  end
@/lua/ge/extensions/gameplay/rally/recceApp.lua

  -- if im.Button('Refresh') then
  --   self:refresh()

  -- if im.Button('Load Mission') then
  --   self:loadMission()
  -- im.SameLine()
  -- if im.Button('Unload Mission') then
  --   self:unloadMission()
  -- im.Text("Vehicle Controls")
  -- if im.Button('<-') then
  -- end
  -- im.SameLine()
  -- if im.Button('->') then
  -- end
@/lua/ge/extensions/editor/flowgraph/garbageDebug.lua
  if e.meta.type == 'node' and e.meta.node then
    if im.Button("View Node##".. e.meta.node.name.."/"..e.meta.node.id, im.ImVec2(im.GetContentRegionAvailWidth(), 0)) then
      self.mgr:selectGraph(e.meta.node.graph)
  if e.meta.type == 'graph' and e.meta.graph then
    if im.Button("View Graph##" ..e.meta.graph.name.."/"..e.meta.graph.id, im.ImVec2(im.GetContentRegionAvailWidth(), 0)) then
      self.mgr:unselectAll()
@/lua/ge/extensions/flowgraph/nodes/gameplay/sites/zoneByName.lua
function C:drawCustomProperties()
  if im.Button("Open Sites Editor") then
    if editor_sitesEditor then
      im.Text(cZone.name)
      if im.Button("Hardcode to zoneName Pin") then
        self:_setHardcodedDummyInputPin(self.pinInLocal.zoneName, cZone.name)
@/lua/ge/extensions/editor/cameraBookmarks.lua

    if imgui.Button("Add") then addMark = true end

    if imgui.Button("Copy Location") then editor.copyCameraBookmarkToClipboard(editor.getCamera()) end

    if imgui.Button("Paste Location") then editor.pasteCameraBookmarkFromClipboard() end
        imgui.PushID4(i)
        if imgui.Button("Go To") then editor.jumpToCameraBookmark(bookmark:getID()) end
        imgui.SameLine()
        imgui.SameLine()
        if imgui.Button("Copy") then editor.copyCameraBookmarkToClipboard(bookmark) end
        imgui.SameLine()
        imgui.SameLine()
        if imgui.Button("Delete") then deleteId = bookmark:getID() end
        imgui.SameLine()
@/lua/ge/extensions/flowgraph/nodes/ui/customUiLayout.lua
  local reason = nil
  if im.Button("Capture") then
    self.storedLayout = nil
  im.tooltip("Saves the current layout into the node.")
  if im.Button("Clear") then
    self.storedLayout = nil
  if self.storedLayout then
    if im.Button("Load Stored Layout") then
      core_gamestate.setGameState("temp_fg_"..self:uniqueId(),self.storedLayout)
  end
  if im.Button("Load Freeroam layout") then
    core_gamestate.setGameState("freeroam","freeroam")
@/lua/ge/extensions/util/screenshotCreator.lua
        im.SameLine()
        if im.Button("Multiply current res") then
          if ctrls.multiplyRes[0] > 0 then

        if im.Button(ctrls.resolutionToggled and "Reset resolution" or "Preview resolution") then
          ctrls.resolutionToggled = not ctrls.resolutionToggled
        im.SameLine()
        if im.Button("Toggle UI apps") then
          ctrls.uiToggled = not ctrls.uiToggled
        else
          if im.Button("Preview final thumbnail") then end
          if im.IsItemHovered() then
                  if not isCurrent then
                    if im.Button("Spawn##"..configData.key) then
                      core_vehicles.replaceVehicle(configData.model_key, { config = configData.key, licenseText = "BeamNG"})
                im.TextWrapped("Current vehicle config has a custom camera")
                if im.Button("Set camera to config camera") then
                  local p,r = rewindCameraOffsets(cameraConfigs.vehCamConfig.cameraConfig.posOffset, cameraConfigs.vehCamConfig.cameraConfig.rotOffset)
              end
              if im.Button("Overwrite config camera") then
                local s = currModelName.."/"..currConfigName
                  im.TextWrapped("Current model has a custom camera")
                  if im.Button("Set camera to model camera") then
                    local p,r = rewindCameraOffsets(cameraConfigs.modelCamConfig.cameraConfig.posOffset, cameraConfigs.modelCamConfig.cameraConfig.rotOffset)
                end
                if im.Button("Overwrite model camera") then
                  local s = currModelName.."/"..currConfigName
            im.Text("Manual controls")
            if im.Button(ctrls.drivingEnabled and "Disable driving" or "Enable driving") then
              ctrls.drivingEnabled = not ctrls.drivingEnabled
            if im.IsItemHovered() then im.BeginTooltip() im.Text("Enable or disable vehicle's controls") im.EndTooltip() end
            if im.Button("Set camera to procedural") then
              local currRes = getCurrentResolution()
            if isCameraSet then
              if im.Button("Revert camera") then
                resetCamera()
      if im.BeginTabItem("Last run review") then
        if im.Button("Open user's vehicle folder") then
          if not fileExistsOrNil('/vehicles/') then  -- create dir if it doesnt exist
        im.SameLine()
        if im.Button("Open user's screenshot/showroom folder") then
          if not fileExistsOrNil('/screenshots/showroom/') then  -- create dir if it doesnt exist
                im.BeginDisabled()
                if im.Button("Preview") then
                end
@/lua/ge/extensions/editor/dynamicDecals/settings.lua

    if im.Button("Update materials") then
      updateMaterials()

    if im.Button(string.format("Enable all##Meshes_%s", widgetId)) then
      api.enableAllMeshes()
    im.SameLine()
    if im.Button(string.format("Disable all##Meshes_%s", widgetId)) then
      api.disableAllMeshes()
    im.PopItemWidth()
    if im.Button("Apply Changes##applyTextureResolution") then
      api.setTextureResolution(Point2I(api.textureResolutions[textureResolutionXId + 1].value, api.textureResolutions[textureResolutionYId + 1].value))

  if im.Button("Show dynamic decals preferences") then
    editor.showPreferences("dynamicDecalsTool")
@/lua/ge/extensions/editor/flowgraph/search.lua
  im.SameLine()
  if im.Button("X") then
    self.searchChanged = true
@/lua/ge/extensions/editor/crawlEditor/waypoints.lua
  im.SameLine()
  if im.Button("Add Pathnode") then
    local newPathnode = trail.path.pathnodes:create()
    im.SameLine()
    if im.Button("Remove Pathnode") then
      if self.index and trail.path.pathnodes.objects[self.index] then
    im.SameLine()
    if im.Button("↑##waypointUp") then
      if self.index and trail.path.pathnodes.objects[self.index] then
    im.SameLine()
    if im.Button("↓##waypointDown") then
      if self.index and trail.path.pathnodes.objects[self.index] then

  if scenetree.findClassObjects("TerrainBlock") and im.Button("Down to Terrain") then
    editor.history:commitAction("Drop Pathnode to Ground",
  editor.uiInputText("##new", self.addFieldText)
  if im.Button("New String") then
    fields:add(ffi.string(self.addFieldText),'string',"value")
  im.SameLine()
  if im.Button("New Number") then
    fields:add(ffi.string(self.addFieldText),'number',0)
  im.Separator()
  if im.Button("Copy Fields") then
    self.cfData = fields:onSerialize()
  end
  if im.Button("Paste Fields") then
    fields:onDeserialized(self.cfData)
@/lua/ge/extensions/core/vehicle/mirror.lua
  if( im.Begin("core_vehicle_mirror Debugger", windowOpen) ) then
    if im.Button("get") then
      imguiMirrordata = getAnglesOffset()
    if imguiMirrordata then
      if im.Button("save") then
        for k,v in pairs(imguiMirrordata) do
@/lua/ge/extensions/editor/perfProfiler.lua
    im.BulletText(string.format("There are %d vehicle spawned", #getAllVehicles()))
    if im.Button("Delete All Vehicles", im.ImVec2(im.GetContentRegionAvailWidth(), 0)) then
      local vehs = deepcopy(getAllVehicles())
        local dir, fn, ext = path.split(file)
        if im.Button("Start " .. fn) then
          startRecording(file)
    im.SameLine()
    if im.Button("X") then
      searchChanged = true
    im.SameLine()
    if im.Button(preset.name) then
      setPreset(preset)
    end
    if im.Button("Save") then
      local file = deepcopy(metadataFile)
@/lua/ge/extensions/editor/dynamicDecals/inspector.lua
local function inspectLayerGui(layer, guiId)
  if im.Button(string.format("Dump##%s_%s", layer.uid, guiId)) then dump(layer) end
  if editor.getPreference("dynamicDecalsTool.general.debug") then
    im.SameLine()
    if im.Button(string.format("Dumpz 3##%s_%s", layer.uid, guiId)) then dumpz(layer, 3) end
  end
@/lua/ge/extensions/flowgraph/nodes/gameplay/race/raceEndScreen.lua
  end
  if im.Button("add") then
    table.insert(self.options, "btn_"..(#self.options+1))
  im.SameLine()
  if im.Button("rem") then
    self.options[#self.options] = nil
@/lua/ge/extensions/editor/fileDialog.lua

        if im.Button("Create") then
          createNewDir = true
        im.SameLine()
        if im.Button("Cancel") then
          ffi.copy(textinputNewFolder, "")
        im.SameLine()
        if im.Button("Create") or createNow then
          local crtPath = ffi.string(pathPointer)
          im.Separator()
          if im.Button("OK") then
            editor.hideWindow("Error##FileDialog_ErrorPopup")
      end
      if im.Button(action) or pressedEnter then
        local fname = ffi.string(textinput)
      im.SameLine()
      if im.Button('Cancel') then
        editor.hideWindow(toolWindowName)
        im.TextUnformatted(overwriteDialogText or "Are you sure you want to overwrite this file")
        if im.Button("YES") then
          im.CloseCurrentPopup()
        im.SameLine()
        if im.Button("NO") then
          im.CloseCurrentPopup()
@/lua/ge/extensions/editor/dynamicDecals/fonts.lua
    im.TextColored(editor.color.warning.Value, "No font atlases have been generated yet.")
    if im.Button("Open fonts section##1st_button") then
      tool.setSectionOpenState("Fonts", true, true)
  im.SameLine()
  if im.Button("Preview") then
    editor.showWindow(fontPreviewWindowName)
  if fontPath == "" then im.BeginDisabled() end
  if im.Button("Generate Font Atlas") then
    createFontBitmap()
@/lua/ge/extensions/flowgraph/nodes/gameplay/sites/parkingspotByName.lua
function C:drawCustomProperties()
  if im.Button("Open Sites Editor") then
    if editor_sitesEditor then
      im.Text(ps.name)
      if im.Button("Hardcode to spotName Pin") then
        self:_setHardcodedDummyInputPin(self.pinInLocal.spotName, ps.name)
@/lua/ge/extensions/core/ropeVisualTest.lua

      if im.Button("Save") then
        local filePath = ffi.string(saveFilePathPtr)
      im.SameLine()
      if im.Button("Cancel") then
        im.CloseCurrentPopup()

      if im.Button("Load") then
        local filePath = ffi.string(loadFilePathPtr)
      im.SameLine()
      if im.Button("Cancel") then
        im.CloseCurrentPopup()
        im.TableSetColumnIndex(4)
        if im.Button("X##DirA") then
          uiPtrs.dirAX[0] = 0
        im.TableSetColumnIndex(4)
        if im.Button("X##DirB") then
          uiPtrs.dirBX[0] = 0
      -- Manual rebuild button
      if im.Button("Rebuild Rope") then
        selectedRope:rebuild()
@/lua/ge/extensions/editor/flowgraph/examples.lua
  im.SameLine()
  if im.Button("X") then
    self.searchChanged = true
@/lua/ge/extensions/flowgraph/nodes/debug/flowButton.lua
  end
  if im.Button(name..'##'..self.id) then
    if self.graph.mgr.runningState == "running" then
@/lua/ge/extensions/flowgraph/nodes/states/stateNode.lua

  if im.Button("Export State") then
    extensions.editor_fileDialog.saveFile(
@/lua/ge/extensions/flowgraph/nodes/vehicle/ai/scriptAI/pathFromFile.lua
function C:drawCustomProperties()
  if im.Button("Refresh Files") then
    self.files = FS:findFiles(trackFilePath, '*' .. trackFileExt, -1, true, false)
@/lua/ge/extensions/editor/dynamicDecals/news.lua
  im.Dummy(spacing)
  if im.Button("Vehicle Livery Creator Thread [Link]", im.ImVec2(im.GetContentRegionAvailWidth(), 0)) then openWebBrowser("https://www.beamng.com/threads/experimental-dynamic-decals.95559/") end
  im.Dummy(spacing)

    if im.Button("OK") then
      windowBeenClosed = true
@/lua/ge/extensions/editor/forestEditor.lua
      im.SameLine()
      if im.Button("Copy") then
        setClipboard(tostring(item:getUid()))
    im.Columns(1, "assetInspectorGuiForestItem_columns")
    if im.Button("Open TextureSet editor##ForestItemInspector", im.ImVec2(im.GetContentRegionAvailWidth(), 0)) then
      editor.showWindow(parallaxMappingTextureSetEditor_WindowId)

    if im.Button("Select ForestItemData", im.ImVec2(im.GetContentRegionAvailWidth(), 0)) then
      for _, forestItemData in ipairs(var.forestItemData) do
    local id = item.type == var.enum_forestObjType.forestBrush and ("##" .. item.internalName .. "_button_FB_" .. tostring(item.id)) or ("##" .. item.internalName .. "_button_FBE_" .. tostring(item.id))
    if im.Button(id, im.ImVec2(im.GetContentRegionAvailWidth(), var.fontSize)) then
      -- add to selection if ctrl is held
  --TODO: make sure to make a better nil check for internalName
  if im.Button("##" .. (obj.internalName or "unnamed") .. "_button_FID_" .. tostring(item.id), im.ImVec2(im.GetContentRegionAvailWidth(), var.fontSize)) then
    -- add to selection if ctrl is held
    end
    if im.Button(string.format("Remove texture##%d", id)) then
      pM_textureSets.data[selectedTextureSetIdStr][id] = ""
  if pM_selectedTextureSetId < 1 or pM_selectedTextureSetData == nil then im.BeginDisabled() end
  if im.Button("Copy##TextureSet") then
    pM_textureSetCopy = deepcopy(pM_textureSets.data[tostring(pM_selectedTextureSetId)])
  if pM_selectedTextureSetId < 1 or pM_textureSetCopy == nil then im.BeginDisabled() end
  if im.Button("Paste##TextureSet") then
    pM_textureSets.data[tostring(pM_selectedTextureSetId)] = deepcopy(pM_textureSetCopy)
  if pM_selectedTextureSetId < 1 or pM_selectedTextureSetData == nil then im.BeginDisabled() end
  if im.Button("Clear##TextureSet") then
    pM_textureSets.data[tostring(pM_selectedTextureSetId)] = nil
  im.EndChild()
  if im.Button("Save##SaveCurrentTextureSetButton") then
    pM_textureSets.data[tostring(pM_selectedTextureSetId)] = pM_selectedTextureSetData
    im.SameLine(nil, im.GetStyle().ItemSpacing.x * 4)
    if im.Button("Revert changes##TextureSetEditor") then
      readOrIntializeParallaxMappingTextureSets()
    im.Spacing()
    if im.Button("Yes") then
      createForestObject()
    im.SameLine()
    if im.Button("No") then
      editor.closeModalWindow("noForestMsgDlg")
    im.Spacing()
    if im.Button("Yes") then
      createForestBrushGroup(true)
    im.SameLine()
    if im.Button("No") then
      editor.closeModalWindow("noForestBrushGroupMsgDlg")

  if im.Button("...") then
    local dir, fn, ext = path.split(fieldValue)
local function brushElementForestItemDataCustomFieldEditor(objectIds, fieldValue, fieldName, fieldLabel, fieldDesc, fieldType, fieldTypeName, customData, pasteCallback, contextMenuUI)
  if im.Button("...") then
    im.OpenPopup("##" .. fieldName .. "DataBlockPopup")
    im.SameLine()
    if im.Button("X###" .. fieldName, clearButtonSize) then
      im.ImGuiTextFilter_Clear(dataBlockNameFilter)
@/lua/ge/extensions/editor/dynamicDecals/layerTypes/decal.lua
  local btnWidth = (im.GetContentRegionAvailWidth() - im.GetStyle().ItemSpacing.x) / 2
  if im.Button(string.format("Horizontally##%s_flipHorizontally", widgetId), im.ImVec2(btnWidth, 0)) then
    layer.decalUv.x = layer.decalUv.x * -1
  im.PushStyleColor2(im.Col_Button, layer.decalUv.y == -1 and editor.color.beamng.Value or btnCol)
  if im.Button(string.format("Vertically##%s_flipVertically", widgetId), im.ImVec2(btnWidth, 0)) then
    layer.decalUv.y = layer.decalUv.y * -1
  if im.TreeNodeEx1(string.format("SDF Properties##DecalColor_%s", guiId), im.TreeNodeFlags_DefaultOpen) then
    if im.Button("What is SDF?", im.ImVec2(im.GetContentRegionAvailWidth(), 0)) then
      M.showSdfIntroWindow()
    im.PopTextWrapPos()
    if im.Button("Highlight SDF properties") then
      setSdfPropertiesHighlighted()
    im.Separator()
    if im.Button("OK") then
      M.hideSdfIntroWindow()
    end
    if im.Button("Cancel") then
      im.CloseCurrentPopup()
    im.SameLine()
    if im.Button("Save") then
      brushes.saveBrush(newBrushName)

  if im.Button("Save as brush") then
    local dir, fileName, fileExt = path.split(api.getDecalTexturePath("color"))
  im.SameLine()
  if im.Button(string.format("Inv##InverseDecalRotation_%s", guiId)) then
    local newVal = api.getDecalRotation() + math.pi
  im.PushStyleColor2(im.Col_Button, enabled and editor.color.beamng.Value or buttonColor)
  if im.Button(string.format("Horizontally##%s_flipHorizontally", guiId), im.ImVec2(btnWidth, 0)) then
    uvValue.x = uvValue.x * -1
  im.PushStyleColor2(im.Col_Button, enabled and editor.color.beamng.Value or buttonColor)
  if im.Button(string.format("Vertically##%s_flipVertically", guiId), im.ImVec2(btnWidth, 0)) then
    uvValue.y = uvValue.y * -1
    end
    if im.Button(string.format("Select##Button_%s_%s", guiId, "decalLayerFontCharacter")) then
      fonts.checkOrGenerateFontBitmaps(api.getDecalLayerFontPath())
      im.TableNextColumn()
      if im.Button(string.format("Highlight##DecalPropertiesTable_%s", property.name)) then
        tool.setSectionOpenState("Decal Properties", true)
@/lua/ge/extensions/editor/inspector.lua
      if string.lower(headerMenu.groupName) == string.lower(groupName) then
        if imgui.Button("...") then
          if headerMenu.open then
        end
        if imgui.Button("Reset Position") then
          resetFieldValue("position", posFieldType)
        end
        if imgui.Button("Reset Rotation") then
          resetFieldValue("rotation", rotFieldType)
        end
        if imgui.Button("Reset Scale") then
          resetFieldValue("scale", scaleFieldType)
        end
        if imgui.Button("Reset Rotation & Scale") then
          resetFieldValue("rotation", rotFieldType)
          imgui.SameLine()
          if imgui.Button("Copy ID") then
            setClipboard(tostring(obj:getId()))
          -- delete dynamic field button
          if imgui.Button("X") then
            -- just set to empty string will delete it
    imgui.SameLine()
    if imgui.Button("Add") then
      wantsToAddField = true
          imgui.SetCursorPosX(cursorPos.x + uvValueWidgetWidth + 2*imgui.GetStyle().FramePadding.x)
          if imgui.Button("Reset") then
            local vec = stringToTable(groundCoverUVInitialValue)
      imgui.SetCursorPosX(availableSize.x * 0.75 + 2*imgui.GetStyle().FramePadding.x)
      if imgui.Button("OK") then
        local fieldVal =
      imgui.SameLine()
      if imgui.Button("Cancel") then
        imgui.CloseCurrentPopup()
@/lua/ge/extensions/editor/dynamicDecalsTool.lua
  local headerWidth = im.GetContentRegionAvailWidth() - (section.buttons and #section.buttons or 0) * (buttonHeight + imguiStyle.ItemSpacing.x)
  if im.Button(string.format("##%s", colHeaderTitle), im.ImVec2(headerWidth, buttonHeight)) then
    section.open = not section.open
      if editor.isWindowVisible(section.windowName) then
        if im.Button(string.format("Close external window##%s", section.name)) then
          editor.hideWindow(section.windowName)
      else
        if im.Button(string.format("Open in external window##%s", section.name)) then
          editor.showWindow(section.windowName)
    local style = im.GetStyle()
    if im.Button("Cancel", im.ImVec2((space - style.ItemSpacing.x) / 2, 0)) then
      editor.hideWindow(openToolWindowPopupName)
    im.SameLine()
    if im.Button("Ok", im.ImVec2((space - style.ItemSpacing.x) / 2, 0)) then
      editor.hideWindow(openToolWindowPopupName)
    --[[
    if im.Button("Show CEF") then
      extensions.ui_visibility.setCef(true)
    im.SameLine()
    if im.Button("Pop action map") then
      popActionMap("dynamicDecals")
  for _, child in ipairs(docsSection.children) do
    if im.Button(child.name, im.ImVec2(im.GetContentRegionAvailWidth(), 0)) then
      deps.docs.selectSection(child.name)
@/lua/ge/extensions/editor/dynamicDecals/layerTypes/fill.lua
    sectionGui("addLayerWindow")
    if im.Button("OK##fillLayer_Add_Modal") then
      api.addFillLayer()
    im.SameLine()
    if im.Button("Cancel##fillLayer_Add_Modal") then
      editor.hideWindow(fillLayer_add_windowName)
@/lua/ge/extensions/ui/messagesDebugger.lua

    if im.Button("Send Message") then
      local msg = ffi.string(txtMsg)
    im.SameLine()
    if im.Button("Send Binding Example") then
      local cat = ffi.string(txtCategory)
    im.SameLine()
    if im.Button("Clear Category") then
      _clearCategory(ffi.string(txtCategory), useRegexClear[0])
    im.SameLine()
    if im.Button("Clear All") then
      _clearAll()
    im.Separator()
    if im.Button("Test 3 Messages") then
      local cat = ffi.string(txtCategory)
@/lua/ge/extensions/editor/vehicleEditor/liveEditor/veNodeTriSelfCollisionDetector.lua

    if im.Button("Start Analysis") then
      analyze()

    if im.Button("Clear Results") then
      table.clear(vehsResultData)
@/lua/ge/extensions/editor/crawlEditor/missionPortTool.lua

      if im.Button("Port All Missions") then
        portAllMissions()
        im.Separator()
        if im.Button("Close") then
          showDialog[0] = false
      im.SameLine()
      if im.Button("Refresh") then
        scanMissions()

          if im.Button(buttonText) then
            local success = portMission(mission.path)

      if im.Button("Close") then
        showDialog[0] = false
@/lua/ge/extensions/editor/flowgraph/properties.lua
    im.Columns(1)
    -- if im.Button('add') then
    --   -- TODO
        im.SameLine(im.GetWindowWidth() - 110)
        if im.Button("Set Once", im.ImVec2(90, 22)) then
          item:setDynamicMode('once')
        im.SameLine(im.GetWindowWidth() - 110)
        if im.Button("Set Repeat", im.ImVec2(90, 22)) then
          item:setDynamicMode('repeat')
    im.Columns(1)
    if im.Button("Add Pin") then
      item:createPin('in', self:getFirstAllowedType(item.allowedManualPinTypes), "newPin", nil, "", 0)
    im.Columns(1)
    if im.Button("Add Pin") then
      item:createPin('out', self:getFirstAllowedType(item.allowedManualPinTypes), "newPin", nil, "", true)
          if im.BeginPopup("fgmultiline") then
            if im.Button("Save") then
              self._editMultilineText.saveCallback(self._editMultilineText.savePath, ffi.string(self._editMultilineText.buf))
      im.NextColumn()
      if im.Button("Delete Graph") then
        local parent = graph.parent
      ui_flowgraph_editor.tooltip("Deletes this graph.")
      if im.Button("Clear Graph") then
        self.mgr:clearGraph(graph)
      ui_flowgraph_editor.tooltip("Clears all nodes and links in this graph.")
      if im.Button("Copy Graph") then
        local created = self.mgr:copyGraph(graph, "Copy of " .. graph.name)
      if graph.type == "graph"  and graph.parentId ~= nil then
        if im.Button("Make Macro##"..graph.id) then
          self.mgr:convertToMacro(graph)
      if graph.type == "macro" and graph.parentId == nil then
        if im.Button("Save Macro") then
          self.fgEditor.saveMacro(graph)

        if im.Button("Save Macro as") then
          self.fgEditor.saveMacroAs(graph)
        im.PopItemWidth()
        if im.Button("Add Tag Field") then
          if ffi.string(self.macroTagField) ~= '' and ffi.string(self.macroTagField):gsub("[%s]",""):len()~=0 then
@/lua/ge/extensions/flowgraph/nodes/ui/selectButtons.lua

  if im.Button("add") then
    table.insert(self.options, "btn_"..(#self.options+1))

  if im.Button("rem") then
    self.options[#self.options] = nil
@/lua/ge/extensions/flowgraph/nodes/vehicle/special/vehicleAction.lua
    if not vehicleActionMaps[self.model] then
      if im.Button("Load Actions") then
        self:loadActions(self.model)
@/lua/ge/extensions/editor/missionEditor/setupModules.lua
    im.Text("Number of vehicles selectable for this mission: "..count)
    if im.Button("Add New Provided Vehicle") then
      table.insert(setupModule.vehicles, deepcopy(defaultVehicle)) -- deepcopy is important here
      im.SameLine()
      if im.Button("Delete##vehicleSelector"..i) then
        delIdx = i
@/lua/ge/extensions/ui/apps/pointsBar.lua
    im.SameLine()
    if im.Button("Clear All") then
      clearData()
@/lua/ge/extensions/editor/roadEditor.lua
      else
        if im.Button("Change Template") then
          templateDialogOpen[0] = true
      local buttonTextSuffix = tableIsEmpty(roadAndNodeIDsTbl) and "" or "s"
      if im.Button("Split Road"..buttonTextSuffix, im.ImVec2(0,0)) then
        splitRoads(roadAndNodeIDsTbl)
    im.Text("Road Operations")
    if im.Button("Flip Direction", im.ImVec2(0,0)) then
      flipSelectedRoadsDirection()
    if shouldShowFuseOption then
      if im.Button("Fuse Roads", im.ImVec2(0,0)) then
        fuseRoads()
    im.TextColored(im.ImVec4(1, 1, 0, 1), "Select and edit not allowed when road is inside packed prefab!")
    if im.Button("OK") then
      editor.closeModalWindow(roadNotSelectableErrorWindowName)
@/lua/ge/extensions/editor/sensorDebugger.lua
    else
      if im.Button("Preview all cameras") then
        startAllPreviews()
      im.SameLine()
      if im.Button("Hide all cameras") then
        stopAllPreviews()
@/lua/ge/extensions/editor/util/transformUtil.lua
    if not self:correctEditMode() then
      if im.Button("Edit " .. self.objectName) then
        self:enableEditing()
      editor.drawAxisGizmo()
      if im.Button("Exit Editing " .. self.objectName) then
        editor.selectEditMode(nil)
    im.SameLine()
    if im.Button("...") then
      im.OpenPopup("Tranform Util Context Menu " .. self.objectName)
@/lua/ge/extensions/editor/dynamicDecals/layerTypes/textureFill.lua
    sectionGui("addLayerWindow")
    if im.Button("OK##textureFillLayer_Add_Modal") then
      api.addTextureFillLayer()
    im.SameLine()
    if im.Button("Cancel##textureFillLayer_Add_Modal") then
      editor.hideWindow(textureFillLayer_add_windowName)
@/lua/ge/extensions/gameplay/missions/missionScreen.lua
    arrayConcat(layouts, M.savedLayouts)
    if im.Button("Discover Layouts") then
      M.discoverLayouts()
    end
    if im.Button("Exit Screen") then
      guihooks.trigger('ChangeState', 'freeroam')
    end
    if im.Button("Clear History") then
      M.uiLayoutHistory = {}
        header = header .. " (" .. (layout.recordedAtFormatted or "Unknown") .. ")"
        if im.Button(header) then
          M.testLayout = layout
        if layout.isSaved then
          if im.Button("Delete") then
            -- Find the file path
        else
          if im.Button("Save") then
            jsonWriteFile("/gameplay/testing/missionScreen_"..layout.recordedAt..".json", layout, true)
@/lua/ge/extensions/editor/dragRaceEditor/lanes.lua

  if im.Button("Add Lane") then
    M.addLane()
    im.SameLine()
    if im.Button("Remove") then
      M.removeSelectedLane()
    im.SameLine()
    if im.Button("Save") then
      local lane = M.getSelectedLane()

  if im.Button("Add Waypoint") then
    -- This would open waypoint creation dialog
@/lua/ge/extensions/editor/sitesEditor/zones.lua
  im.Text("Area: %0.2fm²", self.current:zoneArea())
  if im.Button("Select all vertices") then
    self.currentVertices = self.current.vertices
  end
  if im.Button("Delete current selection") then
    for _, vertex in ipairs(self.currentVertices) do
  end
  if im.Button("Auto Planes") then
    self.current:autoPlanes()
  end
  if im.Button("Divide") then
    self.current:makeHighResolutionFence()
    im.SameLine()
    if im.Button("Edit Top plane") then
      self.currentVertices = {}
    im.SameLine()
    if im.Button("Edit Bot plane") then
      self.currentVertices = {}
@/lua/ge/extensions/editor/crawlEditor/boundaries.lua

  if im.Button("Add Boundary") then
    local newBoundary = self:getNewBoundary()
  im.SameLine()
  if im.Button("Rename") then
    local newFileName = ffi.string(self.fileName)
  im.SameLine()
  if im.Button("Add Vertex") then
    local pos = vec3(0, 0, 0)
  im.SameLine()
  if im.Button("Remove Selected") then
    local verticesToDelete = {}

  if im.Button("Auto Planes") then
    local oldState = boundary:onSerialize()
  im.SameLine()
  if im.Button("High Res Fence") then
    local oldState = boundary:onSerialize()

  if im.Button("Create Decal Road") then
    if boundary.vertices and #boundary.vertices >= 3 then
  editor.uiInputText("##new", self.addFieldText)
  if im.Button("New String") then
    fields:add(ffi.string(self.addFieldText),'string',"value")
  im.SameLine()
  if im.Button("New Number") then
    fields:add(ffi.string(self.addFieldText),'number',0)
  im.Separator()
  if im.Button("Copy Fields") then
    self.cfData = fields:onSerialize()
  end
  if im.Button("Paste Fields") then
    fields:onDeserialized(self.cfData)
@/lua/ge/extensions/editor/dragRaceEditor/strips.lua
  im.SameLine()
  if im.Button("Add##strips_add") then
    log('D', 'drag_race_editor', 'Strips Add button clicked')
  im.SameLine()
  if im.Button("Remove##strips_remove") then
    log('D', 'drag_race_editor', 'Strips Remove button clicked')
  im.SameLine()
  if im.Button("Save##strips_save") then
    log('D', 'drag_race_editor', 'Strips Save button clicked')
  im.SameLine()
  if im.Button("Refresh##strips_refresh") then
    log('D', 'drag_race_editor', 'Strips Refresh button clicked')

  if im.Button("Add Lane") then
    local newLane = {
  im.SameLine()
  if im.Button("Remove Selected Lane") then
    if selectedLaneIndex > 0 and selectedLaneIndex <= #strip.lanes then

  if im.Button("Add Waypoint") then
    local newWaypoint = {
  im.SameLine()
  if im.Button("Remove Selected Waypoint") then
    if selectedWaypointIndex > 0 and selectedWaypointIndex <= #lane.waypoints then
        -- Gizmo controls
        if im.Button("Edit with Gizmo") then
          M.enableWaypointGizmo(selectedWaypoint)
        im.SameLine()
        if im.Button("Focus Camera") then
          local pos = vec3(selectedWaypoint.transform.position.x, selectedWaypoint.transform.position.y, selectedWaypoint.transform.position.z)
    im.SameLine()
    if im.Button("Remove Boundary") then
      lane.boundary = nil
      -- Gizmo controls
      if im.Button("Edit with Gizmo") then
        M.enableBoundaryGizmo(lane.boundary)
      im.SameLine()
      if im.Button("Focus Camera") then
        local pos = vec3(lane.boundary.transform.position.x, lane.boundary.transform.position.y, lane.boundary.transform.position.z)
    im.SameLine()
    if im.Button("Add Boundary") then
      lane.boundary = {
@/lua/ge/extensions/editor/dynamicDecals/layerTypes/path.lua
  im.PushStyleColor2(im.Col_Button, enabled and editor.color.beamng.Value or buttonColor)
  if im.Button("Hor") then
    layer.decalUv = Point2F(layer.decalUv.x * -1, layer.decalUv.y)
  im.PushStyleColor2(im.Col_Button, enabled and editor.color.beamng.Value or buttonColor)
  if im.Button("Vert") then
    layer.decalUv = Point2F(layer.decalUv.x, layer.decalUv.y * -1)

      if im.Button("Reset all##textCharacterPositions") then
        for k,v in ipairs(layer.textCharacterPositions) do
    local count = #layer.dataPoints
    if im.Button(string.format("Reverse data points##%s", layer.uid)) then
      local newDataPoints = {}

    im.Button(string.format("Show data points##%s", layer.uid))
    if im.IsItemHovered() then
      im.TableNextColumn()
      if im.Button(string.format("Highlight##DecalPropertiesTable_%s", property.name)) then
        tool.setSectionOpenState("Decal Properties", true)
@/lua/ge/extensions/editor/rallyEditor/pacenotes/structuredForm.lua
    im.Separator()
    if im.Button("Ok", im.ImVec2(120,0)) then
      pacenote:deleteAudioFiles()
    im.SameLine()
    if im.Button("Cancel", im.ImVec2(120,0)) then
      im.CloseCurrentPopup()
@/lua/ge/extensions/editor/crawlEditor/startingPositions.lua
function C:drawStartingPositionsList(allStartingPositions, selection)
  if im.Button("Add Starting Position") then
    local newStartingPosition = self:getNewStartingPosition()
  im.SameLine()
  if im.Button("Rename") then
    local newFileName = ffi.string(self.fileName)
@/lua/ge/extensions/editor/vehicleEditor/staticEditor/veJBeamSpellchecker.lua
  if im.Begin(wndName, windowOpen) then
    if im.Button("Start Analysis") then
      analyze()
@/lua/ge/extensions/editor/dynamicDecals/camera.lua
  for name, val in pairs(presets) do
    if im.Button(string.format("%s##%s_%s", name:gsub("^%l", string.upper), "Generate Materials", guiId), im.ImVec2(im.GetContentRegionAvailWidth(), 0)) then
      setCamera(vec3(val[1], val[2], val[3]))

  if im.Button(string.format("%s##%s", "Show Preferences", guiId), im.ImVec2(im.GetContentRegionAvailWidth(), 0)) then
    editor.showPreferences("dynamicDecalsTool")
  im.Separator()
  if im.Button("Add Preset##dynDecals_camera_presets_add", im.ImVec2(im.GetContentRegionAvailWidth(), 0)) then
    local i = 0
@/lua/ge/extensions/editor/raceEditor/timeTrials.lua
    im.SameLine()
    if im.Button(" ... ##prefab"..i) then
      extensions.editor_fileDialog.openFile(
  end
  if im.Button("Add##prefabs") then
    local newPrefabs = deepcopy(self.path[fieldName])
@/lua/ge/extensions/flowgraph/basenode.lua
    --if self._trigger and self._triggerCode then
      if im.Button("Log trigger code") then
        print("Trigger Code for " .. self.id .. " : " ..self.name .. " is:")
    im.TextUnformatted("Worked: " .. self.workCount)
    if im.Button("Colors") then
      dumpz(self._flowColors,2)
      accept = im.InputText('',self.graphName,128, im.InputTextFlags_EnterReturnsTrue)
      if accept or im.Button("Create", im.ImVec2(im.GetContentRegionAvailWidth(), 0)) then
      accept = im.InputText('',self._commentInput,128, im.InputTextFlags_EnterReturnsTrue)
      accept = accept or im.Button("Create", im.ImVec2(im.GetContentRegionAvailWidth(), 0))
      im.PushStyleVar2(im.StyleVar_ItemSpacing, im.ImVec2(0,0))
        im.PushStyleColor2(im.Col_ButtonActive, im.ImVec4(c[1],c[2],c[3],0.8))
        if im.Button("##"..i.."clr", im.ImVec2(15*editor.getPreference("ui.general.scale"), 15* editor.getPreference("ui.general.scale"))) then
          accept = true
@/lua/ge/extensions/editor/crawlEditor.lua
      im.SameLine()
      if im.Button("Add Trail") then
        showFileSelectionDialog("trail")
      im.SameLine()
      if im.Button("Add Path") then
        showFileSelectionDialog("path")
      im.SameLine()
      if im.Button("Add Boundary") then
        showFileSelectionDialog("boundary")
      im.SameLine()
      if im.Button("Add Starting Position") then
        showFileSelectionDialog("startingPosition")
      im.SameLine()
      if im.Button("Save") then
        if currentTab == "trails" and selectedTrailIndex > 0 then
        im.PushStyleColor2(im.Col_ButtonActive, im.ImVec4(0.7, 0.1, 0.1, 1.0))
        if im.Button("Delete Trail") then
          local selectedTrail = getSelectedTrail()
        im.PushStyleColor2(im.Col_ButtonActive, im.ImVec4(0.7, 0.1, 0.1, 1.0))
        if im.Button("Delete Path") then
          local selectedPath = allPaths[selectedPathIndex]
        im.PushStyleColor2(im.Col_ButtonActive, im.ImVec4(0.7, 0.1, 0.1, 1.0))
        if im.Button("Delete Boundary") then
          local selectedBoundary = allBoundaries[selectedBoundaryIndex]
        im.PushStyleColor2(im.Col_ButtonActive, im.ImVec4(0.7, 0.1, 0.1, 1.0))
        if im.Button("Delete Starting Position") then
          local selectedStartingPosition = allStartingPositions[selectedStartingPositionIndex]
@/lua/ge/extensions/flowgraph/nodes/debug/display.lua
  if type(self._lastVal) == 'table' then
    if im.Button("Dump##"..self.id) then
      dump(self._lastVal)
@/lua/ge/extensions/editor/dynamicDecals/layerTypes/brushStroke.lua
  im.PushStyleColor2(im.Col_Button, enabled and editor.color.beamng.Value or buttonColor)
  if im.Button("Hor") then
    layer.decalUv = Point2F(layer.decalUv.x * -1, layer.decalUv.y)
  im.PushStyleColor2(im.Col_Button, enabled and editor.color.beamng.Value or buttonColor)
  if im.Button("Vert") then
    layer.decalUv = Point2F(layer.decalUv.x, layer.decalUv.y * -1)
      im.TableNextColumn()
      if im.Button(string.format("Highlight##DecalPropertiesTable_%s", property.name)) then
        tool.setSectionOpenState("Decal Properties", true)
@/lua/ge/extensions/editor/vehicleEditor/liveEditor/vePropTransformer.lua

      if im.Button("Pick Prop") then
        if state.mode ~= 2 then
        im.SameLine()
        if im.Button("Copy to Clipboard") then
          local copyText = string.format('"x":%0.3f, "y":%0.3f, "z":%0.3f', btgX, btgY, btgZ)
        im.SameLine()
        if im.Button("Copy to Clipboard") then
          local copyText = string.format('"x":%0.3f, "y":%0.3f, "z":%0.3f', btgRx * 180.0 / math.pi, btgRy * 180.0 / math.pi, btgRz * 180.0 / math.pi)

        if im.Button("Set baseTranslationGlobal w/ Gizmo") then
          editor.setAxisGizmoMode(editor.AxisGizmoMode_Translate)
        end
        if im.Button("Set baseRotationGlobal w/ Gizmo") then
          editor.setAxisGizmoMode(editor.AxisGizmoMode_Rotate)
@/lua/ge/extensions/editor/flowgraph/references.lua
  if not self.nodeTable or self.nodeTable == {} then
    if im.Button("Load Data", im.ImVec2(-1, 0)) then
      self:createNodeTable()
@/lua/ge/extensions/editor/missionEditor/additionalAttributes.lua
  im.SameLine()
  if im.Button("Now") then
    self.dateInput[0] = os.time()
    im.SameLine()
    if im.Button("Now##after") then
      self._timeUpdaterData.after[0] = os.time()
    im.SameLine()
    if im.Button("Now##setTo") then
      self._timeUpdaterData.setTo[0] = os.time()
    for _, m in ipairs(list) do listById[m.id] = m end
    if im.Button("Update Affected Missions") then
      for _, mId in ipairs(self._timeUpdaterData.missionIds) do
@/lua/ge/extensions/editor/autoSave.lua

    if imgui.Button("Restore") then
      imgui.OpenPopup("AutoSave Restore Confirm")
    imgui.SameLine()
    if imgui.Button("Close") then
      imgui.CloseCurrentPopup()
    --TODO: all folder must be empty before FS:directoryRemove
    -- if imgui.Button("Delete all autosaves for this level") then
    --   FS:directoryRemove("/settings/editor/autosaves/" .. editor.getLevelName())
      imgui.Spacing()
      if imgui.Button("Load AutoSave") then
        imgui.CloseCurrentPopup()
      imgui.SameLine()
      if imgui.Button("Cancel") then
        imgui.CloseCurrentPopup()
@/lua/ge/extensions/editor/trafficDebug.lua
  end
  if im.Button(str, im.ImVec2(100, im.GetFrameHeight())) then
    if trafficAmountChange[0] > 0 then
  end
  if im.Button(str, im.ImVec2(100, im.GetFrameHeight())) then
    if parkingAmountChange[0] > 0 then

  if im.Button("Scatter Traffic Vehicles") then
    gameplay_traffic.scatterTraffic()
  end
  if im.Button("Scatter Parked Vehicles") then
    gameplay_parking.scatterParkedCars()

    if im.Button("Dump Data") then
      dump(currVeh)

    if im.Button("Force Respawn") then
      gameplay_traffic.forceTeleport(currVeh.id)

    if im.Button("Refresh Vehicle") then
      currVeh:onRefresh()

    if im.Button("Reset Vehicle") then
      local obj = getObjectByID(currVeh.id)
@/lua/ge/extensions/flowgraph/nodes/types/transform.lua
  if editor and editor.selection and editor.selection.object and #editor.selection.object == 1 then
    if im.Button("Copy from current Selection") then
      local obj = scenetree.findObjectById(editor.selection.object[1])

    if im.Button("Position to 15m before Camera") then
      self.position = beforeCam
    end
    if im.Button("Position To Camera") then
      self.position = vec3(cameraPosition)

    if im.Button("Rotation To Camera") then
      self.rotation = core_camera.getQuat()

    if im.Button("Down to Terrain") then
      if scenetree.findClassObjects("TerrainBlock") then
@/lua/ge/extensions/career/modules/marketplace.lua

        if im.Button("Take their offer") then
          negotiationActive = false
        end
        if im.Button("Cancel negotiation") then
          negotiationActive = false
@/lua/ge/extensions/editor/raceEditor/pacenotes.lua
      im.SameLine()
      if im.Button("Delete") then
        editor.history:commitAction("Delete Note",
      im.SameLine()
      if im.Button("Move Up") then
        editor.history:commitAction("Move Pacenote in List",
      im.SameLine()
      if im.Button("Move Down") then
        editor.history:commitAction("Move Pacenote in List",
      end
      if scenetree.findClassObjects("TerrainBlock") and im.Button("Down to Terrain") then
        editor.history:commitAction("Drop Note to Ground",
      end
      if scenetree.findClassObjects("TerrainBlock") and im.Button("Align Normal with Terrain") then
        local normalTip = note.pos + note.normal*note.radius
@/lua/ge/extensions/editor/dragRaceEditor/waypoints.lua

  if im.Button("Add Spawn") then
    M.addWaypoint("spawn")
  im.SameLine()
  if im.Button("Add Stage") then
    M.addWaypoint("stage")
  im.SameLine()
  if im.Button("Add End Line") then
    M.addWaypoint("endLine")
    im.NewLine()
    if im.Button("Remove") then
      M.removeSelectedWaypoint()
    im.SameLine()
    if im.Button("Save") then
      local waypoint = M.getSelectedWaypoint()
@/lua/ge/extensions/flowgraph/nodes/ui/updatedUI/endScreenWhole.lua
  end
  if im.Button("add") then
    table.insert(self.options, "btn_"..(#self.options+1))
  im.SameLine()
  if im.Button("rem") then
    self.options[#self.options] = nil
@/lua/ge/extensions/gameplay/drag/debug.lua
    im.SameLine()
    if im.Button("Clear Save Data ##clearData") then
      dragData = nil
        im.SameLine()
        if im.Button("Play " .. value.name) then
          ext.startDebugPhase(index, dragData)

      if im.Button("Start Drag Race") then
        gameplay_drag_general.startDragRaceActivity()

      if im.Button("Reset Drag Race") then
        ext.resetDragRace()
      if selectedVehicle and dragData.racers[selectedVehicle] then
        if im.Button("Remove Vehicle" .. "##"..selectedVehicle) then
          aviableLanes[dragData.racers[selectedVehicle].lane] = true
          for key, laneData in pairs(dragData.strip.lanes[dragData.racers[selectedVehicle].lane]) do
            if im.Button("Lanedata: " .. key) then
              dump(laneData.transform)
        else
          if im.Button("Dump Vehicle data") then
            dump(dragData.racers[selectedVehicle])
@/lua/ge/extensions/editor/vehicleEditor/staticEditor/vePartList.lua
    im.PushItemWidth(15)
    if im.Button('x##partsSearchReset') then
      partsSearchText = im.ArrayChar(256)
        im.SameLine()
        if im.Button('unselect') then
          vEditor.selectedPart = nil
@/lua/ge/extensions/core/quickAccess.lua
        im.SameLine()
        if im.Button("Add ##" .. currentPath) then
          addActionLink("/" .. path .. "/", title, favoriteSelectionIndex)

    if im.Button("Cancel") then
      favoriteSelectionIndex = nil
@/lua/ge/extensions/gameplay/drift/stallingSystem.lua
        im.Text("Imaginary stunt zone count : 3")
        if im.Button("Process stunt zone 1") then processStuntZone(1) end
        if im.Button("Process stunt zone 2") then processStuntZone(2) end
        if im.Button("Process stunt zone 1") then processStuntZone(1) end
        if im.Button("Process stunt zone 2") then processStuntZone(2) end
        if im.Button("Process stunt zone 3") then processStuntZone(3) end
        if im.Button("Process stunt zone 2") then processStuntZone(2) end
        if im.Button("Process stunt zone 3") then processStuntZone(3) end
        if im.Button("Process drift") then processDrift() end
        if im.Button("Process stunt zone 3") then processStuntZone(3) end
        if im.Button("Process drift") then processDrift() end
        if im.Button("Reset") then
        if im.Button("Process drift") then processDrift() end
        if im.Button("Reset") then
          reset()
@/lua/ge/extensions/editor/trafficSignalsEditor.lua
  end
  if im.Button("New...##ctrlDefinitionTypes") then
    local name = "Type "..(#signalCtrlDefinitions.typesSorted + 1)
  im.SameLine()
  if im.Button("Remove##ctrlDefinitionTypes") then
    signalCtrlDefinitions.types[signalCtrlDefinitions.typesSorted[selected.ctrlDefType] or ""] = nil
  end
  if im.Button("New...##ctrlDefinitionStates") then
    local name = "State "..(#signalCtrlDefinitions.statesSorted + 1)
  im.SameLine()
  if im.Button("Remove##ctrlDefinitionStates") then
    signalCtrlDefinitions.states[signalCtrlDefinitions.statesSorted[selected.ctrlDefState] or ''] = nil

      if im.Button("Create##flashingLight") then
        currData.flashingLightsArraySize = currData.flashingLightsArraySize + 1
      im.SameLine()
      if im.Button("Delete##sequencePhase") then
        currData.flashingLightsArraySize = math.max(1, currData.flashingLightsArraySize - 1)
        end
        if im.Button(" "..i.." ") then
          selected.flashingLight = i

    if im.Button("Save & Close##ctrlDefinitions") then
      for _, typeData in pairs(signalCtrlDefinitions.types) do
    im.SameLine()
    if im.Button("Discard & Close##ctrlDefinitions") then
      windowFlags.ctrlDefinitions[0] = false
    im.SameLine()
    if im.Button("Delete##instance") then
      local act = instances[selected.signal]:onSerialize()
    im.PopItemWidth()
    if im.Button("Down to Terrain##instance") then
      if core_terrain.getTerrain() then

      if im.Button("Edit##instanceSequence") or currInstance._newSequence then
        tabFlags = {im.flags(im.TabItemFlags_None), im.flags(im.TabItemFlags_None), im.flags(im.TabItemFlags_SetSelected)} -- selects the sequence tab
    else
      if im.Button("New...##instanceSequence") then
        editor.history:commitAction("Create Sequence", {}, createSequenceActionUndo, createSequenceActionRedo)

      if im.Button("Edit##instanceCtrl") or currInstance._newController then
        tabFlags = {im.flags(im.TabItemFlags_None), im.flags(im.TabItemFlags_SetSelected), im.flags(im.TabItemFlags_None)} -- selects the controller tab
    else
      if im.Button("New...##instanceCtrl") then
        editor.history:commitAction("Create Controller", {}, createControllerActionUndo, createControllerActionRedo)
    im.SameLine()
    im.Button("?")
    im.tooltip("Signals are grouped together if they are in an intersection formation.")

    if im.Button("Highlight Others##instance") then
      if currInstance.tempGroupList then
    im.SameLine()
    im.Button("?")
    im.tooltip("Select signal objects, such as traffic lights, to link with this instance. Remember to Save Level (Ctrl+S) after you are done.")
    if editor.getCurrentEditModeName() ~= "objectSelect" then
      if im.Button("Select Objects##signalObjects") then
        editor.selectEditMode(editor.editModes["objectSelect"])

      if im.Button("Reset Objects##signalObjects") then
        if currInstance.tempSignalObjects then
      local count = tableSize(editor.selection.object)
      if im.Button("Confirm Selection ("..count..")##signalObjects") then
        if count > 0 then

      if im.Button("Cancel##signalObjects") then
        editor.selectEditMode(editor.editModes[editModeName])
    im.SameLine()
    if im.Button("Delete##controller") then
      local act = currController:onSerialize()

    if im.Button("Manage Custom Controllers...##controller") then
      windowFlags.ctrlDefinitions[0] = true
    im.SameLine()
    im.Button("?")
    im.tooltip("States run in order; the next state starts when the timer reaches the current state duration.")
    im.SameLine()
    if im.Button("Delete##sequence") then
      local act = currSequence:onSerialize()
    im.SameLine()
    im.Button("?")
    im.tooltip("Phases run in order, and each phase runs the assigned controllers. Each controller can only be used once per sequence.")

    if im.Button("Create##sequencePhase") then
      currSequence:createPhase()
    im.SameLine()
    if im.Button("Delete##sequencePhase") then
      currSequence:deletePhase()
            im.SameLine()
            if im.Button(" - ##phaseControllerIds"..i.."_"..j) then
              table.remove(phase.controllerIds)
            im.SameLine()
            if im.Button(" + ##phaseControllerIds"..i.."_"..j) then
              table.insert(phase.controllerIds, 0)

      if im.Button("YES", im.ImVec2(inputWidth, 20 * im.uiscale[0])) then
        resetSignals()
      im.SameLine()
      if im.Button("NO", im.ImVec2(inputWidth, 20 * im.uiscale[0])) then
        im.CloseCurrentPopup()
@/lua/ge/extensions/editor/rallyEditor/pacenotes/pacenoteForm.lua

  if im.Button("Generate from Structured") then
    pacenote:generateFreeformFromStructured()

  -- if im.Button("Focus Camera") then
  --   self:setCameraToPacenote()
  -- im.SameLine()
  if im.Button("Place Vehicle") then
    pacenoteToolsWindow:placeVehicleAtPacenote()

  --   if im.Button(camTxt) then
  --     pacenoteToolsWindow:cameraPathPlay()
  -- end
  -- if im.Button(corner_call_txt) then
  --   pacenoteToolsWindow:toggleCornerCalls()

  if im.Button("TODO") then
    -- local pn = pacenoteToolsWindow:selectedPacenote()
  im.SameLine()
  if im.Button("Done") then
    -- local pn = pacenoteToolsWindow:selectedPacenote()

  if im.Button("Delete") then
    showDeleteConfirmDialog = true

  -- if im.Button("Dump") then
  --   dumpPacenote(pacenote)

  -- if im.Button("Measure") then
  --   pacenoteToolsWindow:measureSelectedPacenote()
    im.SameLine()
    if im.Button("Merge with Prev") then
      pacenoteToolsWindow:mergeSelectedWithPrevPacenote()
    im.SameLine()
    if im.Button("Merge with Next") then
      pacenoteToolsWindow:mergeSelectedWithNextPacenote()

    if im.Button("OK", im.ImVec2(120, 0)) then
      pacenoteToolsWindow:deleteSelectedPacenote()
    im.SameLine()
    if im.Button("Cancel", im.ImVec2(120, 0)) then
      im.CloseCurrentPopup()
@/lua/ge/extensions/editor/roadTemplateEditor.lua
    im.Text("Chosen Template: " .. chosenTemplateName)
    if im.Button("Choose Template") then
      templateDialogOpen[0] = true

    if im.Button("Save") then
      saveTemplate(chosenTemplateName)

    if im.Button("Save as...") then
      saveDialog[0] = true

    if im.Button("New##Template") then
      newTemplate()

    if im.Button("Delete##Template") then
      os.remove("roadtemplates/" .. chosenTemplateName .. ".road.json")
      im.InputText("Template Name", saveName)
      if im.Button("Save") then
        local name = ffi.string(saveName)
    if chosenTemplateName ~= "" then
      if im.Button("New##Road") then
        local roadID = editor.createRoad({}, {})

      if im.Button("Clone##Road") then
        local roadID = editor.createRoad({}, editor.copyFields(decalRoads[decalRoadSelectionIndex[0]+1]))

      if im.Button("Delete##Road") then
        -- Delete the selected road
    if chosenTemplateName ~= "" then
      if im.Button("New##Decoration") then
        local decoID = createDecoObject()

      if im.Button("Clone##Decoration") then
        local selectedDeco = scenetree.findObjectById(decorations[decorationSelectionIndex[0]+1])

      if im.Button("Delete##Decoration") then
    if chosenTemplateName ~= "" then
      if im.Button("New##Decal") then
        local decalID = editor.createRoad({}, {})

      if im.Button("Clone##Decal") then
        local decalID = editor.createRoad({}, editor.copyFields(decals[decalSelectionIndex[0]+1]))

      if im.Button("Delete##Decal") then
        -- Delete the selected decal
@/lua/ge/extensions/flowgraph/nodes/scene/camera/setCameraPosition.lua
    end
    if im.Button("Set from camera") then
      local cameraPosition = core_camera.getPosition()
    im.SameLine()
    if im.Button("Preview") then
      self:SetCamera()
@/lua/ge/extensions/editor/dragRaceEditor/dragSettings.lua
  im.SameLine()
  if im.Button("Add##settings_add") then
    log('D', 'drag_race_editor', 'Settings Add button clicked')
  im.SameLine()
  if im.Button("Remove##settings_remove") then
    log('D', 'drag_race_editor', 'Settings Remove button clicked')
  im.SameLine()
  if im.Button("Save##settings_save") then
    log('D', 'drag_race_editor', 'Settings Save button clicked')
  im.SameLine()
  if im.Button("Refresh##settings_refresh") then
    log('D', 'drag_race_editor', 'Settings Refresh button clicked')

  if im.Button("Add Phase") then
    table.insert(dragSettings.phases, {
  im.SameLine()
  if im.Button("Remove Selected Phase") then
    if selectedPhaseIndex > 0 and selectedPhaseIndex <= #dragSettings.phases then
    im.SameLine()
    if im.Button("Browse##christmasTree") then
      editor_fileDialog.openFile("Select Christmas Tree Prefab", "*.prefab", function(path)
    im.SameLine()
    if im.Button("Browse##displaySign") then
      editor_fileDialog.openFile("Select Display Sign Prefab", "*.prefab", function(path)
    im.SameLine()
    if im.Button("Browse##paths") then
      editor_fileDialog.openFile("Select Paths Prefab", "*.prefab", function(path)
    im.SameLine()
    if im.Button("Browse##decorations") then
      editor_fileDialog.openFile("Select Decorations Prefab", "*.prefab", function(path)
  im.NewLine()
  if im.Button("Save Settings") then
    M.saveDragSettings(settingsFile.path)
    im.SameLine()
    if im.Button("Load...##" .. label) then
      editor_fileDialog.openFile(function(data)
      im.SameLine()
      if im.Button("Clear##" .. label) then
        dragSettings.prefabs[prefabType].path = nil
    im.SameLine()
    if im.Button("Remove##phase" .. i) then
      table.remove(dragSettings.phases, i)
      im.SameLine()
      if im.Button("↑##up" .. i) then
        utils.reorderLanes(dragSettings.phases, i, i - 1)
      im.SameLine()
      if im.Button("↓##down" .. i) then
        utils.reorderLanes(dragSettings.phases, i, i + 1)
@/lua/ge/extensions/editor/vehicleEditor/staticEditor/veJBeamTableVis.lua
  if im.Begin(wndName, windowOpen) then
    if im.Button("Open JBeam File...") then
      -- Opens a file dialog to choose JBeam file to load

    if im.Button("Refresh") then
      if jbeamFilePath then
@/lua/ge/extensions/editor/api/valueInspector.lua

    if imgui.Button(string.format("Open in Asset Browser##%s", filenameContextMenu.fieldName)) then
      extensions.editor_assetBrowser.selectFileByPath(filenameContextMenu.fieldValue)
    imgui.Begin("ValueInspectorCopyPasteMenu", nil, imgui.WindowFlags_NoCollapse + imgui.WindowFlags_AlwaysAutoResize + imgui.WindowFlags_NoResize + imgui.WindowFlags_NoTitleBar)
    if imgui.Button("Copy Value") then
      local copiedValue = copyPasteMenu.fieldValue
    end
    if imgui.Button("Paste Value") and tbl and tbl.copiedValue and copyPasteMenu.pasteCallback then
      copyPasteMenu.open = false
function C:displaySimSetPopupList(objectSetArray, fieldName, fieldNameId, fieldValue, selectedIds, val, arrayIndex, className)
  if imgui.Button("  ...  ###" .. fieldNameId) then
    simSetWindowFieldId = fieldNameId
    imgui.SameLine()
    if imgui.Button("X###" .. fieldNameId, clearButtonSize) then
      imgui.ImGuiTextFilter_Clear(simSetNameFilter)
function C:displayMaterialPopupList(objectSet, fieldName, fieldNameId, fieldValue, selectedIds, val, arrayIndex, className)
  if imgui.Button("  ...  ###" .. fieldNameId) then
    simSetWindowFieldId = fieldNameId
    imgui.SameLine()
    if imgui.Button("X###" .. fieldNameId, clearButtonSize) then
      imgui.ImGuiTextFilter_Clear(simSetNameFilter)
  elseif fieldTypeName == "TypeCommand" then
    if imgui.Button(fieldValue:sub(1,20)) then
      editor.newTextEditorInstance(self.selectedIds, fieldName)
    end
    if imgui.Button("Pick...") then
      editor.pickingLinkTo = {}
    end imgui.SameLine()
    if imgui.Button("Select") then
      if obj then
    end imgui.SameLine()
    if imgui.Button("Clear") then
      self.setValueCallback(fieldName, "", arrayIndex, customData, true)
          editor.showNotification(msg)
          editor.setStatusBar(msg, function() if ui_imgui.Button("Close##duplicate") then editor.hideStatusBar() end end)
          changeAllowed = false
          editor.showNotification(msg)
          editor.setStatusBar(msg, function() if imgui.Button("Close##duplicate") then editor.hideStatusBar() end end)
          changeAllowed = false
    if fieldTypeName == "TypePrefabFilename" then extensions = {"Prefabs", {".prefab", ".prefab.json"}} end
    if imgui.Button("  ...  " .. fieldNameId) then
      local dir, fn, ext = path.split(fieldValue)
  --   imgui.SameLine()
  --   if imgui.Button("Edit...") then
  --     editUvRectInfo.objectId = customData.objectId
  elseif customData and customData.isDataBlock then
    if imgui.Button("  ...  ###" .. fieldNameId) then
      imgui.OpenPopup(fieldNameId .. "DataBlockPopup")
      imgui.SameLine()
      if imgui.Button("X###" .. fieldNameId, clearButtonSize) then
        imgui.ImGuiTextFilter_Clear(dataBlockNameFilter)
@/lua/ge/extensions/editor/dynamicDecals/history.lua
  im.BeginChild1(string.format("DynamicDecalsHistoryChild%s", guiId), im.ImVec2(0, childHeight), true)
  if im.Button("Delete All History##DynamicDecalsTool") then history:clear() end
  if im.IsItemHovered() then
  im.TextUnformatted("Undo Stack")
  if im.Button("Undo Selected##DynamicDecalsTool") then history:undo(tableSize(history.undoStack) - undoStackSelectedIndex + 1) end
  im.BeginChild1("undos", im.ImVec2(0, im.GetContentRegionAvail().y))
  im.TextUnformatted("Redo Stack")
  if im.Button("Redo Selected##DynamicDecalsTool") then history:redo(tableSize(history.redoStack) - redoStackSelectedIndex + 1) end
  im.BeginChild1("redos", im.ImVec2(0, im.GetContentRegionAvail().y))
@/lua/ge/extensions/editor/preferences.lua
local function contextMenuUI(copyPasteMenu)
  if imgui.Button("Reset Value") then
    copyPasteMenu.open = false
  end
  if imgui.Button("Copy Preference Path") then
    copyPasteMenu.open = false
  if not imgui.ImGuiTextFilter_IsActive(prefItemNameFilter) then
    if imgui.Button("Export...") then
      editor_fileDialog.saveFile(
    imgui.SameLine()
    if imgui.Button("Import...") then
      editor_fileDialog.openFile(

    if imgui.Button("Reset Category To Defaults") then
      imgui.OpenPopup("Reset Category Preferences To Defaults")
      imgui.Separator()
      if imgui.Button("Yes", imgui.ImVec2(120,0)) then imgui.CloseCurrentPopup() editor.preferencesRegistry:resetToDefaults(catName) end
      imgui.SameLine()
      imgui.SameLine()
      if imgui.Button("No", imgui.ImVec2(120,0)) then imgui.CloseCurrentPopup() end
      imgui.EndPopup()
      imgui.SameLine(prefWindowCurrWidth - 150 * imgui.uiscale[0])
      if imgui.Button("Reset All To Defaults") then
        imgui.OpenPopup("Reset All To Defaults")
        imgui.Separator()
        if imgui.Button("Yes", imgui.ImVec2(120,0)) then imgui.CloseCurrentPopup() editor.preferencesRegistry:resetToDefaults() end
        imgui.SameLine()
        imgui.SameLine()
        if imgui.Button("No", imgui.ImVec2(120,0)) then imgui.CloseCurrentPopup() end
        imgui.EndPopup()
@/lua/ge/extensions/editor/levelValidator.lua
  end
  if im.Button(name) then
    if logLevelFilters[logLevel] then logLevelFilters[logLevel] = nil else logLevelFilters[logLevel] = true end
  if editor.beginWindow(toolWindowName, "Level Validator") then
    if im.Button("Find issues") then
      startLevelValidation()
        im.SameLine()
        if im.Button("Delete all duplicates (WARNING: This cannot be undone with ctrl+z)") then
          for i, logItem in ipairs(levelLogs) do
          end
          if im.Button("Show Ignored (" .. getIgnoredCount() .. ")") then
            showIgnored = not showIgnored
          if (logItem.forestItem or object) and logItem.onCheck and not logItem.prefabChildId then
            if im.Button("Delete Object##" .. i) then
            end
              if isIgnored then
                if im.Button("Un-ignore##" .. i) then
                end
              else
                if im.Button("Ignore Object##" .. i) then
                end
            if isIgnored then
              if im.Button("Un-ignore##" .. i) then
              end
            else
              if im.Button("Ignore Object##" .. i) then
              end
@/lua/ge/extensions/editor/rallyEditor/pacenotes/measurementsForm.lua
  im.Spacing()
  if im.Button("Measure") then
    if pacenoteToolsState and pacenoteToolsState.snaproad then
  im.SameLine()
  if im.Button("Apply") then
    if pacenote.applyMeasurements then
@/lua/ge/extensions/editor/missionEditor.lua
    end
    if im.Button("Create Mission", im.ImVec2(-1, -1)) then
      -- create mission and add into mission list
    end
    if im.Button("Change Auto Key",im.ImVec2(-1,0)) then
      local level = clickedMission.startTrigger and clickedMission.startTrigger.level or "noLevel"
    im.InputText("Key:##translationKey", translationData.translationKeyPtr, translationData.translationKeyLength)
    if im.Button("Make Translation",im.ImVec2(-1,0)) then
      makeTranslation()
    im.InputTextMultiline("##translationCopyPasta", translationData.copyPastaPtr, translationData.copyPastaLength, im.ImVec2(500,500))
    if im.Button("Replace Mission Data with Keys",im.ImVec2(-1,0)) then
      applyTranslation()
@/lua/ge/extensions/trackbuilder/trackBuilder.lua
local function debug()
  if im.Button("Make") then tb.makeTrack() end
  im.Text("currentIndex " .. currentIndex)
  im.SetCursorPosX(piecePositions[1]+10)
  if im.Button("|<",style.thinButtonSize) then tbFunctions.navigate('first') end
  im.tooltip(translateLanguage("ui.trackBuilder.selection.first", "Select First Piece"))
  im.SetCursorPosX(piecePositions[2]+10)
  if im.Button("<",style.thinButtonSize) then tbFunctions.navigate(-1) end
  im.tooltip(translateLanguage("ui.trackBuilder.selection.previous", "Select Previous Piece"))
  im.SetCursorPosX(piecePositions[4]-10)
  if im.Button(">",style.thinButtonSize) then tbFunctions.navigate(1) end
  im.tooltip(translateLanguage("ui.trackBuilder.selection.next", "Select Next Piece"))
  im.SetCursorPosX(piecePositions[5]-10)
  if im.Button(">|",style.thinButtonSize) then tbFunctions.navigate('last') end
  im.tooltip(translateLanguage("ui.trackBuilder.selection.last", "Select Last Piece"))
    im.SetCursorPosX(pos[i])
    if im.Button((displayNames and displayNames[i] or v)..'##'..name, size) then
      old = relative and modifierValues[name].value[0] or 0

  if im.Button("<##bank",style.slimButtonSize) then tbFunctions.modifierShift('bank',-1) end
  im.tooltip('Shift Modifier Back')
  im.SameLine()
  if im.Button(">##bank",style.slimButtonSize) then tbFunctions.modifierShift('bank',1) end
  im.tooltip('Shift Modifier Forward')

  if im.Button("<##height",style.slimButtonSize) then tbFunctions.modifierShift('height',-1) end
  im.tooltip('Shift Modifier Back')
  im.SameLine()
  if im.Button(">##height",style.slimButtonSize) then tbFunctions.modifierShift('height',1) end
  im.tooltip('Shift Modifier Forward')
  im.SetCursorPosX(62)
  if im.Button("<##width",style.slimButtonSize) then tbFunctions.modifierShift('width',-1) end
  im.tooltip('Shift Modifier Back')
  im.SameLine()
  if im.Button(">##width",style.slimButtonSize) then tbFunctions.modifierShift('width',1) end
  im.tooltip('Shift Modifier Forward')
  local size = im.ImVec2(im.GetWindowWidth()-2,24)
  if im.Button(translateLanguage("ui.trackBuilder.trackSettings.alignTrackToCam", "Align Track to Camera"),size) then
    tb.rotateTrackToCamera()
  end
  if im.Button(translateLanguage("ui.trackBuilder.trackSettings.positionTrackBeforeCam", "Position Track before Camera"),size) then
    tb.positionTrackBeforeCamera()
  im.Separator()
  if im.Button(translateLanguage("ui.trackBuilder.trackSettings.alignTrackToVehicle", "Align Track to Vehicle"),size) then
    tb.rotateTrackToTrackVehicle()
  end
  if im.Button(translateLanguage("ui.trackBuilder.trackSettings.positionTrackAboveVehicle", "Position Track above Vehicle"),size) then
    tb.positionTrackAboveVehicle()
  -- actual save button
  if im.Button(text, im.ImVec2(128,20)) then
    local exp, filename = tb.save(
    im.SameLine()
    if im.Button(previewText, im.ImVec2(128,20)) then
      hiddenForScreenshotTimer = 1
  if allowPacking then
    if im.Button(translateLanguage("ui.trackBuilder.saveLoad.packToMod", "Pack to Mod"), im.ImVec2(264,20)) then
      local modName = "mods/TrackBuilder_" .. ffi.string(saveSettings.saveStr)..".zip"
  im.TextColored(style.textColor, translateLanguage("ui.trackBuilder.saveLoad.loadTrack", "Load Track"))
  if im.Button('X ') then im.ImGuiTextFilter_Clear(loadFilesFilter) end
  im.SameLine()
    if im.ImGuiTextFilter_PassFilter(loadFilesFilter, file) then
      if im.Button(file) then
        tb.load(file,false,false,false)

        if im.Button(translateLanguage("ui.trackBuilder.obstacles.remove", "Remove") .. "##o"..i) then
          o.active = false
        im.SameLine()
        if im.Button(translateLanguage("ui.trackBuilder.obstacles.copy", "Copy") .. "##o"..i) then
          copy = o
  end
  if im.Button("<##cp") then tbFunctions.modifierShift("checkpoint",-1) end
  im.SameLine()
  im.SameLine()
  if im.Button(">##cp") then tbFunctions.modifierShift("checkpoint",1) end
end
    end
    if im.Button("<##cp"..i) then
      currentIndex = cp.segmentIndex
    im.SameLine()
    if im.Button("Select##cp"..i) then
      currentIndex = cp.segmentIndex
    im.SameLine()
    if im.Button(">##cp"..i) then
      currentIndex = cp.segmentIndex
    im.SameLine()
    if im.Button("Remove##cp"..i) then
      currentIndex = cp.segmentIndex

  if im.Button("Create") then
    local mergeList = {}

  if im.Button("Delete SubTrack") then
    tb.removeSubTrack(subTrackIndex[0])
      mergeMode = "merge"
      if im.Button("Start Merging") then
        currentMergeList = {}
      end
      if im.Button("Delete Intersection") then
        mergeMode = "delete"
      if mergeMode == "merge" then
        if im.Button("Merge Selected Pieces") then
          if #currentMergeList > 1 then
        end
        if im.Button("Stop Merging") then
          currentMergeList = {}
      elseif mergeMode == "delete" then
        if im.Button("Stop Deleting") then
          selectMode("Select")
  end
  --if im.Button("Load!") then tb.load("mulzi",false,false,false) end
end
  im.Begin("StopDrivingWindow", stopDrivingWindowOpen, im.flags(im.WindowFlags_NoResize, im.WindowFlags_NoScrollbar))
    if im.Button("Stop Driving", im.ImVec2(200,60)) then
      driving = false
    --im.SetCursorPosX(style.toolbarWidth/2 - 100)
    if im.Button("Stop Driving", im.ImVec2(-1,-1)) then
      driving = false

  if im.Button("<##"..name,style.slimButtonSize) then tbFunctions.modifierShift(name,-1) end
    im.tooltip(translateLanguage("ui.trackBuilder.tooltip.shiftBack", "Shift Modifier Back"))
    im.SameLine()
    if im.Button(">##"..name,style.slimButtonSize) then tbFunctions.modifierShift(name,1) end
    im.tooltip(translateLanguage("ui.trackBuilder.tooltip.shiftForward", "Shift Modifier Forward"))
      im.SetCursorPosX(im.GetWindowWidth()/2 - 100)
      if im.Button(translateLanguage("ui.trackbuilder.menus.openAdvancedPieces","Open Advanced Pieces"),im.ImVec2(200,50)) then
        menuItems.advancedPieces.isOpen[0] = true
  im.SetCursorPosX(selectorPositions[1])
  if im.Button(translateLanguage("ui.trackBuilder.base.drive","Drive"),im.ImVec2(100,24)) then
    tbFunctions.drive()
  im.SetCursorPosX(selectorPositions[2])
  if im.Button(translateLanguage("ui.trackBuilder.base.test","Test"),im.ImVec2(100,24)) then
    tbFunctions.drive(currentIndex-1)
    if not trackSpawned then
      if im.Button(translateLanguage("ui.trackbuilder.menus.startTrackBuilder", "Start Track Builder Here"), im.ImVec2(-1,0)) then
        trackSpawned = true
      end
      if im.Button(translateLanguage("ui.trackbuilder.menus.startTrackBuilderOnGlowCity", "Switch to Glow City"), im.ImVec2(-1,0)) then
        freeroam_freeroam.startTrackBuilder('glow_city',true)
@/lua/ge/extensions/flowgraph/nodes/gameplay/sites/location.lua
function C:drawCustomProperties()
  if im.Button("Open Sites Editor") then
    if editor_sitesEditor then
      im.Text(loc.name)
      if im.Button("Copy over Fields") then
      end
  end
  if im.Button("add") then
    table.insert(self.options, "btn_"..(#self.options+1))
  im.SameLine()
  if im.Button("rem") then
    self.options[#self.options] = nil
@/lua/ge/extensions/editor/particleEditor.lua
      im.Text("The DataBlock has been removed from its file and upon restart will cease to exist" )
      if im.Button("OK") then
        confirmationWindowOpen = false
      im.Text("Do you want to save changes to " ..  currentEmitter:getName() .. "?")
      if im.Button("Yes") then
        saveEmitter(currentEmitter)
      im.SameLine()
      if im.Button("No") then
        editor.pasteFields(oldEmitterFields, currentEmitter:getID())
      im.SameLine()
      if im.Button("Cancel") then
        requestedEmitter = nil
      im.Text("Do you want to save changes to " ..  currentParticle:getName() .. "?")
      if im.Button("Yes") then
        editor.saveDataBlockToFile(currentParticle)
      im.SameLine()
      if im.Button("No") then
        editor.pasteFields(oldParticleFields, currentParticle:getID())
      im.SameLine()
      if im.Button("Cancel") then
        requestedParticle = nil
local function customTextureFieldEditor(objectIds, fieldValue, fieldName, fieldLabel, fieldDesc, fieldType, fieldTypeName, customData, pasteCallback, contextMenuUI)
  if im.Button("...") then
    editor_fileDialog.openFile(function(data)
@/lua/ge/extensions/editor/raceEditor/startPositions.lua
      im.SameLine()
      if im.Button("Delete") then
        editor.history:commitAction("Delete Start Position",
      im.SameLine()
      if im.Button("Move Up") then
        editor.history:commitAction("Move Start Position in List",
      im.SameLine()
      if im.Button("Move Down") then
        editor.history:commitAction("Move Start Position in List",
      end
      if scenetree.findClassObjects("TerrainBlock") and im.Button("Down to Terrain") then
        local old = sp:onSerialize()
      end
      if scenetree.findClassObjects("TerrainBlock") and im.Button("Align with Terrain") then
        local old = sp:onSerialize()
      end
      if im.Button("Move Veh To") then
        sp:moveResetVehicleTo(be:getPlayerVehicleID(0))
      end
      if im.Button("Set to Current Vehicle") then
        sp:setToVehicle(be:getPlayerVehicleID(0))
@/lua/ge/extensions/editor/vehicleEditor/liveEditor/veVehicleSpawner.lua
      local vehData = vehsList[i]
      if im.Button(vehData.model.Name) then
        --local spawnPos = startPos + startDir * vec3(10 * (i - 1), 0, 0)

    if im.Button("Spawn Vehicle") then
      vehSelectorWndOpen[0] = true

    if im.Button(pickingLocation and "Picking Start Location... " or "Pick Start Location") then
      pickingLocation = not pickingLocation
    if startPos then
      if im.Button("Spawn Vehicles") then
        spawnVehicles()
    end
    if im.Button("Despawn All") then
      despawnVehicles()
@/lua/ge/extensions/editor/slotTrafficEditor.lua
    if editor.beginWindow(toolWindowName, "Slot Traffic") then
      if im.Button("Import all decal roads") then
        importDecalroads()
                  im.PushID1(roadId)
                  if im.Button("Focus##" .. roadId) then
                    focusOnRoad(roadId)
                  im.PushStyleColor2(im.Col_ButtonHovered, im.ImVec4(0.9, 0.3, 0.3, 0.7))
                  if im.Button("Delete##" .. roadId) then
                    deleteRoad(roadId)
    -- direction
    if im.Button("Change Direction") then
      editor.history:commitAction("ChangestLinkDirection", {link = selectedLink}, changeLinkDirectionActionUndo, changeLinkDirectionActionRedo)
@/lua/ge/extensions/flowgraph/nodes/vehicle/ai/scriptAI/followPath.lua
  end
  if im.Button("Reset AI") then
    self:endAI()
@/lua/ge/extensions/editor/missionEditor/playbookUtils.lua

  if im.Button("Add Empty") then
    local instruction = {type = "missionAttempt", missionId = self.mission.id, stars = {}}
  end
  if im.Button("Add All Stars") then
    local instruction = {type = "missionAttempt", missionId = self.mission.id, stars = {}}

  if im.Button("Add All Default Stars") then
    local instruction = {type = "missionAttempt", missionId = self.mission.id, stars = {}}

  if im.Button("Add All Bonus Stars") then
    local instruction = {type = "missionAttempt", missionId = self.mission.id, stars = {}}

  if im.Button("Add Random Single Star") then
    local instruction = {type = "missionAttempt", missionId = self.mission.id, stars = {}}

  if im.Button("Add Randomized All Stars") then
    local instruction = {type = "missionAttempt", missionId = self.mission.id, stars = {}}

  if im.Button("Add All Stars Individually") then
    local stars = {}

  if im.Button("Add All Default Stars Individually, Sequential") then
    local stars = {}

  if im.Button("Add All Bonus Stars Randomly Individually") then
    local keys = deepcopy(self.missionInstance.careerSetup._activeStarCache.bonusStarKeysSorted)
@/lua/ge/extensions/editor/meshEditor.lua
    if selectedNode then
      if im.Button("Split " .. M.niceName, im.ImVec2(0,0)) then
        splitMesh(selectedMesh, selectedNode)
@/lua/ge/extensions/flowgraph/nodes/ui/imgui/imVehicleSelect.lua

  if im.Button("Select") then
    self.done = true
  end
  if im.Button("Reset") then
    self.util:resetSelections()
@/lua/ge/extensions/editor/missionEditor/previewChecker.lua

  if im.Button("...") then
    Engine.Platform.exploreFolder(self.mission.missionFolder)

  im.Button("Preview")
  if im.IsItemHovered() then
  im.SameLine()
  im.Button("Thumbnail")
  if im.IsItemHovered() then
@/lua/ge/extensions/editor/assetManagementTool.lua

  if imgui.Button("Select All##selectAllRecords") then
    selectedHashes = {}

  if imgui.Button("Deselect All##deselectAllRecords") then
    selectedHashes = {}

  if imgui.Button("Remove Selected") then
    editor.openModalWindow(removeSelectedDlg)

  if imgui.Button("Set Target Folder Path:") then
    setTargetPathForSelection(selectionTargetPath)

  if imgui.Button("...##chooseTargetPathForSelection") then
    editor_fileDialog.openFile(function(data)

          if imgui.Button("...##chooseTargetPath" .. row) then
            changeTargetPathForHash = hash

  if imgui.Button("Add Files...") then
    addFiles()
  imgui.SameLine()
  if imgui.Button("Save List") then
    saveDuplicatesList()
  imgui.SameLine()
  if imgui.Button("Load List") then
    loadDuplicatesList()
  imgui.SameLine()
  if imgui.Button("Clear List") then
    editor.openModalWindow(clearDuplicateListDlg)

  if imgui.Button("Search All Game Duplicates...") then
    editor.openModalWindow(searchAllDuplicatesDlg)

  if imgui.Button("Search duplicates of the assets from the list, in folder:") then
    editor.openModalWindow(searchDuplicatesDlg)
  imgui.SameLine()
  if imgui.Button("...##chooseScanPathForSelection") then
    editor_fileDialog.openFile(function(data)
  imgui.PushStyleColor2(imgui.Col_Button, imgui.ImVec4(0.5, 0, 0, 1))
  if imgui.Button("S T A R T   M I G R A T I O N") then
    if not skipUnnamedTargetPathsPtr[0] and not allTargetPathsAreValid() then
local function linkCheckerUi()
  if imgui.Button("Check For Invalid Links...") then
    editor.openModalWindow(checkForInvalidLinksDlg)

    if imgui.Button("Delete All Invalid Link Files") then
      editor.openModalWindow(deleteInvalidLinksDlg)

    if imgui.Button("Try Fixing Invalid Links...") then
      editor.openModalWindow(tryFixingInvalidLinksDlg)
  imgui.SameLine()
  if imgui.Button("...##chooseScanPathForNaming") then
    editor_fileDialog.openFile(function(data)

  if imgui.Button("Check For Invalid Asset Filenames...") then
    editor.openModalWindow(checkForInvalidFilenamesDlg)
        imgui.SameLine()
        if imgui.Button("Copy##btnCopyFilename" .. idx) then
          local folder, fileNameOnly, ext = path.split(record.suggestedFilename)
  imgui.SameLine()
  if imgui.Button("Browse...##delinkPathBtn") then
    editor_fileDialog.openFile(function(data)

  if imgui.Button("DELINK PATH") then
    editor.openModalWindow(delinkerDlg)
        imgui.SameLine()
        if imgui.Button("Copy Path##btnCopyDelinkedFilename" .. idx) then
          imgui.SetClipboardText(record.filename)
  imgui.SameLine()
  if imgui.Button("Browse...##relinkPathBtn") then
    editor_fileDialog.openFile(function(data)

  if imgui.Button("RELINK PATH") then
    editor.openModalWindow(relinkerDlg)
        imgui.SameLine()
        if imgui.Button("Copy Path##btnCopyRelinkedFilename" .. idx) then
          imgui.SetClipboardText(record.filename)

    if imgui.Button("Yes") then
      for hash, _ in pairs(selectedHashes) do

    if imgui.Button("Cancel") then
      editor.closeModalWindow(removeSelectedDlg)

    if imgui.Button("Yes") then
      clearEverything()

    if imgui.Button("Cancel") then
      editor.closeModalWindow(clearDuplicateListDlg)

    if imgui.Button("Yes") then
      deleteAllInvalidLinkFiles()

    if imgui.Button("Cancel") then
      editor.closeModalWindow(deleteInvalidLinksDlg)
    if not stopped then
      if imgui.Button("Abort") then
        stopped = true
    else
      if imgui.Button("Close") then
        editor.closeModalWindow(migrationDlg)
    if not stopped then
      if imgui.Button("Abort") then
        stopped = true
    else
      if imgui.Button("Close") then
        editor.closeModalWindow(searchDuplicatesDlg)
    if not stopped then
      if imgui.Button("Abort") then
        stopped = true
    else
      if imgui.Button("Close") then
        editor.closeModalWindow(searchAllDuplicatesDlg)
    if not stopped then
      if imgui.Button("Abort") then
        stopped = true
    else
      if imgui.Button("Close") then
        editor.closeModalWindow(checkForInvalidLinksDlg)
    if not stopped then
      if imgui.Button("Abort") then
        stopped = true
    else
      if imgui.Button("Close") then
        editor.closeModalWindow(tryFixingInvalidLinksDlg)
    if not stopped then
      if imgui.Button("Abort") then
        stopped = true
    else
      if imgui.Button("Close") then
        editor.closeModalWindow(checkForInvalidFilenamesDlg)

    if imgui.Button("OK") then
      editor.closeModalWindow(checkDlg)

    if imgui.Button("OK") then
      editor.closeModalWindow(savedListDlg)
    if not stopped then
      if imgui.Button("Abort") then
        stopped = true
    else
      if imgui.Button("Close") then
        editor.closeModalWindow(delinkerDlg)
    if not stopped then
      if imgui.Button("Abort") then
        stopped = true
    else
      if imgui.Button("Close") then
        editor.closeModalWindow(relinkerDlg)
@/lua/ge/extensions/editor/assetBrowser.lua
    im.PopItemWidth()
    if im.Button("Cancel") then
      ffi.copy(var.newFolderName, "")
    im.SameLine()
    if im.Button("Create") then
      createFolder()
      local buttonWidth = im.CalcTextSize(file.fullFileName).x + 2 * var.style.FramePadding.x
      if im.Button("##" .. tostring(file.id), im.ImVec2(buttonWidth,var.fontSize)) then
        selectAsset(file)
  local cPosStart = im.GetCursorPos()
  if im.Button("##" .. group.identifier .. "_CollapsingHeader", im.ImVec2(im.GetContentRegionAvailWidth(), 0)) then
    group.open = not group.open
          im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(4,0))
          if im.Button(dir.name, im.ImVec2(im.GetContentRegionAvailWidth(),0)) then
            selectDirectory(dir, nil, nil, true)
  for k, dir in ipairs(var.selectedDirectory.pathToRoot) do
    if im.Button(dir.name .. "##breadcrump" .. tostring(dir.id)) then
      selectDirectory(dir, nil, nil, true)
  -- Add button for the current selected directory.
  im.Button(var.selectedDirectory.name .. "##breadcrumb" .. tostring(var.selectedDirectory.id))
    im.SameLine()
    im.Button(editor.selection["asset"].fullFileName)
  elseif var.selectedDirectory.dirCount > 0 then
    im.PopItemWidth()
    if im.Button("Save", im.ImVec2(var.saveFilterNameInputWidth, var.inputFieldSize)) then
      if #ffi.string(var.saveFilterNameInput) > 0 then
        )
        if im.Button(dirText, im.ImVec2(0, var.inputFieldSize)) then
          var.options.filter_displayDirs = not var.options.filter_displayDirs
        )
        if im.Button(assetText, im.ImVec2(0 ,var.inputFieldSize)) then
          var.options.filter_displayAssets = not var.options.filter_displayAssets
        )
        if im.Button(setText, im.ImVec2(0 ,var.inputFieldSize)) then
          var.options.filter_displayTextureSets = not var.options.filter_displayTextureSets
        )
        if im.Button("ALL##filterButton") then
          if var.options.assetViewFilterType ~= var.assetViewFilterType_enum.all_files then
          im.PushID1("SelectedDir_FilterButton")
          if im.Button(folderSelectionTruncated and "SEL" or var.selectedDirectory.name) then
            if var.options.assetViewFilterType ~= var.assetViewFilterType_enum.current_folder_files then
      im.NextColumn()
      im.Button("Delete")
      im.NextColumn()
        im.NextColumn()
        if im.Button("Delete##directoryToLoad" .. tostring(k)) then
          local newDirectoriesToLoad = deepcopy(directoriesToLoadRef)
      im.NextColumn()
      if im.Button("Add##directoryToLoad") then
        local newDirectoriesToLoad = deepcopy(directoriesToLoadRef)
@/lua/ge/extensions/flowgraph/nodes/util/ghost.lua
  im.Text("Former node type: " .. self.formerNodeType)
  if im.Button("Dump ghost data") then
    dump(self.ghostData)
@/lua/ge/extensions/flowgraph/nodes/ui/message.lua
function C:drawCustomProperties()
  if im.Button("Open Icons overview") then
    if editor_iconOverview then
@/lua/ge/extensions/ui/bindingsLegend.lua
    im.SameLine()
    if im.Button("Force Fade") then
      dispatchFadeIfChanged(true)
    im.Separator()
    if im.Button("Show Vehicle Specific") then
      M.enableShowVehicleSpecificActions(true)
    im.SameLine()
    if im.Button("Hide Vehicle Specific") then
      M.enableShowVehicleSpecificActions(false)
    im.SameLine()
    if im.Button("Trigger Vehicle Switch") then
      local currentVehicleId = be:getPlayerVehicleID(0)
@/lua/ge/extensions/editor/raceEditor/testing.lua

  if im.Button("Start") then
    editor.setEditorActive(false)
  end
  if im.Button("Start Rolling") then
    editor.setEditorActive(false)

  if im.Button("Move All Vehicles to Starting Positions") then
    for i, veh in ipairs(getAllVehiclesByType()) do

  if im.Button("AI Drive Test Current Vehicle") then
    self:startRace(nil, true, false)

  if im.Button("AI Drive Test All Vehicles") then
    local vehIds = {}
function C:drawRace(dt)
  if im.Button("Stop") then
    for _, id in ipairs(self.race.vehIds) do
  im.SameLine()
  if im.Button("State") then
    dump(self.race.states[self.race.vehIds[1]])
  im.SameLine()
  if im.Button("Recover") then
    self.race:requestRecover(self.race.vehIds[1])
function C:drawStopped()
  if im.Button("Restart") then
    self:setupRace()
@/lua/ge/extensions/editor/vehicleEditor/veToolbar.lua
      end
      if im.Button("Save") then
        editor.hideWindow(saveLayoutWindowName)
    im.Text("This will delete all window layouts files and set the Default factory layout.")
    if im.Button("Continue") then
      editor.hideWindow(resetLayoutsWindowName)
    im.SameLine()
    if im.Button("Cancel") then
      editor.hideWindow(resetLayoutsWindowName)
    im.PushStyleColor2(im.Col_Text, vEditor.mode == vEditor.MODE_PICKING_NODE and selectedColor or regularColor)
    if im.Button("Pick Node") then
      vEditor.changeMode(vEditor.MODE_PICKING_NODE)
    im.PushStyleColor2(im.Col_Text, vEditor.mode == vEditor.MODE_PICKING_BEAM and selectedColor or regularColor)
    if im.Button("Pick Beam") then
      vEditor.changeMode(vEditor.MODE_PICKING_BEAM)
@/lua/ge/extensions/editor/vehicleEditor/liveEditor/veCrashTester.lua
    im.PopItemWidth()
    if im.Button(pickingLocation and "Picking Start Location... " or "Pick Start Location") then
      pickingLocation = not pickingLocation
      if not testRunning then
        if im.Button("Run Test!") then
          runTest()
      else
        if im.Button("Stop Test!") then
          stopTest()
@/lua/ge/extensions/editor/bulkRename.lua
    imgui.PushStyleColor2(imgui.Col_Button, imgui.ImColorByRGB(10, 150, 0, 255))
    if imgui.Button("   R E N A M E   ") then
      doBulkRename()
@/lua/ge/extensions/core/vehicleMirrors.lua
  if im.Begin("Mirror control", windowOpen) then
    if im.Button("<") then
      m.userCorrection.x = m.userCorrection.x + 0.05
    im.SameLine()
    if im.Button(">") then
      m.userCorrection.x = m.userCorrection.x - 0.05
    im.SameLine()
    if im.Button("/\\") then
      m.userCorrection.z = m.userCorrection.z + 0.05
    im.SameLine()
    if im.Button("V") then
      m.userCorrection.z = m.userCorrection.z - 0.05
    im.SameLine()
    if im.Button("reset") then
      m.userCorrection = vec3()
    im.SameLine()
    if im.Button("unload") then
      extensions.unload('core_vehicleMirrors')
@/lua/ge/extensions/flowgraph/nodes/gameplay/sites/locationsByTag.lua
function C:drawCustomProperties()
  if im.Button("Open Sites Editor") then
    if editor_sitesEditor then
@/lua/ge/extensions/editor/forestView.lua
  --TODO: make sure to make a better nil check for internalName
  if imgui.Button("##_button_FID_" .. tostring(item.name), imgui.ImVec2(imgui.GetContentRegionAvailWidth(), fontSize)) then
    -- add to selection if ctrl is held
@/lua/ge/extensions/flowgraph/nodes/vehicle/replay.lua
  local reason = nil
  if im.Button("Load Replays") then
    self.replays = core_replay.getRecordings()
@/lua/ge/extensions/gameplay/rally/tools/rallyToolbox.lua
  -- im.SameLine()
  -- if im.Button("Driveline Route Recalc##debugDrivelineRouteRecalc") then
  --   local rm = self:getRallyManager()

  if im.Button("RM Soft Reload##debugRmVhclSoftReload") then
    self:clearReccePoints()
  im.SameLine()
  if im.Button("RM Full Reload##debugRmVhclReload") then
    self:clearReccePoints()

  if im.Button("Clear Visual Pacenotes##debugClearVisualPacenotes") then
    if rm then

  if im.Button("Trigger Next Visual Note##triggerNextVisualNote") then
    if rm then

  if im.Button("Remove Visual Note##removeNextVisualNote") then
    if rm then

    if im.Button("Build kd-tree for Race AI Path##debugBuildKdTreeRaceAiPath") then
      self:buildKdTreeRaceAiPath()

    if im.Button("<##debugSelectPrevPacenote") then
      if not self.selectedPacenote then

    if im.Button(">##debugSelectNextPacenote") then
      if not self.selectedPacenote then

    if im.Button("Build kd-tree for Driveline Route##debugBuildKdTreeDrivelineRouteStatic") then
      self:buildKdTreeDrivelineRouteStatic()
@/lua/ge/extensions/gameplay/drift/general.lua
      im.PushStyleColor2(im.Col_Text, imVec4Red)
      if im.Button("Exit debug") then setDebug(false) end
      im.PopStyleColor()
      im.SameLine()
      if im.Button("Reset drift") then reset() end
@/lua/ge/extensions/editor/util/zoneSelectorUtil.lua
    -- Select All button
    if im.Button("Select All##initialSelectAll"..e._id) then
      for _, zoneName in ipairs(e.loadedZones) do
    -- Remove All button
    if im.Button("Remove All##initialRemoveAll"..e._id) then
      e.initialZones = {}
    -- Select All button
    if im.Button("Select All##destinationSelectAll"..e._id) then
      for _, zoneName in ipairs(e.loadedZones) do
    -- Remove All button
    if im.Button("Remove All##destinationRemoveAll"..e._id) then
      e.destinationZones = {}
@/lua/ge/extensions/editor/sceneTree.lua
    editor.showNotification(msg)
    editor.setStatusBar(msg, function() if imgui.Button("Close##duplicate") then editor.hideStatusBar() end end)
    return
    editor.showNotification(msg)
    editor.setStatusBar(msg, function() if imgui.Button("Close##duplicate") then editor.hideStatusBar() end end)
    return
@/lua/ge/extensions/editor/shapeEditor.lua

        if im.Button("Export to Collada") then
          editor_fileDialog.saveFile(

        if shapePrev.exportToWavefront and im.Button("Export to Wavefront obj") then
          editor_fileDialog.saveFile(
        end
        if shapePrev.dumpTSShapeInfo and beamng_buildtype=="INTERNAL" and im.Button("dumpShapeInfo") then
          shapePrev:dumpTSShapeInfo()
        end
        if shapePrev.getTSShapeInfo and beamng_buildtype=="INTERNAL" and im.Button("getTSShapeInfo") then
          log("I","getTSShapeInfo", dumps(shapePrev:getTSShapeInfo()))
          im.TextColored(im.ImVec4(1,0.1,0.1,1), "Broken/Invalid mesh !")
          if shapePrev.dumpTSShapeInfo and im.Button("dumpShapeInfo") then
            shapePrev:dumpTSShapeInfo()
        editor.uiInputFloat("Error target",lodErrorTarget,0.1,1, "%.2f", nil)
        if im.Button("add LOD") then
          shapePrev:createMeshLOD(detailLevel[0], lodAmount[0], lodDetDest[0],lodSloppy[0], lodErrorTarget[0]*0.01)
        end
        -- if im.Button("refresh") then
        --   shapePrev:refreshShape()
        -- end
        -- if im.Button("dump info") then
        --   local info = shapePrev:getTSShapeInfo()
        -- end
        -- if im.Button("read MC") then
        --   _readMeshConstructor()
    im.SameLine()
    if im.Button("Open in Shape Editor") then
      M.showShapeEditorLoadFile(obj:getModelFile())
@/lua/common/extensions/ui/imgui_gen_luaintf.lua
  if string_label == nil then log("E", "", "Parameter 'string_label' of function 'Button' cannot be nil, as the c type is 'const char *'") ; return end
  return imgui.Button(string_label, ImVec2_size)
end
@/lua/ge/extensions/editor/renderTest.lua
  if editor.beginWindow(toolWindowName, toolWindowName) then
    if im.Button('left') then mode = 'left' end im.SameLine()
    if im.Button('right') then mode = 'right' end im.SameLine()
    if im.Button('left') then mode = 'left' end im.SameLine()
    if im.Button('right') then mode = 'right' end im.SameLine()
    if im.Button('front') then mode = 'front' end im.SameLine()
    if im.Button('right') then mode = 'right' end im.SameLine()
    if im.Button('front') then mode = 'front' end im.SameLine()
    if im.Button('back') then mode = 'back' end im.SameLine()
    if im.Button('front') then mode = 'front' end im.SameLine()
    if im.Button('back') then mode = 'back' end im.SameLine()
    if im.Button('top') then mode = 'top' end im.SameLine()
    if im.Button('back') then mode = 'back' end im.SameLine()
    if im.Button('top') then mode = 'top' end im.SameLine()
    if im.Button('bottom') then mode = 'bottom' end im.SameLine()
    if im.Button('top') then mode = 'top' end im.SameLine()
    if im.Button('bottom') then mode = 'bottom' end im.SameLine()
    if im.Button('3d') then mode = '3d' end im.SameLine()
    if im.Button('bottom') then mode = 'bottom' end im.SameLine()
    if im.Button('3d') then mode = '3d' end im.SameLine()
    if im.Checkbox('Ortho', ortho) then end im.SameLine()
@/lua/ge/extensions/ui/apps/genericMissionData.lua
    im.SameLine()
    if im.Button("Clear All") then
      clearData()
@/lua/ge/extensions/editor/camPathEditor.lua
  im.SameLine()
  if im.Button('Reset##fov') then
    core_camera.setFOV(0, 65)
        im.SameLine()
        if im.Button('Reset##trackingOffset') then
          trackingOffset[0] = 0.0
    -- Speed normalization
    -- if im.Button('Normalize Speed', im.ImVec2(buttonWidth, 0)) then
    --   im.OpenPopup('Speed Settings')
    -- Timing relaxation
    if im.Button('Relax Timings', im.ImVec2(buttonWidth, 0)) then
      relaxMarkerTimings(M.currentPath, 0.6)
    -- Advanced relaxation
    if im.Button('Smooth More', im.ImVec2(buttonWidth, 0)) then
      relaxMarkerTimings(M.currentPath, 0.9)
      im.Spacing()
      if im.Button('Apply', im.ImVec2(80 * im.uiscale[0], 0)) then
        if speed[0] > 0.1 then
      im.SameLine()
      if im.Button('Cancel', im.ImVec2(80 * im.uiscale[0], 0)) then
        im.CloseCurrentPopup()
  if  tableIsEmpty(M.currentPath.markers) then
    if im.Button('+ Add Marker', im.ImVec2(-1, 0)) then
      addMarker()
    -- Add button at top
    if im.Button('+ Add Marker', im.ImVec2(-1, 0)) then
      addMarker()

      if im.Button('Preview', im.ImVec2(buttonWidth, 0)) then
        local pos = marker.pos
      if M.currentPath.replay and M.currentPath.replay ~= '' then
        if im.Button('Preview + Sync', im.ImVec2(buttonWidth, 0)) then
          local pos = marker.pos

      if im.Button('Overwrite', im.ImVec2(buttonWidth, 0)) then
        editor.history:commitAction(
      end
      if im.Button('Set for all##ttn', im.ImVec2(-1, 0)) then
        setMarkersTTN(M.currentPath, imVal[0])
      im.SameLine()
      if im.Button('Set for all##fov', im.ImVec2(buttonWidth, 0)) then
        changeAllMarkers(M.currentPath, 'fov', imVal[0])
      im.SameLine()
      if im.Button('Set for all##pos', im.ImVec2(buttonWidth, 0)) then
        changeAllMarkers(M.currentPath, 'positionSmooth', imVal[0])
        im.SameLine()
        if im.Button('Set following', im.ImVec2(buttonWidth, 0)) then
          local markerValues = {}
      im.SameLine()
      if im.Button('Set for all##trackPos', im.ImVec2(buttonWidth, 0)) then
        changeAllMarkers(M.currentPath, 'trackPosition', trackPosition[0])
      im.SameLine()
      if im.Button('Set for all##startMove', im.ImVec2(buttonWidth, 0)) then
        changeAllMarkers(M.currentPath, 'movingStart', movingStart[0])
      im.SameLine()
      if im.Button('Set for all##endMove', im.ImVec2(buttonWidth, 0)) then
        changeAllMarkers(M.currentPath, 'movingEnd', movingEnd[0])

        if im.Button('Yes') then
          if isPathSelection then
        im.SameLine()
        if im.Button('No') then
          pendingPathSelection = nil

          if im.Button('-10', im.ImVec2(seekButtonWidth, 0)) then
            core_replay.seek((relativePos[0] - 10) / maxSecs)
          im.SameLine()
          if im.Button('-2', im.ImVec2(seekButtonWidth, 0)) then
            core_replay.seek((relativePos[0] - 2) / maxSecs)
          im.SameLine()
          if im.Button('-1', im.ImVec2(seekButtonWidth, 0)) then
            core_replay.seek((relativePos[0] - 1) / maxSecs)
          im.SameLine()
          if im.Button('+1', im.ImVec2(seekButtonWidth, 0)) then
            core_replay.seek((relativePos[0] + 1) / maxSecs)
          im.SameLine()
          if im.Button('+2', im.ImVec2(seekButtonWidth, 0)) then
            core_replay.seek((relativePos[0] + 2) / maxSecs)
          im.SameLine()
          if im.Button('+10', im.ImVec2(seekButtonWidth, 0)) then
            core_replay.seek((relativePos[0] + 10) / maxSecs)
      im.PushStyleColor2(im.Col_ButtonActive, im.ImVec4(0, 0.8, 0, 0.7))
      if im.Button('Play', im.ImVec2(playButtonWidth, 30 * im.uiscale[0])) then
        playCurrentPath()
      im.PushStyleColor2(im.Col_ButtonActive, im.ImVec4(0, 0.6, 0, 0.7))
      if im.Button('Play (Close Editor)', im.ImVec2(playButtonWidth, 30 * im.uiscale[0])) then
        editor.skipCameraOnExit = true
      im.PushStyleColor2(im.Col_ButtonActive, im.ImVec4(0.8, 0, 0, 0.7))
      if im.Button('Stop', im.ImVec2(stopButtonWidth, 30 * im.uiscale[0])) then
        core_paths.stopCurrentPath()
@/lua/common/extensions/ui/imguiUtils.lua
  if not icon then
    open_popup = imgui.Button(label, size)
  else
      if not item.icon then
        if imgui.Button(lbl, size) then
          if item.func then item.func() end
  if not curItem.icon then
    open_popup = imgui.Button(curItem.label .. "##" .. label, size)
  else
          if not item.icon then
            if imgui.Button(lbl, size) then
              selectedItem[0] = k
        if not item.icon then
          if imgui.Button(lbl, size) then
            selectedItem[0] = k
@/lua/ge/extensions/editor/api/core.lua
    imgui.Separator()
    if imgui.Button("Save All") then
      for k, _ in pairs(dirtyToolsSaveInfo) do
    imgui.SameLine()
    if imgui.Button("Save Selected") then
      for k, v in pairs(dirtyToolsSaveInfo) do
    imgui.SameLine()
    if imgui.Button("Don't Save Any") then
      dirtyToolsSaveInfo = nil
    imgui.SameLine()
    if imgui.Button("Cancel") then
      editor.closeModalWindow("saveDirtyTools")
@/lua/ge/extensions/editor/dynamicDecals/layerStack.lua
    if not layer.mask then im.BeginDisabled() end
    if im.Button("Copy Layer Mask") then
      layerMaskCopyData = deepcopy(layer.mask)
    if not layerMaskCopyData then im.BeginDisabled() end
    if im.Button(layer.mask and "Replace Layer Mask" or "Paste Layer Mask") then
      for _, maskLayer in ipairs(layerMaskCopyData.layers) do
    if not layerMaskCopyData then im.BeginDisabled() end
    if im.Button("Append Layer Mask") then
      local layerCopy = deepcopy(layer)
    if not layer.mask then im.BeginDisabled() end
    if im.Button("Export layer mask") then
      -- api.exportLayerMask(layer, string.format("%sexport/masks/", tool.directoryPath), "niceexport", "png")
    im.SameLine()
    if im.Button(string.format("dump##%s", layer.uid)) then
      dump(layer)
          im.SameLine()
          if im.Button(string.format("Dump##%s_%s_%s_%d", layer.uid, guiId, "layerMaskLayerDumbButton", k)) then
            dump(maskLayer)
    im.TextColored(editor.color.warning.Value , "Do you really want to clear the baked textures? This will also wipe the layer stack!")
    if im.Button("Cancel") then
      im.CloseCurrentPopup()
    im.SameLine()
    if im.Button("Ok") then
      selection.deselectLayer()

  if im.Button("Add Fill Layer") then
    fill.openAddLayerWindow()

  if im.Button("Add Texture Fill Layer") then
    textureFill.openAddLayerWindow()

  if im.Button("Add Group") then
    api.addGroup()

  if im.Button("Add Linked Set Layer") then
    api.addLinkedSet()
  im.Separator()
  if im.Button("Clear Layer Stack") then
    im.OpenPopup("ClearLayerStackPopup")
@/lua/ge/extensions/editor/sitesEditor/tags.lua
    im.NextColumn()
    if im.Button(">") then
      for _,elem in ipairs(self.hasTag) do
    end
    if im.Button("<") then
      for _,elem in ipairs(self.noTag) do
@/lua/ge/extensions/editor/ffiptrleaktest.lua
  if editor.beginWindow(toolWindowName, "ffi ptr leak test") then
    if im.Button("demoWindowOpen[0] = true") then
      demoWindowOpen[0] = true
@/lua/ge/extensions/flowgraph/nodes/gameplay/sites/fileSites.lua
function C:drawCustomProperties()
  if im.Button("Open Sites Editor") then
    if editor_sitesEditor then
      im.Text(cSites.dir .. cSites.name)
      if im.Button("Hardcode to File Pin") then
        self:_setHardcodedDummyInputPin(self.pinInLocal.file, cSites.dir..cSites.name)
@/lua/ge/extensions/editor/rallyEditor/pacenotes.lua

  if im.Button("Refresh") then
    self:refreshPacenotesTab()
  im.SameLine()
  if im.Button("Select Closest to Vehicle") then
    local playerVehicle = getPlayerVehicle(0)
  im.SameLine()
  if im.Button("Delete All") then
    im.OpenPopup("Delete All")
    im.Separator()
    if im.Button("Ok", im.ImVec2(120,0)) then
      self:deleteAllPacenotes()
    im.SameLine()
    if im.Button("Cancel", im.ImVec2(120,0)) then
      im.CloseCurrentPopup()

  if im.Button("Mark All TODO") then
    self.path:markAllTodo()
  im.SameLine()
  if im.Button("Mark Rest TODO") then
    self.path:markRestTodo(self:selectedPacenote())
  im.SameLine()
  if im.Button("Mark All Done") then
    self.path:clearAllTodo()
  -- im.SameLine()
  -- if im.Button("X") then
  --   self.pacenoteToolsState.search = nil

  -- if im.Button("Prev") then
  --     self:selectPrevPacenote()
  -- im.SameLine()
  -- if im.Button("Next") then
  --     self:selectNextPacenote()
@/lua/ge/extensions/flowgraph/nodes/ui/updatedUI/endScreenBegin.lua
  end
  if im.Button("add") then
    table.insert(self.options, "btn_"..(#self.options+1))
  im.SameLine()
  if im.Button("rem") then
    self.options[#self.options] = nil
@/lua/ge/extensions/editor/undoHistory.lua
  if editor.beginWindow(toolWindowName, "Undo History") then
    if imgui.Button("Delete All History") then editor.clearUndoHistory() end
    if imgui.IsItemHovered() then
    imgui.SameLine()
    if imgui.Button("Undo Selected") then editor.undo(tableSize(editor.history.undoStack) - selectedIndex + 1) end
    imgui.BeginChild1("undos", imgui.ImVec2(0, imgui.GetContentRegionAvail().y))
    imgui.SameLine()
    if imgui.Button("Redo Selected") then editor.redo(tableSize(editor.history.redoStack) - selectedIndex2 + 1) end
    imgui.BeginChild1("redos", imgui.ImVec2(0, imgui.GetContentRegionAvail().y))
@/lua/ge/extensions/editor/raceEditor/segments.lua
      im.SameLine()
      if im.Button("Delete") then
        editor.history:commitAction("Delete Segment",
      im.SameLine()
      if im.Button("Move Up") then
        editor.history:commitAction("Move Segment in List",
      im.SameLine()
      if im.Button("Move Down") then
        editor.history:commitAction("Move Segment in List",

          if im.Button("Add Before") then
            local old = segment:onSerialize()
          im.SameLine()
          if im.Button("Add After") then
            local old = segment:onSerialize()
          im.SameLine()
          if im.Button("Remove") then
            local old = segment:onSerialize()
@/lua/ge/extensions/ui/apps/minimap/minimap.lua
    if im.Begin("SDF Minimap debugSettings") then
      if im.Button("Close") then
        debugSettingsOpen = false
      im.SameLine()
      if im.Button("Reset Stats") then
        resetStats()
      im.SameLine()
      if im.Button("Load Topo Map") then
        ui_apps_sdfTopomap.loadTopoMap()
        then p:finish(true) end
      if im.Button("Log Profiler") then
        if p then p:finish(true) end
@/lua/ge/extensions/editor/flowgraphEditor.lua

    if im.Button('Ok') then
      dirtyChildren = nil
local function resetFrecencyDataUi()
  if im.Button("Reset Node Library Usage Data", im.ImVec2(im.GetContentRegionAvailWidth(), 0)) then
    editor.setPreference("flowgraph.general.nodeFrecency", {})
@/lua/ge/extensions/gameplay/util/crashDetection.lua
      im.SameLine()
      if im.Button("Exit Debug") then
        M.setDebug(false)
@/lua/ge/extensions/editor/barriersEditor.lua
    if not editor.editMode or editor.editMode.displayName ~= editModeName then
      if im.Button("Enable Mouse Selection", im.ImVec2(im.GetContentRegionAvailWidth(),0)) then
        editor.selectEditMode(editor.editModes[editModeName])
    im.NextColumn()
    if im.Button(">") then
      for _,elem in ipairs(prefabList) do
    end
    if im.Button("<") then
      for _,elem in ipairs(prefabList) do
@/lua/ge/extensions/editor/flowgraph/projectSettings.lua
  im.Columns(1)
  if im.Button("Save") then
    self.fgEditor.save()
  im.SameLine()
  if im.Button("Save as...") then
    extensions.editor_fileDialog.saveFile(function(data)self.fgEditor.saveAsFile(data)end, {{"Node graph Files",".flow.json"}}, false, "/flowgraphEditor/")
@/lua/ge/extensions/editor/visualization.lua
  im.SameLine(prefWindowCurrWidth - 133 * im.uiscale[0])
  if im.Button("Reset To Defaults") then
    im.OpenPopup("Reset To Defaults")
               im.Separator()
    if im.Button("Yes", im.ImVec2(120,0)) then
      im.CloseCurrentPopup()
    im.SameLine()
    if im.Button("No", im.ImVec2(120,0)) then im.CloseCurrentPopup() end
    im.EndPopup()
@/lua/ge/extensions/editor/rallyEditor/recceTab.lua
  im.HeaderText("Recce Recording")
  if im.Button("Refresh") then
    self:refresh()
  if self.recce.cuts then
    if im.Button("Import") then
      self:import()

  if im.Button("Downsample") then
    self:downsample()
@/lua/ge/extensions/editor/mapSensorEditor.lua
    im.Separator()
    if im.Button('Export Python code...') then
      extensions.tech_pythonExport.getFullConfig(nil, sensors, pythonCodePtr)
      im.Separator()
      if im.Button("Copy to clipboard") then
        setClipboard(ffi.string(pythonCodePtr))
      im.SameLine()
      if im.Button("Close popup") then
        im.CloseCurrentPopup()
@/lua/ge/extensions/editor/crawlEditor/presets.lua
      im.NewLine()
              if im.Button("Save") then
          local name = ffi.string(self:getBoundaryPresetName())
      im.SameLine()
      if im.Button("Cancel") then
        self:setShowSaveBoundaryDialog(false)
      im.NewLine()
              if im.Button("Save") then
          local name = ffi.string(self:getPathnodePresetName())
      im.SameLine()
      if im.Button("Cancel") then
        self:setShowSavePathnodeDialog(false)
      im.NewLine()
              if im.Button("Save") then
          local name = ffi.string(self:getTrailPresetName())
      im.SameLine()
      if im.Button("Cancel") then
        self:setShowSaveTrailDialog(false)
          im.SameLine()
          if im.Button("Delete##trail" .. component.id) then
            self:deleteTrailComponent(component.id)
          im.SameLine()
          if im.Button("Delete##boundary" .. component.id) then
            self:deleteBoundaryComponent(component.id)
          im.SameLine()
          if im.Button("Delete##pathnode" .. component.id) then
            self:deletePathnodeComponent(component.id)
@/lua/ge/extensions/editor/dynamicDecals/vehicleColorPalette.lua

  if im.Button(string.format("Randomize all colors##vehicleColorPalette%s", guiId)) then
    local colors = deepcopy(editor.getPreference("dynamicDecalsTool.colorPresets.presets"))
    if #colorPaletteName == 0 then im.BeginDisabled() end
    if im.Button(string.format("Save##VehicleColorPalette_SaveButton_%s", guiId)) then
      local palettes = editor.getPreference("dynamicDecalsTool.vehicleColorPalette.palettes")
    end
    if im.Button(string.format("Cancel##VehicleColorPalette_Save_CancelButton_%s", guiId)) then
      im.CloseCurrentPopup()
  im.SameLine()
  if im.Button(string.format("Save##vehicleColorPalette", guiId)) then
    im.OpenPopup("SaveVehicleColorPalette_" .. guiId)
    for k, palette in ipairs(palettes) do
      if im.Button(string.format("Load##VehicleColorPalette_LoadButton_%d%s", k, guiId)) then
        vehicleObj.color = Point4F(palette.values[1][1], palette.values[1][2], palette.values[1][3], vehicleObj.color.w)
    im.Separator()
    if im.Button(string.format("Close##VehicleColorPalette_Load_CloseButton_%s", guiId)) then
      im.CloseCurrentPopup()
  im.SameLine()
  if im.Button(string.format("Load##vehicleColorPalette", guiId)) then
    im.OpenPopup("LoadVehicleColorPalette_" .. guiId)
        if editor.getPreference("dynamicDecalsTool.general.debug") then
          if im.Button(string.format("Dump##LoadVehicleColorPalette_dumpButton_%d%s", k, guiId)) then
            print(dumps(palette))
        end
        if im.Button(string.format("Load##VehicleColorPalette_LoadButton_%d%s", k, guiId)) then
          vehicleObj.color = Point4F(palette.values[1][1], palette.values[1][2], palette.values[1][3], vehicleObj.color.w)
@/lua/ge/extensions/editor/crawlEditor/trails.lua
function C:drawTrailsList(allTrails, selection)
  if im.Button("Add Trail") then
    local newTrail = self:getNewTrail()
  im.SameLine()
  if im.Button("Rename") then
    local newFileName = ffi.string(self.fileName)
  im.SameLine()
  if im.Button("Browse##Thumbnail") then
    extensions.editor_fileDialog.openFile(
  im.SameLine()
  if im.Button("Browse##Preview") then
    extensions.editor_fileDialog.openFile(
@/lua/ge/extensions/editor/vehicleEditor/liveEditor/veJBeamPicker.lua

  if im.Button(pickNodesBtnText) then
    if state ~= STATE_PICKING_NODES then -- toggle on

  if im.Button(pickBeamsBtnText) then
    if state ~= STATE_PICKING_BEAMS then

    if im.Button("X##" .. nodeID .. "_nodeDeleteButton") then -- Remove item
      table.remove(pickedNodes, pickedNodesKey)

    if im.Button("X##" .. beamID .. "_beamDeleteButton") then -- Remove item
      table.remove(pickedBeams, pickedBeamsKey)
@/lua/ge/extensions/editor/multiSpawnManager.lua
  im.SameLine()
  if im.Button("Add Tag##editGroup") then
    local tagName = ffi.string(imValues.tagName)
    im.Dummy(dummy)
    if im.Button("Test Generator...##editGroup") then
      editor.openModalWindow(generatorWindowName)
    if editor.beginModalWindow(generatorWindowName, "Generator Tester") then
      if im.Button("Generate Group##testGenerator") then
        core_multiSpawn.useFullData = true

      if im.Button("Copy Group") then
        if options.generatedGroup[1] then

      if im.Button("Close##testGenerator") then
        core_multiSpawn.useFullData = false
      end
      if im.Button(i.."##vehicleSlot", im.ImVec2(24 * im.uiscale[0], 20 * im.uiscale[0])) then
        selectVehIndex(i)

    if im.Button("Add##vehicleSlot") then
      table.insert(currGroup.data, {})
    im.SameLine()
    if im.Button("Remove##vehicleSlot") then
      table.remove(currGroup.data, options.vehIdx)
    im.Dummy(dummy)
    if im.Button("Done##customPaint", im.ImVec2(im.GetContentRegionAvailWidth(), 20)) then
      editor.closeModalWindow(customPaintWindowName)
    im.TextUnformatted("This will overwrite the current group.")
    if im.Button("Yes##overwriteGroup") then
      currGroup.type = "custom"
    im.SameLine()
    if im.Button("No##overwriteGroup") then
      editor.closeModalWindow(overwriteGroupWindowName)

  if im.Button("Spawn##multiSpawn") then
    spawnState = 1

  if im.Button("Delete##multiSpawn") then
    core_multiSpawn.deleteVehicles(imValues.amount[0])
      im.TextUnformatted("Create or select a vehicle group to continue.")
      if im.Button("New Group") then
        createGroup()
@/lua/ge/extensions/editor/engineAudioDebug.lua

      local exportData = im.Button("Copy to Clipboard", im.ImVec2(150, 25))
      im.SameLine()
      local reset = im.Button("Reset All to 0", im.ImVec2(150, 25))
      if reset then
@/lua/ge/extensions/editor/dynamicDecals/layerTypes/linkedSet.lua

  if im.Button(string.format("Add##LinkedSet_%s_%s", guiId, layer.uid), im.ImVec2(im.GetContentRegionAvailWidth(), 0)) then
    im.OpenPopup(string.format("%s_%s_AddPropertyPopup", layer.uid, guiId))
  im.Separator()
  if im.Button(string.format("Apply##%s_%s_LinkedSetProperties", layer.uid, guiId), im.ImVec2(im.GetContentRegionAvailWidth(), 0)) then
    setPropertiesInChildrenRec(layer, layer.properties)
@/lua/ge/extensions/editor/vehicleEditor/staticEditor/vePartTextView.lua
      im.SameLine()
      if im.Button('explore') then
        Engine.Platform.exploreFolder(jbeamFilename)
    im.Separator()
    if im.Button("Apply") then
      if nodeType == 'string' or nodeType == 'string_single' then
    im.SameLine()
    if im.Button("Cancel") then
      editor.closeModalWindow("editASTNode")
@/lua/ge/extensions/flowgraph/nodes/ui/contextTranslation.lua
    im.SameLine()
    if im.Button("Load Variables", im.ImVec2(im.GetContentRegionAvailWidth(), 0)) then
@/lua/ge/extensions/editor/missionStartPositionEditor.lua
  -- Add button to move nearby missions
  if im.Button("Move Nearby Missions (10m)") then
    moveNearbyMissions(selectedMission, 10)
@/lua/ge/extensions/gameplay/drift/quickMessages.lua
      im.SameLine()
      if im.Button("Clear") then debugHistory = {} end
      if im.BeginTable("Loaded extensions", 2, nil) then
@/lua/ge/extensions/editor/flowgraph/variables.lua
      im.SameLine()
      if im.Button("Create", im.ImVec2(im.GetContentRegionAvailWidth(), -1)) then
        acceptCreate = true
@/lua/ge/extensions/gameplay/drift/scoreboard.lua
    if im.Begin("Drift scoreboard") then
      if im.Button("Reset scoreboard") then
        M.reset()
@/lua/ge/extensions/editor/missionPlaybook/missionTreeViewer.lua

      if im.Button("Generate") then
        generateNodes()
@/lua/ge/extensions/editor/dynamicDecals/textures.lua
        if (cPos.x + scrollY - thumbnailSize) > imagePosY or imagePosY > (cPos.x + scrollY + spaceAvailable.y) then
          im.Button("##" .. filePath, im.ImVec2(thumbnailSize, thumbnailSize))
        else
            else
              im.Button("##" .. filePath, im.ImVec2(thumbnailSize, thumbnailSize))
            end
          else
            im.Button("##" .. filePath, im.ImVec2(thumbnailSize, thumbnailSize))
          end

      if im.Button("Apply##dynDecalTexturesInspector_bulkChange") then
        for _, f in ipairs(sel) do

        if im.Button("Apply##dynDecalTexturesInspector_" .. file) then
          textures.updateSidecarFile(file, selectedTexturesSidecarContent[file])
        im.SameLine()
        if im.Button("Cancel##dynDecalTexturesInspector_" .. file) then
          selectedTexturesSidecarContent[file] = textures.readSidecarFile(file)
  if im.BeginPopup("TextureContextMenuPopup") then
    if im.Button("Set as decal color texture") then
      api.setDecalTexturePath("color", contextMenuTexturePath)
    end
    if im.Button("Set as decal alpha texture") then
      api.setDecalTexturePath("alpha", contextMenuTexturePath)
@/lua/ge/extensions/editor/sitesEditor/sortedListDisplay.lua
  editor.uiInputText("##new", self.addFieldText)
  if im.Button("New String") then
    for _, id in ipairs(self.selections) do
  im.SameLine()
  if im.Button("New Number") then
    for _, id in ipairs(self.selections) do

  if im.Button("Copy Fields") then
    self.cfData = fields:onSerialize()
  end
  if im.Button("Paste Fields") then
    fields:onDeserialized(self.cfData)
  --im.SameLine()
  --if im.Button("Populate Others") then
    --local cfData = fields:onSerialize()
  im.SameLine()
  if im.Button("Add Tag") then
    self:addTag()
@/lua/ge/extensions/editor/dataBlockEditor.lua
        im.Text("The DataBlock has been removed from its file and upon restart will cease to exist" )
        if im.Button("OK") then
          confirmationWindowOpen = false
      end
      if im.Button("Create") then
        editor.hideWindow(createDataBlockWindowName)
@/lua/ge/extensions/editor/dynamicDecals/debugSection.lua

  if im.Button(string.format("%s##%s", "Reproject Layers", guiId)) then
    dump(api.reprojectLayers())
  local buttonWidth = (maxWidth - style.ItemSpacing.x) / 2
  if im.Button(string.format("%s##%s", "set true##api.setProjectDynamicDecalsState(true)", guiId), im.ImVec2(buttonWidth, 0)) then
    api.setProjectDynamicDecalsState(true)
  im.SameLine()
  if im.Button(string.format("%s##%s", "set false##api.setProjectDynamicDecalsState(false)", guiId), im.ImVec2(buttonWidth, 0)) then
    api.setProjectDynamicDecalsState(false)

  if im.Button(string.format("%s##%s", "Bake Brush", guiId)) then
    api.bakeBrush()

  if im.Button(string.format("%s##%s", "Dump api.layerStack", guiId)) then
    dump(api.getLayerStack())

  if im.Button(string.format("%s##%s", "Reload textures", guiId)) then
    textures.reloadTextureFiles()

  if im.Button(string.format("%s##%s", "getShapeMaterialNames", guiId)) then
    dump(api.getShapeMaterialNames())

  if im.Button(string.format("%s##%s", "getMeshObjectCount", guiId)) then
    dump(api.getMeshObjectCount())

  if im.Button(string.format("%s##%s", "api.getShapeMeshes()", guiId)) then
    dump(api.getShapeMeshes())

  if im.Button(string.format("%s##%s", "dump selection", guiId)) then
    dump(editor.selection["dynamicDecalLayer"])

  if im.Button(string.format("%s##%s", "dump gizmo.transform", guiId)) then
    dump(gizmo.transform)

  if im.Button(string.format("%s##%s", "dump gizmo.transform:getPosition()", guiId)) then
    dump(gizmo.transform:getPosition())

  if im.Button(string.format("%s##%s", "notification.add", guiId)) then
    notification.add("Debug", "test", "this is a test")

  if im.Button(string.format("%s##%s", "Open 'Load/Save' section", guiId)) then
    tool.setSectionOpenState("Load/Save", true)

  if im.Button(string.format("%s##%s", "Close 'Load/Save' section", guiId)) then
    tool.setSectionOpenState("Load/Save", false)

  if im.Button(string.format("%s##%s", "Docs - Select 'Linked Set Layers'", guiId)) then
    docs.selectSection("Linked Set Layers")

  if im.Button(string.format("%s##%s", "Highlight 'rotation' widget", guiId)) then
    widgets.highlight("##Decal Properties_section_decalRotation", 3)

  if im.Button(string.format("%s##%s", "api.updateVehicleMaterials()", guiId)) then
    api.updateVehicleMaterials()

  if im.Button(string.format("%s##%s", "Dump settings.getUsedMaterialNames()", guiId)) then
    dump(settings.getUsedMaterialNames())

  if im.Button(string.format("%s##%s", "Generate Materials", guiId)) then
    local vehicles = FS:findFiles('/vehicles/', '*', 0, false, true)
@/lua/ge/extensions/editor/cameraTransform.lua
  if editor.beginWindow(toolWindowName, "Camera Transform") then
    if im.Button("Get Camera Transform") then
      ffi.copy(camTransfrom, commands.getCameraTransformJson())
    im.SameLine()
    if im.Button("GoTo") then
      commands.setFreeCameraTransformJson(ffi.string(camTransfrom))
    im.PopItemWidth()
    if im.Button("Copy") then
      im.SetClipboardText(ffi.string(camTransfrom))
@/lua/ge/extensions/editor/raceEditor/tools.lua
  im.SameLine()
  if im.Button(" ... ##leftSelector") then
    extensions.editor_fileDialog.openFile(
  im.SameLine()
  if im.Button(" ... ##rightSelector") then
    extensions.editor_fileDialog.openFile(
    end
    if im.Button("Create") then
      self:createDecoration(allTransforms)
      im.SameLine()
      if im.Button("Replace") then
        lastGroup:delete()

      if im.Button("Remove") then
        lastGroup:delete()
  im.Text("Pathnode Tools")
  if im.Button("Drop All Pathnodes to Terrain Height") then
    local newDataMap = {}
  end
  if im.Button("Align All Pathnode Normals to Terrain Height") then
    local newDataMap = {}
  im.SameLine()
  if im.Button("Set All Pathnode Sizes") then
    local newDataMap = {}

  if im.Button("Remove Redundant BeamNGWaypoints") then
    for _, node in pairs(self.path.pathnodes.objects) do
  end
  if im.Button("Align All Pathnodes to Grid") then
    for _, node in pairs(self.path.pathnodes.objects) do
  end
  if im.Button("Remove All Segments") then
    self.path.segments:clear()
  im.Text("Debug Tools")
  if im.Button("Open Test Race Window") then
    self.raceEditor.setupRace()
  im.SameLine()
  if im.Button("Dump Path [Debug]") then
    dumpz(self.path,2)

  if im.Button("Dump Auto Config [Debug]") then
    self.path:autoConfig()
  end im.SameLine()
  if im.Button("Dump Auto Config Reverse [Debug]") then
    self.path:autoConfig(true)
@/lua/ge/extensions/gameplay/drift/freeroam/driftSpots.lua
    if activeLine then
      if im.Button("Reset drift zone scores") then
        resetDriftZoneScores(activeLine.spotName)
@/lua/ge/extensions/editor/rallyEditor/testTab.lua

  if im.Button("Test 1") then
    self:test1()

  if im.Button("Load Recce Mission") then
    local mid = self.path:getMissionId()

  if im.Button("Unload Recce Mission") then
    extensions.unload("gameplay_rally_recceApp")
@/lua/ge/extensions/flowgraph/nodes/vehicle/customPartsConfigProvider.lua
    if self.configPath then
      if im.Button("Load Config") then
        self.partConfig = jsonReadFile(self.configPath) or {parts = {},vars = {}}
        im.Text(veh.partConfig)
        if im.Button("Read from File") then
          self.partConfig = jsonReadFile(veh.partConfig) or {parts = {},vars = {}}
      else
        if im.Button("Copy from Vehicle") then
          self.partConfig = deserialize(veh.partConfig) or {parts = {},vars = {}}
        end
        if im.Button("Copy only Parts") then
          self.partConfig.parts = deserialize(veh.partConfig).parts or {}
        end
        if im.Button("Copy only Vars") then
          self.partConfig.vars = deserialize(veh.partConfig).vars or {}
  if im.TreeNode2(field..'tree',name..' ('..#self.sortedKeys[field]..' Items)') then
    if im.Button("Sort", im.ImVec2(im.GetContentRegionAvailWidth(),0)) then
      self:sortKeys()
@/lua/ge/extensions/editor/crawlEditor/paths.lua

  if im.Button("Add Path") then
    local newPath = self:getNewPath()
  im.SameLine()
  if im.Button("Rename") then
    local newFileName = ffi.string(self.fileName)

  if im.Button("Add Node") then
    self:getNewPathnode()
@/lua/ge/extensions/render/openxr.lua

    if im.Button("Turn on/off (ctrl+numpad0)##openXRclose") then
      M.setStateUI("disabled")
    im.SameLine()
    if im.Button("Center (ctrl+numpad5)##openXRcenter") then
      M.center()

    if im.Button("Reference setIdentity") then
      OpenXR.setLocalReference(true)