GE Lua Documentation

Press F to search!

SmallButton

Definition


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

Callers

@/lua/ge/extensions/editor/vehicleDetailViewer.lua
  if im.BeginMenu('Layouts##VDV_'..tostring(view.name)) then
    if im.SmallButton('reset current##resetLayouy') then
      createViewsForVehicle(veh)

    if im.SmallButton('save##saveLayouy') then
      local baseFilename = ffi.string(saveFilenameFFI)
        im.SetCursorPosX(200)
        if im.SmallButton('load##loadLayouy_'..tostring(lidx)) then
          loadedLayoutBaseFilename = baseFilename
        im.SameLine()
        if im.SmallButton('overwrite##overwriteLayouy_'..tostring(lidx)) then
          jsonWriteFile(layoutFilename, onSerialize())
        im.SameLine()
        if im.SmallButton('delete##deleteLayouy_'..tostring(lidx)) then
          FS:removeFile(layoutFilename)
@/lua/ge/extensions/flowgraph/nodes/vehicle/ai/scriptAI/playRecording.lua
  builder:Middle()
  if im.SmallButton("Load") then
    self:loadRecording()
@/lua/ge/extensions/editor/util/zoneSelectorUtil.lua
        im.SameLine()
        if im.SmallButton("Remove##initialRemove"..i..e._id) then
          table.remove(e.initialZones, i)
        im.SameLine()
        if im.SmallButton("Remove##destinationRemove"..i..e._id) then
          table.remove(e.destinationZones, i)
@/lua/ge/extensions/editor/terrainMaterialsEditor.lua
      im.SetCursorPosX(posX + im.GetContentRegionAvailWidth() - ((2 * im.GetStyle().FramePadding.x) + im.CalcTextSize("Reload Terrain Materials").x))
      if im.SmallButton("Reload Terrain Materials") then
        editor.logInfo("Reloading Terrain Materials")
      else
        if im.SmallButton("Add Material") then
          terrainMaterialEditor_Accept()
        im.SameLine()
        if im.SmallButton("Cancel") then
          terrainMtlCopyProxy.material:deleteObject()
@/lua/ge/extensions/editor/flowgraph/overview.lua
    im.SameLine()
    if im.SmallButton('X') then
      im.ImGuiTextFilter_Clear(self.filter)
      im.SameLine()
      if im.SmallButton("Print Graphs") then
        print("-- Current child path --")
@/lua/ge/extensions/editor/raceEditor/pathnodes.lua
    im.SameLine()
    if im.SmallButton("X##"..i) then
      remove = name
@/lua/ge/extensions/editor/sceneTree.lua
      for i = #selectedNodePathNodes, 1, -1 do
        if imgui.SmallButton(selectedNodePathNodes[i].displayName) then
          if i > 1 then
@/lua/ge/extensions/editor/rallyEditor/drivelineTab.lua
    im.SameLine()
    if im.SmallButton("Change Source") then
      self.drivelineLoaded = false
@/lua/ge/extensions/editor/vehicleEditor/staticEditor/vePartTree.lua
      im.SameLine()
      if im.SmallButton('Sync with AST') then
        --jsonAST.syncASTfromData(ast)
      im.SameLine()
      if im.SmallButton('Spawn') then
        local playerVehicle = extensions.core_vehicle_manager.getPlayerVehicleData()
@/lua/ge/extensions/editor/crawlEditor/paths.lua

    if im.SmallButton("Delete##" .. i) then
      removeIdx = i
@/lua/ge/extensions/editor/crawlEditor/trails.lua
    im.SameLine()
    if im.SmallButton("Remove##" .. i) then
      table.remove(trail.prefabs, i)
@/lua/ge/extensions/editor/crawlEditor/waypoints.lua
    im.SameLine()
    if im.SmallButton("X##"..i) then
      remove = name
@/lua/ge/extensions/editor/missionEditor/careerSetup.lua
    im.SameLine()
    if im.SmallButton("Rem") then
      remIdx = i
