tableSize
Definition
-- @/lua/common/utils.lua:696
-- returns the size of the table. Works with arrays and dictionaries. SLOW, as it iterates all ekements
function tableSize(tbl)
if type(tbl) ~= "table" then
return 0
end
local count = 0
for _ in pairs(tbl) do
count = count + 1
end
return count
end
Callers
@/lua/ge/extensions/editor/sitesEditor/sortedListDisplay.lua
im.SetCursorPosY(im.GetCursorPosY() + 2)
if not self.sharedSelectedTags or tableSize(self.sharedSelectedTags) == 0 then
im.Text("No Tags yet")
im.SameLine()
if tableSize(self.currTags) >= 1 then
im.PushItemWidth(45)
@/lua/ge/extensions/ui/apps/genericMissionData.lua
if not args.category then args.category = 'default' end
if not args.order then args.order = -(1 + tableSize(missionData.elements)) end
@/lua/ge/extensions/core/vehicle/inplaceEdit.lua
text("****************************************************************************************************************")
text(" " .. tostring(tableSize(vBundle.vdata.activePartsData)) .. " active parts")
text(" " .. tostring(tableSize(availableParts)) .. " available parts")
text(" " .. tostring(tableSize(vBundle.vdata.activePartsData)) .. " active parts")
text(" " .. tostring(tableSize(availableParts)) .. " available parts")
if selectedPartName then
@/lua/common/graphpath.lua
for nid, n in pairs(graph) do
if tableSize(n) ~= 2 then
isJunctionNode[nid] = true
end
local linkCount = max(1, tableSize(graph[node]) - (minParent[node] and 1 or 0))
for child, edgeData in pairs(graph[node]) do
local nodeLinkCount = tableSize(graph[prevPath[1]])
local inFwdFlow, inBackFlow, inDrivability, inGated = radius[prevPath[1]], 0, 1, false
nodeLinkCount = tableSize(graph[child])
if nodeLinkCount > 2 or i == prevPathCount then -- child node is a junction (has more than two links) or is the start node of the next path
@/lua/vehicle/ai.lua
player = mapmgr.objects[M.targetObjectID]
elseif tableSize(mapmgr.objects) == 2 then
if player ~= nil then
local nid = currentRoute.path[plan[seg].pathidx]
if seg < plan.planCount - 1 and tableSize(mapData.graph[nid]) > 2 and plan[seg].pos:squaredDistance(mapData.positions[nid]) <= square(mapData.radius[nid]) then
dist = dist + 20
-- check if this node is an intersection
intersectionFound = intersectionFound or tableSize(mapData.graph[route.path[i]]) > 2
if i >= curPlanIdx then
if tableSize(mapData.graph[path[i]]) > 2 then
return true
local n3Pos = mapData.positions[path[i + 2]]
if tableSize(mapData.graph[nid2]) > 2 then -- if next path node is not in the middle of the junction
tSi.turnDir = n3Pos - n2Pos
-- *****detect uncontrolled intersection or set the turn direction for an already detected controlled intersection******
if tableSize(mapData.graph[nid1]) > 2 and not tSi.node and tSi.startIdx > 0 then
-- we should try to get the effective curvature of the path after this point to determine turn signals
-- the prevNode check is to make sure one of the three roads of the T-Junction is the one the vehicle is comming from
if prevNode and tableSize(mapData.graph[nid1]) == 3 then
for k, v in pairs(mapData.graph[nid1]) do
-- local node = path[i]
-- if tableSize(graph[node]) > 2 then
local wp2 = currentRoute.path[i+1]
if tableSize(mapData.graph[wp2]) > 2 then
local minNode = roadNaturalContinuation(wp1, wp2)
@/lua/ge/extensions/editor/levelValidator.lua
if not tableIsEmpty(logsToRemove) then
for i = tableSize(levelLogs), 1, -1 do
if logsToRemove[i] then
@/lua/ge/extensions/editor/textEditor.lua
local obj = scenetree.findObjectById(objIds[1])
guiInstancer.instances[index].textInput = imgui.ArrayChar(textInputSize, tableSize(objIds) == 1 and obj:getField(fieldName, "") or "")
local wndName = windowNamePrefix .. index
@/lua/ge/extensions/career/modules/delivery/cargoScreen.lua
table.insert(result, minDistTarget.pos)
if tableSize(targetsById) <= 1 or onlyClosestTarget then return end
getClosestNeighbor(minDistTarget.id, targetsById, result)
@/lua/ge/extensions/editor/terrainEditor.lua
updatePaintMaterialProxies()
terrainMtlProxy.index = tableSize(paintMaterialProxies)
0,
terrainPainterWindowSize.y - cursorPos.y - (tableSize(notifications) * (var.fontSize + var.style.ItemSpacing.y)) - var.style.WindowPadding.y - (var.fontSize + 2*var.style.FramePadding.y + var.style.ItemSpacing.y)
)
local bottomButtonPosX = im.GetCursorPosX()
if im.BeginChild1("MaterialSelectorChild", childSize) and tableSize(paintMaterialProxies) then
local btnHeight = math.ceil(im.GetFontSize()) + 2
@/lua/ge/extensions/core/vehicle/partmgmt.lua
local colorTable = vehicle:getColorFTable()
local colorTableSize = tableSize(colorTable)
for i = 1, colorTableSize do
local function createVehIdMapRec(entry)
vehIdMap[entry.vehId] = tableSize(vehIdMap) + 1
for _, child in ipairs(entry.children) do
local colorTable = playerVehicle:getColorFTable()
local colorTableSize = tableSize(colorTable)
for i = 1, colorTableSize do
else
local paintCount = tableSize(inData.paints)
for i = 1, paintCount do
@/lua/vehicle/powertrain/sequentialGearbox.lua
device.minGearRatio = 999999
for i = 0, tableSize(forwardGears) - 1, 1 do
device.gearRatios[i] = forwardGears[i + 1]
end
local reverseGearCount = tableSize(reverseGears)
for i = -reverseGearCount, -1, 1 do
@/lua/ge/extensions/editor/gen/exp_meshexplorer.lua
for id, veh in activeVehiclesIterator() do
lo('??++++++++++++++++++++++ veh:'..id..':'..veh:getNodeCount()..':'..tostring(veh:getNodePosition(1))..':'..veh:getJBeamFilename()) --.':'..tostring(veh:getPosition())..':'..tostring(veh:getNodePosition(veh:getRefNodeId()))) --..':'..tableSize(veh.vdata.beams))
lo('?? forPos:'..tostring(veh:getPosition())..':'..tostring(be:getObjectByID(pvd.id):getPosition())..':'..tostring(veh:getNodePosition(veh:getRefNodeId())))
local am = M.gpuFrom(pvd.id)
-- dump(dbeam, '?? dbeam:'..#pvd.vdata.beams..':'..tableSize(dbeam), nil, 1)
-- dump(am, '?? ageo:'..tableSize(am),nil, 1)
-- dump(dbeam, '?? dbeam:'..#pvd.vdata.beams..':'..tableSize(dbeam), nil, 1)
-- dump(am, '?? ageo:'..tableSize(am),nil, 1)
-- local s = 0
for id, veh in activeVehiclesIterator() do
lo('??++++++++++++++++++++++ veh:'..id..':'..veh:getNodeCount()..':'..tostring(veh:getNodePosition(1))..':'..veh:getJBeamFilename()..':'..veh:getId()) --..':'..tableSize(veh.vdata.beams))
end
end
lo('?? NIN:'..#amodel..':'..tableSize(dimg)..'/'..#data.configs)
-- dump(dimg, '?? if_TILES:'..tostring(data))
for k,v in pairs(dbeam) do
-- dump(v,'??==================== vehDATA_dbeam:'..tableSize(dbeam),nil)
break
-- U.out.f = nil
-- lo('?? added:'..i..':'..#avp..' AF:'..#afp..'/'..tableSize(af)..':'..(endIndex-startIndex))
-- dump(afp,'?? AFP:')
-- lo('?? FAFFFFPPPP:'..tableSize(bag)..':'..tostring(am[1].faces))
-- dump(bag, '?? FAFFFFPPPP:'..tableSize(bag))
-- lo('?? FAFFFFPPPP:'..tableSize(bag)..':'..tostring(am[1].faces))
-- dump(bag, '?? FAFFFFPPPP:'..tableSize(bag))
else
-- daedata.djoint = {}
-- dump(daedata.dgeo, '?? DGEO:'..val..':'..n..':'..tableSize(daedata.dgeo),nil,2)
for k,d in pairs(daedata.dgeo) do
end
dump(aline, '?? aline:'..tableSize(U.out.agraph))
local apth = {}
daedata.alod = {}
if tableSize(dimg) == 0 then
-- load previews
-- dump(daedata.dgeo,'??****************** TO_ANIM:'..val,nil,2)
danim['for_joints'] = {cb=forJoints, N=tableSize(daedata.dgeo),
arg={val=env.ui['geo_up'],pos=pos}, out=astick, done=function()
-- inwait = nil
-- lo('?? geo_up:'..val..':'..tableSize(daedata.dgeo))
-- return
daedata.djoint = {}
danim['for_joints'] = {cb=forJoints, N=tableSize(daedata.dgeo),
arg={val=val,pos=pos}, out=astick, done=function()
end}
-- for i=1,tableSize(daedata.dgeo) do
-- forJoints(val, pos, i, astick)
end
-- dump(geonode,'?? abag:'..tableSize(djoint)..':'..#astick)
end
if tableSize(djoint)>0 then
break
end
local s = -step*(tableSize(alod) - 1)/2
-- lo('?? for_POS:'..tableSize(dgeo)..':'..step)
local s = -step*(tableSize(alod) - 1)/2
-- lo('?? for_POS:'..tableSize(dgeo)..':'..step)
table.sort(alod,function(a,b)
-- fsnode.astep = {fsnode.astep[1]}
-- dump(fsnode.astep, '?? astep:'..ind[1]..':'..#fsnode.astep..':'..tableSize(fsnode.astep))
fsnode.adir,fsnode.afile = W.dir2list(path)
env.ui['inpin'] = inpin
-- lo('?? toPIN:'..tableSize(djoint))
for c,d in pairs(daedata.dgeo) do
env.ui['inpin'] = inpin
-- lo('?? toPIN:'..tableSize(djoint))
for c,d in pairs(daedata.dgeo) do
-- im.SameLine()
if #ageopin>0 and indae and tableSize(daedata.dgeo)>0 then
if not env.ui['model_on'] or inmesh then
gui()
if tableSize(U.out.agraph)>0 then
-- lo('??^^^^^^^^^^^^ forGRAPH:'..#U.out.agraph[1].list)
env.ui['inpin'] = inpin
-- lo('?? toPIN:'..tableSize(djoint))
for c,d in pairs(daedata.dgeo) do
@/lua/ge/extensions/editor/gen/test.lua
local list = FS:findFiles(pth, '*.dae', -1, true, false)
-- lo('??^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ onVal_gen_unique:'..tostring(pth)..':'..tableSize(amesh))
for i,s in pairs(list) do
list = FS:findFiles(pth, '*.json', -1, true, false)
-- lo('?? onVal_gen_unique:'..tostring(pth)..':'..tableSize(amesh))
for i,s in pairs(list) do
if U._PRD ~= 0 then return end
lo('>>"""""""""""""""""""""""" test:'..tableSize(adesc),true)
-- pretest(true)
-- local matobj = scenetree.findObject('GroundGrid2')
-- lo('?? test_if_build:'..tableSize(adesc)..':'..tableSize(levelMaterialNames)..':'..tostring(matobj))
-- local ffifound, ffi = pcall(require, 'ffi')
-- local matobj = scenetree.findObject('GroundGrid2')
-- lo('?? test_if_build:'..tableSize(adesc)..':'..tableSize(levelMaterialNames)..':'..tostring(matobj))
-- local ffifound, ffi = pcall(require, 'ffi')
local winleft,winbot,win,door,doorind,h = 0.2,1
lo('?? for_W:'..tableSize(adesc))
local base
local levelMaterialNames = editor.getPreference("materialEditor.general.levelMaterialNames")
lo('?? test_if_build:'..tableSize(adesc)..':'..tableSize(levelMaterialNames))
local torebuild = true
local levelMaterialNames = editor.getPreference("materialEditor.general.levelMaterialNames")
lo('?? test_if_build:'..tableSize(adesc)..':'..tableSize(levelMaterialNames))
local torebuild = true
local nd_maingeo = nodevs.kids[2]
lo('??^^^^^^^^^^ if_KIDS:'..tableSize(nodevs.kids)..':'..tostring(nd_maingeo.attr['id'])) --..tostring(nd_maingeo.kids[2].name)) --..tostring(tableSize(nd_maingeo.kids[2])))
nodevs = M.forNode(xmain, {'COLLADA','library_visual_scenes'})
local nd_maingeo = nodevs.kids[2]
lo('??^^^^^^^^^^ if_KIDS:'..tableSize(nodevs.kids)..':'..tostring(nd_maingeo.attr['id'])) --..tostring(nd_maingeo.kids[2].name)) --..tostring(tableSize(nd_maingeo.kids[2])))
nodevs = M.forNode(xmain, {'COLLADA','library_visual_scenes'})
local nd_maingeo = nodevs.kids[2]
lo('??^^^^^^^^^^ if_KIDS:'..tableSize(nodevs.kids)..':'..tostring(nd_maingeo.attr['id'])) --..tostring(nd_maingeo.kids[2].name)) --..tostring(tableSize(nd_maingeo.kids[2])))
-- U.dump(nd_maingeo)
local nd_maingeo = nodevs.kids[2]
lo('??^^^^^^^^^^ if_KIDS:'..tableSize(nodevs.kids)..':'..tostring(nd_maingeo.attr['id'])) --..tostring(nd_maingeo.kids[2].name)) --..tostring(tableSize(nd_maingeo.kids[2])))
-- U.dump(nd_maingeo)
jsonWriteFile(pth..'/top.materials.json', dmat)
U.dump(amat,'?? json_DONE:'..tableSize(dmat))
if not olist then olist = {} end
print('?? Tst.inject:'..tableSize(olist))
E = olist.E
@/lua/ge/ge_utils.lua
local paints = {}
local colorTableSize = tableSize(colorTable)
for i = 1, colorTableSize do
end
local randval = math.random(1, tableSize(t))
local n = 0
@/lua/ge/extensions/editor/vehicleEditor/liveEditor/veView.lua
local wndName = createViewFromData(id or tableSize(sceneViews) + 1, data)
saveSettings()
if idNotInUse == -1 then
idNotInUse = tableSize(sceneViews) + 1
end
@/lua/ge/extensions/freeroam/bigMapMode.lua
local stepSize = camHeightAboveTerrain / navPathSimplificationFactor
for index = 1, tableSize(route) - 1 do
local pos1 = route[index].pos
end
table.insert(simple, route[tableSize(route)].pos)
return simple
local navRouteAlpha = groundMarkerAlphaSmoother:getWithRateUncapped(alphaGoal, camData.dtReal, 0.85)
local simplifiedPathLength = simplifiedPath and tableSize(simplifiedPath)
if simplifiedPathLength and simplifiedPathLength > 1 then
@/lua/ge/extensions/editor/extensionsEditor.lua
imgui.TableHeadersRow()
for k = 1, tableSize(editor.allExtensionNames) do
local extName = editor.allExtensionNames[k]
@/lua/ge/extensions/editor/vehicleEditor/staticEditor/veJBeamTableVis.lua
if firstCount == -1 then
firstCount = tableSize(v1)
else
else
allEquallySizedTables = firstCount == tableSize(v1)
allExceptFirstHaveNums = type(v1[1]) == "number" and type(v1[2]) == "number"
@/lua/ge/extensions/career/modules/insurance/insurance.lua
else
local numberOfPaints = tableSize(info.visualState.paint.originalPaints)
info.visualState = {paint = {originalPaints = {}}}
@/lua/ge/extensions/editor/gen/region.lua
-- local L = W.out.L
-- U.dump(across[rmi], '??____________ mi: nmi='..nmi..' dmi:'..dmi..' rmi:'..tostring(rmi)) --..':'..tostring(across[rmi])) --tostring(adec[rmi].list[nmi])..':'..tableSize(across)) --..':'..tostring(adec[rmi].list[nmi])..':'..tostring(adec[rmi].list[nmi+1])..':'..tostring(p))
-- local grid = 10
end
-- U.dump(across[1][1], '?? pop:'..tableSize(across))
D = odec
local p = cpoint -- cameraMouseRayCast().pos
-- U.dump(adec[133], '?? pop_adec:'..tableSize(adec)..':'..tostring(p))
-- out.avedit = {}
-- local L = W.out.L
U.dump(across[rmi], '??____________ mi: nmi='..nmi..' dmi:'..dmi..' rmi:'..tostring(rmi)..':'..tostring(adec[rmi].list[nmi])..':'..tableSize(across)) --..':'..tostring(adec[rmi].list[nmi])..':'..tostring(adec[rmi].list[nmi+1])..':'..tostring(p))
-- local grid = 10
if #adec == 0 then
-- if true or tableSize(editor.getAllRoads()) ~= #adec then
lo('?? to_update:'..tableSize(editor.getAllRoads())..'/'..#adec) --..' L:'..L, true)
-- if true or tableSize(editor.getAllRoads()) ~= #adec then
lo('?? to_update:'..tableSize(editor.getAllRoads())..'/'..#adec) --..' L:'..L, true)
-- L = 4096
end
lo('>>++++++++__________ conform:'..L..':'..tableSize(adec)..':'..tableSize(aref)..':'..#aref..':'..tostring(U._mode))
-- U.dump(aref, '?? AREF:')
end
lo('>>++++++++__________ conform:'..L..':'..tableSize(adec)..':'..tableSize(aref)..':'..#aref..':'..tostring(U._mode))
-- U.dump(aref, '?? AREF:')
-- U.dump(aref, '?? AREF:')
-- if tableSize(adec)
-- shmap = {}
r = r + mantle
local hasnodes = tableSize(aref) > 0
c = c + pos
@/lua/ge/extensions/core/vehicleTriggers.lua
if vData.vdata and vData.vdata.maxIDs and not vData.vdata.maxIDs.triggerEventLinksDict then
vData.vdata.maxIDs.triggerEventLinksDict = tableSize(vData.vdata.triggerEventLinksDict or {})
end
@/lua/vehicle/controller/tirePressureControl.lua
wheelData = wheelData,
wheelCount = tableSize(wheelData),
maxPressure = maxPressure,
@/lua/ge/extensions/freeroam/specialTriggers.lua
log('D', logTag, 'Created '..tableSize(data)..' special triggers')
end
@/lua/console/test.lua
end
log('I', "lua.test", " * " .. v .. " with "..tableSize(parts).." parts")
allParts = tableMerge(allParts, parts)
@/lua/ge/extensions/editor/flowgraph/references.lua
im.PushStyleColor2(im.Col_Text, matchColor)
im.Text(tostring(tableSize(self.nodeTable)))
im.PopStyleColor()
im.TableNextColumn()
im.Text(tostring(tableSize(n.nodeData.amountForProjects)))
im.TableNextColumn()
if tableSize(self.nodeTable[self.inspectedNode].behaviour) > 0 then
@/lua/ge/extensions/core/input/bindings.lua
if vehicleName == "none" then vehicleName = nil end
log("D", "bindings", "Saving "..tableSize(v.bindings).." bindings for vehicle: "..dumps(vehicleName))
saveBindingsFileToDisk(v, vehicleName)
@/lua/vehicle/controller/vehicleController/vehicleController.lua
else
if tableSize(jbeamDataCopy[v]) ~= gearCount then
for i = 1, gearCount, 1 do
@/lua/ge/extensions/editor/camPathEditor.lua
local function playCurrentPath()
if tableSize(M.currentPath.markers) < 1 then
return
@/lua/ge/extensions/editor/trafficDebug.lua
local function drawGeneralTab()
local trafficTotalAmount = tableSize(traffic)
local trafficAmount = gameplay_traffic.getNumOfTraffic()
local trafficActiveAmount = gameplay_traffic.getNumOfTraffic(true)
local policeAmount = tableSize(gameplay_police.getPoliceVehicles())
local parkedAmount = tableSize(gameplay_parking.getParkedCarsList())
local policeAmount = tableSize(gameplay_police.getPoliceVehicles())
local parkedAmount = tableSize(gameplay_parking.getParkedCarsList())
@/lua/ge/extensions/util/configListGenerator.lua
end
return math.random(tableSize(filteredConfigList))
end
@/lua/ge/extensions/ui/bindingsLegend.lua
local previousModifierCount = tableSize(modifiersActive)
table.clear(modifiersActive)
end
local newModifierCount = tableSize(modifiersActive)
if hideVehicleSpecificActionsOnModifierPressed and newModifierCount > previousModifierCount then
@/lua/ge/extensions/editor/sitesEditor/zones.lua
local transform = QuatF(0, 0, 0, 0):getMatrix()
if tableSize(self.currentVertices) > 0 then
end
centroid = centroid / tableSize(self.currentVertices)
transform:setPosition(centroid)
-- check for vertices
if tableSize(self.currentVertices) > 0 then
for i, vertex in ipairs(self.currentVertices) do
-- check for vertices (only rotate if more than one selected)
if tableSize(self.currentVertices) > 1 then
local centroid = vec3(0, 0, 0)
end
centroid = centroid / tableSize(self.currentVertices)
self.current = zone
if (tableSize(self.currentVertices) > 0 or self.currentPlane) and self.sitesEditor.allowGizmo() then
editor.updateAxisGizmo(function()
@/lua/ge/extensions/util/terrainGenerator.lua
local materialsTblSize = tableSize(self.materials)
local textureMapsTblSize = tableSize(processedMaterials)
local materialsTblSize = tableSize(self.materials)
local textureMapsTblSize = tableSize(processedMaterials)
self.materials = deepcopy(processedMaterials)
@/lua/ge/extensions/core/modmanager.lua
local keys = tableKeys(couldBe)
if tableSize(keys) == 1 then
if needsMountPoint[keys[1]] then
@/lua/ge/extensions/util/saveDynamicData.lua
local configCount = tableSize(filteredConfigs)
log("I", logTag, tostring(configCount) .. " configs")
@/lua/ge/extensions/editor/decalEditor.lua
end
averagePos.x = averagePos.x / tableSize(selectedInstances)
averagePos.y = averagePos.y / tableSize(selectedInstances)
averagePos.x = averagePos.x / tableSize(selectedInstances)
averagePos.y = averagePos.y / tableSize(selectedInstances)
averagePos.z = averagePos.z / tableSize(selectedInstances)
averagePos.y = averagePos.y / tableSize(selectedInstances)
averagePos.z = averagePos.z / tableSize(selectedInstances)
if editor.getAxisGizmoAlignment() == editor.AxisGizmoAlignment_Local and tableSize(selectedInstances) == 1 then
editor.setAxisGizmoTransform(firstInstance:getWorldMatrix())
else
if not (isSelected(instance) and tableSize(selectedInstances) == 1) then
editor.history:commitAction("SelectSingleInst", {instance = instance, oldSelection = oldSelection}, selectSingleInstanceActionUndo, selectSingleInstanceActionRedo)
if tableSize(selectedInstances) == 1 then
local selectedInstance
-- Rotate the decals
if editor.getAxisGizmoAlignment() == editor.AxisGizmoAlignment_Local and tableSize(selectedInstances) == 1 then
local gizmoTransform = editor.getAxisGizmoTransform()
@/lua/ge/extensions/util/jbeamStats.lua
if state ~= false then
partCount = partCount + tableSize(parts)
@/lua/ge/extensions/editor/sceneView.lua
if data == nil then data = {} end
local newName = sceneViewName or 'Scene view ' .. tostring(tableSize(sceneViews) + 1)
sceneViews[newName] = {
@/lua/ge/extensions/editor/dynamicDecals/notification.lua
if editor.beginWindow(dynamicDecal_notification_windowName, "Dynamic Decals - Notifications") then
if tableSize(notifications) > 0 then
local style = im.GetStyle()
@/lua/ge/extensions/gameplay/rally/transcripts/entry.lua
-- fix up the rotations
local markerCount = tableSize(pathJsonObj.markers)
for i = 2, markerCount do
@/lua/ge/extensions/campaign/comics.lua
local comicPanels = {backgroundSound = comicData.backgroundSound, list = {}}
local numberPanels = tableSize(comicData.order)
for i=1,numberPanels do
@/lua/ge/extensions/editor/main.lua
local function unloadEditorExtensions()
M.log("Unloading " .. tableSize(M.extensionNames) .. " editor extensions...")
for _, name in ipairs(M.extensionNames) do
@/lua/ge/extensions/career/modules/delivery/vehicleTasks.lua
local partConditions = res.result
if tableSize(partConditions) > 0 then
taskData.brokenPartsNumber = career_modules_valueCalculator.getNumberOfBrokenParts(partConditions)
taskData.brokenPartsNumber = career_modules_valueCalculator.getNumberOfBrokenParts(partConditions)
taskData.partsNumber = tableSize(partConditions)
end
local partConditions = res.result
if tableSize(partConditions) > 0 then
taskData.brokenPartsNumber = career_modules_valueCalculator.getNumberOfBrokenParts(partConditions)
taskData.brokenPartsNumber = career_modules_valueCalculator.getNumberOfBrokenParts(partConditions)
taskData.partsNumber = tableSize(partConditions)
end
@/lua/ge/extensions/editor/flowgraph/missionVariableHelper.lua
log("D", logTag, string.format("Found %s mission variables to apply from Mission to Flowgraph", tableSize(missionTypeData)))
@/lua/vehicle/powertrain/manualGearbox.lua
device.minGearRatio = 999999
for i = 0, tableSize(forwardGears) - 1, 1 do
device.gearRatios[i] = forwardGears[i + 1]
end
local reverseGearCount = tableSize(reverseGears)
for i = -reverseGearCount, -1, 1 do
@/lua/common/jbeam/sections/camera.lua
end
--log('D', "jbeam.postProcess"," - processed "..tableSize(vehicle.cameras.onboard).." cameras.onboard")
end
@/lua/vehicle/extensions/escMeasurement.lua
local avgYawRate = 0
local yawRateCount = tableSize(wapData)
for i = 1, yawRateCount do
@/lua/ge/extensions/ui/messagesTasksAppContainers.lua
local visibleApps = getVisibleApps(containerId)
im.Text("Visible Apps: " .. #visibleApps .. "/" .. tableSize(container.apps))
@/lua/vehicle/extensions/vehiclePerformanceData.lua
--activate updateGFX if there are active recordings
if tableSize(activeRecordingTypes) > 0 and not M.updateGFX then
M.updateGFX = updateGFX
--deactivate updateGFX if there are no active recordings
if tableSize(activeRecordingTypes) <= 0 then
M.updateGFX = nil
@/lua/ge/extensions/editor/vehicleEditor/liveEditor/veFlexbodyDebug.lua
currNodesUsed = tableSize(nodesUsed)
@/lua/ge/extensions/editor/trafficSignalsEditor.lua
local count = tableSize(editor.selection.object)
if im.Button("Confirm Selection ("..count..")##signalObjects") then
@/lua/ge/extensions/editor/forestEditor.lua
local numObjects = tableSize(editor.selection.forestItem)
selectionCentroid.x = selectionCentroid.x / numObjects;
if tableSize(var.selectedForestBrushes) == 1 then
editor.selectObjectById(var.selectedForestBrushes[1].id)
if tableSize(var.selectedForestItemDatas) == 1 then
editor.selectObjectById(var.selectedForestItemDatas[1].id)
local function onEditorInspectorFieldChanged(selectedIds, fieldName, fieldValue, arrayIndex)
if tableSize(selectedIds) == 1 then
local object = scenetree.findObjectById(selectedIds[1])
@/lua/ge/extensions/editor/gen/terrain.lua
local function roadPlace()
lo('>> roadPlace:'..tableSize(mask)..':'..iR)
-- U.dump(mask)
@/lua/ge/extensions/editor/flowgraphEditor.lua
local del = nil
im.Text(tostring(tableSize(sortedNames)) .. " Custom Lua Nodes:")
for _, name in ipairs(sortedNames) do
@/lua/ge/extensions/editor/meshEditor.lua
end
elseif tableSize(selectedNodes) > 1 then
-- Multiple selected nodes
end
averagePos = averagePos / tableSize(selectedNodes)
nodeTransform:setPosition(averagePos)
if tableSize(selectedNodes) == 1 then
selectedNode = id
local selectedMesh = selectedMeshId and scenetree.findObjectById(selectedMeshId)
if selectedMesh and editor.keyModifiers.shift and tableSize(selectedNodes) == 1 and selectedNode and (selectedNode == 0 or selectedNode == selectedMesh:getNodeCount() - 1) then
local nodeInfo = editor.getNodes(selectedMesh)[selectedNode + 1]
-- Rotate the decals
if editor.getAxisGizmoAlignment() == editor.AxisGizmoAlignment_Local and tableSize(selectedInstances) == 1 then
local gizmoTransform = editor.getAxisGizmoTransform()
@/lua/ge/extensions/editor/dynamicDecals/history.lua
im.TextUnformatted("Undo Stack")
if im.Button("Undo Selected##DynamicDecalsTool") then history:undo(tableSize(history.undoStack) - undoStackSelectedIndex + 1) end
im.BeginChild1("undos", im.ImVec2(0, im.GetContentRegionAvail().y))
im.BeginChild1("undos", im.ImVec2(0, im.GetContentRegionAvail().y))
for k = tableSize(history.undoStack), 1, -1 do
local isSel = (k >= undoStackSelectedIndex)
im.TextUnformatted("Redo Stack")
if im.Button("Redo Selected##DynamicDecalsTool") then history:redo(tableSize(history.redoStack) - redoStackSelectedIndex + 1) end
im.BeginChild1("redos", im.ImVec2(0, im.GetContentRegionAvail().y))
im.BeginChild1("redos", im.ImVec2(0, im.GetContentRegionAvail().y))
for k = tableSize(history.redoStack), 1, -1 do
local isSel = (k >= redoStackSelectedIndex)
@/lua/ge/spawn.lua
if tableSize(rayCastHits) == 3 then
-- 1: origin
@/lua/ge/extensions/gameplay/police.lua
local function onTrafficStarted()
local policeAmount, propAmount = tableSize(policeVehs), #policePropIds
if policeAmount > 0 or propAmount > 0 then
@/lua/ge/extensions/editor/gen/ui.lua
-- M.forHelp()
lo('<<++++++++++++++++++_________________________ reload:'..tableSize(dicon))
end
local spline = W.forSpline()
if spline then -- desc.selection and tableSize(desc.selection) == 1 then
--TODO: more conditions
-- im.Dummy(im.ImVec2(0, 26))
im.TextColored(colorNav, 'Hint') --..tableSize(HTree[3]))
-- im.Indent(10)
if tableSize(row) > 0 then
-- im.SameLine()
-- im.Indent(10)
if tableSize(row) > 0 then
-- im.SameLine()
@/lua/ge/extensions/tech/utils.lua
local outputs = core_settings_graphic.getDisplayInformation().outputs
M.secondViewOutput = (M.secondViewOutput + 1) % (tableSize(outputs)+1)
@/lua/ge/extensions/editor/gen/lib/ui.lua
-- im.Indent(10)
if tableSize(row) > 0 then
-- im.SameLine()
@/lua/ge/extensions/editor/dynamicDecals/selection.lua
editor.selection["dynamicDecalLayer"][uid] = nil
if tableSize(editor.selection["dynamicDecalLayer"]) == 0 then
editor.selection["dynamicDecalLayer"] = nil
@/lua/ge/extensions/editor/gen/world.lua
U.dump(aref, '?? for_ext:'..tostring(ext)..':'..L..':'..tableSize(aref))
--++
W.daeExport = function()
lo('>> daeExport:'..tostring(cedit.mesh)..':'..tableSize(adesc))
local mat
editor.selectObjects(aid, editor.SelectMode_Add)
lo('?? daeExport:'..#aid..':'..#afi..':'..tostring(tableSize(editor.selection))) --..':'..tostring(editor.selection.forestItem))--..':'..tostring(aid[1])..':'..tostring(editor.selection.object.id)..':'..tostring(tableSize(editor.selection)))
editor.selectObjects(aid, editor.SelectMode_Add)
lo('?? daeExport:'..#aid..':'..#afi..':'..tostring(tableSize(editor.selection))) --..':'..tostring(editor.selection.forestItem))--..':'..tostring(aid[1])..':'..tostring(editor.selection.object.id)..':'..tostring(tableSize(editor.selection)))
local desc = adesc[cedit.mesh]
if desc and desc.selection and scope=='wall' and tableSize(desc.selection)==1 then
for i,f in pairs(desc.selection) do
local function sameSide(buf)
if not buf or tableSize(buf)==0 then return end
local akey = {}
W.recover = function(jdesc, cb, keep)
lo('>> recover:'..tostring(keep)..':'..tableSize(adesc))
if not keep then
local fdir = U.path2disk({editor.getLevelPath(), 'forest'})
lo('?? for_parts:'..tableSize(apart)..':'..tostring(fdir))
local fname = fdir..nm..'.forest4.json'
end)
lo('?? to_HIDE:'..tableSize(dhide))
for k,f in pairs(dhide) do
end
lo('??+++++ dae:'..tableSize(ddae)..':'..tableSize(W.adae))
end
lo('??+++++ dae:'..tableSize(ddae)..':'..tableSize(W.adae))
lo('?? up.if_rec:'..tostring(inrecover)..':'..tableSize(adesc))
if inrecover then
local list = groupBat:getObjects()
if tableSize(list)>0 then return end
end
local function houseUp(desc, toedit, update, prn, fordae)
lo('>>**************** houseUp:'..tostring(desc)..':'..tostring(toedit)..' prn:'..tostring(prn)..':'..tostring(update)..':'..tostring(desc and desc.prn or nil)..' nfloors:'..tostring(desc and #desc.afloor or nil)..':'..tostring(cedit.forest)..':'..tableSize(adesc)) --..tostring(scenetree.findClassObjects('Roads33'))..':'..tostring(scenetree.findObject("Vegetation")))
local om
if not desc then
lo('!! houseUp_NODESC:'..tostring(toedit)..':'..tableSize(adesc)..':'..tostring(adesc[tonumber(toedit)])..':'..tostring(adesc[toedit..'']))
-- for k,d in pairs(adesc) do
-- local data = subdata and {mdata,subdata} or {mdata}
-- lo('?? preRender:'..ic..':'..c.shape..':'..tostring(subdata and tableSize(subdata) or nil)..':'..tostring(data and tableSize(data) or nil))
-- U.dump(data, '?? preRender_d:'..ic..':'..tostring(data and tableSize(data) or nil))
-- local data = subdata and {mdata,subdata} or {mdata}
-- lo('?? preRender:'..ic..':'..c.shape..':'..tostring(subdata and tableSize(subdata) or nil)..':'..tostring(data and tableSize(data) or nil))
-- U.dump(data, '?? preRender_d:'..ic..':'..tostring(data and tableSize(data) or nil))
-- lo('?? preRender:'..ic..':'..c.shape..':'..tostring(subdata and tableSize(subdata) or nil)..':'..tostring(data and tableSize(data) or nil))
-- U.dump(data, '?? preRender_d:'..ic..':'..tostring(data and tableSize(data) or nil))
-- lo('??^^^^^^^^^^^^^^^^^^^^^^^^ pre_TORENDER:')
local uvv
-- U.dump(f.awplus,'?? hU_prePLUS:'..tableSize(f.awplus))
-- U.dump(f.awplus,'??++++++++++++ for_SUBROOF:'..i)
if desc.acorner_ then
-- U.dump(desc.acorner_, '??>>>>>> for_CORNER:'..tableSize(desc.acorner_))
for i,s in pairs(desc.acorner_) do
end
-- U.dump(desc.df, '??<<<<<< for_CORNER:'..tableSize(desc.acorner_))
-- if i > 1 then break end
local list = FS:findFiles(pth, '*.dae', -1, true, false)
lo('??^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ building4test:'..tostring(pth)..':'..tableSize(amesh))
for i,s in pairs(list) do
list = FS:findFiles(pth, '*.json', -1, true, false)
-- lo('?? onVal_gen_unique:'..tostring(pth)..':'..tableSize(amesh))
for i,s in pairs(list) do
end
lo('?? for_BASE:'..i..':'..tableSize(base)..':'..tostring(p))
W.buildingGen(p, base, true)
-- local awmat = {'m_bricks_01', 'metal_plates', 'm_stonebrick_eroded_01'} --'m_stonebrick_mixed_02'} --, 'm_stonebricks_mixed_01', 'm_stonebricks_mixed_01'}
-- lo('??^^^^^^^^^^^^^^^^^^^^^^^^^^^ BG_mat:'..tostring(out.inseed)..':'..tableSize(W.ui.mat_wall)..':'..tostring(W.ui.building_style)..':'..#dmat.wall)
if out.inseed then
local nd_maingeo = nodevs.kids[2]
lo('??^^^^^^^^^^ if_KIDS:'..tableSize(nodevs.kids)..':'..tostring(nd_maingeo.attr['id'])) --..tostring(nd_maingeo.kids[2].name)) --..tostring(tableSize(nd_maingeo.kids[2])))
nodevs = M.forNode(xmain, {'COLLADA','library_visual_scenes'})
local nd_maingeo = nodevs.kids[2]
lo('??^^^^^^^^^^ if_KIDS:'..tableSize(nodevs.kids)..':'..tostring(nd_maingeo.attr['id'])) --..tostring(nd_maingeo.kids[2].name)) --..tostring(tableSize(nd_maingeo.kids[2])))
nodevs = M.forNode(xmain, {'COLLADA','library_visual_scenes'})
local desc = adesc[cedit.mesh]
-- U.dump(desc.aspline, '?? if_SEL:'..tostring(desc.selection and tableSize(desc.selection) or nil))
if desc and desc.selection then
local function wallCollapse(desc, buf, redraw)
lo('>> wallCollapse:'..desc.id..':'..tableSize(buf))
local jmi = math.huge
local desc = adesc[cedit.mesh]
-- U.dump(desc.selection, '?? sel:'..tableSize(desc.selection))
if U._HERE and desc.selection and tableSize(desc.selection) == 1 then
-- U.dump(desc.selection, '?? sel:'..tableSize(desc.selection))
if U._HERE and desc.selection and tableSize(desc.selection) == 1 then
-- _dbdrag = true
for i,f in pairs(desc.selection) do
-- lo('?? fsel:'..tableSize(f))
if tableSize(f) == 1 then
-- lo('?? fsel:'..tableSize(f))
if tableSize(f) == 1 then
for j,key in pairs(f) do
end
if tableSize(insplit)>0 then
cedit.cval['DragPos'].insplit = insplit
local desc = adesc[cedit.mesh]
-- U.dump(desc.selection,'?? drag_free:'..tostring(desc)..':'..tostring(desc.selection)..':'..tableSize(desc.selection))
if desc and desc.selection and scope=='wall' and tableSize(desc.selection)==1 then
-- U.dump(desc.selection,'?? drag_free:'..tostring(desc)..':'..tostring(desc.selection)..':'..tableSize(desc.selection))
if desc and desc.selection and scope=='wall' and tableSize(desc.selection)==1 then
for i,f in pairs(desc.selection) do
end
out.inselect = tableSize(desc.selection)>0
-- out.selection = desc.selection
-- start edit
lo('?? if_edit:'..tostring(cedit.mesh)..':'..tostring(id)..':'..tableSize(adesc))
-- for k,d in pairs(adesc) do
else
lo('!! NO_desc:'..tostring(cedit.mesh)..':'..tostring(cij)..':'..tableSize(adesc))
end
local buf = {}
if desc.selection and tableSize(desc.selection) > 0 then
buf = desc.selection
-- PASTE
U.dump(incopy[cedit.mesh], '??+++++++++++++++++++++++++++++++ to_PASTE:'..tableSize(incopy)..':'..tostring(out.invertedge))
-- TODO: for between buildings
if false and U._PRD == 0 and not incopy[cedit.mesh] then
if tableSize(incopy) == 1 then
for id,buf in pairs(incopy) do
else
lo('?? paste_SAME:'..tableSize(incopy)..tostring(cedit.mesh)..':'..tostring(out.acorner)..':'..tostring(scope))
local buf = incopy[cedit.mesh]
if not buf then
if tableSize(incopy) == 1 then
for id,b in pairs(incopy) do
if #akey == 1 then
local buflen = tableSize(buf[akey[1]])
if buflen == 0 or buflen == #dsrc.afloor[akey[1]].awall then
U.dump(cij, '?? SSide:'..cij[1])
U.dump(desc.selection, '?? if_sel:'..tableSize(desc.selection))
local jmi = math.huge
if tableSize(desc.selection) == 1 and sameSide(desc.selection) then
local buf = {}
local buftgt = desc.selection
if tableSize(buftgt) > 1 then return end
local ftgt
local desc = adesc[cedit.mesh]
if not daePath[tp] or tableSize(daePath[tp]) == 0 or not desc then return end
lo('>> toggle:'..tp..':'..daePath[tp][1])
end
local span = tableSize(desc.selection)
-- U.dump(desc.selection, '?? for_SPLIT:'..lastrow)
-- lo('?? extrude:')
-- if tableSize(buf) > 1 or not sameSide(buf) then return end
-- U.dump(buf, '>> extrude:'..tostring(rebased))
local dirname = editor.getLevelPath()..'bat/'
lo('>> persist:'..tableSize(adesc)..'>'..dirname, true)
scope = 'building'
local afi = {}
-- lo('?? pre_build:'..tostring(desc)..':'..tostring(tableSize(editor.selection)))
-- lo('?? for_desc:'..tostring())
editor.selectObjects(aid, editor.SelectMode_Add)
-- lo('?? daeExport:'..#aid..':'..#afi..':'..tostring(tableSize(editor.selection))) --..':'..tostring(editor.selection.forestItem))--..':'..tostring(aid[1])..':'..tostring(editor.selection.object.id)..':'..tostring(tableSize(editor.selection)))
-- scope = nil
editor.selectObjects(aid, editor.SelectMode_Add)
-- lo('?? daeExport:'..#aid..':'..#afi..':'..tostring(tableSize(editor.selection))) --..':'..tostring(editor.selection.forestItem))--..':'..tostring(aid[1])..':'..tostring(editor.selection.object.id)..':'..tostring(tableSize(editor.selection)))
-- scope = nil
else
if desc.selection and tableSize(desc.selection) == 1 then
for j,aw in pairs(desc.selection) do
local amesh = FS:findFiles(pth, '*.dae', -1, true, false)
lo('?? onVal_gen_unique:'..tostring(pth)..':'..tableSize(amesh))
-- clean folder
p.z = z
lo('?? for_BASE:'..i..':'..tableSize(base)..':'..tostring(p))
buildingGen(p, base, true)
]]
lo('?? genned:'..tableSize(adesc))
W.out.inperftest = true
W.building4test(W.ui.build_pattern, R, center, true)
lo('?? onVal_gen_inst:'..tableSize(adesc))
W.out.inperftest = true
else
lo('?? dae_exp:'..tableSize(adesc)..':'..tostring(W.out.inperftest))
-- W.persist()
local jdesc = jsonDecode(jbody)
lo('?? desc_loaded:'..tostring(tableSize(jdesc['jdata'])))
file:close()
-- if true then return end
local istart = adesc and tableSize(adesc) or 0
local aid = W.recover(jdesc['jdata'], function()
end, true)
U.dump(aid, '?? post_recover:'..tableSize(adesc)..':'..#aid) --istart)
--[[
local jdesc = jsonDecode(jbody)
lo('?? desc_saved:'..tostring(tableSize(jdesc['jdata'])))
file:close()
end)
lo('?? post_recover:'..tableSize(adesc))
local aid = {}
@/lua/ge/extensions/editor/gen/mesh.lua
-- lo('?? forNode_match:'..nmatch..':'..ind..':'..lvl..':'..kid.name)
if dbg then U.dump(path,'?? match:'..nmatch..'/'..tostring(ind)..':'..tableSize(node.kids)..':'..kid.name) end
if ind == 0 and lvl==#path then
-- lo('?? for_S:'..s)
-- dump(bag, '?? AVP:'..tableSize(bag)..':'..tableSize(avp)..':'..tostring(avp[1]))
-- lo('?? for_AFP:'..#afp..'/'..(endIndex-startIndex+1))
-- lo('?? for_S:'..s)
-- dump(bag, '?? AVP:'..tableSize(bag)..':'..tableSize(avp)..':'..tostring(avp[1]))
-- lo('?? for_AFP:'..#afp..'/'..(endIndex-startIndex+1))
}
lo('<< vehFrom:'..tableSize(abag))
return am,dbeam
local gind = 1
-- lo('?? daeFrom:'..tableSize(dgeo))
-- for i=1,1 do
-- lo('?? for_KID:'..i..':'..k.name)
-- lo('?? geoKID_pre:'..i..':'..tableSize(dgeo))
if k.name == 'geometry' then -- and _>2 then
end
-- lo('?? geoKID:'..i..':'..tableSize(dgeo))
end
if kid.name == prop and not val then
U.lo('?? check_KID:'.._..':'..prop..':'..tableSize(node.kids))
table.remove(node.kids, _)
table.remove(node.kids, _)
U.lo('?? deld_KID:'.._..':'..tableSize(node.kids))
return
av[#av+1] = {pos=p, star={}}
-- lo('?? pi0:'..tableSize(de))
edgeUp(sega[1], #av, de[sa])
edgeUp(sega[1], #av, de[sa])
-- lo('?? pi1:'..tableSize(de))
edgeUp(#av, sega[2], de[sa])
edgeUp(#av, sega[2], de[sa])
-- lo('?? pi2:'..tableSize(de))
edgeUp(segb[1], #av, de[sb])
edgeUp(segb[1], #av, de[sb])
-- lo('?? pi3:'..tableSize(de))
edgeUp(#av, segb[2], de[sb])
edgeUp(#av, segb[2], de[sb])
-- lo('?? pi4:'..tableSize(de))
edgeDown(sa)
edgeDown(sa)
-- lo('?? pi11:'..tableSize(de)..':'..sa)
edgeDown(sb)
edgeDown(sb)
-- lo('?? pi22:'..tableSize(de)..':'..sb)
end
local ne = tableSize(de)
-- U.dump(av, '?? for_AV:'..ne..':'..#av)
local st2 = U.stamp({k.ind,U.mod(b+1,aloop[j]).ind},true)
-- lo('??___ preINS:'..tableSize(de)..':'..a..':'..b..':'..st1..':'..st2)
edgeCross(st1,st2,p)
lena,lenb = #aloop[i],#aloop[j]
-- lo('?? pINS:'..tableSize(de)..':'..lena..':'..lenb)
local ang = U.vang(l.pos-U.mod(a+1,aloop[i]).pos, k.pos-U.mod(b+1,aloop[j]).pos, true)
local ang = U.vang(l.pos-U.mod(a+1,aloop[i]).pos, k.pos-U.mod(b+1,aloop[j]).pos, true)
-- lo('?? lCROSS:'..a..':'..b..':'..tostring(p)..':'..s..':'..#av..':'..tableSize(de)..':'..ang)
-- lo('?? lCROSS:'..i..':'..j..':'..a..':'..b..':'..tostring(p)..':'..s..':'..ang..':'..#av..':'..tableSize(de))
-- lo('?? lCROSS:'..a..':'..b..':'..tostring(p)..':'..s..':'..#av..':'..tableSize(de)..':'..ang)
-- lo('?? lCROSS:'..i..':'..j..':'..a..':'..b..':'..tostring(p)..':'..s..':'..ang..':'..#av..':'..tableSize(de))
if hit then
--[[
U.dump(av, '?? for_AV0:'..tableSize(av)..'/'..#av)
M.out.atext[1] = {list=U.map(av,function(k,v)
--[[
U.dump(av, '?? for_AV1:'..tableSize(av)..'/'..#av)
M.out.atext[1] = {list=U.map(av,function(k,v)
end)
-- U.dump(across, '?? for_CROSS:'..i..':'..tableSize(de)..':'..#across)
--- cleanup colinear edges
for j=1,#across,2 do
-- U.dump(av,'?? for_AV_pre:'..tableSize(av)..'/'..#av)
-- lo('?? in_cross:'..j..':'..across[j][1]..':'..tostring(l[1]+dir*across[j][2]))
local ind = edgeSplit(across[j][1], l[1]+dir*across[j][2])
-- U.dump(av,'?? for_AV:'..tableSize(av)..'/'..#av)
-- if true then break end
if dbg then
lo('?? DE:'..tableSize(de)..' av:'..#av)
-- U.dump(av, '?? AV:'..tableSize(de))
lo('?? DE:'..tableSize(de)..' av:'..#av)
-- U.dump(av, '?? AV:'..tableSize(de))
M.out.aset[3] = {set=U.map(av, 'pos'), c={0.5,0,1}, w=0.005}
-- lo('?? post_SPROUT:'..#av)
-- U.dump(de, '?? DE_out:'..N..':'..tableSize(de))
-- M.out.aset[3] = {set=U.map(av, 'pos'), c={0.5,0,1}, w=0.01}
end
-- U.dump(avert, '?? avert:'..tableSize(avert))
local an,auv,af = {},{},{}
local function edgeUp(v1,v2)
-- ae[tableSize(ae)+1] = {v1,v2}
ae[iemax+1] = {v1,v2}
for i,loop in pairs(aloop) do
-- U.dump(loop, '?? for_loop:'..i) --..':'..#loop..':'..tableSize(loop))
local isout,irc
local function forSprouts(v)
if tableSize(v.star) > 2 then return {} end
return v.star
-- U.dump(av[#av], '?? to_INS:'..i..':'..#av..':'..emi)
-- U.dump(ae, '?? for_AEINS_pre:'..i..'>'..#av..':'..tableSize(ae)..':'..emi)
-- end
-- local v1,v2 = i,#av
-- ae[tableSize(ae)+1] = {v1,v2}
-- ae[#ae+1] = {v1,v2}
-- U.dump(av[#av], '?? to_INS:'..i..':'..#av..':'..emi)
-- U.dump(ae, '?? for_AEINS_post:'..tableSize(ae))
-- U.dump(ae, '?? postINS:')
local istart = 1
local ne = tableSize(ae)
for i,e in pairs(ae) do
-- U.dump(m.verts, '?? verts:')
-- U.dump(w4v, '?? AVERT:'..tableSize(w4v)..'/'..#avert..':'..#aface)
-- U.dump(aface, '?? AFACE:')
@/lua/ge/extensions/flowgraph/nodes/math/math.lua
function C:onLink(link)
if tableSize(self.pinInLocal) <= tableSize(self.pinIn) then
local pinName = string.char(97 + tableSize(self.pinIn))
function C:onLink(link)
if tableSize(self.pinInLocal) <= tableSize(self.pinIn) then
local pinName = string.char(97 + tableSize(self.pinIn))
if tableSize(self.pinInLocal) <= tableSize(self.pinIn) then
local pinName = string.char(97 + tableSize(self.pinIn))
self:createPin("in", {"number",'vec3','quat'}, pinName, 0, "A term of the expression.")
@/lua/ge/extensions/editor/gen/lib/jbeam.lua
-- dump(dgroup, '<< fileUp:'..tableSize(dgroup),nil,1)
lo('<< fileUp:'..tableSize(dgroup))
-- dump(dgroup, '<< fileUp:'..tableSize(dgroup),nil,1)
lo('<< fileUp:'..tableSize(dgroup))
part.dgroup = dgroup
-- dump(p2f, '?? p2f:',nil,1)
lo('<< part2file:'..tableSize(p2f))
@/lua/ge/extensions/util/export.lua
if tableSize(gltfRoot.materials[i].pbrMetallicRoughness) == 0 then
gltfRoot.materials[i].pbrMetallicRoughness = nil
@/lua/ge/extensions/editor/inspector.lua
else
for i = 1, tableSize(selectedIds) do
editor.setFieldValue(selectedIds[i], fieldName, fieldValue, arrayIndex)
else
for i = 1, tableSize(selectedIds) do
editor.setFieldValue(selectedIds[i], fieldName, fieldValue, arrayIndex)
else
for i = 1, tableSize(selectedIds) do
editor.setDynamicFieldValue(selectedIds[i], fieldName, fieldValue, arrayIndex)
if not valueInspector.selectedIds or 0 == tableSize(valueInspector.selectedIds) then
imgui.Text("No selection")
if tableSize(valueInspector.selectedIds) > 1 then
imgui.Text(tostring(tableSize(valueInspector.selectedIds)) .. " selected object(s)")
if tableSize(valueInspector.selectedIds) > 1 then
imgui.Text(tostring(tableSize(valueInspector.selectedIds)) .. " selected object(s)")
end
for fldName, field in pairs(ctx.fields) do
if field.useCount == tableSize(valueInspector.selectedIds) then
if nil == tableFindKey(commonFields, fldName) then
-- if we have multi selection, remove the name field, cant rename all objects at once the same name
if tableSize(editor.selection.object) > 1 then commonFields["name"] = nil end
-- we start at the second object, since the first one we keep as reference
for i = 2, tableSize(valueInspector.selectedIds) do
if not val.isArray then
for i = 1, tableSize(sortedFields) do
local val = sortedFields[i]
-- get all fields from all selected objects
for i = 1, tableSize(editor.selection.object) do
local objFields = editor.getFields(editor.selection.object[i])
@/lua/ge/map.lua
return (n1.endNode and 1 or 0) < (n2.endNode and 1 or 0)
elseif tableSize(n1.links) ~= tableSize(n2.links) then
return tableSize(n1.links) < tableSize(n2.links)
return (n1.endNode and 1 or 0) < (n2.endNode and 1 or 0)
elseif tableSize(n1.links) ~= tableSize(n2.links) then
return tableSize(n1.links) < tableSize(n2.links)
elseif tableSize(n1.links) ~= tableSize(n2.links) then
return tableSize(n1.links) < tableSize(n2.links)
else
elseif tableSize(n1.links) ~= tableSize(n2.links) then
return tableSize(n1.links) < tableSize(n2.links)
else
local node = nodeList[i]
tmpBuf:put(node.pos.x, node.pos.y, node.pos.z, node.radius, node.manual or 0, node.noMerge and 1 or 0, node.endNode and 1 or 0, tableSize(node.links))
end
local nodesNotMatchedCount = list2Count - tableSize(matchedL2)
if nodesNotMatchedCount > 0 then
local edgesNotMatchedCount = edgeList2Count - tableSize(matchedL2)
if edgesNotMatchedCount > 0 then
local l1n1id = edges[i][1] -- the vertical edge in the T junction
if tableSize(map.nodes[l1n1id].links) == 1 then
local edgeId, xnorm = resolveTJunction(edges, q_edges, i, l1n1id)
local l1n2id = edges[i][2]
if tableSize(map.nodes[l1n2id].links) == 1 then
local edgeId, xnorm = resolveTJunction(edges, q_edges, i, l1n2id)
-- if tableSize(newNodesCreated) ~= numOfNewNodesCreated then -- TODO: remove debug
-- print('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! mergeNodesToLines Error 2 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!')
local function isJunction(nId)
local nodeDegree = tableSize(map.nodes[nId].links)
if nodeDegree ~= 2 then
for nid, n in pairs(map.nodes) do
local linksize = tableSize(n.links)
if linksize == 1 then
if not gp or not gp.graph[nId] then return -1 end
return tableSize(gp.graph[nId])
end
@/lua/vehicle/hydros.lua
local function processResponseCurve(rCurve)
if tableSize(rCurve) < 2 then
log("W", "", "FFB response functionality disabled due to invalid curve table size: "..dumps(rCurve))
local result = { {1,1} }
for i = tableSize(rCurve), 1, -1 do
if rCurve[i][1] < result[1][1] and rCurve[i][2] < result[1][2] then
if tableSize(result) < 2 then
log("W", "", "FFB response functionality disabled due to invalid normalized curve: "..dumps(result))
end
numberOfPoweredWheels = tableSize(poweredWheelIndices)
wheelCount = wheels.wheelCount
@/lua/ge/extensions/editor/api/valueInspector.lua
for i = 1, tableSize(sortedObjectNameAndClass) do
local objInfo = sortedObjectNameAndClass[i]
--TODO: sort by name
for i = 1, tableSize(objectSet) do
local obj = objectSet[i]
if imgui.BeginCombo(fieldNameId, fieldValue, imgui.ComboFlags_HeightLargest) then
for n = 1, tableSize(annotations) do
local isSelected = (fieldValue == annotations[n]) and true or false
end
elseif customData and customData.enum ~= nil and tableSize(customData.enum) > 0 then
local widgetsBasicComboItems = { "" }
@/lua/ge/extensions/career/modules/partShopping.lua
if jbeamData.cargoStorage and not isCargoLogisticsMaterialsUnlocked() and jbeamData.information.name ~= "Magic Cargo Testing Part" then
for i=2, tableSize(jbeamData.cargoStorage) do
for _, cargoType in ipairs(jbeamData.cargoStorage[i][3]) do
local text = "Bought new parts: "
for i=1,tableSize(shoppingCart.partsInList) - 1 do
local part = shoppingCart.partsInList[i]
end
local part = shoppingCart.partsInList[tableSize(shoppingCart.partsInList)]
text = text .. part.description.description
@/lua/ge/extensions/flowgraph/nodes/gameplay/traffic/signals/controller.lua
self.pinOut.signalType.value = ctrl.type
self.pinOut.stateCount.value = tableSize(ctrl.states)
self.pinOut.duration.value = ctrl.totalDuration
@/lua/ge/extensions/editor/flowgraph/overview.lua
--im.SameLine()
--im.TextColored(im.ImVec4(1,0.6,0,1), '[' .. tostring(tableSize(graph.nodes)) .. ']')
--selectThisGraph = selectThisGraph or im.IsItemClicked()
@/lua/ge/extensions/ui/ambientSound.lua
stream.currentSoundData.currentSound = stream.sounds[temp]
if stream.delay and tableSize(stream.delay) ==2 then
stream.currentSoundData.delay = math.random(stream.delay[1],stream.delay[2])
stream.currentSoundData.delay = math.random(stream.delay[1],stream.delay[2])
elseif tableSize(stream.delay)==1 then
temptable.delay = math.random(stream.delay[1]) -- generates integer numbers between 1 and stream.delay[1]
local function deleteSoundSFX(ID)
local soundtablesize =tableSize(soundStreams)
for i=1,soundtablesize do
@/lua/ge/extensions/editor/api/object.lua
local numObjects = tableSize(editor.selection.object)
for i = 1, tableSize(editor.selection.object) do
local obj = Sim.findObjectById(editor.selection.object[i])
if tableSize(sortedFieldData) == tableSize(fieldData) then
break
if tableSize(sortedFieldData) == tableSize(fieldData) then
break
if not editor.selection.object then return end
for i = 1, tableSize(editor.selection.object) do
editor.deleteObject(editor.selection.object[i])
if not editor.selection.object then editor.selection.object = {} end
for i = 1, tableSize(idArray) do
if not arrayFindValueIndex(editor.selection.object, idArray[i]) then
local idx
for i = 1, tableSize(idArray) do
idx = arrayFindValueIndex(editor.selection.object, idArray[i])
local idx
for i = 1, tableSize(idArray) do
idx = arrayFindValueIndex(editor.selection.object, idArray[i])
local function lockObjectSelection()
for i = 1, tableSize(editor.selection.object) do
editor.setFieldValue(editor.selection.object[i], "locked", "true")
local function unlockObjectSelection()
for i = 1, tableSize(editor.selection.object) do
editor.setFieldValue(editor.selection.object[i], "locked", "false")
local function hideObjectSelection()
for i = 1, tableSize(editor.selection.object) do
editor.setFieldValue(editor.selection.object[i], "hidden", "true")
local function showObjectSelection()
for i = 1, tableSize(editor.selection.object) do
editor.setFieldValue(editor.selection.object[i], "hidden", "false")
end
if tableSize(editor.selection.object) < 2 then
return true
for i = 2, tableSize(editor.selection.object) do
local object = Sim.findObjectById(editor.selection.object[i])
-- move all selected objects to align with the calculated bounds
for i = 1, tableSize(editor.selection.object) do
if i ~= baseObjIndex then
end
if tableSize(editor.selection.object) < 2 then
return true
local pos = object:getPosition()
for i = 1, tableSize(editor.selection.object) do
local object = Sim.findObjectById(editor.selection.object[i])
--TODO: undo
for i = 1, tableSize(editor.selection.object) do
local object = Sim.findObjectById(editor.selection.object[i])
local function resetObjectSelectionRotation()
for i = 1, tableSize(editor.selection.object) do
local object = Sim.findObjectById(editor.selection.object[i])
local function resetObjectSelectionScale()
for i = 1, tableSize(editor.selection.object) do
local object = Sim.findObjectById(editor.selection.object[i])
local function translateObjectSelection(deltaTranslate)
for i = 1, tableSize(editor.selection.object) do
local object = Sim.findObjectById(editor.selection.object[i])
if not initialTransformations then return end
for i = 1, tableSize(editor.selection.object) do
local object = Sim.findObjectById(editor.selection.object[i])
local currentMax = 0
for i = 1, tableSize(editor.selection.object) do
objects[i] = Sim.findObjectById(editor.selection.object[i])
local maxPrevScale = -math.huge
for i = 1, tableSize(editor.selection.object) do
local object = objects[i]
local center = centerPoint or vec3(editor.objectSelectionBBox:getCenter())
for i = 1, tableSize(editor.selection.object) do
local object = objects[i]
local divisor = 0
local stackSize = tableSize(stack)
while stackSize > 0 do
stackSize = tableSize(stack)
end
local stackSize = tableSize(stack)
while stackSize > 0 do
stackSize = tableSize(stack)
end
for i = 1, tableSize(editor.selection.object) do
local obj = scenetree.findObjectById(editor.selection.object[i])
editor.logDebug("Selection:")
for i = 1, tableSize(editor.selection.object) do
local object = Sim.findObjectById(editor.selection.object[i])
if editor.selection.object then
for i = 1, tableSize(editor.selection.object) do
local selectedObject = scenetree.findObjectById(editor.selection.object[i])
@/lua/ge/extensions/core/quickAccess.lua
for _, triggerEntry in ipairs(triggerEntries) do
if tableSize(vehIds) > 1 then
triggerEntry.title = triggerEntry.titleWithVehicleName
@/lua/ge/extensions/career/saveSystem.lua
local folders = FS:directoryList(saveRoot .. slotName, false, true)
for i = 1, tableSize(folders) do
local dir, filename, ext = path.split(folders[i])
-- TODO use getAllAutosaves to get the newest or oldest save
if (tableSize(folders) < numberOfAutosaves) and oldest then
-- Check the autosave folders that are already there to find a name that isnt used yet
else
for i = 1, tableSize(folders) do
local data = jsonReadFile(folders[i] .. "/info.json")
local folders = FS:directoryList(oldName, true, true)
for i = 1, tableSize(folders) do
if FS:directoryExists(folders[i]) then
local folders = FS:directoryList(saveRoot, false, true)
for i = 1, tableSize(folders) do
local dir, filename, ext = path.split(folders[i])
@/lua/common/jbeam/groups.lua
if not tableIsEmpty(vehicle.groups) then
--log('D', "jbeam.postProcess"," - processed "..tableSize(vehicle.groups).." groups")
--for k, g in pairs(vehicle.groups) do
@/lua/vehicle/beamstate.lua
if part then
local beamCount = tableSize(part.beams)
local partValue = 0
if not tableIsEmpty(inflatedTires) then
deflateTire(inflatedTires[math.floor(math.random(tableSize(inflatedTires)))])
end
@/lua/vehicle/extensions/scenario/functionFreezer.lua
end
log("D", "functionFreezer", "Added "..dumps(tableSize(functionNames)).." functions to freeze list")
end
@/lua/ge/extensions/editor/materialEditor.lua
end
elseif editor.selection.forestItem and tableSize(editor.selection.forestItem) > 0 then
materialObjectNames = {}
if im.BeginCombo("##annotation", value, im.ComboFlags_HeightLargest) then
for n = 1, tableSize(annotations) do
local isSelected = (value == annotations[n]) and true or false
@/lua/ge/extensions/flowgraph/nodes/logic/booleanExpression.lua
function C:onLink(link)
if tableSize(self.pinInLocal) <= tableSize(self.pinIn) then
local pinName = string.char(97 + tableSize(self.pinIn))
function C:onLink(link)
if tableSize(self.pinInLocal) <= tableSize(self.pinIn) then
local pinName = string.char(97 + tableSize(self.pinIn))
if tableSize(self.pinInLocal) <= tableSize(self.pinIn) then
local pinName = string.char(97 + tableSize(self.pinIn))
self:createPin("in", "bool", pinName, 0, "A term of the expression.")
@/lua/ge/extensions/editor/sceneTree.lua
if node.children and tableSize(node.children) then
for _, child in pairs(node.children) do
local function nodeIsInTheSelection(instance, node)
for i = 1, tableSize(instance.selectedNodes) do
if instance.selectedNodes[i].id == node.id then return true end
elseif operation == opAddObject then
if tableSize(batchedData) > 0 then
refreshAllNodes(batchedData)
local prefab_instances = editor.convertSelectedPrefabsToV2()
-- if tableSize(groups) then
-- if groups[1] then
local groups = editor.unpackageSelectedPrefabInstance()
-- if tableSize(groups) then
-- if groups[1] then
if (onClickSelected or clickedOnNode) and not hasDragDropPayload then
if tableSize(editor.selection.object) == 1 and not nodeWasDblClicked then
node.renameRequestTime = socket.gettime()
if imgui.Selectable1("Select Children") then
if tableSize(instance.selectedNodes) == 1 then
local parentNode = instance.selectedNodes[1]
if (onClickSelected or clickedOnNode) and not hasDragDropPayload then
if tableSize(editor.selection.object) == 1 and not nodeWasDblClicked then
node.renameRequestTime = socket.gettime()
if imgui.Selectable1("Select Children") then
if tableSize(instance.selectedNodes) == 1 then
local parentNode = instance.selectedNodes[1]
if node.selected and not (ctrlDown or shiftDown) then
if tableSize(editor.selection.object) == 1 and not nodeWasDblClicked then
node.renameRequestTime = socket.gettime()
local groups = editor.explodeSelectedPrefab()
if tableSize(groups) then
if groups[1] then
if tableSize(editor.selection.object) == 1
and node.renameRequestTime
--TODO: this will force 1 instance only of the scene tree
if tableSize(guiInstancer.instances) == 1 then return end
addNewSceneTreeInstance()
editor.getSelectedSceneTreeNodes = function()
if tableSize(guiInstancer.instances) then
--TODO: remove the "0" key, was a wrong decision to use 0-based indices
@/lua/ge/extensions/editor/buildingEditor.lua
-- lo('>> onEditorObjectSelectionChanged:')
if tableSize(editor.selection.object) == 1 and editor.selection.object[1] and D then
D.out.inconform = false
@/lua/ge/extensions/editor/rallyEditor/measurementsTab.lua
log('I', logTag, 'Loaded ' .. tableSize(self.measurements) .. ' measurements')
end
@/lua/vehicle/controller/advancedCouplerControl.lua
local groupState
if tableSize(currentStates) == 1 then
groupState = couplerGroup.couplerNodePairs[1].state
@/lua/ge/extensions/editor/api/gui.lua
editor.icons = atlasInfo.icons
local iconsCount = tableSize(editor.icons)
@/lua/ge/extensions/gameplay/garageMode.lua
garageInitCurrentStep = garageInitCurrentStep + 1
if garageInitCurrentStep > tableSize(garageInitModules) then
garageInitCurrentStep = 1
if career_career.isActive() then
if tableSize(career_modules_inventory.getVehicles()) == 0 then
ui_message("No vehicles in inventory! Buy a vehicle to enter garage mode.", nil, "garageMode")
@/lua/vehicle/bdebugImpl.lua
txt = '{'
local ngSize = tableSize(node.group)
local k = 1
torsionBarsCount = v.data.torsionbars and tableSizeC(v.data.torsionbars) or 0
railsCount = v.data.rails and tableSize(v.data.rails) or 0
slidenodesCount = v.data.slidenodes and tableSizeC(v.data.slidenodes) or 0
@/lua/vehicle/powertrain/rangeBox.lua
device.maxGearRatio = 0
for i = 0, tableSize(forwardGears) - 1, 1 do
device.gearRatios[i] = forwardGears[i + 1]
end
for i = -1, -tableSize(reverseGears), -1 do
device.gearRatios[i] = reverseGears[abs(i)]
@/lua/ge/extensions/scenario/scenarios.lua
-- get the last entry in the list, this is usually the last waypoint in the path
local numWaypoints = #scenario.lapConfig -- tableSize(scenario.lapConfig)
-- log('I', 'scenario.race', 'number of waypoint '..numWaypoints)
-- the extra choice is "no vehicle assigned", represented by number 0
local nChoices = tableSize(scenario.playerUsableVehicles) + 1
return (index + step) % nChoices
else
local nChoices = tableSize(scenario.playerUsableVehicles)
return ((index - 1 + step) % nChoices) + 1 -- vehicleIds range is 1..N
@/lua/vehicle/powertrain/automaticGearbox.lua
device.minGearRatio = 999999
for i = 0, tableSize(forwardGears) - 1, 1 do
device.gearRatios[i] = forwardGears[i + 1]
end
local reverseGearCount = tableSize(reverseGears)
for i = -reverseGearCount, -1, 1 do
@/lua/ge/extensions/career/modules/milestones/generalMilestones/speedTraps.lua
local allTrapMilestoneId = "allSpeedTrapMilestone"
local numOfTraps = tableSize(velocityMilestonesByTrapName)
local stepPercent = {0.01,0.3,0.6,1.0}
@/lua/ge/extensions/core/paths.lua
-- fix up the rotations
local markerCount = tableSize(pathJsonObj.markers)
for i = 2, markerCount do
@/lua/common/jbeam/io.lua
end
log('D', 'jbeam.startLoading', "Loaded " .. tostring(partCountTotal) .. " parts from " .. tostring(tableSize(jbeamCache)) .. ' jbeam files in ' .. tostring(dir))
end
@/lua/ge/extensions/util/calibrateESC.lua
local configCount = tableSize(filteredConfigs)
log("I", logTag, tostring(configCount) .. " configs")
@/lua/ge/extensions/career/modules/painting.lua
if tableSize(chosenPaints) < 3 then
for i = tableSize(chosenPaints)+1, 3 do
if tableSize(chosenPaints) < 3 then
for i = tableSize(chosenPaints)+1, 3 do
chosenPaints[i] = chosenPaints[i-1]
@/lua/ge/extensions/career/modules/inventory.lua
local files = FS:findFiles(savePath .. "/career/vehicles/", '*.json', 0, false, false)
for i = 1, tableSize(files) do
local vehicleData = jsonReadFile(files[i])
callbackCounter = callbackCounter + 1
if callbackCounter >= tableSize(vehIdToInventoryId) then
callback()
local files = FS:findFiles(currentSavePath .. "/career/vehicles/", '*.json', 0, false, false)
for i = 1, tableSize(files) do
local dir, filename, ext = path.split(files[i])
if tableSize(vehicles) == 1 then
M.setFavoriteVehicle(inventoryId)
@/lua/ge/extensions/editor/terrainMaterialsEditor.lua
if index ~= -1 then
if tableSize(editor_terrainEditor.getPaintMaterialProxies()) == 1 then
editor.logWarn("Cannot delete terrain material, there must be at least one in the library and terrain block")
if im.BeginCombo("##annotation", value, im.ComboFlags_HeightLargest) then
for n = 1, tableSize(annotations) do
local isSelected = (value == annotations[n]) and true or false
@/lua/common/extensions/ui/imguiUtils.lua
if type(data) == 'table' then
local tsize = tableSize(data)
if tsize == 0 then
@/lua/ge/extensions/editor/measuresInspectorHeader.lua
if tableSize(selection.object) == 1 then
local obj = scenetree.findObjectById(selection.object[1])
@/lua/ge/extensions/editor/api/objectHistoryActions.lua
local function changeObjectFieldUndo(actionData)
for i = 1, tableSize(actionData.objectIds) do
editor.setFieldValue(actionData.objectIds[i], actionData.fieldName, actionData.oldFieldValues[i] or "", actionData.arrayIndex)
local function changeObjectFieldRedo(actionData)
for i = 1, tableSize(actionData.objectIds) do
editor.setFieldValue(actionData.objectIds[i], actionData.fieldName, actionData.newFieldValue, actionData.arrayIndex)
local function changeObjectFieldMultipleValuesUndo(actionData)
for i = 1, tableSize(actionData.objectIds) do
editor.setFieldValue(actionData.objectIds[i], actionData.fieldName, actionData.oldFieldValues[i] or "", actionData.arrayIndex)
local function changeObjectFieldMultipleValuesRedo(actionData)
for i = 1, tableSize(actionData.objectIds) do
editor.setFieldValue(actionData.objectIds[i], actionData.fieldName, actionData.newFieldValues[i], actionData.arrayIndex)
local function changeObjectDynFieldUndo(actionData)
for i = 1, tableSize(actionData.objectIds) do
editor.setDynamicFieldValue(actionData.objectIds[i], actionData.fieldName, actionData.oldFieldValues[i] or "", actionData.arrayIndex)
local function changeObjectDynFieldRedo(actionData)
for i = 1, tableSize(actionData.objectIds) do
editor.setDynamicFieldValue(actionData.objectIds[i], actionData.fieldName, actionData.newFieldValue, actionData.arrayIndex)
@/lua/ge/extensions/editor/fileDialog.lua
table.insert(recentDirs, currentPath)
if tableSize(recentDirs) > 10 then
table.remove(recentDirs, 1)
end
im.SetNextWindowSize(im.ImVec2(recentDirsWindowWidth, 23 * im.uiscale[0] * tableSize(recentDirs) + 5))
--TODO: convert to modal popup
@/lua/ge/extensions/editor/dynamicDecals/layerTypes/decal.lua
end
if tableSize(sMeshesCopy) == 0 then
layer.meshes[vehicleObj.jbeam] = nil
layer.meshes[vehicleObj.jbeam] = nil
if tableSize(layer.meshes) == 0 then
layer.meshes = nil
if layer.meshes and tableSize(layer.meshes) == 0 then
layer.meshes = nil
@/lua/ge/extensions/editor/roadEditor.lua
local function pasteFieldsAM()
if tableSize(selectedRoadsIds) == 1 and fieldsCopy then
editor.history:commitAction("PasteRoad", {oldFields = editor.copyFields(selectedRoadsIds[1]), newFields = deepcopy(fieldsCopy), roadId = selectedRoadsIds[1]}, pasteActionUndo, pasteActionRedo)
else
for index = 1, tableSize(road2Nodes) do
local node = road2Nodes[numNodes - index + 1]
local function fuseRoads()
if tableSize(selectedRoadsIds) ~= 2 then return end
local selectedRoad1 = scenetree.findObjectById(selectedRoadsIds[1])
if selectedNodesInRoad then
nodeId = (tableSize(selectedNodesInRoad) == 1) and selectedNodesInRoad[1] or -1
end
if not tableIsEmpty(selectedRoadsIds) then
local numSelectedRoads = tableSize(selectedRoadsIds)
for i = 1, numSelectedRoads do
end
local averageNodeWidth = nodeWidthsTotal / tableSize(editor.getNodes(selectedRoad))
editor.setPreference("roadEditor.general.defaultWidth", averageNodeWidth)
nodes[roadID] = {}
local numSelectedNodesInRoad = tableSize(selectedNodes[roadID])
-- If there are 2 or more unselected nodes then we just delete the selected nodes
table.clear(selectedRoadsIds)
for i = 1, tableSize(editor.selection.object) do
local selectedObject = scenetree.findObjectById(editor.selection.object[i])
@/lua/vehicle/energyStorage.lua
storageCount = tableSize(energyStorages)
@/lua/ge/extensions/tech/sumoExporter.lua
end
if tableSize(nextSuccessors) ~= 2 or allVisited then
if not doesCollectionContainSegment(segments, currentPath) then
@/lua/common/jbeam/tableSchema.lua
if type(entry) == "table" and tableIsDict(entry) then
log('D', ""," ** "..tostring(keyEntry).." = [DICT] #" ..tableSize(entry))
elseif type(entry) == "table" and not tableIsDict(entry) then
elseif type(entry) == "table" and not tableIsDict(entry) then
log('D', ""," ** "..tostring(keyEntry).." = [LIST] #"..tableSize(entry))
else
@/lua/ge/extensions/career/modules/vehicleShopping.lua
end
local average = sum / tableSize(configs)
for _, configInfo in ipairs(configs) do
-- generate the remaining vehicles without a duplicate check
local numberOfMissingVehicles = numberOfVehiclesToGenerate - tableSize(newRandomVehicleInfos)
if numberOfMissingVehicles > 0 then
repeat
parkingSpotName = parkingSpotNames[math.random(tableSize(parkingSpotNames))]
parkingSpot = parkingSpots[parkingSpotName]
repeat
parkingSpotName = parkingSpotNames[math.random(tableSize(parkingSpotNames))]
parkingSpot = parkingSpots[parkingSpotName]
log("I", "Career", "Vehicles in shop: " .. tableSize(vehiclesInShop))
end
@/lua/ge/extensions/editor/assetManagementTool.lua
local recordCount = tableSize(assetsByHash)
local idx = 0
editor.log("Discovered " .. tableSize(allAssetsWithHashes) .. " game files")
local folderIndex = 0
total = tableSize(allAssetsWithHashes)
local idx = 0
imgui.Separator()
imgui.Text(tostring(tableSize(assetsByHash)) .. " asset record(s)")
local selectedCount = tableSize(selectedHashes)
@/lua/ge/extensions/editor/gen/utils.lua
a[3] = nil
print('??^^^^^^^^^^^ TST2:'..#a..':'..tableSize(a))
a[#a+1] = 9
a[#a+1] = 9
print('??^^^^^^^^^^^ TST3:'..#a..':'..tableSize(a)..':'..tostring(a[3])..':'..tostring(a[#a]))
]]
@/lua/ge/extensions/editor/mainMenu.lua
if forceShowNewest then
editor.currentNotificationIndex = tableSize(editor.notificationQueue)
end
and (not tableIsEmpty(editor.notificationQueue))
and editor.notificationQueue[tableSize(editor.notificationQueue)].time > editor.notificationQueue[tableSize(editor.notificationQueue)].duration then return end
and (not tableIsEmpty(editor.notificationQueue))
and editor.notificationQueue[tableSize(editor.notificationQueue)].time > editor.notificationQueue[tableSize(editor.notificationQueue)].duration then return end
if editor.currentNotificationIndex == 0 then editor.currentNotificationIndex = tableSize(editor.notificationQueue) end
editor.currentNotificationIndex = editor.currentNotificationIndex + 1
if editor.currentNotificationIndex > tableSize(editor.notificationQueue) then editor.currentNotificationIndex = 0 return end
end
@/lua/ge/extensions/career/modules/milestones/generalMilestones/missions.lua
for _, m in ipairs(missions) do
count = count + tableSize(m.saveData.unlockedStars or {})
end
for _, m in ipairs(missions) do
count = count + tableSize(m.saveData.unlockedStars or {})
end
@/lua/vehicle/powertrain.lua
local function serializeDevicesInfo()
if tableSize(powertrainDevices) < tableSize(serializeInfoRes) then
table.clear(serializeInfoRes)
local function serializeDevicesInfo()
if tableSize(powertrainDevices) < tableSize(serializeInfoRes) then
table.clear(serializeInfoRes)
--check how many of our children ARE actually connected properly and adjust their parent if they aren't
t.connectedChildrenCount = tableSize(t.children)
if t.children then
if v.data.powertrain then
local count = tableSize(v.data.powertrain)
if count <= 0 then
device.uiSimpleModeControl = jbeamData.uiSimpleModeControl == nil and true or jbeamData.uiSimpleModeControl
if type(jbeamData.visualPositionRelativeParent) == "table" and tableSize(jbeamData.visualPositionRelativeParent) == 3 then
device.visualPositionRelativeParent = {
end
if type(jbeamData.visualPositionRelativeChildren) == "table" and tableSize(jbeamData.visualPositionRelativeChildren) > 0 then
for _, childRelativePosition in pairs(jbeamData.visualPositionRelativeChildren) do
local pos = {}
if tableSize(childRelativePosition) == 3 then
pos = {
deviceCount = tableSize(powertrainDevices)
for childIndex, childRelativePosition in ipairs(device.visualPositionRelativeChildren) do
if tableSize(childRelativePosition) == 3 and device.children[childIndex] and device.children[childIndex].visualPosition then
device.visualPosition = {
@/lua/ge/extensions/core/vehicles.lua
if cache[key].configs and tableSize(cache[key].configs) < 1 then
cache[key].configs[key] = deepcopy(model)
@/lua/ge/extensions/util/groundModelDebug.lua
local i = 1
local groundModelSize = tableSize(core_environment.groundModels)
@/lua/ge/extensions/c2/panelPlugins/tileManager.lua
im.Separator()
im.Text("Cache Size: " .. tableSize(activeTileCache))
if tableSize(activeTileCache) > 50 then
activeTileCache = {}
@/lua/ge/extensions/editor/objectTool.lua
if obj and obj.getPosition then
if tableSize(editor.selection.object) > 1 then
if editor.getPreference("snapping.general.snapToGrid") and editor.getPreference("snapping.grid.useLastObjectSelected") and obj.getPosition then
local objects = {}
for i = 1, tableSize(editor.selection.object) do
objects[i] = scenetree.findObjectById(editor.selection.object[i])
for i = 1, tableSize(editor.selection.object) do
local obj = objects[i]
axisGizmoEventState.objects = {}
for i = 1, tableSize(editor.selection.object) do
local obj = scenetree.findObjectById(editor.selection.object[i])
local objects = {}
for i = 1, tableSize(editor.selection.object) do
objects[i] = scenetree.findObjectById(editor.selection.object[i])
local objects = {}
for i = 1, tableSize(editor.selection.object) do
objects[i] = scenetree.findObjectById(editor.selection.object[i])
editor.history:beginTransaction("ScaleObjectSelection")
for i = 1, tableSize(editor.selection.object) do
local obj = objects[i]
editor.history:beginTransaction("TransformObjectSelection")
for i = 1, tableSize(editor.selection.object) do
local obj = objects[i]
local drawGizmo = not raycastMode
for i = 1, tableSize(editor.selection.object) do
local obj = scenetree.findObjectById(editor.selection.object[i])
if editor.getPreference("gizmos.general.drawSelectionBoundingBox") then
if tableSize(editor.selection.object) > 1 then
local mtx = MatrixF(true)
local selectedObjects = {}
for i = 1, tableSize(editor.selection.object) do
local obj = scenetree.findObjectById(editor.selection.object[i])
imgui.BeginChild1("icon object classes", imgui.ImVec2(0, 200))
for k = 1, tableSize(classes) do
imgui.PushID1(tostring(k))
@/lua/common/jsonPrettyEncoderCustom.lua
-- collapse anything below bindings that has less than 4 items
return path:sub(1,10) == '/bindings/' and tableSize(item) < 4
end
@/lua/ge/extensions/editor/slotTrafficEditor.lua
if tableSize(editor.selection.stNode) == 1 then
onlySelectedNode = id
log('I', logTag, "Imported " .. tableSize(roads) .. " roads with " .. tableSize(mapNodes) .. " nodes")
updateQt = true
log('I', logTag, "Imported " .. tableSize(roads) .. " roads with " .. tableSize(mapNodes) .. " nodes")
updateQt = true
-- Display road statistics
im.Text("Roads: " .. tableSize(roads))
im.Text("Nodes: " .. tableSize(mapNodes))
im.Text("Roads: " .. tableSize(roads))
im.Text("Nodes: " .. tableSize(mapNodes))
-- Show roads data table with virtual scrolling
if tableSize(roads) > 0 then
-- Add filter text box
@/lua/ge/extensions/editor/autoSave.lua
autosaves = {}
for i = 1, tableSize(folders) do
table.insert(autosaves, {
imgui.BeginChild1("autosaves", imgui.ImVec2(0, 200))
for k = tableSize(autosaves), 1, -1 do
imgui.PushID1(tostring(k))
@/lua/ge/extensions/editor/undoHistory.lua
imgui.SameLine()
if imgui.Button("Undo Selected") then editor.undo(tableSize(editor.history.undoStack) - selectedIndex + 1) end
imgui.BeginChild1("undos", imgui.ImVec2(0, imgui.GetContentRegionAvail().y))
imgui.BeginChild1("undos", imgui.ImVec2(0, imgui.GetContentRegionAvail().y))
for k = tableSize(editor.history.undoStack), 1, -1 do
local isSel = (k >= selectedIndex)
imgui.SameLine()
if imgui.Button("Redo Selected") then editor.redo(tableSize(editor.history.redoStack) - selectedIndex2 + 1) end
imgui.BeginChild1("redos", imgui.ImVec2(0, imgui.GetContentRegionAvail().y))
imgui.BeginChild1("redos", imgui.ImVec2(0, imgui.GetContentRegionAvail().y))
for k = tableSize(editor.history.redoStack), 1, -1 do
local isSel = (k >= selectedIndex2)
@/lua/ge/extensions/editor/missionEditor/setupModules.lua
for k, v in pairs(m.setupModules) do
if v.enabled == nil or (v.enabled and tableSize(v) <= 1) then
table.insert(issues, {label = 'Missing or malformed data for setup module: '..k, severity = 'error'})
@/lua/common/jbeam/sections/wheels.lua
if not tableIsEmpty(vehicle[wheelSection]) then
--log('D', "jbeam.processWheel"," - processed "..tableSize(vehicle[wheelSection]).." of "..wheelSection.."(s)")
end
if not tableIsEmpty(vehicle.rotators) then
--log('D', "jbeam.postProcess"," - processed "..tableSize(vehicle.rotators).." of rotator(s)")
end
@/lua/ge/extensions/editor/biomeTool.lua
local numNodes = tableSize(lassoArea.nodes)
for index, node in ipairs(lassoArea.nodes) do
if layer.layerID == layerID and layer.layerType == layerType_enum.area then
count = tableSize(layer.lassoAreas)
break
@/lua/ge/extensions/editor/api/genericInspector.lua
for i = 1, tableSize(sortedFields) do
local val = sortedFields[i]
@/lua/ge/client/postFx/dof.lua
local resultArgs = split(result, ' ')
if result == "" or tableSize(resultArgs) < 4 or not resultArgs[1] or not resultArgs[2] or not resultArgs[3] then
return farDist
@/lua/ge/extensions/core/settings/graphic.lua
local entries = split( videoModeStr, ' ')
local count = tableSize(entries)
if count == 6 then
@/lua/vehicle/backwardsCompatibility.lua
local numberOfOldDiffs = tableSize(oldData)
if numberOfOldDiffs == 1 then
local uniqueWheels = {}
for i = 0, tableSize(oldData) - 1, 1 do
local oldDiff = oldData[i]
@/lua/ge/extensions/core/multiseat.lua
local maxPlayers = getMaxPlayersAmount(multiseat)
local nVehicles = tableSize(getAllVehicles())
local nControllers = tableSize(devices) - 1 -- assume mouse goes together with keyboard
local nVehicles = tableSize(getAllVehicles())
local nControllers = tableSize(devices) - 1 -- assume mouse goes together with keyboard
local players = math.max(1,math.min(maxPlayers, nControllers))
@/lua/ge/extensions/editor/gen/decal.lua
local aobj = groupLines:getObjects()
-- lo('?? pre:'..tableSize(editor.getAllRoads())..':'..#scenetree.getAllObjects())
for _,o in pairs(aobj) do
groupLines:deleteAllObjects()
-- lo('?? post:'..tableSize(editor.getAllRoads())..':'..#scenetree.getAllObjects())
end
out.across = across
lo('<< forCross:'..tableSize(across)..':'..nc) --..':'..tostring(out.avedit[1])..':'..tostring(out.avedit[2]))
-- U.dump(across)
local rdlist = editor.getAllRoads()
lo('>> decalsLoad:'..tostring(L)) --..' m/p=:'..tostring(g)..' N='..tableSize(rdlist)..':'..tostring(obj))
local icheck
local icheck
if tableSize(rdlist) > 400 then return end
nrd = 1
-- junctions
lo('?? for_across:'..tableSize(out.across)..':'..#adec)
-- U.dump(across)
-- U.dump(adec[10].list, '?? list:')
lo('<< decalsLoad:'..(nrd-1)..':'..#across..' adec:'..#adec..'/'..tableSize(editor.getAllRoads())..' aref:'..#aref..':'..tableSize(aref)) --..':'..tostring(adec[49].list[1]))
-- U.camSet({-497.75, 315.61, 227.73, -0.10119, 0.277522, -0.897572, -0.327271})
-- U.dump(adec[10].list, '?? list:')
lo('<< decalsLoad:'..(nrd-1)..':'..#across..' adec:'..#adec..'/'..tableSize(editor.getAllRoads())..' aref:'..#aref..':'..tableSize(aref)) --..':'..tostring(adec[49].list[1]))
-- U.camSet({-497.75, 315.61, 227.73, -0.10119, 0.277522, -0.897572, -0.327271})
-- if true then return end
lo('?? D.undo:'..tableSize(adec)..'/'..#adec..':'..tableSize(mask)..':'..tostring(silent))
for ij,d in pairs(mask) do
-- if true then return end
lo('?? D.undo:'..tableSize(adec)..'/'..#adec..':'..tableSize(mask)..':'..tostring(silent))
for ij,d in pairs(mask) do
end
-- lo('<< del:'..tableSize(adec)..':'..#adec)
end
local bcross = across[ind]
lo('?? conf_road:'.._..':'..ind..':'..tostring(adec[ind].list[1])..':'..tableSize(bcross))
if bcross then
out.avedit = {}
if dbg then U.dump(bcross, '?? road2ter:'..ind..':'..adec[ind].id..':'..tableSize(bcross)..' w:'..tostring(rd.aw and rd.aw[1] or rd.w)) end
--- go over cross points on the branch
if dbg then
lo('?? to_flat:'..i..':'..tostring(jrad)..':'..tableSize(mask))
end
if tableSize(bcross) == 1 then
-- lo('?? for_bc:'..ccross)
dhist[rd.ind][#dhist[rd.ind]+1] = deepcopy(mask)
lo('?? to_hist:'..rd.ind..':'..tableSize(dhist[rd.ind][#dhist[rd.ind]])..':'..tostring(rd.aset and tableSize(rd.aset) or nil)..' lines:'..tostring(rd.aline and #rd.aline or nil))
-- update ajacent
dhist[rd.ind][#dhist[rd.ind]+1] = deepcopy(mask)
lo('?? to_hist:'..rd.ind..':'..tableSize(dhist[rd.ind][#dhist[rd.ind]])..':'..tostring(rd.aset and tableSize(rd.aset) or nil)..' lines:'..tostring(rd.aline and #rd.aline or nil))
-- update ajacent
local function forPlot(render)
lo('>> forPlot:'..tableSize(amatch)..':'..tostring(render))
-- out.aplot = {}
local n = 0
while tableSize(tomatch) > 0 and n<15 do
for i,_ in pairs(tomatch) do
local function onSelect()
lo('>> onSelect:'..tableSize(editor.selection.object))
for i = 1, tableSize(editor.selection.object) do
lo('>> onSelect:'..tableSize(editor.selection.object))
for i = 1, tableSize(editor.selection.object) do
local selectedObject = scenetree.findObjectById(editor.selection.object[i])
local function widthRestore()
lo('>>+++++!!!!!!!!!!!!!! widthRestore:'..tableSize(aedit))
if true then return end
lo('?? deacl:'..tostring(tableSize(rdlist)))
--[[
if false and tableSize(adec) == 0 then
lo('!! TO_LOAD:')
anode = editor.getNodes(croad)
lo('?? ter2road:'..tableSize(adec)) --..':'..tostring(adec[1].list[1])..':'..croad:getEdgeCount()..':'..tostring(anode[2].width))
if #U.index(conformed, cpick) == 0 then
lo('<< ter2road:'..#out.avedit..':'..#shmap..':'..aeinfo[#aeinfo].d) --....croad:getField("Material", "")..':'..tostring(croad:getPosition()))
-- U.dump(ap, '?? asq:'..tostring(asq[1])..':'..tableSize(ap))
end
return croad or #apick --and croad:getField("material", "") ~= 'WarningMaterial'
-- return tableSize(editor.selection.object) == 1 and scenetree.findObjectById(editor.selection.object[1]):getClassName() == "DecalRoad"
-- return croad
end
if not abr[i].djrad or tableSize(abr[i].djrad)==0 then
abr[i].djrad = {}
local rd = adec[cdesc]
lo('?? undo_local:'..#adec[cdesc].aset..':'..tableSize(mask)..':'..tostring(rd.jrad))
local amark = {}
if #out.sidepick.list == 2 then
U.dump(out.sidepick, '?? for_SP:') --..tableSize(out.sidepick.split)..':'..jmi..':'..adec[jmi].id)
-- lo('?? SP_PRE:'..#across)
lo('??****** seled:'..tableSize(anodesel)..':'..#anodesel..' cdesc:'..tostring(cdesc)..':'..tostring(nodehit)..':'..tostring(cpick)..':'..#apick)
elseif editor.keyModifiers.ctrl then
rdlist = editor.getAllRoads()
lo('?? new_list:'..tostring(tableSize(rdlist)))
end
if im.IsKeyPressed(im.GetKeyIndex(im.Key_UpArrow)) then
if tableSize(anodesel) == 1 and anodesel[1] then
local ndi = 1
-- lo('?? key_R1:'..anode[1].width..':'..croad:getNodeWidth(1))
for i,_ in pairs((tableSize(anodesel) > 0) and anodesel or anode) do
-- lo('?? to_w:'..i)
local anode = editor.getNodes(croad)
for i,_ in pairs((tableSize(anodesel) > 0) and anodesel or anode) do
-- for i,n in pairs(anode) do
@/lua/ge/extensions/career/career.lua
local files = FS:findFiles(careerModuleDirectory, '*.lua', -1, true, false)
for i = 1, tableSize(files) do
extensions.luaPathToExtName(modulePath)
@/lua/ge/extensions/flowgraph/manager.lua
ui_flowgraph_editor.ClearSelection()
local copiedNodesTblSize = tableSize(self.copyData.nodes)
local mousePos = ui_flowgraph_editor.ScreenToCanvas(im.GetMousePos())
@/lua/ge/extensions/editor/util/plotHelperUtil.lua
local count = tableSize(self.data)
for r, row in ipairs(self.data) do
@/lua/ge/extensions/editor/vehicleEditor/liveEditor/veCrashTester.lua
for i = 1, numVehsPtr[0] do
local randomVehData = vehsList[math.random(tableSize(vehsList))]
@/lua/ge/extensions/editor/api/forest.lua
-- single selections will rotate around own axis, multiple about world
if tableSize(editor.selection.forestItem) == 1 then
local object = editor.selection.forestItem[1]
@/lua/vehicle/powertrain/dctGearbox.lua
device.minGearRatio = 999999
for i = 0, tableSize(forwardGears) - 1, 1 do
device.gearRatios[i] = forwardGears[i + 1]
end
local reverseGearCount = tableSize(reverseGears)
for i = -reverseGearCount, -1, 1 do
@/lua/ge/extensions/editor/api/history.lua
if action.data.objectIds then
for i = 1, tableSize(action.data.objectIds) do
if action.data.objectIds[i] == oldObjectId then
@/lua/ge/extensions/util/inputSystemUtils.lua
-- collapse anything below bindings that has less than 4 items
return path:sub(1,10) == '/bindings/' and tableSize(item) < 4
end
@/lua/ge/extensions/editor/tech/roadArchitect/roads.lua
local function convertDecalRoads2RoadArchitect()
for i = 1, tableSize(editor.selection.object) do -- Iterate over all the selected objects in the scenetree.
local selObj = editor.selection.object[i]
@/lua/ge/extensions/editor/roadArchitect.lua
if editor.beginWindow(win.materialSelectWinName, "Material Selector###82", im.WindowFlags_NoCollapse) then
for i = 1, tableSize(materialSet) do
local obj = materialSet[i]
@/lua/ge/extensions/gameplay/rally/cameraPathPlayer.lua
-- fix up the rotations
local markerCount = tableSize(pathJsonObj.markers)
for i = 2, markerCount do
@/lua/ge/extensions/flowgraph/nodes/debug/drawGraph.lua
local pinCount = tableSize(self.pinInLocal) - 1
if pinCount ~= self.data.count then
@/lua/ge/extensions/ui/gameplayAppContainers.lua
local visibleApps = getVisibleApps(containerId)
im.Text("Visible Apps: " .. #visibleApps .. "/" .. tableSize(container.apps))