GetContentRegionAvailWidth
Definition
-- @/lua/common/extensions/ui/imgui_custom_luaintf.lua:304
-- Wrapper function, this was removed in the latest imgui version
function M.GetContentRegionAvailWidth()
return M.GetContentRegionAvail().x
end
Callers
@/lua/ge/extensions/editor/dynamicDecals/docs.lua
local titleSize = im.CalcTextSize(windowName)
im.SetCursorPosX(im.GetCursorPosX() + im.GetContentRegionAvailWidth() / 2 - titleSize.x / 2)
im.TextColored(editor.color.beamng.Value, windowName)
if im.BeginChild1("TreeChild", nil, true) then
if editor.uiInputSearchTextFilter("docsfilter", filter, im.GetContentRegionAvailWidth()) then
filterDocs()
local titleSize = im.CalcTextSize(currentSection.name)
im.SetCursorPosX(im.GetCursorPosX() + im.GetContentRegionAvailWidth() / 2 - titleSize.x / 2)
im.TextColored(editor.color.beamng.Value, currentSection.name)
local ratio = img.size.y / img.size.x
local sizeX = overrideWidth or im.GetContentRegionAvailWidth()
local sizeY = sizeX * ratio
M.introductionGui = function(docsSection)
im.PushTextWrapPos(im.GetContentRegionAvailWidth())
helper.textUnformattedCentered("Welcome to the world of skin customization in BeamNG!")
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()
local function gettingStartedGui(docsSection)
im.PushTextWrapPos(im.GetContentRegionAvailWidth())
@/lua/ge/extensions/editor/dynamicDecals/layerTypes/textureFill.lua
local function documentationGui(docsSection)
im.PushTextWrapPos(im.GetContentRegionAvailWidth())
im.TextUnformatted([[
@/lua/ge/extensions/editor/missionEditor/careerSetup.lua
im.NextColumn()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if im.BeginCombo("##Skill", self.mission.careerSetup.skill or "(none)") then
@/lua/ge/extensions/editor/terrainMaterialsEditor.lua
end
im.PushItemWidth(im.GetContentRegionAvailWidth() + (widthMod or 0))
editor.uiInputText(
im.SameLine()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiInputFloat(
im.SameLine()
im.PushItemWidth(im.GetContentRegionAvailWidth())
editor.uiInputFloat(
im.SameLine()
im.PushItemWidth(im.GetContentRegionAvailWidth())
editor.uiInputFloat2(
im.SameLine()
im.PushItemWidth(im.GetContentRegionAvailWidth())
editor.uiInputInt2(
im.SetCursorPosX(posX + 90)
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiInputFloat(
im.SetCursorPosX(posX + 90)
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiInputFloat(
im.SetCursorPosX(posX + 90)
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiInputFloat(
im.SetCursorPosX(posX + 90)
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiInputFloat(
im.SameLine()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if im.BeginCombo("##groundModels", groundModelName) then
im.SameLine()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if im.BeginCombo("##groundModels", groundModelName) then
im.PushTextWrapPos(im.GetContentRegionAvailWidth())
im.TextUnformatted("The following Terrain Materials will be moved to a new file using the the most recent file format.")
if editor.beginModalWindow("upgradeTerrainMaterialsModal", "Upgrade Terrain Materials") then
im.PushTextWrapPos(im.GetContentRegionAvailWidth())
im.TextUnformatted("This will create a TerrainMaterialTextureSet object and attach it to your Terrain Blocks.")
local posX = im.GetCursorPosX()
im.SetCursorPosX(posX + im.GetContentRegionAvailWidth() - ((2 * im.GetStyle().FramePadding.x) + im.CalcTextSize("Reload Terrain Materials").x))
if im.SmallButton("Reload Terrain Materials") then
if im.Selectable1(mtl.internalName .. "##Terrain Materials" .. id, name == mtl.internalName, nil,
im.ImVec2(im.GetContentRegionAvailWidth() - (editor_terrainEditor.getVars().style.ItemSpacing.x + btnHeight), 0))
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
im.Dummy(im.ImVec2(0,20))
im.PushTextWrapPos(im.GetContentRegionAvailWidth())
im.TextColored(editor.color.warning.Value, "The Terrain Materials reside in a file with a deprecated format.")
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()
im.SameLine()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if im.BeginCombo("##annotation", value, im.ComboFlags_HeightLargest) then
@/lua/ge/extensions/editor/materialEditor.lua
im.SameLine()
im.Dummy(im.ImVec2(im.GetContentRegionAvailWidth() - (num*iconW * im.uiscale[0] + num*spacing + 10),1))
im.SameLine()
end
im.PushItemWidth(im.GetContentRegionAvailWidth() + (widthMod or 0))
if editor.uiInputText(
local mul = 1
if x > im.GetContentRegionAvailWidth() then
mul = im.GetContentRegionAvailWidth()/x
if x > im.GetContentRegionAvailWidth() then
mul = im.GetContentRegionAvailWidth()/x
end
im.NextColumn()
if im.GetContentRegionAvailWidth() > 160 then
additionalGuiFn()
tempBoolPtr[0] = false
im.PushItemWidth(im.GetContentRegionAvailWidth() - 10)
if editor.uiColorEdit4(
im.SameLine()
im.PushItemWidth(im.GetContentRegionAvailWidth() - 10)
if editor.uiSliderInt(
im.SameLine()
im.PushItemWidth(im.GetContentRegionAvailWidth() - 10)
if editor.uiSliderFloat(
im.SameLine()
im.PushItemWidth(im.GetContentRegionAvailWidth() - 10)
if editor.uiInputFloat(
im.SameLine()
im.PushItemWidth(im.GetContentRegionAvailWidth() - 10)
if editor.uiInputFloat2(
im.SameLine()
im.PushItemWidth(im.GetContentRegionAvailWidth() - 10)
tempBoolPtr[0] = false
im.SameLine()
im.PushItemWidth(im.GetContentRegionAvailWidth() - 10)
tempBoolPtr[0] = false
end
im.PushItemWidth(im.GetContentRegionAvailWidth() - 10)
if im.Combo1("##" .. label .. property .. tostring(layer), editor.getTempInt_StringString(index), cptr) then
end
im.PushItemWidth(im.GetContentRegionAvailWidth() - 10)
if im.Button(cubemap) then
-- local childSize = im.ImVec2(0, )
cubemapFaceThumbnailSize = (im.GetContentRegionAvailWidth() - (3 * v.style.ItemSpacing.x) - 8) / 4 -- -8 = remove 4 times the ImageButton border size (2px)
local function layer()
im.PushItemWidth(im.GetContentRegionAvailWidth() - 10)
if im.Combo2("##MaterialEditorLayer", o.layer, "Layer 0\0Layer 1\0Layer 2\0Layer 3\0\0") then
colorEdit4("Color", "diffuseColor", nil, nil, true)
local availWidth = im.GetContentRegionAvailWidth()
checkbox("Instance Diffuse", "instanceDiffuse", nil, "If enabled the material multiplies the color value by the SimObject's instanceColor value.")
im.SameLine()
im.PushItemWidth(im.GetContentRegionAvailWidth() - 10)
if im.Combo1("##Alpha Blend Mode_translucent0", editor.getTempInt_StringString(index), cptr) then
im.SameLine()
im.PushItemWidth(im.GetContentRegionAvailWidth() - 10)
if im.BeginCombo("##annotation", value, im.ComboFlags_HeightLargest) then
combo("UV Layer", "diffuseMapUV", {"0", "1"}, lyr)
local availWidth = im.GetContentRegionAvailWidth()
checkbox("Instance BaseColor", "instanceDiffuse", lyr, "If enabled the material multiplies the color value by the SimObject's instanceColor value.")
else
if im.GetContentRegionAvailWidth() ~= matPreviewRenderSize or updateMaterialPreviewRender == true then
matPreviewRenderSize = im.GetContentRegionAvailWidth()
if im.GetContentRegionAvailWidth() ~= matPreviewRenderSize or updateMaterialPreviewRender == true then
matPreviewRenderSize = im.GetContentRegionAvailWidth()
matPreviewRenderSize = matPreviewRenderSize > options.maxMaterialPreviewSize and options.maxMaterialPreviewSize or matPreviewRenderSize
local p1 = im.ImVec2(wpos.x + cpos.x - v.style.WindowPadding.x, wpos.y + cpos.y - v.style.WindowPadding.y)
local p2 = im.ImVec2(wpos.x + cpos.x + im.GetContentRegionAvailWidth() + 2 * v.style.WindowPadding.x, wpos.y + cpos.y + v.inputWidgetHeight * 1.5)
im.ImDrawList_AddRectFilled(im.GetWindowDrawList(), p1, p2, im.GetColorU321(im.Col_MenuBarBg))
if im.BeginPopup("PickMapToFromObjectPopup") then
local maxWidth = im.GetContentRegionAvailWidth()
if pickingFromObjectMaterials then
im.SameLine()
im.PushItemWidth(im.GetContentRegionAvailWidth() - (v.inputWidgetHeight * im.uiscale[0] + v.style.ItemSpacing.x + 10))
im.InputText("##NewMatName", newMatName, nil, im.flags(im.InputTextFlags_CharsNoBlank))
if newMatMapToLocked == true then
im.PushItemWidth(im.GetContentRegionAvailWidth() - (v.inputWidgetHeight * im.uiscale[0] + v.style.ItemSpacing.x + 10))
else
else
im.PushItemWidth(im.GetContentRegionAvailWidth() - (v.inputWidgetHeight * im.uiscale[0] + 3 * v.style.ItemSpacing.x + im.CalcTextSize("Pick from TSStatic").x + 10))
end
im.SameLine()
im.PushItemWidth(im.GetContentRegionAvailWidth() - (v.style.ItemSpacing.x + 2 * v.style.FramePadding.x + im.CalcTextSize("...").x))
im.InputText("##NewMatPath", newMatPath, nil, im.flags(im.InputTextFlags_CharsNoBlank))
im.SetCursorPosX(im.GetCursorPosX() + im.GetContentRegionAvailWidth() - (v.style.ItemSpacing.x + 4 * v.style.FramePadding.x + im.CalcTextSize("Create").x + im.CalcTextSize("Cancel").x))
if createMaterialError then im.BeginDisabled() end
if editor.uiInputSearchTextFilter("Filter materials (inc, -exc)", matFilter, im.GetContentRegionAvailWidth()) then
v.currentMaterialIndex = 0
next(v.dirtyMaterials) == nil and
(im.GetContentRegionAvailWidth() - (math.ceil(17 * im.uiscale[0]) + 2 * v.style.FramePadding.y + v.style.ItemSpacing.x))
or
or
(im.GetContentRegionAvailWidth() - (2 * (math.ceil(17 * im.uiscale[0]) + 2 * v.style.FramePadding.y) + 2 * v.style.ItemSpacing.x))
)
@/lua/ge/extensions/editor/missionPlaybook.lua
--if #M.book.results == 0 then return end
im.PushItemWidth(im.GetContentRegionAvailWidth()-150)
pagePtr[0] = M.book.page
@/lua/ge/extensions/editor/flowgraphEditor.lua
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/editor/bulkRename.lua
imgui.Text("Search Pattern: (use * to match any substring, ? to match any single character)")
if editor.uiInputSearchTextFilter("##renameFilter", filter, imgui.GetContentRegionAvailWidth(), nil, nil) then
updatePreview()
@/lua/ge/extensions/editor/flowgraph/garbageDebug.lua
local flags = bit.bor(im.WindowFlags_NoScrollbar, im.WindowFlags_NoScrollWithMouse)
local winWidth = im.GetContentRegionAvailWidth()
local fillPercent = 0.33
plotHelperUtil:setSeriesColors({{1,1,1,1},{0,0,1,1}})
plotHelperUtil:draw(im.GetContentRegionAvailWidth(),250, im.GetIO().DeltaTime)
im.Text(string.format("Change | Avg: %d | Q25: %d | Q75: %d | Q90: %d | (only active)", entry.averageChange or -1, entry.q25 or -1, entry.q50 or -1, entry.q75 or -1))
plotHelperUtil:setSeriesColors({{1,0,0,1},{0,0,1,1}})
plotHelperUtil:draw(im.GetContentRegionAvailWidth(),250, im.GetIO().DeltaTime)
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()
if show then
im.PushItemWidth(im.GetContentRegionAvailWidth())
if im.BeginCombo("garbageSort","Sort by: " .. valueLabels[editor.getPreference("flowgraph.debug.garbageSort")]) then
@/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])
@/lua/ge/extensions/gameplay/drift/scoring.lua
if debugToggleSmothnessGraph[0] then
im.BeginChild1("Data", im.ImVec2(im.GetContentRegionAvailWidth() / 100 * 65, 300), true)
-- debug graph
plotHelperUtil:setScale(nil, nil, 0, nil)
plotHelperUtil:draw(im.GetContentRegionAvailWidth(), im.GetContentRegionAvail().y, 400)
im.EndChild()
im.SameLine()
im.BeginChild1("Legend", im.ImVec2(im.GetContentRegionAvailWidth(), 300), true)
im.PushStyleColor2(im.Col_Text, im.ImVec4(1, 1, 0.1, 1))
@/lua/ge/extensions/editor/audioEventsList.lua
if editor.beginWindow(toolWindowName, toolWindowTitle) then
local searchInputSize = im.GetContentRegionAvailWidth() * 0.4
im.PushItemWidth(searchInputSize)
@/lua/ge/extensions/editor/forestEditor.lua
im.NextColumn()
im.PushItemWidth(im.GetContentRegionAvailWidth())
local editEnded = im.BoolPtr(false)
im.Columns(1, "assetInspectorGuiForestItem_columns")
if im.Button("Open TextureSet editor##ForestItemInspector", im.ImVec2(im.GetContentRegionAvailWidth(), 0)) then
editor.showWindow(parallaxMappingTextureSetEditor_WindowId)
im.SeparatorText("Mesh Preview")
local size = im.GetContentRegionAvailWidth()
var.meshPreviewDimRdr.point = Point2I(0, 0)
if im.Button("Select ForestItemData", im.ImVec2(im.GetContentRegionAvailWidth(), 0)) then
for _, forestItemData in ipairs(var.forestItemData) do
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(var.style.FramePadding.x, 0))
im.PushItemWidth(im.GetContentRegionAvailWidth())
if var.highlightInputText == true then
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
if pM_selectedTextureSetId > 0 then
local imgSize = (im.GetContentRegionAvailWidth() - (im.GetStyle().WindowPadding.x + 8 * im.GetStyle().ItemSpacing.x + 8 * im.GetStyle().FramePadding.x)) / 4
im.SetCursorPosX(imgSize + im.GetStyle().ItemSpacing.x + im.GetStyle().WindowPadding.x + 2 * im.GetStyle().FramePadding.x)
im.SameLine()
im.PushItemWidth(im.GetContentRegionAvailWidth())
local size = im.GetContentRegionAvailWidth()
var.meshPreviewDimRdr.point = Point2I(0, 0)
local size = im.GetContentRegionAvailWidth()
var.meshPreviewDimRdr.point = Point2I(0, 0)
@/lua/ge/extensions/flowgraph/nodes/input/blacklistAction.lua
local toggled = false
im.PushItemWidth(im.GetContentRegionAvailWidth())
if im.BeginCombo("##presets" .. self.id, "Presets...") then
self:drawSearchInput()
im.BeginChild1("all", im.ImVec2(im.GetContentRegionAvailWidth(), 400 * editor.getPreference("ui.general.scale")))
if self.search.matchString ~= "" then
for _, result in ipairs(self.results) do
im.BeginChild1(result.id, im.ImVec2(im.GetContentRegionAvailWidth(), 22 * editor.getPreference("ui.general.scale") + 2))
im.Checkbox("##cba" .. result.id, im.BoolPtr(listKeys[result.id] or false))
for i, name in ipairs(allCategories[cat]) do
im.BeginChild1(name, im.ImVec2(im.GetContentRegionAvailWidth(), 22 * editor.getPreference("ui.general.scale") + 2))
local clk = im.Checkbox("##cba" .. name .. "-" .. cat .. "-" .. self.id, im.BoolPtr(listKeys[name] or false))
@/lua/ge/extensions/editor/dynamicDecals/settings.lua
local widgetId = "dynamicDecals_settings_cursorPosition"
local width = (im.GetContentRegionAvailWidth() - im.GetStyle().ItemSpacing.x) / 2
im.PushItemWidth(width)
im.SameLine()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if im.Combo1("##uvLayer", editor.getTempInt_NumberNumber(api:getUvLayer()), uvLayerNamesCharPtr) then
if im.TreeNodeEx1(string.format("Materials##VehicleLiveryEditor_Settings_%s", widgetId), im.TreeNodeFlags_DefaultOpen) then
editor.uiInputSearchTextFilter("Materials Filter", materialsFilter, im.GetContentRegionAvailWidth())
im.BeginChild1(string.format("MaterialsChild_VehicleLiveryEditor_Settings_%s", widgetId), im.ImVec2(0, 280), true)
im.SameLine()
editor.uiInputSearchTextFilter(string.format("Meshes Filter##%s", widgetId), meshesFilter, im.GetContentRegionAvailWidth())
im.BeginChild1(string.format("MeshesChild_VehicleLiveryEditor_Settings_%s", widgetId), im.ImVec2(0, 280), true)
im.SameLine()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if im.Combo1("##textureResolution_x", editor.getTempInt_NumberNumber(textureResolutionXId), textureResolutionNamesCharPtr) then
im.SameLine()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if im.Combo1("##textureResolution_y", editor.getTempInt_NumberNumber(textureResolutionYId), textureResolutionNamesCharPtr) then
@/lua/ge/extensions/editor/windows.lua
editor.uiInputSearchTextFilter("##windowsFilter", filter, im.GetContentRegionAvailWidth())
if im.BeginChild1("Windows##Child", nil, true) then
@/lua/ge/extensions/editor/dynamicDecalsTool.lua
local buttonHeight = math.ceil(im.GetFontSize()) + imguiStyle.FramePadding.y
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
if editor.beginModalWindow(openToolWindowPopupName, "Open now?") then
im.PushTextWrapPos(im.GetContentRegionAvailWidth())
im.TextUnformatted("Would you like to open the Vehicle Livery Editor now?")
im.TextUnformatted("Would you like to open the Vehicle Livery Editor now?")
local space = im.GetContentRegionAvailWidth()
local style = im.GetStyle()
local function layerTypesDocumentationGui(docsSection)
im.PushTextWrapPos(im.GetContentRegionAvailWidth())
im.TextUnformatted([[
for _, child in ipairs(docsSection.children) do
if im.Button(child.name, im.ImVec2(im.GetContentRegionAvailWidth(), 0)) then
deps.docs.selectSection(child.name)
local function toolbarDocumentationGui(docsSection)
im.PushTextWrapPos(im.GetContentRegionAvailWidth())
im.TextUnformatted([[
function(cat, subCat, item)
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiInputText(
im.SameLine()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiInputInt(string.format("##sectionsOrderPrefs_%s_input", section.name), editor.getTempInt_NumberNumber(section.order), 1, 10, nil, editor.getTempBool_BoolBool(false)) then
@/lua/ge/extensions/editor/dynamicDecals/colorHistory.lua
local function documentationGui(docsSection)
im.PushTextWrapPos(im.GetContentRegionAvailWidth())
im.TextUnformatted([[
@/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())
for _, result in ipairs(results) do
im.BeginChild1(result.id.."child", im.ImVec2(im.GetContentRegionAvailWidth(), 22 * editor.getPreference("ui.general.scale") + 2))
if im.Checkbox("##cba" .. result.id, im.BoolPtr(columns[result.id].enabled or false)) then
for i, column in ipairs(columns) do
im.BeginChild1(i.."child", im.ImVec2(im.GetContentRegionAvailWidth(), 22 * editor.getPreference("ui.general.scale") + 2))
if im.Checkbox("##cbaa" .. i, im.BoolPtr(column.enabled or false)) then
@/lua/ge/extensions/editor/resourceChecker.lua
im.Spacing()
im.Dummy(im.ImVec2(im.GetContentRegionAvailWidth()-220* im.uiscale[0], 0))
im.SameLine()
warning("Remove only selected files", level, cnt, unusType, isSelected)
im.Dummy(im.ImVec2(im.GetContentRegionAvailWidth()-buttonWidth*3-11* im.uiscale[0], 0))
else
else
im.Dummy(im.ImVec2(im.GetContentRegionAvailWidth()-buttonWidth-5* im.uiscale[0], 0))
end
if filepath and testName then
im.Dummy(im.ImVec2(im.GetContentRegionAvailWidth()-200* im.uiscale[0], 0))
im.SameLine()
local total = tonumber(totals.diskBytes) or 1
local barW = im.GetContentRegionAvailWidth()
local barH = 18* im.uiscale[0]
im.Text(labels[key].." ("..cnt.." files) "..humanMB(b).." ["..string.format("%.1f%%", pct).."]")
local w = im.GetContentRegionAvailWidth()
im.PushStyleColor2(im.Col_PlotHistogram, colors[key])
im.Text("Meshes: "..humanMB(usedM).." ("..string.format("%.1f%%", (usedM/usedTotal)*100)..")")
local w = im.GetContentRegionAvailWidth()
im.ProgressBar(usedT/usedTotal, im.ImVec2(w, 0), "Textures")
local splitterWidth = im.GetContentRegionAvailWidth()
local spPos = im.GetCursorScreenPos()
im.SameLine()
im.Dummy(im.ImVec2(im.GetContentRegionAvailWidth()-180* im.uiscale[0], 0))
im.SameLine()
@/lua/ge/extensions/flowgraph/nodes/vehicle/ai/scriptAI/pathStored.lua
if editor_scriptAIManager then
im.PushItemWidth(im.GetContentRegionAvailWidth())
if im.BeginCombo("Selector",tostring(self.currentID)) then
@/lua/ge/extensions/editor/dynamicDecals/debugSection.lua
local style = im.GetStyle()
local maxWidth = im.GetContentRegionAvailWidth()
@/lua/ge/extensions/editor/prefabInstanceEditor.lua
local availWidth = imgui.GetContentRegionAvailWidth()
imgui.PushStyleColor2(imgui.Col_Button, imgui.ImColorByRGB(255,102,0,255).Value)
@/lua/ge/extensions/editor/scriptAIManager.lua
local objMax = be:getObjectCount()-1
local availWidth = im.GetContentRegionAvailWidth()
local show = availWidth >= 420 -- full view or compact view
im.NextColumn()
im.Dummy(im.ImVec2(im.GetContentRegionAvailWidth(), 0))
im.Separator()
im.Dummy(im.ImVec2(im.GetContentRegionAvailWidth(), 0))
im.Text('Debug: ')
@/lua/ge/extensions/editor/flowgraph/references.lua
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(6, 6.5 * editor.getPreference("ui.general.scale")))
im.PushItemWidth(im.GetContentRegionAvailWidth() * 0.55)
if im.InputText("##findReferenceByName", self.searchText, nil) then
im.SameLine()
im.PushItemWidth(im.GetContentRegionAvailWidth() - buttonSize.x * editor.getPreference("ui.general.scale") - 5)
if im.BeginCombo("##paths", self.filterMode) then
if im.BeginTable('', 4) then
im.TableSetupColumn("Input Pins", 0, im.GetContentRegionAvailWidth() / 6)
im.TableSetupColumn("Description", 0, im.GetContentRegionAvailWidth() / 3)
im.TableSetupColumn("Input Pins", 0, im.GetContentRegionAvailWidth() / 6)
im.TableSetupColumn("Description", 0, im.GetContentRegionAvailWidth() / 3)
im.TableSetupColumn("Output Pins", 0, im.GetContentRegionAvailWidth() / 6)
im.TableSetupColumn("Description", 0, im.GetContentRegionAvailWidth() / 3)
im.TableSetupColumn("Output Pins", 0, im.GetContentRegionAvailWidth() / 6)
im.TableSetupColumn("Description", 0, im.GetContentRegionAvailWidth() / 3)
im.TableSetupColumn("Output Pins", 0, im.GetContentRegionAvailWidth() / 6)
im.TableSetupColumn("Description", 0, im.GetContentRegionAvailWidth() / 3)
im.TableHeadersRow()
im.TableSetupColumn("Behaviour", 0, im.CalcTextSize("Behaviour").x + 10)
im.TableSetupColumn("Description", 0, im.GetContentRegionAvailWidth())
im.TableHeadersRow()
@/lua/ge/extensions/editor/visualization.lua
im.SameLine()
local avail = im.GetContentRegionAvailWidth()
im.Dummy(vec2(math.max(1, avail - im.CalcTextSize(right).x - _uiScale(6)), 1))
im.Spacing(im.ImVec2(0, 0))
local prefWindowCurrWidth = im.GetContentRegionAvailWidth();
im.SameLine(prefWindowCurrWidth - 133 * im.uiscale[0])
im.PushID1("VizSearchFilter")
if editor.uiInputSearchTextFilter("##vizSearchFilter", vizFilter, im.GetContentRegionAvailWidth(), nil) then
if ffi.string(im.TextFilter_GetInputBuf(vizFilter)) == "" 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/editor/missionEditor/general.lua
local editEnded = im.BoolPtr(false)
im.PushItemWidth(im.GetContentRegionAvailWidth() - 35)
editor.uiInputText("##GeneralName", self.nameText, 1024, nil, nil, nil, editEnded)
editEnded = im.BoolPtr(false)
im.PushItemWidth(im.GetContentRegionAvailWidth() - 35)
editor.uiInputTextMultiline("##Description", self.descText, 2048, im.ImVec2(0,100), nil, nil, nil, editEnded)
@/lua/ge/extensions/editor/veMain.lua
local txtSize = im.CalcTextSize("FPS: 999 ").y + im.CalcTextSize("GpuWait: 00.0f ").y + im.CalcTextSize("Poly: 123456789").y
im.SetCursorPosX(im.GetCursorPosX() + im.GetContentRegionAvailWidth() - txtSize*4)
@/lua/ge/extensions/editor/sceneTree.lua
local helpIconWidth = 24
local searchFilterWidth = imgui.GetContentRegionAvailWidth() - (filterTypeComboWidth + 2 * (searchRangeIconWidth + helpIconWidth) * imgui.uiscale[0] + 2 * style.ItemSpacing.x)
@/lua/ge/extensions/editor/dynamicDecals/inspector.lua
im.SameLine()
im.PushItemWidth(im.GetContentRegionAvailWidth())
im.InputText(string.format("##uid_%s", widgetId), editor.getTempCharPtr(layer.uid), nil, im.InputTextFlags_ReadOnly)
im.SameLine()
im.PushItemWidth(im.GetContentRegionAvailWidth())
im.InputText(string.format("##type_%s", widgetId), editor.getTempCharPtr(string.format("%s Layer", helper.splitAndCapitalizeCamelCase(api.layerTypesMap[layer.type]))), nil, im.InputTextFlags_ReadOnly)
local function documentationGui(docsSection)
im.PushTextWrapPos(im.GetContentRegionAvailWidth())
im.TextUnformatted([[
@/lua/ge/extensions/editor/dynamicDecals/layerStack.lua
local p1 = im.ImVec2(wpos.x + cpos.x, wpos.y + cpos.y - tool.getMainScrollY())
local p2 = im.ImVec2(wpos.x + cpos.x + im.GetContentRegionAvailWidth(), wpos.y + cpos.y + layerDropHeight - tool.getMainScrollY())
im.ImDrawList_AddRect(im.GetWindowDrawList(), p1, p2, im.GetColorU322(editor.getTempImVec4_TableTable(colorTbl or {1,1,1,1})))
im.PushItemWidth(im.GetContentRegionAvailWidth() - 4 * tool.getIconSize() - 5 * im.GetStyle().ItemSpacing.x)
editor.uiInputText(
im.SameLine()
im.SetCursorPosX(im.GetCursorPosX() + (im.GetContentRegionAvailWidth() - (tool.getIconSize() * im.uiscale[0])))
if editor.uiIconImageButton(layer.enabled and editor.icons.visibility or editor.icons.visibility_off, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, string.format("##enabled_%s_%s", guiId, layer.uid)) then
local textWidth = im.CalcTextSize(text).x
im.SetCursorPosX(im.GetCursorPosX() + im.GetContentRegionAvailWidth() - textWidth)
im.TextColored(editor.color.warning.Value, text)
im.SameLine()
if im.GetContentRegionAvailWidth() <= (im.GetStyle().ItemSpacing.x + 2*im.GetStyle().FramePadding.x + im.CalcTextSize("Add Texture Fill Layer").x - im.GetStyle().WindowPadding.x) then
im.NewLine()
im.SameLine()
if im.GetContentRegionAvailWidth() <= (im.GetStyle().ItemSpacing.x + 2*im.GetStyle().FramePadding.x + im.CalcTextSize("Add Group").x - im.GetStyle().WindowPadding.x) then
im.NewLine()
im.SameLine()
if im.GetContentRegionAvailWidth() <= (im.GetStyle().ItemSpacing.x + 2*im.GetStyle().FramePadding.x + im.CalcTextSize("Add Linked Set Layer").x - im.GetStyle().WindowPadding.x) then
im.NewLine()
if im.GetContentRegionAvailWidth() < im.CalcTextSize(layerCountText).x then
im.NewLine()
local topLayerTextSize = im.CalcTextSize(topLayerText)
im.SetCursorPosX(im.GetCursorPosX() + im.GetContentRegionAvailWidth() / 2 - topLayerTextSize.x / 2)
im.TextUnformatted(topLayerText)
local bottomLayerTextSize = im.CalcTextSize(bottomLayerText)
im.SetCursorPosX(im.GetCursorPosX() + im.GetContentRegionAvailWidth() / 2 - bottomLayerTextSize.x / 2)
im.TextUnformatted(bottomLayerText)
local bottomLayerTextSize = im.CalcTextSize(bottomLayerText)
im.SetCursorPosX(im.GetCursorPosX() + im.GetContentRegionAvailWidth() / 2 - bottomLayerTextSize.x / 2)
im.TextUnformatted(bottomLayerText)
local topLayerTextSize = im.CalcTextSize(topLayerText)
im.SetCursorPosX(im.GetCursorPosX() + im.GetContentRegionAvailWidth() / 2 - topLayerTextSize.x / 2)
im.TextUnformatted(topLayerText)
local function documentationGui(docsSection)
im.PushTextWrapPos(im.GetContentRegionAvailWidth())
im.TextUnformatted([[
@/lua/ge/extensions/editor/api/gui.lua
end
imgui.SetCursorPosX(imgui.GetCursorPosX() + imgui.GetContentRegionAvailWidth() - imgui.CalcTextSize(string_label).x + ((offset) and offset or 0))
imgui.TextUnformatted(string_label)
end
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
local style = imgui.GetStyle()
local width = imgui.GetContentRegionAvailWidth() - style.ItemSpacing.x
res = uiInputFloatEx_componentInput(v, 0, id .. "_xcomponent", addStepButtons, step, step_fast, format, intermediate, editEnded, width)
local style = imgui.GetStyle()
local width = (imgui.GetContentRegionAvailWidth() - style.ItemSpacing.x) / 2
local intermediate = flags ~= nil and (bit.band(flags, InputFloat_IndeterminateX) == InputFloat_IndeterminateX)
local style = imgui.GetStyle()
local width = (imgui.GetContentRegionAvailWidth() - style.ItemSpacing.x) / 3
local intermediate = flags ~= nil and (bit.band(flags, InputFloat_IndeterminateX) == InputFloat_IndeterminateX)
local style = imgui.GetStyle()
local width = (imgui.GetContentRegionAvailWidth() - style.ItemSpacing.x) / 4
local intermediate = flags ~= nil and (bit.band(flags, InputFloat_IndeterminateX) == InputFloat_IndeterminateX)
@/lua/ge/extensions/editor/trafficManager.lua
local function tabVehicleSelector()
local availWidth = im.GetContentRegionAvailWidth()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if im.BeginCombo("##trafficManagerSignalController", currInstance.description or "(None)") then
if currInstance.tempSignalObjects[1] then
local columnWidth = im.GetContentRegionAvailWidth() * 0.25
im.Columns(4, "signalObjects", false)
@/lua/ge/extensions/flowgraph/nodes/vehicle/customPartsConfigProvider.lua
if im.TreeNode2(field..'tree',name..' ('..#self.sortedKeys[field]..' Items)') then
if im.Button("Sort", im.ImVec2(im.GetContentRegionAvailWidth(),0)) then
self:sortKeys()
local keyText = im.ArrayChar(128, key)
im.PushItemWidth(im.GetContentRegionAvailWidth())
if im.InputText("##inputKeyPart" .. i .. field, keyText, nil, im.InputTextFlags_EnterReturnsTrue) then
im.NextColumn()
im.PushItemWidth(im.GetContentRegionAvailWidth()-20)
if tpe == 'string' then
self._keyText = self._keyText or im.ArrayChar(128, "")
im.PushItemWidth(im.GetContentRegionAvailWidth())
im.InputText("##AddKeyPart", self._keyText)
im.NextColumn()
im.PushItemWidth(im.GetContentRegionAvailWidth()-20)
if tpe == 'string' then
@/lua/ge/extensions/editor/dynamicDecals/loadSave.lua
local function documentationGui(docsSection)
im.PushTextWrapPos(im.GetContentRegionAvailWidth())
im.TextUnformatted([[
@/lua/ge/extensions/editor/preferences.lua
imgui.NextColumn()
imgui.PushItemWidth(imgui.GetContentRegionAvailWidth())
importExportUi(cat.name)
imgui.Spacing(imgui.ImVec2(0, 0))
local prefWindowCurrWidth = imgui.GetContentRegionAvailWidth();
imgui.SameLine(prefWindowCurrWidth - 150 * imgui.uiscale[0])
@/lua/ge/extensions/editor/missionEditor/previewChecker.lua
local size = vec3(self.previewImage.size.x, self.previewImage.size.y, 0)
if size.x > im.GetContentRegionAvailWidth() then
size = size * im.GetContentRegionAvailWidth() / size.x
if size.x > im.GetContentRegionAvailWidth() then
size = size * im.GetContentRegionAvailWidth() / size.x
end
size = vec3(self.thumbImage.size.x, self.thumbImage.size.y, 0)
if size.x > im.GetContentRegionAvailWidth() then
size = size * im.GetContentRegionAvailWidth() / size.x
if size.x > im.GetContentRegionAvailWidth() then
size = size * im.GetContentRegionAvailWidth() / size.x
end
@/lua/ge/extensions/editor/decalEditor.lua
local positionSliderEditEnded = im.BoolPtr(false)
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiDragFloat3(string.format("##pos_%d_%s", selectedInstance.id, label), position, 0.1, minFloatValue, maxFloatValue,
im.NextColumn()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiInputFloat3(string.format("##rot_%d_%s", selectedInstance.id, label), input4FloatValue, "%.1f", im.InputTextFlags_EnterReturnsTrue, nil) then
local originalSize = size[0]
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiInputFloat(string.format("##size_%d_%s", selectedInstance.id, label), size, 0.1, 1.0, "%0." .. editor.getPreference("ui.general.floatDigitCount") .. "f", nil) then
@/lua/ge/extensions/editor/fileDialog.lua
im.Columns(1, "FilePreviewColumns")
local maxImageSize = (im.GetContentRegionAvailWidth() - 2) > maxFilePreviewSize and maxFilePreviewSize or (im.GetContentRegionAvailWidth() - 2)
local ratio = imgSize.x / imgSize.y
im.Columns(1, "FilePreviewColumns")
local maxImageSize = (im.GetContentRegionAvailWidth() - 2) > maxFilePreviewSize and maxFilePreviewSize or (im.GetContentRegionAvailWidth() - 2)
local ratio = imgSize.x / imgSize.y
im.SameLine()
im.SetCursorPosX(im.GetCursorPosX() + im.GetContentRegionAvailWidth() - (25 * im.uiscale[0]))
if editor.uiIconImageButton(editor.icons.create_new_folder, im.ImVec2(25 * im.uiscale[0], 25 * im.uiscale[0])) then
im.SameLine()
local itemWidth = im.GetContentRegionAvailWidth() - (buttonsAreaMaxWidth + buttonsAreaMaxWidth) * im.uiscale[0]
itemWidth = itemWidth > filenameTextInputMinWidth and itemWidth or filenameTextInputMinWidth
im.SameLine()
local itemWidth = (im.GetContentRegionAvailWidth() - buttonsAreaMaxWidth * im.uiscale[0])
itemWidth = itemWidth > filetypeComboMaxWidth and filetypeComboMaxWidth or
@/lua/ge/extensions/editor/dynamicDecals/inspector/utils.lua
local function decalTextureWidgetInspect(layer, property, guiId, removeTextureOverridePath)
im.PushItemWidth(im.GetContentRegionAvailWidth() - 2 * tool.getIconSize() - 2 * im.GetStyle().ItemSpacing.x)
im.InputText(string.format("##%s_%s_%s_%s", layer.uid, guiId, propert, "texturePath"), editor.getTempCharPtr(layer[property]), nil, im.InputTextFlags_ReadOnly)
local imgWidthSetting = editor.getPreference("dynamicDecalsTool.inspector.texturePreviewSize")
local imgWidth = imgWidthSetting > im.GetContentRegionAvailWidth() and im.GetContentRegionAvailWidth() or imgWidthSetting
local imgHeight = img.path == "/" and imgWidth or imgWidth * img.size.y / img.size.x
local imgWidthSetting = editor.getPreference("dynamicDecalsTool.inspector.texturePreviewSize")
local imgWidth = imgWidthSetting > im.GetContentRegionAvailWidth() and im.GetContentRegionAvailWidth() or imgWidthSetting
local imgHeight = img.path == "/" and imgWidth or imgWidth * img.size.y / img.size.x
local size = im.GetContentRegionAvailWidth() / 2 > 256 and 256 or im.GetContentRegionAvailWidth() / 2
local size = im.GetContentRegionAvailWidth() / 2 > 256 and 256 or im.GetContentRegionAvailWidth() / 2
@/lua/ge/extensions/editor/terrainEditor.lua
if not terrainBlock then return end
im.PushItemWidth(im.GetContentRegionAvailWidth())
if im.BeginCombo("##availableMaterials", "") then
im.PushTextWrapPos(im.GetContentRegionAvailWidth())
im.TextColored(editor.color.warning.Value, "Warning: This action may take a while. BeamNG will not be responsive during this time.")
if im.TreeNodeEx1("Material Preview", im.TreeNodeFlags_DefaultOpen) then
local size = im.GetContentRegionAvailWidth()
size = size > editor.getPreference("terrainEditor.general.maxMaterialPreviewSize") and editor.getPreference("terrainEditor.general.maxMaterialPreviewSize") or size
local remainingW = im.GetContentRegionAvailWidth() - (var.style.ItemSpacing.x + btnHeight * im.uiscale[0] + 10)
im.Selectable1(
im.SetCursorPosX(bottomButtonPosX)
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
im.SameLine()
im.PushItemWidth(im.GetContentRegionAvailWidth())
im.InputText('##TerrainName', terrainImpExp.terrainName)
im.SameLine()
im.PushItemWidth(im.GetContentRegionAvailWidth())
im.InputFloat('##MetersPerPixel', terrainImpExp.metersPerPixel, 0.1, 1, "%.1f")
im.SameLine()
im.PushItemWidth(im.GetContentRegionAvailWidth())
im.InputFloat('##MaxHeight', terrainImpExp.heightScale, 1, 5, "%.1f")
im.TextUnformatted("Height Map Image:")
local inputTextWidth = im.GetContentRegionAvailWidth() - (var.inputWidgetHeight or 24) - var.style.ItemSpacing.x
im.PushItemWidth(inputTextWidth)
im.PushStyleColor2(im.Col_Button, clr)
local btnWidth = im.GetContentRegionAvailWidth() - (var.channelComboWidth + var.materialComboWidth + 2*var.style.ItemSpacing.x)
if im.Button(map.path, im.ImVec2(btnWidth, var.inputWidgetHeight)) then
im.SameLine()
im.SetCursorPosX(im.GetCursorPosX() + im.GetContentRegionAvailWidth() - (var.channelComboWidth + var.materialComboWidth + var.style.ItemSpacing.x))
im.PushItemWidth(var.materialComboWidth)
im.SameLine()
local inputPosWidth = (im.GetContentRegionAvailWidth() - 2 * var.style.ItemInnerSpacing.x) / 3
im.PushItemWidth(inputPosWidth)
im.TextUnformatted("Export path:")
local inputTextWidth = im.GetContentRegionAvailWidth() - var.inputWidgetHeight - var.style.ItemSpacing.x
im.PushItemWidth(inputTextWidth)
if editor.uiButtonRightAlign("Default", nil, true, "brushSoftnessCurve", (var.sc_curveWidgetSize - im.GetContentRegionAvailWidth()) - (im.CalcTextSize("Reset").x + var.style.ItemSpacing.x + 2*var.style.FramePadding.x) + textWidthLeftBound) then
brushSoftnessCurve_Default()
if editor.uiButtonRightAlign("Reset", nil, true, "brushSoftnessCurve", var.sc_curveWidgetSize - im.GetContentRegionAvailWidth() + textWidthLeftBound) then
brushSoftnessCurve_Reset()
im.TextUnformatted("Inside")
editor.uiTextUnformattedRightAlign("Outside", true, var.sc_curveWidgetSize - im.GetContentRegionAvailWidth() + textWidthLeftBound)
im.SetCursorPosY(im.GetCursorPosY() + 2*var.style.ItemSpacing.y)
end
if editor.uiButtonRightAlign("Ok", im.ImVec2(0.5*((var.sc_curveWidgetSize + textWidthLeftBound)-var.style.ItemSpacing.x),var.inputWidgetHeight), true, "brushSoftnessCurve", var.sc_curveWidgetSize - im.GetContentRegionAvailWidth() + textWidthLeftBound) then
brushSoftnessCurve_Accept()
@/lua/ge/extensions/editor/missionEditor/setupModules.lua
if veh.setRangebox then table.insert(diffSetupText,"Rangebox to Low") end
im.SetNextItemWidth(im.GetContentRegionAvailWidth())
if im.BeginCombo("##setupdiff", diffSetupCount .. " / " .. 5 .. " (" .. table.concat( diffSetupText, ", " )..")") then
@/lua/ge/extensions/editor/missionEditor/additionalAttributes.lua
im.NextColumn()
im.PushItemWidth(im.GetContentRegionAvailWidth() - 35)
editor.uiInputText("##author", self.authorInput, 1024, nil, nil, nil, editEnded)
local isAuto = eh and eh.autoAdditionalAttributes[attKey]
im.PushItemWidth(im.GetContentRegionAvailWidth())
if isAuto then im.BeginDisabled() end
editEnded = im.BoolPtr(false)
im.PushItemWidth(im.GetContentRegionAvailWidth() - 35)
editor.uiInputText("##groupId", self.groupIdInput, 1024, nil, nil, nil, editEnded)
editEnded = im.BoolPtr(false)
im.PushItemWidth(im.GetContentRegionAvailWidth() - 35)
editor.uiInputText("##GeneralName", self.groupLabelInput, 2048, nil, nil, nil, editEnded)
@/lua/ge/extensions/editor/dynamicDecals/vehicleColorPalette.lua
im.SameLine()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiSliderFloat(string.format("##VehicleColorPalette%d_Metallic_%s", id, guiId), editor.getTempFloat_NumberNumber(tonumber(metallicPaintData[1])), 0.0, 1.0, "%.2f") then
im.SameLine()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiSliderFloat(string.format("##VehicleColorPalette%d_Roughness_%s", id, guiId), editor.getTempFloat_NumberNumber(tonumber(metallicPaintData[2])), 0.0, 1.0, "%.2f") then
im.SameLine()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiSliderFloat(string.format("##VehicleColorPalette%d_ClearCoat_%s", id, guiId), editor.getTempFloat_NumberNumber(tonumber(metallicPaintData[3])), 0.0, 1.0, "%.2f") then
im.SameLine()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiSliderFloat(string.format("##VehicleColorPalette%d_ClearCoatRoughness_%s", id, guiId), editor.getTempFloat_NumberNumber(tonumber(metallicPaintData[4])), 0.0, 1.0, "%.2f") then
im.SameLine()
im.PushItemWidth(im.GetContentRegionAvailWidth() - (im.GetStyle().ItemSpacing.x + tool.getIconSize()))
if im.ColorEdit3("##VehicleColorPaletteColor0_" .. guiId, editor.getTempFloatArray3_TableTable({color.x, color.y, color.z})) then
im.SameLine()
im.PushItemWidth(im.GetContentRegionAvailWidth() - (im.GetStyle().ItemSpacing.x + tool.getIconSize()))
if im.ColorEdit3("##VehicleColorPaletteColor1_" .. guiId, editor.getTempFloatArray3_TableTable({color.x, color.y, color.z})) then
im.SameLine()
im.PushItemWidth(im.GetContentRegionAvailWidth() - (im.GetStyle().ItemSpacing.x + tool.getIconSize()))
if im.ColorEdit3("##VehicleColorPaletteColor2_" .. guiId, editor.getTempFloatArray3_TableTable({color.x, color.y, color.z})) then
im.SameLine()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiInputText(string.format("##LoadVehicleColorPalette_paletteName_InputWidget_%d%s", k, guiId), editor.getTempCharPtr(palette.name), nil, im.InputTextFlags_AutoSelectAll, nil, nil, editor.getTempBool_BoolBool(false)) then
local function documentationGui(docsSection)
im.PushTextWrapPos(im.GetContentRegionAvailWidth())
im.TextUnformatted([[
@/lua/ge/extensions/editor/flowgraph/projectSettings.lua
im.NextColumn()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if im.InputText("##projectName", self.mgrNameField,64) then
local editEnded = im.BoolPtr(false)
if editor.uiInputTextMultiline('##prDesc', textinput, 512,im.ImVec2(im.GetContentRegionAvailWidth(),100), nil, nil, nil, editEnded) then
self.mgr.description = ffi.string(textinput)
im.NextColumn()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if im.InputText("##authors", self.mgrAuthorField,128) then
im.NextColumn()
im.PushItemWidth(im.GetContentRegionAvailWidth() - 100)
editEnded = im.BoolPtr(false)
@/lua/ge/extensions/editor/rendererComponents.lua
else
im.PushItemWidth(im.GetContentRegionAvailWidth())
if im.SliderFloat("##" .. field.identifier, getTempFloat(value), field.clampMin or 0, field.clampMax or 100, field.format or "%.3f") then
else
im.PushItemWidth(im.GetContentRegionAvailWidth())
if im.ColorEdit3("##" .. field.identifier, getTempFloatArray3(value), im.flags(im.ColorEditFlags_HDR, im.ColorEditFlags_Float)) then
else
im.PushItemWidth(im.GetContentRegionAvailWidth())
if im.ColorEdit4("##" .. field.identifier, getTempFloatArray4(value), im.flags(im.ColorEditFlags_HDR, im.ColorEditFlags_Float)) then
tempBoolPtr[0] = false
im.PushItemWidth(im.GetContentRegionAvailWidth() + (widthMod or 0))
editor.uiInputText(
im.Columns(4)
local buttonSize = im.ImVec2(im.GetContentRegionAvailWidth(), 42)
if im.Button("Load Preset...", buttonSize) then
@/lua/common/extensions/ui/flowgraph/editor.lua
im.PushID1("VariablesColumns")
local totalWidth = im.GetContentRegionAvailWidth()
self.configName = self.configName or ""
local availWidth = im.GetContentRegionAvailWidth()
local scale = editor.getPreference("ui.general.scale")
im.NextColumn()
im.PushItemWidth(im.GetContentRegionAvailWidth() - 28)
if im.BeginCombo("##vehType" .. dumps(self.id), self.vehType) then
im.NextColumn()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if im.BeginCombo("##models" .. dumps(self.id), self.modelName .. " [" .. self.model .. "]") then
if self.configs and self.configs ~= {} then
im.PushItemWidth(im.GetContentRegionAvailWidth())
if im.BeginCombo("##configs" .. dumps(self.id), self.configName .. " [" .. self.config .. "]") then
--end
im.SetNextItemWidth(im.GetContentRegionAvailWidth())
if im.InputText("##searchVehicles", vehSearchTxt, nil, im.InputTextFlags_AutoSelectAll) then
for _, result in ipairs(vehSearchResults) do
im.BeginChild1(result.id, im.ImVec2(im.GetContentRegionAvailWidth(), 20 * editor.getPreference("ui.general.scale")))
local cPos = im.GetCursorScreenPos()
@/lua/ge/extensions/flowgraph/nodes/logic/booleanExpression.lua
end
im.PushItemWidth(im.GetContentRegionAvailWidth()-25)
if im.BeginCombo("##templateExpressions", currentTemplate and currentTemplate.name or "Custom Expression") then
@/lua/ge/extensions/editor/biomeTool.lua
if errCode == 0 then
imgui.ProgressBar(progressPercent, imgui.ImVec2(imgui.GetContentRegionAvailWidth(), 0), string.format("%d%%", progressPercent * 100))
end
if errCode == 0 then
imgui.ProgressBar(progressPercent, imgui.ImVec2(imgui.GetContentRegionAvailWidth(), 0), string.format("%d%%", progressPercent * 100))
end
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)
local shouldWrap = false
if imgui.GetContentRegionAvailWidth() < 720 then
shouldWrap = true
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)
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
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
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
local shouldWrap = false
if imgui.GetContentRegionAvailWidth() < 720 then
shouldWrap = true
if errCode == 0 then
imgui.ProgressBar(progressPercent, imgui.ImVec2(imgui.GetContentRegionAvailWidth(), 0), string.format("%d%%", progressPercent * 100))
end
@/lua/ge/extensions/editor/missionEditor.lua
im.NextColumn()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiInputText("##NameNewMission", newMissionData.name, 1024) and newMissionData.autoId then
im.NextColumn()
im.PushItemWidth(im.GetContentRegionAvailWidth()-26*scale)
if editor.uiInputText("##idNewMission", newMissionData.id, 1024) then
im.NextColumn()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if im.BeginCombo('##MissionType',newMissionData.type) then
im.BeginChild1("MissionEditorGroupFilterChild", im.ImVec2(300,200))
im.PushItemWidth(im.GetContentRegionAvailWidth())
if im.BeginCombo("##GroupMissions", "Grouping: " .. grouping.mode) then
@/lua/ge/extensions/editor/dynamicDecals/widgets.lua
im.PushItemWidth(im.GetContentRegionAvailWidth())
if im.InputInt(widgetId, editor.getTempInt_NumberNumber(baseProp.getMod and baseProp.getMod(value) or value), 1, 10) then
im.PushItemWidth(im.GetContentRegionAvailWidth())
if im.SliderInt(widgetId, editor.getTempInt_NumberNumber(baseProp.getMod and baseProp.getMod(value) or value), baseProp.min, baseProp.max) then
im.PushItemWidth(im.GetContentRegionAvailWidth())
if im.DragInt(widgetId, editor.getTempInt_NumberNumber(baseProp.getMod and baseProp.getMod(value) or value), baseProp.dragSpeed, baseProp.min, baseProp.max) then
im.PushItemWidth(im.GetContentRegionAvailWidth() + (widgetOptions.widthMod and widgetOptions.widthMod or 0))
if im.Combo2(widgetId, editor.getTempInt_NumberNumber(baseProp.getMod and baseProp.getMod(value) or value), options) then
im.PushItemWidth(im.GetContentRegionAvailWidth() + (widgetOptions.widthMod or 0))
if im.InputFloat(widgetId, editor.getTempFloat_NumberNumber(baseProp.getMod and baseProp.getMod(value) or value), 1, 10, baseProp.format) then
im.PushItemWidth(im.GetContentRegionAvailWidth() + (widgetOptions.widthMod or 0))
if im.SliderFloat(widgetId, editor.getTempFloat_NumberNumber(baseProp.getMod and baseProp.getMod(value) or value), baseProp.min, baseProp.max, baseProp.format) then
end
im.PushItemWidth(im.GetContentRegionAvailWidth() + (widgetOptions.widthMod or 0))
if im.DragFloat(widgetId, editor.getTempFloat_NumberNumber(baseProp.getMod and baseProp.getMod(value) or value), baseProp.dragSpeed, baseProp.min, baseProp.max, baseProp.format) then
local width = (im.GetContentRegionAvailWidth() - im.GetStyle().ItemSpacing.x) / 2
im.PushItemWidth(width)
local width = (im.GetContentRegionAvailWidth() - im.GetStyle().ItemSpacing.x) / 2
im.PushItemWidth(width)
local width = (im.GetContentRegionAvailWidth() - im.GetStyle().ItemSpacing.x) / 2
im.PushItemWidth(width)
local width = (im.GetContentRegionAvailWidth() - 2 * im.GetStyle().ItemSpacing.x + (widgetOptions.widthMod and widgetOptions.widthMod or 0)) / 3
im.PushItemWidth(width)
im.PushItemWidth(im.GetContentRegionAvailWidth())
if im.ColorEdit3(widgetId, editor.getTempFloatArray3_TableTable(value)) then
local width = (im.GetContentRegionAvailWidth() - 3 * im.GetStyle().ItemSpacing.x) / 4
im.PushItemWidth(width)
im.PushItemWidth(im.GetContentRegionAvailWidth())
if im.ColorEdit4(widgetId, editor.getTempFloatArray4_TableTable(value)) then
im.PushItemWidth(im.GetContentRegionAvailWidth())
if im.InputText(widgetId, editor.getTempCharPtr(value), nil, im.InputTextFlags_AutoSelectAll) then
if im.InputTextMultiline(widgetId, editor.getTempCharPtr(value), nil, im.ImVec2(im.GetContentRegionAvailWidth(), 120)) then
property.value = editor.getTempCharPtr()
im.PushItemWidth(im.GetContentRegionAvailWidth() - (im.GetStyle().ItemSpacing.x + tool.getIconSize()))
im.InputText(widgetId, editor.getTempCharPtr(value), nil, im.InputTextFlags_ReadOnly)
im.PushItemWidth(im.GetContentRegionAvailWidth())
local val = {value[1] / 255, value[2] / 255, value[3] / 255, value[4] / 255}
im.PushItemWidth(im.GetContentRegionAvailWidth() - (im.GetStyle().ItemSpacing.x + tool.getIconSize()))
im.InputText(widgetId, editor.getTempCharPtr(value), nil, im.InputTextFlags_ReadOnly)
local inputPosX = im.GetCursorPosX()
im.PushItemWidth(im.GetContentRegionAvailWidth() - (im.GetStyle().ItemSpacing.x + tool.getIconSize()))
im.InputText(widgetId, editor.getTempCharPtr(value), nil, im.InputTextFlags_ReadOnly)
local imgWidthSetting = editor.getPreference("dynamicDecalsTool.widgets.texturePreviewSize")
local imgWidth = imgWidthSetting > im.GetContentRegionAvailWidth() and im.GetContentRegionAvailWidth() or imgWidthSetting
local imgHeight = img.path == "/" and imgWidth or imgWidth * img.size.y / img.size.x
local imgWidthSetting = editor.getPreference("dynamicDecalsTool.widgets.texturePreviewSize")
local imgWidth = imgWidthSetting > im.GetContentRegionAvailWidth() and im.GetContentRegionAvailWidth() or imgWidthSetting
local imgHeight = img.path == "/" and imgWidth or imgWidth * img.size.y / img.size.x
-- right align
im.SetCursorPosX(im.GetContentRegionAvailWidth() - (imgWidth))
local prefSize = editor.getPreference("dynamicDecalsTool.widgets.multiColorWidgetWidth")
local maxSize = im.GetContentRegionAvailWidth() - (2 * im.GetStyle().ItemSpacing.x + 2 * math.ceil(im.GetFontSize()))
local size = prefSize > maxSize and maxSize or prefSize
local p1 = im.ImVec2(wpos.x + startCursorPos.x - scrollX - style.ItemSpacing.x / 2, wpos.y + startCursorPos.y - scrollY)
local p2 = im.ImVec2(wpos.x + endCursorPos.x - scrollX + im.GetContentRegionAvailWidth() + style.ItemSpacing.x / 2, wpos.y + endCursorPos.y - scrollY)
im.ImDrawList_AddRect(im.GetWindowDrawList(), p1, p2, im.GetColorU322(editor.color.beamng.Value), nil, nil, 2)
@/lua/ge/extensions/editor/inspector.lua
local uvValueWidgetWidth = 2*imgui.GetContentRegionAvailWidth()/16
imgui.PushItemWidth(uvValueWidgetWidth)
for propertyIndex = 0, 3 do
imgui.PushItemWidth(imgui.GetContentRegionAvailWidth() - imgui.CalcTextSize(metallicLabels[3]).x)
if editor.getPreference("ui.general.useSlidersInInspector") then
local buttonSize = imgui.GetFontSize() / imgui.uiscale[0]
local uvValueWidgetWidth = imgui.GetContentRegionAvailWidth() - buttonSize * imgui.uiscale[0]
@/lua/ge/extensions/editor/missionEditor/layers.lua
im.tooltip("Mission will try to find files in each of these folders, until it finds a matching file.")
local width = im.GetContentRegionAvailWidth()
im.Columns(2)
@/lua/ge/extensions/editor/api/valueInspector.lua
imgui.SameLine()
imgui.PushItemWidth(imgui.GetContentRegionAvailWidth())
comboMenuOpen = false
local startX = windowPos.x + cursorPos.x + 2 * imgui.uiscale[0]
local elementWidth = (imgui.GetContentRegionAvailWidth() - style.ItemSpacing.x) / 3
imgui.NextColumn()
imgui.PushItemWidth(imgui.GetContentRegionAvailWidth())
imgui.SameLine()
imgui.PushItemWidth(imgui.GetContentRegionAvailWidth())
if fieldValue ~= nil then
imgui.SameLine()
imgui.PushItemWidth(imgui.GetContentRegionAvailWidth())
if imgui.BeginCombo(fieldNameId, fieldValue, imgui.ComboFlags_HeightLargest) then
imgui.PushItemWidth(imgui.GetContentRegionAvailWidth())
local changed = editor.uiInputText(fieldNameId, self.inputTextValue, imgui.ArraySize(self.inputTextValue), nil, nil, nil, self.editEnded)
@/lua/ge/extensions/gameplay/missions/missionTypes/editorHelper.lua
label(e)
im.PushItemWidth(im.GetContentRegionAvailWidth())
editEnded[0] = im.InputFloat('##'..e.fieldName, e.ptr, 1, 5, nil, im.InputTextFlags_EnterReturnsTrue)
local width = im.GetContentRegionAvailWidth() - (hasTranslate and 35 or 0) - (hasDropdown and 45 or 0) - (hasTranslate and hasDropdown and 10 or 0)
end
im.BeginChild1("LB",im.ImVec2(im.GetContentRegionAvailWidth()*0.66, 62), true)
im.Columns(3)
local separatorDummySize = im.ImVec2(0,5)
local function decoSeparatorDraw(e, mtd) im.Dummy(separatorDummySize) im.ImDrawList_AddLine(im.GetWindowDrawList(), im.GetCursorScreenPos(), im.ImVec2(im.GetCursorScreenPos().x+im.GetContentRegionAvailWidth(), im.GetCursorScreenPos().y), separatorColor, 1) im.Dummy(separatorDummySize) end
local function decoDummyDraw(e, mtd) im.Dummy(im.ImVec2(0,e.height)) end
@/lua/ge/extensions/editor/dynamicDecals/layerTypes/brushStroke.lua
im.NextColumn()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiInputText(
im.NextColumn()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if im.InputFloat3(string.format("##%s_%s_%s", layer.uid, guiId, "camPosition"), editor.getTempFloatArray3_Vec3Vec3(layer.camPosition), "%.6f") then
im.NextColumn()
im.PushItemWidth(im.GetContentRegionAvailWidth() - ((layer.colorPaletteMapId > 0) and (im.GetStyle().ItemSpacing.x + math.ceil(im.GetFontSize()) + 2 * im.GetStyle().FramePadding.y) or 0))
if im.Combo2(string.format("##%s_%s_%s", layer.uid, guiId, "colorpalettemapid"), editor.getTempInt_NumberNumber(layer.colorPaletteMapId), "zero\0one\0two\0three\0\0") then
im.NextColumn()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiColorEdit4(string.format("##%s_%s_%s", layer.uid, guiId, "color"), editor.getTempFloatArray4_TableTable(layer.color:toTable()), nil, editor.getTempBool_BoolBool(false)) then
im.NextColumn()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiSliderFloat3(string.format("##%s_%s_%s", layer.uid, guiId, "decalScale"), editor.getTempFloatArray3_Vec3Vec3(layer.decalScale), 0.05, 6.0, nil, nil, editor.getTempBool_BoolBool(false)) then
im.NextColumn()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiSliderFloat(string.format("##%s_%s_%s", layer.uid, guiId, "decalRotation"), editor.getTempFloat_NumberNumber(layer.decalRotation * 180 / math.pi), 0, 360, nil, nil, editor.getTempBool_BoolBool(false)) then
im.NextColumn()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiSliderFloat2(string.format("##%s_%s_%s", layer.uid, guiId, "decalSkew"), editor.getTempFloatArray2_TableTable({layer.decalSkew.x, layer.decalSkew.y}), -2.0, 2.0, nil, nil, editor.getTempBool_BoolBool(false)) then
im.NextColumn()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiSliderFloat2(string.format("##%s_%s_%s", layer.uid, guiId, "colorTextureScale"), editor.getTempFloatArray2_TableTable({layer.colorTextureScale.x, layer.colorTextureScale.y}), 0.01, 6.0, nil, nil, editor.getTempBool_BoolBool(false)) then
im.NextColumn()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if im.Combo2(string.format("##%s_%s_%s", layer.uid, guiId, "alphaMaskChannel"), editor.getTempInt_NumberNumber(layer.alphaMaskChannel), "red\0green\0blue\0alpha\0\0") then
im.NextColumn()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if im.Combo2(string.format("##%s_%s_%s", layer.uid, guiId, "alphaMaskBlendMode"), editor.getTempInt_NumberNumber(layer.alphaMaskBlendMode), "multiply\0add\0\0") then
im.NextColumn()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiSliderFloat2(string.format("##%s_%s_%s", layer.uid, guiId, "alphaMaskScale"), editor.getTempFloatArray2_TableTable({layer.alphaMaskScale.x, layer.alphaMaskScale.y}), 0.01, 6.0, nil, nil, editor.getTempBool_BoolBool(false)) then
im.NextColumn()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiSliderFloat(string.format("##%s_%s_%s", layer.uid, guiId, "alphaMaskRotation"), editor.getTempFloat_NumberNumber(layer.alphaMaskRotation * 180 / math.pi), 0, 360, nil, nil, editor.getTempBool_BoolBool(false)) then
im.NextColumn()
im.PushItemWidth(im.GetContentRegionAvailWidth())
local val = 0
im.NextColumn()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiInputInt(string.format("##%s_%s_%s", layer.uid, guiId, "interpolationSteps"), editor.getTempInt_NumberNumber(layer.interpolationSteps), 1, 2) then
im.NextColumn()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiSliderFloat(string.format("##%s_%s_%s", layer.uid, guiId, "sdfThickness"), editor.getTempFloat_NumberNumber(layer.sdfThickness), 0.0, 1.0, "%.2f", nil, editor.getTempBool_BoolBool(false)) then
im.NextColumn()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiSliderFloat(string.format("##%s_%s_%s", layer.uid, guiId, "sdfSoftness"), editor.getTempFloat_NumberNumber(layer.sdfSoftness), 0.0, 1.0, "%.2f", nil, editor.getTempBool_BoolBool(false)) then
im.NextColumn()
im.PushItemWidth(im.GetContentRegionAvailWidth())
local sdfOutlineColorTbl = layer.sdfOutlineColor:toTable()
im.NextColumn()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiSliderFloat(string.format("##%s_%s_%s", layer.uid, guiId, "sdfOutlineThickness"), editor.getTempFloat_NumberNumber(layer.sdfOutlineThickness), 0.0, 1.0, "%.2f", nil, editor.getTempBool_BoolBool(false)) then
im.NextColumn()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiSliderFloat(string.format("##%s_%s_%s", layer.uid, guiId, "sdfOutlineSoftness"), editor.getTempFloat_NumberNumber(layer.sdfOutlineSoftness), 0.0, 1.0, "%.2f", nil, editor.getTempBool_BoolBool(false)) then
im.SameLine()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiSliderFloat2(string.format("##%s_%s_%s_%d", layer.uid, guiId, "brushdataPoints_cursorPosScreenUv", k), editor.getTempFloatArray2_TableTable({data.x, data.y}), 0.0, 1.0, nil, nil, editor.getTempBool_BoolBool(false)) then
local function documentationGui(docsSection)
im.PushTextWrapPos(im.GetContentRegionAvailWidth())
im.TextUnformatted([[
@/lua/ge/extensions/editor/assetBrowser.lua
im.SameLine()
if im.GetContentRegionAvailWidth() < childSize.x or (newLine and newLine == true) then
im.NewLine()
im.SameLine()
if im.GetContentRegionAvailWidth() < childSize.x or (newLine and newLine == true) then
im.NewLine()
im.SameLine()
if im.GetContentRegionAvailWidth() < childSize.x then
im.NewLine()
im.SameLine()
if im.GetContentRegionAvailWidth() < childSize.x or (newLine and newLine == true) then
im.NewLine()
im.SameLine()
if im.GetContentRegionAvailWidth() < childSize.x or (newLine and newLine == true) then
im.NewLine()
local cPosStart = im.GetCursorPos()
if im.Button("##" .. group.identifier .. "_CollapsingHeader", im.ImVec2(im.GetContentRegionAvailWidth(), 0)) then
group.open = not group.open
-- Items per row
var.horizontalItems = (childSize == -1) and 1 or getHorizontalItemsCount(childSize.x, im.GetContentRegionAvailWidth())
-- Rows
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)
-- There's not enough space to draw the widget. We rather have no widget instead of having a weird UX
if im.GetContentRegionAvailWidth() < minimumWidgetSize then
return
-- There's limited space, draw a widget that resizes based on the given available width.
elseif im.GetContentRegionAvailWidth() < var.thumbnailSliderGroupWidth then
sliderWidth = im.GetContentRegionAvailWidth() - (2 * var.inputFieldSize + 2 * var.style.ItemSpacing.x)
elseif im.GetContentRegionAvailWidth() < var.thumbnailSliderGroupWidth then
sliderWidth = im.GetContentRegionAvailWidth() - (2 * var.inputFieldSize + 2 * var.style.ItemSpacing.x)
var.thumbnailSliderGroupWidth = 2 * var.style.ItemSpacing.x + 2 * var.inputFieldSize + sliderWidth
end
im.SetCursorPosX((im.GetCursorPosX() + im.GetContentRegionAvailWidth()) - (var.thumbnailSliderGroupWidth))
thumbnailSizeSliderWidget(sliderWidth, true)
local availWidth = im.GetContentRegionAvailWidth()
-- Different stages where we want to truncate or hide some of the widgets/widget groups.
im.TextUnformatted("Material Preview")
local matPreviewSize = im.GetContentRegionAvailWidth()
var.dimRdr:set(0, 0, matPreviewSize, matPreviewSize)
im.TextUnformatted("Preview:")
local width = im.GetContentRegionAvailWidth()
if width > var.options.maxInspectorImagePreviewSize then
local pressed = false
if im.GetContentRegionAvailWidth() > (im.CalcTextSize("Show in ShapeEditor").x + 2 * var.style.FramePadding.x) then
pressed = editor.uiButtonRightAlign("Show in ShapeEditor", nil, true)
if pressed then editor_shapeEditor.showShapeEditorLoadFile(asset.path) end
local size = im.GetContentRegionAvailWidth()
var.meshPreviewDimRdr.point = Point2I(0, 0)
im.NextColumn()
maxWidth = im.GetContentRegionAvailWidth()
local assetName = inspector_selectedAsset.fullFileName or inspector_selectedAsset.name
im.NextColumn()
maxWidth = im.GetContentRegionAvailWidth()
im.TextUnformatted(inspector_selectedAsset.path)
im.NextColumn()
maxWidth = im.GetContentRegionAvailWidth()
im.TextUnformatted(inspector_selectedAsset.filestats.accesstimeString)
im.NextColumn()
maxWidth = im.GetContentRegionAvailWidth()
im.TextUnformatted(inspector_selectedAsset.filestats.createtimeString)
im.NextColumn()
maxWidth = im.GetContentRegionAvailWidth()
im.TextUnformatted(inspector_selectedAsset.filestats.modtimeString)
prefTempBoolPtr[0] = false
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiColorEdit3("##typeColor_" .. typeName, getTempFloatArray3(var.typeColors[typeName]), nil, prefTempBoolPtr) then
@/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/common/extensions/ui/imgui_custom_luaintf.lua
local cursor = M.GetCursorPos()
local width = M.GetContentRegionAvailWidth()
M.BeginGroup()
@/lua/ge/extensions/flowgraph/basenode.lua
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))
@/lua/ge/extensions/editor/dynamicDecals/colorPresets.lua
local function onGui(guiId)
editor.uiInputSearchTextFilter("Texture Filter", searchFilter, im.GetContentRegionAvailWidth())
im.Separator()
im.PushItemWidth(im.GetContentRegionAvailWidth() - (4 * uiIconSize + 5 * im.GetStyle().ItemSpacing.x * im.uiscale[0]) - uiIconSize/2) -- nice hack so buttons are visible when uiscale is above 1.2
im.SameLine()
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})
local function documentationGui(docsSection)
im.PushTextWrapPos(im.GetContentRegionAvailWidth())
im.TextUnformatted([[
@/lua/ge/extensions/editor/camPathEditor.lua
local buttonWidth = (im.GetContentRegionAvailWidth() - 15 * im.uiscale[0]) / 3
local buttonCount = (M.currentPath.replay and M.currentPath.replay ~= '') and 3 or 2
local buttonWidth = (im.GetContentRegionAvailWidth() - (5 * (buttonCount - 1) * im.uiscale[0])) / buttonCount
-- Timing section
local halfWidth = (im.GetContentRegionAvailWidth() - 10 * im.uiscale[0]) * 0.5
-- Camera parameters section
local paramWidth = (im.GetContentRegionAvailWidth() - 10 * im.uiscale[0]) * 0.6
local buttonWidth = (im.GetContentRegionAvailWidth() - 10 * im.uiscale[0]) * 0.4
local paramWidth = (im.GetContentRegionAvailWidth() - 10 * im.uiscale[0]) * 0.6
local buttonWidth = (im.GetContentRegionAvailWidth() - 10 * im.uiscale[0]) * 0.4
-- Moving Start/End in a responsive layout
local checkboxWidth = (im.GetContentRegionAvailWidth() - 10 * im.uiscale[0]) * 0.5
local buttonWidth = (im.GetContentRegionAvailWidth() - 10 * im.uiscale[0]) * 0.5
local checkboxWidth = (im.GetContentRegionAvailWidth() - 10 * im.uiscale[0]) * 0.5
local buttonWidth = (im.GetContentRegionAvailWidth() - 10 * im.uiscale[0]) * 0.5
im.SameLine()
im.PushItemWidth(im.GetContentRegionAvailWidth())
local relativePos = im.FloatPtr(core_replay.getPositionSeconds())
local spacing = 5 * im.uiscale[0]
local availWidth = im.GetContentRegionAvailWidth()
local seekButtonWidth = (availWidth - (spacing * (buttonCount - 1))) / buttonCount
@/lua/ge/extensions/editor/util/searchUtil.lua
im.BeginChild1("##"..string_label.."childCombo", im.ImVec2(im.GetContentRegionAvailWidth(), 140 * (editor and editor.getPreference and editor.getPreference("ui.general.scale") or 1)) )
for _, result in ipairs(self.filtered) do
@/lua/ge/extensions/editor/mainMenu.lua
local txtSize = imgui.CalcTextSize("FPS: 999 ").y + imgui.CalcTextSize("GpuWait: 00.0f ").y + imgui.CalcTextSize("Poly: 123456789").y
imgui.SetCursorPosX(imgui.GetCursorPosX() + imgui.GetContentRegionAvailWidth() - txtSize*4)
if editor.beginWindow(saveLayoutWindowName, saveLayoutWindowTitle) then
imgui.PushItemWidth(imgui.GetContentRegionAvailWidth())
if imgui.InputText("##SaveLayout", layoutName, 128, imgui.InputTextFlags_EnterReturnsTrue) then
@/lua/ge/extensions/editor/dynamicDecals/textures.lua
im.SameLine()
if im.GetContentRegionAvailWidth() < thumbnailSize then
im.NewLine()
local cPos = im.GetCursorPos()
local textSpace = im.GetContentRegionAvailWidth() - (im.GetStyle().ItemSpacing.x + textFilterWidth)
im.PushTextWrapPos(textSpace)
im.NextColumn()
im.SetNextItemWidth(im.GetContentRegionAvailWidth())
if im.Combo2("##dynDecalTexturesInspector_type", editor.getTempInt_NumberNumber(bulkChangeTemplate.type), "greyscale\0color\0sdf\0\0") then
im.NextColumn()
im.SetNextItemWidth(im.GetContentRegionAvailWidth())
if im.Checkbox("##dynDecalTexturesInspector_isSdfCompatible", editor.getTempBool_BoolBool(bulkChangeTemplate.isSdfCompatible)) then
im.NextColumn()
im.SetNextItemWidth(im.GetContentRegionAvailWidth())
if editor.uiInputText(
local img = editor.getTempTextureObj(file)
local maxWidth = im.GetContentRegionAvailWidth()
local cpos = im.GetCursorPos()
im.NextColumn()
im.SetNextItemWidth(im.GetContentRegionAvailWidth())
if im.Combo2("##dynDecalTexturesInspector_type", editor.getTempInt_NumberNumber(selectedTexturesSidecarContent[file].type), "greyscale\0color\0\0") then
im.NextColumn()
im.SetNextItemWidth(im.GetContentRegionAvailWidth())
if im.Checkbox("##dynDecalTexturesInspector_isSdfCompatible", editor.getTempBool_BoolBool(selectedTexturesSidecarContent[file].isSdfCompatible)) then
im.NextColumn()
im.SetNextItemWidth(im.GetContentRegionAvailWidth())
if editor.uiInputText(
local function texturesDocsGui(docsSection)
im.PushTextWrapPos(im.GetContentRegionAvailWidth())
im.TextUnformatted([[
@/lua/ge/extensions/editor/dynamicDecals/fonts.lua
im.SameLine()
if im.GetContentRegionAvailWidth() < previewSize then
im.NewLine()
im.BeginChild1("FontPreviewAtlasChild")
helper.imageWidget(string.format("%s%s/%s%s", destinationDirectory, getSelectedFontAtlasName(), getSelectedFontAtlasName(), "_monospaced.png"), im.GetContentRegionAvailWidth() - 2 * im.GetStyle().FramePadding.x)
im.EndChild()
im.SameLine()
if im.GetContentRegionAvailWidth() <= (glyphPreviewSize + im.GetStyle().ItemSpacing.x) then
im.NewLine()
im.BeginChild1("FontPreviewSDFAtlasChild")
helper.imageWidget(string.format("%s%s/%s%s", destinationDirectory, getSelectedFontAtlasName(), getSelectedFontAtlasName(), "_sdf_monospaced.png"), im.GetContentRegionAvailWidth() - 2 * im.GetStyle().FramePadding.x)
im.EndChild()
im.SameLine()
if im.GetContentRegionAvailWidth() <= (glyphPreviewSize + im.GetStyle().ItemSpacing.x) then
im.NewLine()
im.SameLine()
im.PushItemWidth(im.GetContentRegionAvailWidth() - (im.GetStyle().ItemSpacing.x + im.CalcTextSize("Preview").x + 2 * im.GetStyle().FramePadding.x))
if #generatedFontAtlases == 0 then im.BeginDisabled() end
im.SameLine()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if im.Combo1("##selectedGlyphForPreview", editor.getTempInt_NumberNumber(selectedGlyphId), glyphCharPtr) then
im.TextUnformatted("Font Path")
im.PushItemWidth(im.GetContentRegionAvailWidth() - 1 * tool.getIconSize() - 1 * im.GetStyle().ItemSpacing.x)
im.InputText("##fontPath_InputText", editor.getTempCharPtr(fontPath), nil, im.InputTextFlags_ReadOnly)
im.SameLine()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if im.InputFloat("##fontAtlasGlyphPixelHeight", editor.getTempFloat_NumberNumber(glyphPixelHeight), 1, 10, "%.0f") then
@/lua/ge/extensions/editor/missionEditor/objectives.lua
end
im.PushItemWidth(im.GetContentRegionAvailWidth())
if im.BeginCombo("##sss"..key, currentSlot) then
im.SameLine()
im.PushItemWidth(im.GetContentRegionAvailWidth() -35)
editor.uiInputText("##outroText", buf, 2048, nil, nil, nil, editEnded)
@/lua/ge/extensions/editor/shortcutLegend.lua
-- Center the shortcuts on the bar
local wholeSpace = im.GetContentRegionAvailWidth()
local completeNeededSpace = 0
for _, action in ipairs(compoundedActionInfos) do
local restOfSpace = im.GetContentRegionAvailWidth()
local controlName = prettyNames[action.control] or action.control
@/lua/ge/extensions/flowgraph/nodes/vehicle/special/vehicleAction.lua
self:loadActions('allVehicles', "lua/ge/extensions/core/input/actions/vehicle.json")
im.PushItemWidth(im.GetContentRegionAvailWidth())
if im.BeginCombo("##transformMode" .. self.id, self.action.title, im.ComboFlags_HeightLarge) then
@/lua/ge/extensions/editor/flowgraph/properties.lua
local editEnded = im.BoolPtr(false)
im.PushItemWidth(im.GetContentRegionAvailWidth() - (padRight or 0))
local inputFlags = im.InputTextFlags_EnterReturnsTrue
im.PopItemWidth()
im.PushItemWidth(im.GetContentRegionAvailWidth() - (padRight or 0) - 30)
if editor.uiInputText("##input" .. path, cdata[path], nil, nil, nil, nil, editEnded) then
im.SameLine()
im.PushItemWidth(im.GetContentRegionAvailWidth()-64)
im.NextColumn()
im.PushItemWidth(im.GetContentRegionAvailWidth())
local textinput = im.ArrayChar(256, tostring(graph.name or ''))
local editEnded = im.BoolPtr(false)
if editor.uiInputTextMultiline('##Description', textinput, 512,im.ImVec2(im.GetContentRegionAvailWidth(),150), nil, nil, nil, editEnded) then
end
@/lua/ge/extensions/editor/shapeEditor.lua
end
im.PushItemWidth(im.GetContentRegionAvailWidth())
if im.SliderInt("##detailLevel", detailLevel, 0, shapePrev:getDetailLevelCount()-1) then
@/lua/ge/extensions/editor/flowgraph/variables.lua
if self:Begin("Variables") then
local totalWidth = im.GetContentRegionAvailWidth()
im.PushFont3("cairo_regular_medium")
im.PopFont()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if im.BeginCombo("##variableTarget","Add to: "..self.targets[self.addVariableSettings.target].name) then
end
local w = im.GetContentRegionAvailWidth()
im.PushItemWidth(w-50)
else
im.PushItemWidth(im.GetContentRegionAvailWidth())
end
im.SameLine()
if im.Button("Create", im.ImVec2(im.GetContentRegionAvailWidth(), -1)) then
acceptCreate = true
local flags = (not variable.expanded) and bit.bor(im.WindowFlags_NoScrollbar, im.WindowFlags_NoScrollWithMouse) or nil
im.BeginChild1(target.id..varName..dumps(global), im.ImVec2(im.GetContentRegionAvailWidth(), scale*(variable.expanded and 68 or 24)+16), true, flags)
local valueText = ui_flowgraph_editor.shortValueString(variable.value, variable.type)
local width = im.GetContentRegionAvailWidth()
local prePos = im.GetCursorPos()
im.PushStyleVar2(im.StyleVar_FramePadding, im.ImVec2(0, 0))
im.BeginChild1(target.id..varName..dumps(global).."clicker", im.ImVec2(im.GetContentRegionAvailWidth()-90*scale, endPos.y-prePos.y+3))
im.EndChild()
local mouseXMin = im.GetCursorScreenPos().x + 10
local mouseXMax = im.GetCursorScreenPos().x + im.GetContentRegionAvailWidth()-10
id = id or target.id
if math.abs(mousePos.y - y) < dragReleaseVerticalDistance and mousePos.x > mouseXMin and mousePos.x < mouseXMax then
im.ImDrawList_AddLine(im.GetWindowDrawList(), im.ImVec2(im.GetCursorScreenPos().x+10, y-1), im.ImVec2(im.GetCursorScreenPos().x+im.GetContentRegionAvailWidth()-20, y-1), lineColor, 3)
if im.IsMouseReleased(0) then
@/lua/ge/extensions/flowgraph/nodes/util/customLua.lua
im.PushItemWidth(im.GetContentRegionAvailWidth())
if im.BeginCombo("##loadNode", "Load from library...") then
local name = im.ArrayChar(256, self.name)
im.PushItemWidth(im.GetContentRegionAvailWidth() - 24 * im.uiscale[0])
editor.uiInputText("##name"..self.id, name, 256, nil, nil, nil, editEnded)
local buff = im.ArrayChar(bufLen, self.code[code] or "")
if editor.uiInputTextMultiline("##"..code..self.id.."/"..self.mgr.id, buff, bufLen, im.ImVec2(im.GetContentRegionAvailWidth(),150), im.InputTextFlags_Multiline, nil, nil, editEnded) then
self.code[code] = ffi.string(buff)
@/lua/ge/extensions/editor/dynamicDecals/browser.lua
local function browserDocsGui(docsSection)
im.PushTextWrapPos(im.GetContentRegionAvailWidth())
im.TextUnformatted([[
@/lua/ge/extensions/editor/flowgraph/welcome.lua
im.BeginGroup()
--im.BeginChild1("##" .. txt, im.ImVec2(im.GetContentRegionAvailWidth(), lowerTxt and 80 or 30), nil, im.WindowFlags_NoScrollWithMouse)
im.TextColored(col, txt)
im.PushStyleColor2(im.Col_Text, im.ImVec4(0.5, 0.5, 0.5, 1))
im.PushTextWrapPos(im.GetCursorPosX() + math.max(minWrap,math.min(im.GetContentRegionAvailWidth(), maxWrap-43)))
im.TextWrapped(lowerTxt)
im.Dummy(im.ImVec2(0, 20))
im.PushTextWrapPos(im.GetCursorPosX() + math.max(minWrap,math.min(im.GetContentRegionAvailWidth(), maxWrap)))
if im.GetContentRegionAvailWidth() > 500 then
im.Image(self.sideImage.texId, self.sideImageSize, im.ImVec2(0, 0), im.ImVec2(1, 1), col)
@/lua/ge/extensions/editor/dynamicDecals/brushes.lua
local size = im.GetContentRegionAvailWidth() / 2 > 256 and 256 or im.GetContentRegionAvailWidth() / 2
local size = im.GetContentRegionAvailWidth() / 2 > 256 and 256 or im.GetContentRegionAvailWidth() / 2
local imageWidth = im.GetContentRegionAvailWidth() / 2 > 256 and 256 or im.GetContentRegionAvailWidth() / 2
if im.TreeNodeEx1("properties##inspectorGuiBrush", im.TreeNodeFlags_DefaultOpen) then
local imageWidth = im.GetContentRegionAvailWidth() / 2 > 256 and 256 or im.GetContentRegionAvailWidth() / 2
if im.TreeNodeEx1("properties##inspectorGuiBrush", im.TreeNodeFlags_DefaultOpen) then
im.SameLine()
if im.GetContentRegionAvailWidth() < thumbnailSize then
im.NewLine()
local cPos = im.GetCursorPos()
local textSpace = im.GetContentRegionAvailWidth() - (im.GetStyle().ItemSpacing.x + textFilterWidth)
im.PushTextWrapPos(textSpace)
@/lua/ge/extensions/gameplay/drift/drift.lua
plotHelperUtil = plotHelperUtil or require('/lua/ge/extensions/editor/util/plotHelperUtil')()
im.BeginChild1("Debug Graph", im.ImVec2(im.GetContentRegionAvailWidth(), 400), true)
for _, historyData in pairs(debugHistories) do
plotHelperUtil:setScale(nil, nil, 0, nil)
plotHelperUtil:draw(im.GetContentRegionAvailWidth(), im.GetContentRegionAvail().y, 400)
@/lua/ge/extensions/editor/multiSpawnManager.lua
im.BeginChild1("Generated Group##editGroup", im.ImVec2(im.GetContentRegionAvailWidth(), 470 * im.uiscale[0]), im.WindowFlags_ChildWindow)
local width1 = 40 * im.uiscale[0]
local width1 = 40 * im.uiscale[0]
local width2 = im.GetContentRegionAvailWidth() - 100 * im.uiscale[0]
if not currGroup.data then currGroup.data = {} end
local width = im.GetContentRegionAvailWidth()
local groupSize = #currGroup.data
im.Dummy(dummy)
if im.Button("Done##customPaint", im.ImVec2(im.GetContentRegionAvailWidth(), 20)) then
editor.closeModalWindow(customPaintWindowName)
im.SameLine()
im.PushItemWidth(im.GetContentRegionAvailWidth())
local currName = commonGroups[options.groupListIdx] and commonGroups[options.groupListIdx].name or "(None)"
@/lua/ge/extensions/editor/util/transformUtil.lua
--self.widgetSettings.width = 350
local width = self.widgetSettings.width or im.GetContentRegionAvailWidth()
local elemCount = (self.allowTranslate and 1 or 0) + (self.allowRotate and 1 or 0) + (self.allowScale and 1 or 0)
@/lua/ge/extensions/editor/mainToolbar.lua
local iconButtonWidth = editor.getDefaultIconButtonSize().x*im.uiscale[0] + 6 + 2*im.GetStyle().FramePadding.x + im.GetStyle().ItemSpacing.x
local widthLeftToolBar = im.GetContentRegionAvailWidth()-iconButtonWidth*1.5
local maxNumEditModesToShow = 0
end
if im.GetContentRegionAvailWidth() > (550 * (1+im.uiscale[0])/2) then
im.SetCursorPosX(im.GetCursorPosX() + im.GetContentRegionAvailWidth() - (550 * (1+im.uiscale[0])/2))
if im.GetContentRegionAvailWidth() > (550 * (1+im.uiscale[0])/2) then
im.SetCursorPosX(im.GetCursorPosX() + im.GetContentRegionAvailWidth() - (550 * (1+im.uiscale[0])/2))
end
@/lua/ge/extensions/editor/dataBlockEditor.lua
im.SameLine()
im.Dummy(im.ImVec2(im.GetContentRegionAvailWidth() - 60 * im.uiscale[0], 1))
im.SameLine()
@/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
local function documentationGui(docsSection)
im.PushTextWrapPos(im.GetContentRegionAvailWidth())
im.TextUnformatted([[
@/lua/ge/extensions/editor/flowgraph/main.lua
im.SameLine()
im.Dummy(im.ImVec2(im.GetContentRegionAvailWidth()-5,1))
im.EndGroup()
@/lua/ge/extensions/editor/trafficSignalsEditor.lua
im.BeginChild1("instanceData", im.ImVec2(0, 0), im.WindowFlags_ChildWindow)
contentWidth = im.GetContentRegionAvailWidth() * 0.5
if not im.IsWindowHovered(im.HoveredFlags_AnyWindow) and editor.getCurrentEditModeName() ~= "objectSelect" and editor.keyModifiers.shift then
else
im.BeginChild1("signalObjects", im.ImVec2(im.GetContentRegionAvailWidth(), 110 * im.uiscale[0]), im.WindowFlags_ChildWindow)
for _, oid in ipairs(currInstance.tempSignalObjects) do
im.BeginChild1("controllerData", im.ImVec2(0, 0), im.WindowFlags_ChildWindow)
contentWidth = im.GetContentRegionAvailWidth() * 0.5
local currController = controllers[selected.controller]
else
local columnWidth = im.GetContentRegionAvailWidth() * 0.333
im.BeginChild1("sequenceData", im.ImVec2(0, 0), im.WindowFlags_ChildWindow)
contentWidth = im.GetContentRegionAvailWidth() * 0.5
local currSequence = sequences[selected.sequence]
im.ProgressBar(currTime / maxTime, im.ImVec2(im.GetContentRegionAvailWidth(), 0))
im.TableNextColumn()
@/lua/ge/extensions/flowgraph/nodes/math/math.lua
end
im.PushItemWidth(im.GetContentRegionAvailWidth()-25)
if im.BeginCombo("##templateExpressions", currentTemplate and currentTemplate.name or "Custom Expression") then
@/lua/ge/extensions/editor/textEditor.lua
if editor.beginWindow(wndName, "Text Editor " .. idsToString(instance.objIds) .. " " .. instance.fieldName .. "##" .. index) then
if editor.uiInputTextMultiline('##text' .. index, instance.textInput, textInputSize, imgui.ImVec2(imgui.GetContentRegionAvailWidth(), imgui.GetWindowSize().y - imgui.CalcTextSize('Cancel Ok').y * 4), imgui.InputTextFlags_AllowTabInput, nil, nil, nil) then
end
@/lua/ge/extensions/gameplay/drift/quickMessages.lua
im.Text("Available quick messages : ")
if im.BeginChild1("Available quick messages", im.ImVec2(im.GetContentRegionAvailWidth(), 130), true) then
for messageId, data in pairs(quickMessages) do
@/lua/ge/extensions/editor/util/vehicleSelectUtil.lua
im.BeginChild1("##vehicleSelector"..dumps(self.id), im.ImVec2(im.GetContentRegionAvailWidth(), elemCount * elemHeight + elemPadding))
im.NextColumn()
im.PushItemWidth(im.GetContentRegionAvailWidth())
im.PushItemWidth(im.GetContentRegionAvailWidth())
im.PushItemWidth(im.GetContentRegionAvailWidth())
if im.BeginCombo("##vehicleSelectorConfigs"..dumps(self.id), label) then
im.PushItemWidth(im.GetContentRegionAvailWidth())
if im.BeginCombo("##vehicleSelectorPaints"..dumps(self.id).."_"..i, label) then
im.PushItemWidth(im.GetContentRegionAvailWidth() - 40)
if editor.uiInputFile("##vehicleSelectorCustom"..dumps(self.id), self.customConfigPtr, nil, nil, {{"Part config files", ".pc"}}, im.InputTextFlags_EnterReturnsTrue) then
@/lua/ge/suspensionFrequencyTester.lua
if imgui.Begin("Suspension Frequency Tester", windowOpen) then
local availWidth = imgui.GetContentRegionAvailWidth()
local contentWidth = math.floor(availWidth)
@/lua/ge/extensions/editor/dynamicDecals/layerTypes/group.lua
local function documentationGui(docsSection)
im.PushTextWrapPos(im.GetContentRegionAvailWidth())
im.TextUnformatted([[
@/lua/ge/extensions/editor/vehicleEditor/veToolbar.lua
if editor.beginWindow(saveLayoutWindowName, saveLayoutWindowTitle) then
im.PushItemWidth(im.GetContentRegionAvailWidth())
if im.InputText("##SaveLayout", layoutName, 128, im.InputTextFlags_EnterReturnsTrue) then
im.SameLine()
im.SetCursorPosX(im.GetCursorPosX() + im.GetContentRegionAvailWidth() - getCameraTodSlidersSize())
cameraTodSliders()
@/lua/ge/extensions/editor/util/editorElementHelper.lua
local function label(e)
local width = im.GetContentRegionAvailWidth()
im.Columns(3, nil, true)
label(e)
im.PushItemWidth(im.GetContentRegionAvailWidth())
-- Handle displayOptions as either a table or a string (tooltip)
local width = im.GetContentRegionAvailWidth() - (hasTranslate and 35 or 0) - (hasDropdown and 45 or 0) - (hasTranslate and hasDropdown and 10 or 0)
end
im.BeginChild1("LB",im.ImVec2(im.GetContentRegionAvailWidth()*0.66, 62), true)
im.Columns(3)
local separatorDummySize = im.ImVec2(0,5)
local function decoSeparatorDraw(e, ctd) im.Dummy(separatorDummySize) im.ImDrawList_AddLine(im.GetWindowDrawList(), im.GetCursorScreenPos(), im.ImVec2(im.GetCursorScreenPos().x+im.GetContentRegionAvailWidth(), im.GetCursorScreenPos().y), separatorColor, 1) im.Dummy(separatorDummySize) end
local function decoDummyDraw(e, ctd) im.Dummy(im.ImVec2(0,e.height)) end
@/lua/ge/extensions/gameplay/util/crashDetection.lua
-- Add vehicle selector and exit debug button on same line
im.PushItemWidth(im.GetContentRegionAvailWidth() - 200) -- Reserve space for button
im.Combo2("Select Vehicle", debugSelectedVehicleIndex, vehicleListStr)
if graphGroups[graphNum] and crashData.debug.graphEnabled[graphNum][0] then
im.BeginChild1("Graph " .. graphNum .. "##" .. selectedVehId, im.ImVec2(im.GetContentRegionAvailWidth(), 300), true)
plotHelperUtil:setScale(nil, nil, 0, nil)
plotHelperUtil:draw(im.GetContentRegionAvailWidth(), im.GetContentRegionAvail().y, 400)
end
@/lua/ge/extensions/editor/cameraTransform.lua
im.PushItemWidth(im.GetContentRegionAvailWidth())
if im.InputText("Camera Transform", camTransfrom) 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)
if im.BeginChild1("PropertiesDirtyInfoChild", nil, true) then
im.PushTextWrapPos(im.GetContentRegionAvailWidth())
im.TextUnformatted("Properties have been altered and the changes have not been applied yet.\nHit the 'Apply' button in order to propagate the values to all child layers.")
local function documentationGui(docsSection)
im.PushTextWrapPos(im.GetContentRegionAvailWidth())
im.TextUnformatted([[
@/lua/ge/extensions/editor/missionEditor/conditions.lua
im.SameLine()
im.PushItemWidth(im.GetContentRegionAvailWidth())
local val, name = 'vName'..index, 'vnName'..index
@/lua/ge/extensions/util/screenshotCreator.lua
local halfWidth = im.GetContentRegionAvailWidth() / 2
if im.BeginChild1("unselectedSection", im.ImVec2(halfWidth, 0), true) then
if im.BeginChild1("Parent parent", im.ImVec2(0, imguiHeight), true) then
if im.BeginChild1("Config list", im.ImVec2(im.GetContentRegionAvailWidth() / 2, 0), nil) then
if im.BeginTable('Model configs', 4, nil) then
local cameraConfigs = getCameraConfig(currModelName, currConfigName)
if im.BeginChild1("Config custom camera", im.ImVec2(im.GetContentRegionAvailWidth() / 2, 0), true) then
if cameraConfigs.vehCamConfig and cameraConfigs.vehCamConfig.cameraConfig then
local halfWidth = im.GetContentRegionAvailWidth() / 2
if im.BeginChild1("Vehicle list info", im.ImVec2(halfWidth, 0), true) then
@/lua/ge/extensions/editor/dynamicDecals/layerTypes/decal.lua
im.PushStyleColor2(im.Col_Button, layer.decalUv.x == -1 and editor.color.beamng.Value or btnCol)
local btnWidth = (im.GetContentRegionAvailWidth() - im.GetStyle().ItemSpacing.x) / 2
if im.Button(string.format("Horizontally##%s_flipHorizontally", widgetId), im.ImVec2(btnWidth, 0)) then
im.SameLine()
editor.uiInputSearchTextFilter("##InspectorMeshesFilter", meshesFilter, im.GetContentRegionAvailWidth())
im.NextColumn()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiSliderFloat2(string.format("##%s_%s_%s", layer.uid, guiId, "colorTextureScale"), editor.getTempFloatArray2_TableTable({layer.colorTextureScale.x, layer.colorTextureScale.y}), 0.01, 6.0, nil, nil, editor.getTempBool_BoolBool(false)) then
im.NextColumn()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if im.Combo2(string.format("##%s_%s_%s", layer.uid, guiId, "alphaMaskChannel"), editor.getTempInt_NumberNumber(layer.alphaMaskChannel), "red\0green\0blue\0alpha\0\0") then
im.NextColumn()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if im.Combo2(string.format("##%s_%s_%s", layer.uid, guiId, "alphaMaskBlendMode"), editor.getTempInt_NumberNumber(layer.alphaMaskBlendMode), "multiply\0add\0\0") then
im.NextColumn()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiSliderFloat2(string.format("##%s_%s_%s", layer.uid, guiId, "alphaMaskScale"), editor.getTempFloatArray2_TableTable({layer.alphaMaskScale.x, layer.alphaMaskScale.y}), 0.01, 6.0, nil, nil, editor.getTempBool_BoolBool(false)) then
im.NextColumn()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiSliderFloat(string.format("##%s_%s_%s", layer.uid, guiId, "alphaMaskRotation"), editor.getTempFloat_NumberNumber(layer.alphaMaskRotation * 180 / math.pi), 0, 360, nil, nil, editor.getTempBool_BoolBool(false)) then
im.NextColumn()
im.PushItemWidth(im.GetContentRegionAvailWidth())
local val = 0
im.NextColumn()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiSliderFloat(string.format("##%s_%s_%s", layer.uid, guiId, "sdfThickness"), editor.getTempFloat_NumberNumber(layer.sdfThickness), 0.0, 1.0, "%.2f", nil, editor.getTempBool_BoolBool(false)) then
im.NextColumn()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiSliderFloat(string.format("##%s_%s_%s", layer.uid, guiId, "sdfSoftness"), editor.getTempFloat_NumberNumber(layer.sdfSoftness), 0.0, 1.0, "%.2f", nil, editor.getTempBool_BoolBool(false)) then
im.NextColumn()
im.PushItemWidth(im.GetContentRegionAvailWidth())
local sdfOutlineColorTbl = layer.sdfOutlineColor:toTable()
im.NextColumn()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiSliderFloat(string.format("##%s_%s_%s", layer.uid, guiId, "sdfOutlineThickness"), editor.getTempFloat_NumberNumber(layer.sdfOutlineThickness), 0.0, 1.0, "%.2f", nil, editor.getTempBool_BoolBool(false)) then
im.NextColumn()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiSliderFloat(string.format("##%s_%s_%s", layer.uid, guiId, "sdfOutlineSoftness"), editor.getTempFloat_NumberNumber(layer.sdfOutlineSoftness), 0.0, 1.0, "%.2f", nil, editor.getTempBool_BoolBool(false)) then
im.TextUnformatted("Decal " .. name .. " Texture Path")
im.PushItemWidth(im.GetContentRegionAvailWidth() - 2 * tool.getIconSize() - 2 * im.GetStyle().ItemSpacing.x)
im.InputText("##Decal" .. name .. "TexturePath", editor.getTempCharPtr(api.getDecalTexturePath(type)), nil, im.InputTextFlags_ReadOnly)
local imgWidthSetting = editor.getPreference("dynamicDecalsTool.decalProperties.texturePreviewSize")
local imgWidth = imgWidthSetting > im.GetContentRegionAvailWidth() and im.GetContentRegionAvailWidth() or imgWidthSetting
local imgHeight = img.path == "/" and imgWidth or imgWidth * img.size.y / img.size.x
local imgWidthSetting = editor.getPreference("dynamicDecalsTool.decalProperties.texturePreviewSize")
local imgWidth = imgWidthSetting > im.GetContentRegionAvailWidth() and im.GetContentRegionAvailWidth() or imgWidthSetting
local imgHeight = img.path == "/" and imgWidth or imgWidth * img.size.y / img.size.x
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()
if im.TreeNode1(string.format("SDF Texture Preview##DecalColor_%s", guiId)) then
api.renderSdfTextureImgui(im.GetContentRegionAvailWidth(), im.GetContentRegionAvailWidth())
im.TreePop()
if im.TreeNode1(string.format("SDF Texture Preview##DecalColor_%s", guiId)) then
api.renderSdfTextureImgui(im.GetContentRegionAvailWidth(), im.GetContentRegionAvailWidth())
im.TreePop()
im.SameLine()
im.SetCursorPosX(im.GetCursorPosX() + im.GetContentRegionAvailWidth() - (im.CalcTextSize("Do not show again").x + 2*im.GetStyle().ItemSpacing.x + tool.getIconSize()))
im.TextUnformatted("Do not show again")
local style = im.GetStyle()
local widgetWidth = im.GetContentRegionAvailWidth() - (style.ItemSpacing.x + 2 * style.FramePadding.x + im.CalcTextSize("Inv").x)
if widgets.draw(api.getDecalRotation(), api.propertiesMap["decalRotation"], guiId, nil, {widthMod = -(style.ItemSpacing.x + 2 * style.FramePadding.x + im.CalcTextSize("Inv").x)}) then
local uvValue = api.getDecalUv()
local btnWidth = (im.GetContentRegionAvailWidth() - im.GetStyle().ItemSpacing.x) / 2
local enabled = uvValue.x < 0 and true or false
im.SameLine()
im.PushItemWidth(im.GetContentRegionAvailWidth() - (im.CalcTextSize("Select").x + 3 * im.GetStyle().ItemSpacing.x))
if im.InputText(string.format("##%s_%s", guiId, "decalLayerFontCharacter"), editor.getTempCharPtr(api.getDecalLayerFontCharacter()), nil, im.InputTextFlags_AutoSelectAll) then
local p1 = im.ImVec2(wpos.x + highlightSdfProperties.startCursorPos.x - scrollX, wpos.y + highlightSdfProperties.startCursorPos.y - scrollY)
local p2 = im.ImVec2(wpos.x + highlightSdfProperties.endCursorPos.x - scrollX + im.GetContentRegionAvailWidth(), wpos.y + highlightSdfProperties.endCursorPos.y - scrollY)
im.ImDrawList_AddRect(im.GetWindowDrawList(), p1, p2, im.GetColorU322(editor.color.beamng.Value), nil, nil, 3)
local function documentationGui(docsSection)
im.PushTextWrapPos(im.GetContentRegionAvailWidth())
im.TextUnformatted([[
local function sdfDocumentationGui(docsSection)
im.PushTextWrapPos(im.GetContentRegionAvailWidth())
im.TextUnformatted("What is SDF?")
@/lua/ge/extensions/editor/sitesEditor/sortedListDisplay.lua
local padding = im.GetStyle().FramePadding
local totalWidth = im.GetContentRegionAvailWidth()
local removeTag
@/lua/ge/extensions/ui/console.lua
im.SetCursorPosX(im.GetCursorPosX() + im.GetContentRegionAvailWidth() - fsize)
if gui.uiIconImageButton(fullscreen and gui.icons.fullscreen_exit or gui.icons.fullscreen, {x=fsize, y=fsize}, iconButtonFgColor.Value, nil, iconButtonBgColor.Value) then
-- im.TextColored(lcol,"%s",tostring(v) )
-- if v ~= 2 and im.GetContentRegionAvailWidth() < im.CalcTextSize(tostring(v)).x then
-- im.tooltip(tostring(v))
-- im.TextColored(lcol,"%s",tostring(v) )
-- if v ~= 2 and im.GetContentRegionAvailWidth() < im.CalcTextSize(tostring(v)).x then
-- im.tooltip(tostring(v))
local txtwidth = im.CalcTextSize(tostring(v)).x
if v ~= 2 and im.GetContentRegionAvailWidth() < txtwidth then
im.TextColored(lcol,string.format("%s", tostring(v):sub(1,256) ))
if mustFocusKeyboard then im.SetKeyboardFocusHere() end
im.PushItemWidth(im.GetContentRegionAvailWidth() - 70 * uiScale)
local exec = im.InputText("##inputText", consoleInputField, im.ArraySize(consoleInputField), flags, ffi.C.ImGuiInputTextCallbackLua, "ConsoleInputCallback")
@/lua/ge/extensions/editor/dynamicDecals/layerTypes/path.lua
im.NextColumn()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiInputText(
im.NextColumn()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if im.InputFloat3(string.format("##%s_%s_%s", layer.uid, guiId, "inspector_camPosition"), editor.getTempFloatArray3_Vec3Vec3(layer.camPosition), "%.6f") then
im.NextColumn()
im.PushItemWidth(im.GetContentRegionAvailWidth() - ((layer.colorPaletteMapId > 0) and (im.GetStyle().ItemSpacing.x + math.ceil(im.GetFontSize()) + 2 * im.GetStyle().FramePadding.y) or 0))
if im.Combo2(string.format("##%s_%s_%s", layer.uid, guiId, "inspector_colorpalettemapid"), editor.getTempInt_NumberNumber(layer.colorPaletteMapId), "zero\0one\0two\0three\0\0") then
im.NextColumn()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiColorEdit4(string.format("##%s_%s_%s", layer.uid, guiId, "inspector_color"), editor.getTempFloatArray4_TableTable(layer.color:toTable()), nil, editor.getTempBool_BoolBool(false)) then
im.NextColumn()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiSliderFloat3(string.format("##%s_%s_%s", layer.uid, guiId, "inspector_decalScale"), editor.getTempFloatArray3_Vec3Vec3(layer.decalScale), 0.05, 6.0, nil, nil, editor.getTempBool_BoolBool(false)) then
im.NextColumn()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiSliderFloat(string.format("##%s_%s_%s", layer.uid, guiId, "inspector_decalRotation"), editor.getTempFloat_NumberNumber(layer.decalRotation * 180 / math.pi), 0, 360, nil, nil, editor.getTempBool_BoolBool(false)) then
im.NextColumn()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if im.Combo2(string.format("##%s_%s_%s", layer.uid, guiId, "inspector_pathType"), editor.getTempInt_NumberNumber(layer.pathType), "Linear\0Bezier\0\0") then
im.NextColumn()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiInputText(
im.NextColumn()
im.PushItemWidth(im.GetContentRegionAvailWidth() - 2 * tool.getIconSize() - 2 * im.GetStyle().ItemSpacing.x)
im.InputText("##inspector_fontPath_InputText", editor.getTempCharPtr(layer.fontPath), nil, im.InputTextFlags_ReadOnly)
im.NextColumn()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if #layer.text > 0 then im.BeginDisabled() end
im.NextColumn()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiSliderFloat2(string.format("##%s_%s_%s", layer.uid, guiId, "inspector_decalSkew"), editor.getTempFloatArray2_TableTable({layer.decalSkew.x, layer.decalSkew.y}), -2.0, 2.0, nil, nil, editor.getTempBool_BoolBool(false)) then
im.NextColumn()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiSliderFloat2(string.format("##%s_%s_%s", layer.uid, guiId, "inspector_colorTextureScale"), editor.getTempFloatArray2_TableTable({layer.colorTextureScale.x, layer.colorTextureScale.y}), 0.01, 6.0, nil, nil, editor.getTempBool_BoolBool(false)) then
im.NextColumn()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if im.Combo2(string.format("##%s_%s_%s", layer.uid, guiId, "inspector_alphaMaskChannel"), editor.getTempInt_NumberNumber(layer.alphaMaskChannel), "red\0green\0blue\0alpha\0\0") then
im.NextColumn()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if im.Combo2(string.format("##%s_%s_%s", layer.uid, guiId, "inspector_alphaMaskBlendMode"), editor.getTempInt_NumberNumber(layer.alphaMaskBlendMode), "multiply\0add\0\0") then
im.NextColumn()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiSliderFloat2(string.format("##%s_%s_%s", layer.uid, guiId, "inspector_alphaMaskScale"), editor.getTempFloatArray2_TableTable({layer.alphaMaskScale.x, layer.alphaMaskScale.y}), 0.01, 6.0, nil, nil, editor.getTempBool_BoolBool(false)) then
im.NextColumn()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiSliderFloat(string.format("##%s_%s_%s", layer.uid, guiId, "inspector_alphaMaskRotation"), editor.getTempFloat_NumberNumber(layer.alphaMaskRotation * 180 / math.pi), 0, 360, nil, nil, editor.getTempBool_BoolBool(false)) then
im.NextColumn()
im.PushItemWidth(im.GetContentRegionAvailWidth())
local val = 0
im.NextColumn()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiSliderFloat(string.format("##%s_%s_%s", layer.uid, guiId, "inspector_sdfThickness"), editor.getTempFloat_NumberNumber(layer.sdfThickness), 0.0, 1.0, "%.2f", nil, editor.getTempBool_BoolBool(false)) then
im.NextColumn()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiSliderFloat(string.format("##%s_%s_%s", layer.uid, guiId, "inspector_sdfSoftness"), editor.getTempFloat_NumberNumber(layer.sdfSoftness), 0.0, 1.0, "%.2f", nil, editor.getTempBool_BoolBool(false)) then
im.NextColumn()
im.PushItemWidth(im.GetContentRegionAvailWidth())
local sdfOutlineColorTbl = layer.sdfOutlineColor:toTable()
im.NextColumn()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiSliderFloat(string.format("##%s_%s_%s", layer.uid, guiId, "inspector_sdfOutlineThickness"), editor.getTempFloat_NumberNumber(layer.sdfOutlineThickness), 0.0, 1.0, "%.2f", nil, editor.getTempBool_BoolBool(false)) then
im.NextColumn()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiSliderFloat(string.format("##%s_%s_%s", layer.uid, guiId, "inspector_sdfOutlineSoftness"), editor.getTempFloat_NumberNumber(layer.sdfOutlineSoftness), 0.0, 1.0, "%.2f", nil, editor.getTempBool_BoolBool(false)) then
im.SameLine()
im.PushItemWidth(im.GetContentRegionAvailWidth() - (tool.getIconSize() + im.GetStyle().ItemSpacing.x))
if editor.uiSliderFloat(string.format("##%s_%s_%s_%d", layer.uid, guiId, "textCharacterPositions", k), editor.getTempFloat_NumberNumber(v), 0, 1, nil, nil, editor.getTempBool_BoolBool(false)) then
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiSliderFloat2(string.format("##%s_%s_%s_%d", layer.uid, guiId, "brushDataPoints_cursorPosScreenUv", k), editor.getTempFloatArray2_TableTable({data.x, data.y}), 0.0, 1.0, nil, nil, editor.getTempBool_BoolBool(false)) then
local function documentationGui(docsSection)
im.PushTextWrapPos(im.GetContentRegionAvailWidth())
im.TextUnformatted([[
@/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/dynamicDecals/helper.lua
if not string_label then return end
im.SetCursorPosX(im.GetCursorPosX() + im.GetContentRegionAvailWidth() / 2 - im.CalcTextSize(string_label).x / 2)
im.TextUnformatted(string_label)
if not string_label then return end
im.SetCursorPosX(im.GetCursorPosX() + im.GetContentRegionAvailWidth() / 2 - im.CalcTextSize(string_label).x / 2)
im.TextColored(color, string_label)
local img = editor.getTempTextureObj(path)
local imgWidth = overrideWidth or im.GetContentRegionAvailWidth()
local imgHeight = img.path == "/" and imgWidth or imgWidth * img.size.y / img.size.x
@/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)
local titleSize = im.CalcTextSize("Vehicle Livery Creator")
im.SetCursorPosX(im.GetCursorPosX() + im.GetContentRegionAvailWidth() / 2 - titleSize.x / 2)
im.TextColored(editor.color.beamng.Value, "Vehicle Livery Creator")
im.Dummy(spacing)
im.PushTextWrapPos(im.GetContentRegionAvailWidth())
welcomingMessage()
im.SameLine()
im.SetCursorPosX(im.GetCursorPosX() + im.GetContentRegionAvailWidth() - (im.CalcTextSize("Do not show again").x + 2*im.GetStyle().ItemSpacing.x + tool.getIconSize()))
im.TextUnformatted("Do not show again")
@/lua/ge/extensions/editor/dynamicDecals/meshes.lua
im.TextUnformatted("Shape Path")
im.PushItemWidth(im.GetContentRegionAvailWidth() - tool.getIconSize() - im.GetStyle().ItemSpacing.x)
im.InputText("##Shape Path", editor.getTempCharPtr(api.getShapePath()), nil, im.InputTextFlags_ReadOnly)
@/lua/ge/extensions/editor/particleEditor.lua
if i > #particleNames + 1 then im.BeginDisabled() disabled = true end
im.PushItemWidth(im.GetContentRegionAvailWidth() - 2 * (22 * im.uiscale[0]))
if im.BeginCombo("##particles" .. i, particleNames[i] or "") then
@/lua/ge/extensions/flowgraph/nodes/debug/comment.lua
if im.InputTextMultiline("##" .. self.id, descText, 2048,im.ImVec2(im.GetContentRegionAvailWidth(),300), im.InputTextFlags_Multiline) then
self.commentText = ffi.string(descText)
@/lua/ge/extensions/editor/rallyEditor.lua
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)
@/lua/ge/extensions/flowgraph/nodes/gameplay/traffic/trafficCustomGroup.lua
-- mode select
im.PushItemWidth(im.GetContentRegionAvailWidth())
if im.BeginCombo('Mode', modes[self.mode]) then
@/lua/ge/extensions/editor/dynamicDecals/layerTypes/fill.lua
local function documentationGui(docsSection)
im.PushTextWrapPos(im.GetContentRegionAvailWidth())
im.TextUnformatted([[
@/lua/ge/extensions/flowgraph/nodes/types/string.lua
end
im.PushItemWidth(im.GetContentRegionAvailWidth())
if self.multiLine then
@/lua/ge/extensions/editor/iconOverview.lua
if not selectedFun then selectedFun = nop end
local availableWidth = imgui.GetContentRegionAvailWidth() - imgui.GetStyle().ScrollbarSize
local itemSize = ((size.x * imgui.uiscale[0] + style.ItemSpacing.x))
local itemsPerRow = math.floor(availableWidth / itemSize)
if editor.uiInputSearchTextFilter("##iconFilter", filter, imgui.GetContentRegionAvailWidth(), nil, editEnded) then
if ffi.string(imgui.TextFilter_GetInputBuf(filter)) == "" then
@/lua/ge/extensions/flowgraph/nodes/vehicle/special/customVehicleGetter.lua
im.SameLine()
im.PushItemWidth(im.GetContentRegionAvailWidth())
local currentFun = "Custom Function"
@/lua/ge/extensions/editor/dynamicDecals/export.lua
im.SameLine()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if vehicleObj then
im.SameLine()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if im.InputText("##skinExport_Name", editor.getTempCharPtr(skinExport_Name)) then
im.TextUnformatted("Export Name")
im.PushItemWidth(im.GetContentRegionAvailWidth())
if im.InputText("##texturesExport_Name", editor.getTempCharPtr(texturesExport_Name)) then
im.TextUnformatted("Export Directory")
im.PushItemWidth(im.GetContentRegionAvailWidth() - tool.getIconSize() - im.GetStyle().ItemSpacing.x)
if im.InputText("##texturesExport_DirectoryPath", editor.getTempCharPtr(texturesExport_DirectoryPath)) then
-- im.TextUnformatted("Export Filetype")
-- im.PushItemWidth(im.GetContentRegionAvailWidth())
-- if im.Combo1("##reflectionMode", editor.getTempInt_NumberNumber(texturesExport_exportFormatId), textureExport_NamesCharPtr) then
local function documentationGui(docsSection)
im.PushTextWrapPos(im.GetContentRegionAvailWidth())
im.TextUnformatted([[
@/lua/ge/extensions/editor/assetManagementTool.lua
if editor.uiInputSearchTextFilter("Search...", searchFilter, imgui.GetContentRegionAvailWidth()) or forceFilterNow then
filterDuplicateList()
imgui.Text(message)
imgui.ProgressBar(progress, imgui.ImVec2(imgui.GetContentRegionAvailWidth(), 0))
imgui.Spacing()
imgui.Text(message)
imgui.ProgressBar(progress, imgui.ImVec2(imgui.GetContentRegionAvailWidth(), 0))
imgui.Spacing()
imgui.Text(message)
imgui.ProgressBar(progress, imgui.ImVec2(imgui.GetContentRegionAvailWidth(), 0))
imgui.Spacing()
imgui.Text(message)
imgui.ProgressBar(progress, imgui.ImVec2(imgui.GetContentRegionAvailWidth(), 0))
imgui.Spacing()
imgui.Text(message)
imgui.ProgressBar(progress, imgui.ImVec2(imgui.GetContentRegionAvailWidth(), 0))
imgui.Spacing()
imgui.Text(message)
imgui.ProgressBar(progress, imgui.ImVec2(imgui.GetContentRegionAvailWidth(), 0))
imgui.Spacing()
imgui.Text(message)
imgui.ProgressBar(progress, imgui.ImVec2(imgui.GetContentRegionAvailWidth(), 0))
imgui.Spacing()
imgui.Text(message)
imgui.ProgressBar(progress, imgui.ImVec2(imgui.GetContentRegionAvailWidth(), 0))
imgui.Spacing()
@/lua/ge/extensions/editor/raceEditor/testing.lua
local lapCount = im.IntPtr(self.race.lapCount or 1)
im.PushItemWidth(im.GetContentRegionAvailWidth() * 0.5)
if im.InputInt("Lap Count", lapCount) then