@/lua/common/extensions/ui/imguiUtils.lua
  if not icon then
    open_popup = imgui.SmallButton(label)
  else
    for k, item in pairs(itemsRMB) do
      if imgui.SmallButton(item.label.."##") then
        if item.func then item.func(item.args) end
@/lua/ge/extensions/editor/newsMessage.lua
    imgui.SameLine()
    if imgui.SmallButton("https://support.beamng.com/") then openWebBrowser("https://support.beamng.com/") end
    imgui.SameLine()
    imgui.SameLine()
    if imgui.SmallButton("https://www.beamng.com/forums/world-editor/") then openWebBrowser("https://www.beamng.com/forums/world-editor/") end
    imgui.Separator()
@/lua/ge/extensions/util/screenshotCreator.lua
      if im.BeginTabItem("Models selection") then
        if im.SmallButton("Player Vehicle Model") then
          selectPlayerVehicle()
        im.SameLine()
        if im.SmallButton("Select All") then
          for _,v in ipairs(vehList) do
        im.SameLine()
        if im.SmallButton("Unselect All") then
          for _,v in ipairs(vehList) do
        im.SameLine()
        if im.SmallButton("Invert Selection") then
          for _,v in ipairs(vehList) do
@/lua/ge/extensions/ui/console.lua
      im.PushItemWidth(40 * uiScale)
      exec = exec or im.SmallButton("execute")
      if exec then
@/lua/ge/extensions/core/vehicleTriggers.lua
                        im.TableNextColumn()
                        im.SmallButton((tostring(lnk.triggerInput) or 'trigger') .. '##lnk2_'..tostring(lnk.cid)..'_'..tostring(vehId))
                        im.SameLine()
                        im.SmallButton('trigger##lnk_'..tostring(lnk.cid)..'_'..tostring(vehId))
                        if im.IsItemHovered() and im.IsMouseClicked(0) then
                      im.SameLine()
                      if not isSelected and im.SmallButton('highlight##highlight_'..tostring(trg.cid) .. '_' .. tostring(actionStr)) then
                        highLightedTriggerData = {vehId, trg.cid}

                im.SmallButton('trigger##u'..tostring(evt.cid)..'_'..tostring(vehId))
                if im.IsItemHovered() and im.IsMouseClicked(0) and evt.onDown then
                if evt.onUp ~= nil then
                  if im.SmallButton('up##u'..tostring(evt.cid)..'_'..tostring(vehId)) then
                    queueCmd(vehId, evt.onUp)
                  if sameLineNeeded then im.SameLine() end
                  if im.SmallButton('down##d'..tostring(evt.cid)..'_'..tostring(vehId)) then
                    queueCmd(vehId, evt.onDown)
                  if sameLineNeeded then im.SameLine() end
                  if im.SmallButton('-1##z'..tostring(evt.cid)..'_'..tostring(vehId)) then
                    local cmdStr = evt.onChange:gsub("VALUE", tostring(-1))
                  im.SameLine()
                  if im.SmallButton('0##z'..tostring(evt.cid)..'_'..tostring(vehId)) then
                    local cmdStr = evt.onChange:gsub("VALUE", tostring(0))
                  im.SameLine()
                  if im.SmallButton('1##o'..tostring(evt.cid)..'_'..tostring(vehId)) then
                    local cmdStr = evt.onChange:gsub("VALUE", tostring(1))
                      im.SameLine()
                      im.SmallButton('trigger##u'..tostring(lnk.cid)..'_'..tostring(vehId))
                      if im.IsItemHovered() and im.IsMouseClicked(0) then
                      im.SameLine()
                      im.SmallButton('trigger##u'..tostring(lnk.cid)..'_'..tostring(vehId))
                      if im.IsItemHovered() and im.IsMouseClicked(0) then
@/lua/ge/extensions/trackbuilder/trackBuilder.lua
local function modifierButtons(name, resetValue, hasInterpolation, size)
  --if im.SmallButton("m##"..name) then
  if editor.uiIconImageButton(editor.icons.adjust, size or im.ImVec2(20,20), style.colorYellow) then
  im.SameLine()
  --if im.SmallButton("x##"..name) then
  if editor.uiIconImageButton(editor.icons.delete, size or im.ImVec2(20,20), style.colorRed) then
  im.SameLine()
  --if im.SmallButton("r##"..name) then
  if editor.uiIconImageButton(editor.icons.undo, size or im.ImVec2(20,20), style.colorGreen) then
    local changed = false
    if im.SmallButton(translateLanguage("ui.trackBuilder.matEditor.selectAll", "Select All")) then setAllPaintModes(true) changed = true end
    im.SameLine()
    im.SameLine()
    if im.SmallButton(translateLanguage("ui.trackBuilder.matEditor.deselectAll", "Deselect All")) then setAllPaintModes(false) changed = true end
        im.SameLine()
       -- if im.SmallButton("r##op"..i) then
        if editor.uiIconImageButton(editor.icons.undo, im.ImVec2(20,20), style.colorGreen) then
        im.SameLine()
      --  if im.SmallButton("r##os"..i) then
        im.SameLine()
       -- if im.SmallButton("r##or"..i) then
        if editor.uiIconImageButton(editor.icons.undo, im.ImVec2(20,20), style.colorGreen) then
@/lua/ge/extensions/editor/raceEditor.lua
        if im.BeginMenu("All Races...") then
          if im.SmallButton("Refresh (!)") then
            table.clear(allFiles)
@/lua/ge/extensions/editor/scriptAIManager.lua
    --[[
    if (not tableIsEmpty(recordings)) and im.SmallButton("save") then
      jsonWriteFile(persistenceFilename, M.onSerialize())
    im.SameLine()
    if FS:fileExists(persistenceFilename) and im.SmallButton("load") then
      M.onDeserialized(jsonReadFile(persistenceFilename))
@/lua/ge/extensions/editor/dynamicDecals/textures.lua
        for _, file in ipairs(missingSidecarFiles) do
          if im.SmallButton("Select##DynamicDecalsTextures_" .. file) then
            selectTextureFile({file})
          im.Separator()
          if im.SmallButton("Select All##DynamicDecalsTextures") then
            selectTextureFile(missingSidecarFiles)
        for _, file in ipairs(missingSidecarFiles) do
          if im.SmallButton("Select##DynamicDecalsTextures_" .. file) then
            selectTextureFile({file})
          im.Separator()
          if im.SmallButton("Select All##DynamicDecalsTextures") then
            selectTextureFile(missingSidecarFiles)
@/lua/ge/extensions/editor/crawlEditor/boundaries.lua
    im.SameLine()
    if im.SmallButton("X##"..i) then
      remove = name
@/lua/ge/extensions/editor/materialEditor.lua
      im.SameLine()
      if im.SmallButton("Refresh") then
        computeMaterialUsageForMatName(data.lastMat)
    im.SameLine()
    if im.SmallButton("Save") then
      saveCubemap()
    im.SameLine()
    if im.SmallButton("New") then
      newCubemap()
    im.SameLine()
    if im.SmallButton("Delete") then
      deleteCubemap()
          for _, material in ipairs(tags[tagName]) do
            if im.SmallButton(material) then
              -- Clear search filter before selecting a material, it might not be part of the mat list yet.
@/lua/ge/extensions/editor/flowgraph/properties.lua
   -- self:_drawDataTable(path, cdata, v, savePath, saveCallback, true)
   -- if im.SmallButton("Add element") then end -- Todo: being able to dynamically add an element to the table
   -- im.EndChild()
        if not pin.fixed then
          if im.SmallButton("Delete##deletePin" .. pin.id) then
            item:removePin(pin)
        end
        if im.SmallButton("Up##"..pin.id) then
          item:shiftPin(pid, -1)
        im.SameLine()
        if im.SmallButton("Down##"..pin.id) then
          item:shiftPin(pid, 1)
        if not pin.fixed then
          if im.SmallButton("Delete##deletePin" .. pin.id) then
            item:removePin(pin)
        end
        if im.SmallButton("Up##"..pin.id) then
          item:shiftPin(pid, -1)
        im.SameLine()
        if im.SmallButton("Down##"..pin.id) then
          item:shiftPin(pid, 1)
    im.PopItemWidth()
    if im.SmallButton('X') then
      table.remove(self.mgr.macroTags,i)
@/lua/ge/extensions/editor/vizHelper.lua
    im.SameLine()
    if im.SmallButton("clear") then
      savedDecals = {}
@/lua/common/extensions/ui/imgui_gen_luaintf.lua
  if string_label == nil then log("E", "", "Parameter 'string_label' of function 'SmallButton' cannot be nil, as the c type is 'const char *'") ; return end
  return imgui.SmallButton(string_label)
end
@/lua/ge/extensions/editor/dynamicDecals/layerTypes/decal.lua
  im.SetCursorPosX(cpos.x + 80)
  if im.SmallButton("enable all") then
    if layer.meshes and layer.meshes[vehicleObj.jbeam] then
  im.SameLine()
  if im.SmallButton("disable all") then
    if not layer.meshes then layer.meshes = {} end
@/lua/ge/extensions/flowgraph/nodes/logic/wait.lua
  im.ProgressBar(self.timer / math.max(1e-12, self.pinIn.duration.value), im.ImVec2(50,0))
  if im.SmallButton("Reset") then
    self.timer = 0
@/lua/ge/extensions/editor/missionEditor/objectives.lua
    im.SameLine()
    if im.SmallButton("Rem##"..i) then
      remIdx = i
@/lua/ge/extensions/editor/util/vehicleFilterUtil.lua
    im.SameLine()
    if im.SmallButton("Remove##removeFilter") then
      table.remove(e.baseFilter.whiteList, filterIdx)
    im.SameLine()
    if im.SmallButton("Remove##removeFilter") then
      table.remove(e.baseFilter.blackList, filterIdx)
    im.SameLine()
    if im.SmallButton("Remove##removeSetting") then
      table.remove(e.probabilitySettings, settingIdx)
      im.SameLine()
      if im.SmallButton("Remove##removeFilter") then
        table.remove(setting.whiteList, filterIdx)
      im.SameLine()
      if im.SmallButton("Remove##removeFilter") then
        table.remove(setting.blackList, filterIdx)
      im.SameLine()
      if im.SmallButton("Remove##"..e._id.."remove"..i) then
        -- Check if it's a manual addition
@/lua/ge/extensions/editor/dynamicDecals/fonts.lua
  im.SameLine()
  if im.SmallButton("Open fonts section##2nd_button") then
    tool.setSectionOpenState("Fonts", true, true)
@/lua/ge/extensions/editor/assetBrowser.lua
    -- TODO: add button to rename item
    if im.SmallButton("Remove" .. "##Filter_" .. item.label) then
      removeSavedFilter(index)
  im.PushStyleColor2(im.Col_Button, editor.color.transparent.Value) -- set SmallButton's background color to transparent
  if im.SmallButton(item.label) then
    openSearchFilter(item)
  im.SameLine()
  if im.SmallButton("Saved Filter") then
    var.savedSearchesOpen = not var.savedSearchesOpen
  local itemDoubleClicked = false
  if im.SmallButton(dir.name .. "##" .. tostring(dir.id)) then
    var.currentListIndex = var.listIndexCounter
    -- [debug]
    -- im.SmallButton((parentDir == true) and ("[...]##parentDir" .. dir.path) or (tostring(im.GetCursorPosY()) .. " " .. dir.name .. "##" .. dir.path))
    if dir.selectedInABView == true then im.PushStyleColor2(im.Col_Text, im.GetStyleColorVec4(im.Col_ButtonActive)) end -- set SmallButton's font color to if the asset is selected
    if dir.selectedInABView == true then im.PushStyleColor2(im.Col_Text, im.GetStyleColorVec4(im.Col_ButtonActive)) end -- set SmallButton's font color to if the asset is selected
    im.SmallButton((parentDir == true) and ("[...]##parentDir" .. dir.id) or (dir.name .. "##" .. dir.id))
    im.PopStyleColor((dir.selectedInABView == true) and 2 or 1)
    if set.selectedInABView == true then im.PushStyleColor2(im.Col_Text, im.GetStyleColorVec4(im.Col_ButtonActive)) end -- set SmallButton's font color to if the asset is selected
    im.SmallButton(set.name .. "##_" .. set.path)
    im.PopStyleColor((set.selectedInABView == true) and 2 or 1)
    -- [Debug]
    -- im.SmallButton(tostring(var.itemPos) .. " " .. tostring(im.GetCursorPosY()) .. " " .. material.fullFileName)
    if im.SmallButton(material.name) then
    -- im.SmallButton(tostring(var.itemPos) .. " " .. tostring(im.GetCursorPosY()) .. " " .. material.fullFileName)
    if im.SmallButton(material.name) then
      selectAsset(material)
      im.PushStyleColor2(im.Col_Button, editor.color.transparent.Value)
      im.SmallButton(file.fullFileName)
      im.PopStyleColor((file.selectedInABView == true) and 2 or 1)
            )
            if im.SmallButton("Actual image size") then
              openImageInspectorWindow(editor.selection["asset"])
  var.matPreview:ImGui_Image(matPreviewSize, matPreviewSize)
  if im.SmallButton("Open in Material Editor") then
    if editor_materialEditor then
@/lua/ge/extensions/flowgraph/nodes/vehicle/ai/simpleFollowDecalroad.lua
  builder:Middle()
  if im.SmallButton("Load") then
    self:loadRecording()
@/lua/ge/extensions/editor/raceEditor/testing.lua
  for i, sp in ipairs(self.path.startPositions.sorted) do
    if im.SmallButton("Move to " .. sp.name) then
      sp:moveResetVehicleTo(be:getPlayerVehicleID(0))
@/lua/ge/extensions/util/groundModelDebug.lua
    if im.TreeNode1("Groundmodels") then
      if im.SmallButton("Enable All") then
        for _,k in pairs(gms) do
      im.SameLine()
      if im.SmallButton("Disable All") then
        for _,k in pairs(gms) do
        --   im.SameLine()
        --   if ui_imgui.SmallButton("select") then
        --     TorqueScript.eval('EWorldEditor.clearSelection();EWorldEditor.selectObject(' .. tostring(body.objId) .. ');EWorldEditor.dropCameraToSelection();')
@/lua/ge/extensions/flowgraph/nodes/logic/frameDelay.lua
  im.ProgressBar(self.pinIn.frames.value and (self.counter / self.pinIn.frames.value) or 0, im.ImVec2(50,0))
  if im.SmallButton("Reset") then
    self.counter = 0
@/lua/ge/extensions/editor/sitesEditor/sortedListDisplay.lua
  im.SameLine()
  if im.SmallButton("x") then
    self.search = im.ArrayChar(256, '')
      if tableContains(self.selections, obj.id) then
        if im.SmallButton("X##" .. obj.id) then
          remove = obj
    im.SameLine()
    if im.SmallButton("X##" .. i) then
      remove = name
      end
      if im.SmallButton(t) then
        self.popupTag = t
@/lua/ge/extensions/editor/forestEditor.lua
    im.SameLine()
    if im.SmallButton("ForestBrushes") then
      M.dumpForestBrushes()
    im.SameLine()
    if im.SmallButton("ForestBrushes Map") then
      M.dumpForestBrushesMap()
    im.SameLine()
    if im.SmallButton("Brush Properties") then
      M.dumpBrushProperties()
    im.SameLine()
    if im.SmallButton("Test") then
      print("var.forestBrushGroup:size()")
    im.SameLine()
    if im.SmallButton("Forest Brush Group") then
      print("ForestBrushGroup")
    im.SameLine()
    if im.SmallButton("Save") then
      Sim.serializeToLineObjectsFile('ForestBrushGroup', editor.levelPath .. 'main.forestbrushes4.json')
@/lua/ge/extensions/flowgraph/nodes/input/blacklistAction.lua
      else
        if im.SmallButton("X##" .. i) then
          rem = i
@/lua/ge/extensions/editor/assetDeduplicator.lua
          im.SameLine()
          if im.SmallButton("Preview##" .. i) then
            openPreviewFor(origin, entry)
          im.SameLine()
          if im.SmallButton("Preview##" .. i) then
            openPreviewFor(origin, entry)