tableIsEmpty
Definition
-- @/lua/common/utils.lua:591
function tableIsEmpty(tbl)
return type(tbl) ~= 'table' or next(tbl) == nil
end
Callers
@/lua/ge/extensions/flowgraph/utils.lua
function(variable, newValue)
if tableIsEmpty(variable.mergeVal) then
variable.mergeVal = newValue
function(variable, newValue)
if tableIsEmpty(variable.mergeVal) then
variable.mergeVal = newValue
@/lua/ge/extensions/editor/api/object.lua
local function isObjectSelectionEmpty()
return (not editor.selection.object or tableIsEmpty(editor.selection.object))
end
if tableIsEmpty(editor.selection.object) then
return
local selectionChanged = false
if not idArray or tableIsEmpty(idArray) then return false end
-- new selection
local function createPrefabFromObjectSelection(newPrefabFilename, objName, loadmode, pathNative)
if tableIsEmpty(editor.selection.object) then
return
end
if tableIsEmpty(cleanup) then -- we only need to delete the root simgroup which will delete every child
table.insert(cleanup, grp)
@/lua/ge/extensions/career/modules/painting.lua
for index, paintOptions in ipairs(package) do
if not tableIsEmpty(paintOptions) then
total.money.amount = total.money.amount + prices.basePrices[paintOptions.paintClass].money.amount
@/lua/ge/extensions/core/online.lua
end
if type(responseData) == 'table' and not tableIsEmpty(responseData) then
r.pub.responseData = responseData
@/lua/ge/extensions/core/environment.lua
local objNames = scenetree.findClassObjects(className)
if objNames and not tableIsEmpty(objNames) then
local obj = scenetree.findObject(objNames[1])
@/lua/vehicle/controller/vehicleController/shiftLogic/dctGearbox.lua
return tableIsEmpty(data) and nil or data
end
@/lua/ge/extensions/freeroam/facilities.lua
end
if tableIsEmpty(sites) then
log("W","","Could not find sites file for facility: " .. dumps(facility.sitesFile))
if tableIsEmpty(sites) then
log("W","","Could not find sites file for facility: " .. dumps(facility.sitesFile))
@/lua/ge/extensions/career/modules/delivery/vehicleTasks.lua
navigateToTask(taskThatChangedThisFrame)
elseif not tableIsEmpty(idsToRemove) and not tableIsEmpty(vehicleTasks) then
-- Navigate to the next task if one has been removed
navigateToTask(taskThatChangedThisFrame)
elseif not tableIsEmpty(idsToRemove) and not tableIsEmpty(vehicleTasks) then
-- Navigate to the next task if one has been removed
@/lua/ge/extensions/core/quickAccess.lua
-- if there are no gaps, remove all positions and sizes and place all buttons dynamically
if tableIsEmpty(gaps) then
for _, e in ipairs(currentMenuItems) do
@/lua/vehicle/powertrain.lua
if not tableIsEmpty(previousDeviceModes) then
for k, v in pairs(previousDeviceModes) do
@/lua/ge/extensions/editor/objectTool.lua
local function updateObjectSelectionAxisGizmo()
if editor.selection.object and not tableIsEmpty(editor.selection.object) then
local xform = MatrixF(true)
if shiftDown and not tableIsEmpty(axisGizmoEventState.objects) then
axisGizmoEventState.dragAndDuplicate = true
local duplicableObjects = getMementoFromManipulableSelection()
if not tableIsEmpty(duplicableObjects) then
editor.history:commitAction("DuplicateObjects", {objects = duplicableObjects, objectIds = deepcopy(editor.selection.object), parentIds = getParentIds(editor.selection.object)}, pasteObjectsUndo, pasteObjectsRedo, true)
--debugDrawer:currentRenderViewMaskSet(1)
if editor.selection.object and not tableIsEmpty(editor.selection.object) then
local boxColor
if not editor.isViewportFocused() then return end
if not editor.selection.object or tableIsEmpty(editor.selection.object) then return end
--TODO cut objects to clipboard
if not editor.isViewportFocused() then return end
if not editor.selection.object or tableIsEmpty(editor.selection.object) then return end
copySelectionToClipboard()
@/lua/ge/extensions/editor/main.lua
if state.version ~= CurrentStateFileFormatVersion and not tableIsEmpty(state) then
editor.logWarn("Editor state file format version mismatch. Expected: " .. CurrentStateFileFormatVersion .. " File: " .. tostring(state.version) .. ", will upgrade.")
@/lua/ge/extensions/editor/levelValidator.lua
end
if not tableIsEmpty(logsToRemove) then
for i = tableSize(levelLogs), 1, -1 do
@/lua/ge/extensions/freeroam/vueBigMap.lua
local poiIds = freeroam_bigMapMarkers.getIdsFromHoveredPoiId(poiId)
if not tableIsEmpty(poiIds) then
guihooks.trigger("showPoiDetails", {poiIds = poiIds})
@/lua/ge/extensions/core/vehicles.lua
end
if not tableIsEmpty(paints) then
info.paints = paints
-- dump(model.configs)
if model.configs and not tableIsEmpty(model.configs) then
for _, config in pairs(model.configs) do
@/lua/ge/extensions/scenario/scenariosLoader.lua
end
if tableIsEmpty(np) then
table.insert(np, imageExistsDefault('/'))
@/lua/vehicle/controller/vehicleController/shiftLogic/cvtGearbox2.lua
return tableIsEmpty(data) and nil or data
end
@/lua/vehicle/controller.lua
return tableIsEmpty(data) and nil or data
end
@/lua/ge/extensions/ui/bindingsLegend.lua
if actionCategoryActive["vehicleSpecific"] then return false end
if not tableIsEmpty(actionData) then return false end
return true]]
if tableIsEmpty(getVehicleSpecificActions()) then
uiData.additionalData.vehicleSpecificStatus = "inactive"
end
uiActionsEmptyBefore = tableIsEmpty(uiData.actions)
end
if not tableIsEmpty(actions) then
setActionDefaults(actions)
if not tableIsEmpty(modifierNames) then
local activeActions = core_input_actions.getActiveActions()
vehicleSpecificActions = getVehicleSpecificActions()
if tableIsEmpty(vehicleSpecificActions) then
return
local vehicleSpecificActions = getVehicleSpecificActions()
if not tableIsEmpty(vehicleSpecificActions) then
if tableIsEmpty(modifiersActive) then
if not tableIsEmpty(vehicleSpecificActions) then
if tableIsEmpty(modifiersActive) then
-- go into a "fleeting" vehicle specific actions state that will be removed after 7 seconds and also overwritten by a higher priority action set
@/lua/ge/extensions/editor/mainMenu.lua
-- if no index and no notifications, exit
if editor.currentNotificationIndex == 0 and tableIsEmpty(editor.notificationQueue) then return end
-- if all notifications were shown and the last one was also shown
if editor.currentNotificationIndex == 0
and (not tableIsEmpty(editor.notificationQueue))
and editor.notificationQueue[tableSize(editor.notificationQueue)].time > editor.notificationQueue[tableSize(editor.notificationQueue)].duration then return end
@/lua/ge/extensions/core/remoteController.lua
local function devicesConnected ()
return not tableIsEmpty(virtualDevices)
end
@/lua/ge/extensions/editor/assetBrowser.lua
local function selectAsset(asset)
if (not tableIsEmpty(editor.selection)) and editor.selection["asset"] == nil and var.viewSelectionHistory ~= nil then
-- Resets tracked previous selection when selection changed outside of the asset browser
if not tableIsEmpty(editor.selection.object) then
var.editorLastSelection = editor.selection.object[#editor.selection.object]
if not tableIsEmpty(editor.selection.object) then
var.editorLastSelection = editor.selection.object[#editor.selection.object]
@/lua/vehicle/extensions/skeleton.lua
or (v.data.information ~= nil and not v.data.information.showSkeleton)
or (v.data.flexbodies ~= nil and not tableIsEmpty(v.data.flexbodies)) then
@/lua/ge/extensions/editor/toolUtilities/materialSelectionMgr.lua
loadedTextures = loadedTextures + 1
if texture and not tableIsEmpty(texture) then
texObjs[absPath] = texture
@/lua/ge/extensions/editor/autoSave.lua
wasNotCleanExit = not editor.getPreference("general.internal.cleanExit")
if (not tableIsEmpty(autosaves)) or showWindowNow then
imgui.OpenPopup("AutoSave Restore")
@/lua/ge/extensions/flowgraph/nodes/vehicle/customPartsConfigProvider.lua
self.partConfig = jsonReadFile(self.configPath) or {parts = {},vars = {}}
if not tableIsEmpty(self.partConfig.parts) then
self.partConfig.partConfigFilename = self.configPath
self.partConfig = jsonReadFile(veh.partConfig) or {parts = {},vars = {}}
if not tableIsEmpty(self.partConfig.parts) then
self.partConfig.partConfigFilename = self.configPath
@/lua/ge/extensions/editor/vehicleEditor/liveEditor/vePowerTrain.lua
obj:queueGameEngineLua("vEditor.powertrainDevices =" .. powertrain.serializeDevicesInfo())]])
if vEditor.powertrainDevices and not tableIsEmpty(vEditor.powertrainDevices) then
if not deviceString or vEditor.resetDeviceString then
@/lua/ge/extensions/career/modules/vehicleShopping.lua
-- if there are already vehicles in the shop, don't generate starter vehicles
if onlyStarterVehicles and not tableIsEmpty(vehiclesInShop) then
return
end
if not tableIsEmpty(randomVehicleInfos) then
sellersInfos[seller.id].lastGenerationTime = currentTime
local function onUpdate()
if tableIsEmpty(vehicleWatchlist) or (currentUiState and currentUiState ~= "play") then return end
local currentTime = os.time()
@/lua/common/extensions.lua
if not tableIsEmpty(toResolveModules) then
-- Note(AK) 27/10/2020: This is IMPORTANT. For these remaining modules, they could not be resolved because
if not tableIsEmpty(toPrint) then
log('D', logTag, 'Force resolved cycle dependencies for: '..dumps(toPrint))
if not tableIsEmpty(failedModules) then
log('W', logTag, 'Unloading the following modules. Their dependencies could not be resolved:')
if not tableIsEmpty(modulesToUnload) then
unloadInternal(modulesToUnload)
if tableIsEmpty(moduleDataArray) then return end
@/lua/vehicle/controller/vehicleController/vehicleController.lua
return tableIsEmpty(data) and nil or data
end
@/lua/ge/extensions/editor/camPathEditor.lua
local avail = im.GetContentRegionAvail()
if tableIsEmpty(M.currentPath.markers) then
if im.Button('+ Add Marker', im.ImVec2(-1, 0)) then
@/lua/ge/extensions/editor/api/preferencesRegistry.lua
-- if there are no prefs in a subcategory, delete it from the table
if prefsToSave[catName] and prefsToSave[catName][subcatName] and tableIsEmpty(prefsToSave[catName][subcatName]) then
prefsToSave[catName][subcatName] = nil
-- if there are no subcategories in a category, delete it from the table
if prefsToSave[catName] and tableIsEmpty(prefsToSave[catName]) then
prefsToSave[catName] = nil
@/lua/ge/extensions/editor/materialEditor.lua
if tableIsEmpty(sortedMaterialObjectNames) and tableIsEmpty(sortedMaterialObjectNamesAtTop) then
sortedMaterialObjectNames = deepcopy(materialObjectNames)
if tableIsEmpty(sortedMaterialObjectNames) and tableIsEmpty(sortedMaterialObjectNamesAtTop) then
sortedMaterialObjectNames = deepcopy(materialObjectNames)
@/lua/ge/extensions/editor/createObjectTool.lua
local function getCurrentSelectedParent()
if editor.selection.object and not tableIsEmpty(editor.selection.object) then
local obj = scenetree.findObjectById(editor.selection.object[1])
@/lua/vehicle/partCondition.lua
if tableIsEmpty(hasSetPartCondition) then
return false
local function ensureConditionsInit(fallbackOdometer, fallbackIntegrityValue, fallbackVisualValue)
if tableIsEmpty(hasSetPartCondition) then
initConditions(nil, fallbackOdometer, fallbackIntegrityValue, fallbackVisualValue)
local function testSave()
if tableIsEmpty(hasSetPartCondition) then
M.initConditions(nil, 812812000, 1, 0.5)
@/lua/common/jbeam/groups.lua
if not tableIsEmpty(vehicle.groups) then
--log('D', "jbeam.postProcess"," - processed "..tableSize(vehicle.groups).." groups")
@/lua/vehicle/extensions/core/quickAccess.lua
-- check if there are powered wheels
local hasPoweredWheels = not tableIsEmpty(powertrain.getPoweredWheelNames())
@/lua/ge/extensions/editor/api/guiInstancer.lua
function C:addInstance()
if tableIsEmpty(self.instances) then
self.nextInstanceIndex = 1
@/lua/ge/extensions/career/modules/marketplace.lua
local function onUpdate(dtReal, dtSim, dtRaw)
if tableIsEmpty(listedVehicles) or offerMenuOpen then
return
@/lua/console/bananabench-xml.lua
-- Turned this of because logcache is not written to.
--if not tableIsEmpty(firstTest.logcache) then
--local errorlog = xh('errorlog')
@/lua/ge/extensions/editor/assetManagementTool.lua
local noSelection = tableIsEmpty(selectedHashes)
@/lua/ge/extensions/editor/forestEditor.lua
if not tableIsEmpty(editor.selection.forestItem) then
local shapeFilename = tostring(editor.selection.forestItem[#editor.selection.forestItem]:getData().shapeFile)
local function removeItems(items, dontCallRedo)
if tableIsEmpty(items) then return end
if dontCallRedo == nil then dontCallRedo = false end
elseif var.lassoSelectMode == var.enum_lassoSelectMode.freehand then
if not tableIsEmpty(var.lassoFHLineSegments) then
local nodeRayDistance = (var.lassoFHLineSegments[1] - camPos):cross(rayDir):length() / rayDir:length()
debugDrawer:drawSphere(hit.pos, sphereRadius, roadRiverGui.highlightColors.node, false)
if not tableIsEmpty(var.lassoPLNodes) then
local tempNode = {pos = hit.pos, isUpdated = true}
if tableIsEmpty(var.lassoPLNodes) then return end
if tableIsEmpty(var.lassoFHLineSegments) then return end
local lineWidth = editor.getPreference("gizmos.general.lineThicknessScale") * 4
else
if tableIsEmpty(var.lassoPLNodes) then
var.lassoSelectMode = var.enum_lassoSelectMode.freehand
-- Insert first segment start point
if tableIsEmpty(var.lassoFHLineSegments) then
table.insert(var.lassoFHLineSegments, var.lassoFHLastMousePos)
@/lua/ge/extensions/editor/api/camera.lua
local function placeCameraAtSelection()
if not editor.selection or tableIsEmpty(editor.selection.object) then
return
@/lua/ge/extensions/util/resaveMaterials.lua
if not tableIsEmpty(objects) then
log('I', '', 'parsing materials file: ' .. tostring(fn))
@/lua/ge/extensions/editor/shortcutLegend.lua
compoundedActionInfos = {}
if editor.editMode and not tableIsEmpty(currentActionNames) then
for controlFlag, title in pairs(currentActionNames) do
@/lua/ge/extensions/career/modules/delivery/cargoScreen.lua
if tableIsEmpty(allCargo) then
core_groundMarkers.setPath(nil)
@/lua/vehicle/sounds.lua
local sounds = loadSoundFiles(loadedFolder)
M.usesOldCustomSounds = not tableIsEmpty(sounds)
@/lua/ge/extensions/editor/scriptAIManager.lua
--[[
if (not tableIsEmpty(recordings)) and im.SmallButton("save") then
jsonWriteFile(persistenceFilename, M.onSerialize())
@/lua/ge/extensions/editor/slotTrafficEditor.lua
-- actual algo
while not tableIsEmpty(nodesToCheck) do
local nextNid = getNodeWithSmallestDist(nodesToCheck)
end
if tableIsEmpty(editor.selection.stNode) then editor.selection.stNode = nil end
end
-- delete the temp node
if not tableIsEmpty(tempNodes) then
for _, id in ipairs(tempNodes) do
end
if not tableIsEmpty(tempNodes) then
for _, id in ipairs(tempNodes) do
mouseButtonHeldOnNode = true
if not tableIsEmpty(editor.selection.stNode) then
for nodeId, _ in pairs(editor.selection.stNode) do
temporaryLink = nil
elseif (not dragMouseStartPos) and not tableIsEmpty(editor.selection.stNode) then
local newValues = {}
else
if tableIsEmpty(editor.selection.stNode) then
mouseButtonHeldOnNode = false
if editModeOpen then
if not editModeOpen and tableIsEmpty(mapNodes) then
-- import the decal roads when the edit mode is not open
local function onDeleteSelection()
if editor.selection.stNode and not tableIsEmpty(editor.selection.stNode) then
local nodeInfos = {}
@/lua/ge/extensions/career/saveSystem.lua
asyncSaveExtensions[extName] = nil
if syncSaveExtensionsDone and tableIsEmpty(asyncSaveExtensions) then
saveCompleted()
syncSaveExtensionsDone = true
if tableIsEmpty(asyncSaveExtensions) then
saveCompleted()
@/lua/ge/extensions/editor/sceneTree.lua
if not instance.rootNode then return end
if not objectIds or tableIsEmpty(objectIds) then return end
local count = #objectIds
local function deleteSelectedNodes(instance)
if not instance.selectedNodes or tableIsEmpty(instance.selectedNodes) then return end
for _, node in ipairs(instance.selectedNodes) do
if imgui.Selectable1("Delete Selection") then
if not tableIsEmpty(instance.selectedNodes) then
deleteNodes = true
imgui.Separator()
if not tableIsEmpty(instance.selectedNodes) then
if imgui.Selectable1("Hide Selection") then
end
if not tableIsEmpty(instance.selectedNodes) then
if imgui.Selectable1("Lock Selection") then
if imgui.Selectable1("Delete Selection") then
if not tableIsEmpty(instance.selectedNodes) then
deleteNodes = true
imgui.Separator()
if not tableIsEmpty(instance.selectedNodes) then
if imgui.Selectable1("Hide Selection") then
end
if not tableIsEmpty(instance.selectedNodes) then
if imgui.Selectable1("Lock Selection") then
if imgui.Selectable1("Duplicate Selection") then
if not tableIsEmpty(instance.selectedNodes) then
editor.duplicate()
if imgui.Selectable1("Delete Selection") then
if not tableIsEmpty(instance.selectedNodes) then
deleteNodes = true
end
if not tableIsEmpty(instance.selectedNodes) then
if imgui.Selectable1("Hide Selection") then
end
if not tableIsEmpty(instance.selectedNodes) then
if imgui.Selectable1("Lock Selection") then
end
if tableIsEmpty(instance.selectionRange) then
instance.selectionRange = nil
end
if not tableIsEmpty(dragSelectionList) then
instance.lastSelectedIndex = minIndex
@/lua/ge/extensions/editor/api/core.lua
local function anyToolDirty()
if not tableIsEmpty(editor.dirtyTools) then
editor.openModalWindow("saveDirtyTools")
@/lua/vehicle/extensions/inputAnalyzer.lua
if tableIsEmpty(registeredInputStrings) then
M.updateGFX = nop
end
if tableIsEmpty(registeredInputStrings) then
M.updateGFX = nop
@/lua/common/devUtils.lua
local t = {}
if not tableIsEmpty(locals) then t.locals = locals ; used = true end
if not tableIsEmpty(v) then t.module = v ; used = true end
if not tableIsEmpty(locals) then t.locals = locals ; used = true end
if not tableIsEmpty(v) then t.module = v ; used = true end
if used then
else
if v.module and not tableIsEmpty(v.module) then
snapshot.tables[v.key] = v
@/lua/ge/extensions/editor/dataBlockEditor.lua
for className, dataBlocks in pairs(dataBlockClasses) do
if not tableIsEmpty(dataBlocks) then
if im.TreeNode1(className) then
@/lua/vehicle/extensions/gameplayInterface.lua
--we just removed an element from the notif table, check if we still need to call the GFX update
if tableIsEmpty(registeredValueChangeNotifications) then
checkValueChangeNotificationMethod = nop
@/lua/ge/extensions/editor/decalEditor.lua
local function onEditorAxisGizmoAligmentChanged()
if (not tableIsEmpty(selectedInstances)) and editor.editMode and (editor.editMode.displayName == editor.editModes.decalEditMode.displayName) then
updateGizmoPos()
if not instance then
if not tableIsEmpty(selectedInstances) then
editor.history:commitAction("ClearDecalSelection", {oldSelection = oldSelection}, clearSelectionActionUndo, clearSelectionActionRedo)
local disabled = false
if tableIsEmpty(selectedInstances) then im.BeginDisabled() disabled = true end
if editor.uiIconImageButton(editor.icons.delete, im.ImVec2(22 * im.uiscale[0], 22 * im.uiscale[0]), nil, nil, nil) then
if not tableIsEmpty(selectedInstances) then
editor.updateAxisGizmo(gizmoBeginDrag, gizmoEndDrag, gizmoDragging)
@/lua/ge/extensions/editor/api/valueInspector.lua
loadedTextures = loadedTextures + 1
if texture and not tableIsEmpty(texture) then
texObjs[absPath] = texture
@/lua/vehicle/controller/vehicleController/shiftLogic/cvtGearbox.lua
return tableIsEmpty(data) and nil or data
end
@/lua/ge/extensions/editor/meshEditor.lua
local function selectNode(id)
if tableIsEmpty(selectedNodes) then lastSelectedNode = nil end
if id == nil then
if selectedMesh then
if (not tableIsEmpty(selectedNodes)) and selectedMesh:getNodeCount() > 2 then
local nodeInfos = {}
local selectedMesh = selectedMeshId and scenetree.findObjectById(selectedMeshId)
if selectedMesh and (not tableIsEmpty(selectedNodes)) and selectedMesh:getNodeCount() > 0 then
im.BeginChild1("node", im.ImVec2(0, 150), true)
end
if not tableIsEmpty(oldWidths) then
editor.history:commitAction("SetAllMeshNodesWidth", {meshID = selectedMeshId, oldWidths = oldWidths, newWidth = nodeWidth[0]}, setAllNodesWidthActionUndo, setAllNodesWidthActionRedo)
end
if not tableIsEmpty(oldDepths) then
editor.history:commitAction("SetAllMeshNodesDepth", {meshID = selectedMeshId, oldDepths = oldDepths, newDepth = nodeDepth[0]}, setAllNodesDepthActionUndo, setAllNodesDepthActionRedo)
@/lua/ge/extensions/freeroam/organizations.lua
local function orgHasUnlocks(organization)
if not organization.reputationLevels or tableIsEmpty(organization.reputationLevels) then return false end
local hasUnlocks = false
for i, levelInfo in ipairs(organization.reputationLevels) do
if levelInfo.unlocks and not tableIsEmpty(levelInfo.unlocks) then return true end
end
@/lua/ge/extensions/util/configListGenerator.lua
end)
if tableIsEmpty(filteredConfigList) then return end
local result = {}
if seller.subFilters and not tableIsEmpty(seller.subFilters) then
for _, subFilter in ipairs(seller.subFilters) do
local randomVehicleInfos = {}
while vehicleCount < numberOfVehicles and not tableIsEmpty(configs) do
-- Choose one of the filters
-- if there are no filters left, continue to the next filterSet
if tableIsEmpty(filters) then
break
@/lua/ge/extensions/career/modules/vehicleDeletionService.lua
local function checkOnUpdateFunction()
if tableIsEmpty(flaggedVehicles) then
if M.onUpdate then
@/lua/ge/extensions/editor/biomeTool.lua
debugDrawer:drawSphere(hit.pos, sphereRadius, roadRiverGui.highlightColors.node, false)
if not tableIsEmpty(var.lassoPLNodes) then
local tempNode = {pos = hit.pos, isUpdated = true}
if tableIsEmpty(var.lassoPLNodes) then return end
local function removeItems(items)
if tableIsEmpty(items) then return end
editor.history:commitAction("RemoveBiomeItems", {items = items}, removeItemsActionUndo, removeItemsActionRedo, true)
if blendingMethod == blending_enum.replace then
if not tableIsEmpty(itemsToAdd) or not tableIsEmpty(itemsToDel) then
local delItems = {}
if blendingMethod == blending_enum.replace then
if not tableIsEmpty(itemsToAdd) or not tableIsEmpty(itemsToDel) then
local delItems = {}
elseif blendingMethod == blending_enum.add then
if not tableIsEmpty(itemsToAdd) then
local itemUIDs = {}
elseif blendingMethod == blending_enum.delete then
if not tableIsEmpty(itemsToDel) then
local delItems = {}
itemsToDel = itemsTbl["itemsToDel"]
if not tableIsEmpty(itemsToAdd) then
editor.history:commitAction("AddBiomeItems", {items = itemsToAdd}, addItemsActionUndo, addItemsActionRedo, true)
local brushBorder = getForestBrushSelection(layerType, layerID, enum_forestBrushItemZone.falloff)
local bothBrushesEmpty = tableIsEmpty(brushCentral) and tableIsEmpty(brushBorder)
local noLasso = tableIsEmpty(getLassoAreas(layerID))
local brushBorder = getForestBrushSelection(layerType, layerID, enum_forestBrushItemZone.falloff)
local bothBrushesEmpty = tableIsEmpty(brushCentral) and tableIsEmpty(brushBorder)
local noLasso = tableIsEmpty(getLassoAreas(layerID))
local bothBrushesEmpty = tableIsEmpty(brushCentral) and tableIsEmpty(brushBorder)
local noLasso = tableIsEmpty(getLassoAreas(layerID))
local brush = getForestBrushSelection(layerType, layerID, enum_forestBrushItemZone.central)
local brushName = tableIsEmpty(brush) and "None" or brush[1]
imgui.SameLine()
local value = layerDensityPtr[0]
if not tableIsEmpty(minMaxPair) then
value = clamp(layerDensityPtr[0], minMaxPair[1], minMaxPair[2])
local borderBrush = getForestBrushSelection(layerType, layerID, enum_forestBrushItemZone.falloff)
local borderBrushName = tableIsEmpty(borderBrush) and "None" or borderBrush[1]
imgui.SameLine()
local value = borderDensityPtr[0]
if not tableIsEmpty(minMaxPair) then
value = clamp(value, minMaxPair[1], minMaxPair[2])
local value = borderFalloffPtr[0]
if not tableIsEmpty(minMaxPair) then
value = clamp(borderFalloffPtr[0], minMaxPair[1], minMaxPair[2])
local value = slopeInfluencePtr[0]
if not tableIsEmpty(minMaxPair) then
value = clamp(slopeInfluencePtr[0], minMaxPair[1], minMaxPair[2])
local maxVal = input2FloatValue[1]
--[[if not tableIsEmpty(minMaxPair) then
minVal = clamp(input2FloatValue[0], minMaxPair[1], math.min(maxVal, minMaxPair[2]))
local edgeElements = getForestBrushElementsFromSelection(layerType, layerID, enum_forestBrushItemZone.edge)
if tableIsEmpty(edgeElements) then
imgui.OpenPopup("No Brush Selected!##Edge")
local borderBrush = getForestBrushSelection(layerType, layerID, enum_forestBrushItemZone.edge)
local borderBrushName = tableIsEmpty(borderBrush) and "None" or borderBrush[1]
imgui.SameLine()
local lassoAreas = getAllLassoAreas(layer.layerID)
if tableIsEmpty(lassoAreas) then
local noAreaText = "N O L A S S O A R E A A V A I L A B L E !"
itemsToDel = itemsTbl["itemsToDel"]
if not tableIsEmpty(itemsToDel) then
local delItems = {}
itemsToDel = itemsTbl["itemsToDel"]
if not tableIsEmpty(itemsToDel) then
local delItems = {}
local brush = getForestBrushSelection(layer.layerType, layer.layerID, enum_forestBrushItemZone.central)
local brushName = tableIsEmpty(brush) and "None" or brush[1]
imgui.Dummy(imgui.ImVec2(10,1))
local layers = getLayersWithType(layerType_enum.terrain)
if tableIsEmpty(layers) then
local noAreaText = "N O T E R R A I N L A Y E R A V A I L A B L E !"
local layers = getLayersWithType(layerType_enum.area)
if tableIsEmpty(layers) then
local noAreaText = "N O A R E A L A Y E R A V A I L A B L E !"
local function onEditorAfterSaveLevel()
if tableIsEmpty(var.layers) then return end
local levelPath, levelName = getLevelPathAndName()
local terrLayers = getLayersWithType(layerType_enum.terrain)
local layerAvailable = not tableIsEmpty(areaLayers) or not tableIsEmpty(terrLayers)
if FS:fileExists(biomeDataPath) then
local terrLayers = getLayersWithType(layerType_enum.terrain)
local layerAvailable = not tableIsEmpty(areaLayers) or not tableIsEmpty(terrLayers)
if FS:fileExists(biomeDataPath) then
@/lua/ge/extensions/core/modmanager.lua
local modData = jsonReadFile(persistencyfile)
local modsInstalled = (type(modData) == 'table' and type(modData.mods) == 'table' and not tableIsEmpty(modData.mods))
if modsInstalled then
@/lua/ge/extensions/core/input/bindings.lua
-- remove empty lists
if tableIsEmpty(result.removed) then result.removed = nil end
if tableIsEmpty(result.bindings) then result.bindings = nil end
if tableIsEmpty(result.removed) then result.removed = nil end
if tableIsEmpty(result.bindings) then result.bindings = nil end
if result.bindings == nil and result.removed == nil then result = nil end
local function onUIStateTriggered(stateName, opened, stateStack)
if tableIsEmpty(stateStack) or stateStack[#stateStack] == "/play" then
setMenuActionMapEnabled(false)
@/lua/ge/extensions/editor/roadArchitect.lua
loadedTextures = loadedTextures + 1
if texture and not tableIsEmpty(texture) then
texObjs[absPath] = texture
@/lua/ge/extensions/editor/flowgraph/nodelibrary.lua
im.SameLine()
if tableIsEmpty(self.fgEditor.copyData) then
editor.uiIconImage(editor.icons.content_paste, im.ImVec2(22, 22), im.ImVec4(0.5, 0.5, 0.5, 1.0))
@/lua/ge/extensions/editor/inspector.lua
local function openInspector()
if not tableIsEmpty(guiInstancer.instances) then return end
addInspectorInstance()
if imgui.IsItemHovered() then imgui.SetTooltip("Unlock Inspector Window") end
elseif editor.uiIconImageButton(editor.icons.lock_open, imgui.ImVec2(24, 24)) and (not tableIsEmpty(editor.selection)) then
inspectorInfo.selection = deepcopy(editor.selection)
for _, val in pairs(editor.selection) do
if not tableIsEmpty(val) then
numKeys = numKeys + 1
@/lua/ge/extensions/editor/assetDeduplicator.lua
if editor.beginWindow(toolWindowName, "Asset Deduplicator", im.WindowFlags_AlwaysAutoResize+im.WindowFlags_NoResize+im.WindowFlags_NoDocking) then
if tableIsEmpty(cacheData) then
if FS:fileExists(cacheFile) then
im.Text("Generating cache... ("..generateCacheJob.processed.."/"..generateCacheJob.allfiles..")")
elseif tableIsEmpty(cacheData) then
im.Text("Cache is missing")
@/lua/vehicle/controller/vehicleController/shiftLogic/electricMotor.lua
return tableIsEmpty(data) and nil or data
end
@/lua/ge/extensions/editor/roadEditor.lua
local function onSelectAll()
if not tableIsEmpty(selectedRoadsIds) then
for _, roadID in ipairs(selectedRoadsIds) do
local selNodes = selectedNodes[roadId]
if not tableIsEmpty(selNodes) then
local lastSelNode = selNodes[#selNodes]
local function splitRoadActionUndo(actionData)
if tableIsEmpty(actionData.originalRoadAndNodeIDs) then return end
local roadIndex = 1
local function splitRoadActionRedo(actionData)
if tableIsEmpty(actionData.originalRoadAndNodeIDs) then return end
local newRoadIds = {}
local function fuseRoadsActionUndo(actionData)
if tableIsEmpty(actionData.fuseRoadsInfo) then return end
local function fuseRoadsActionRedo(actionData)
if tableIsEmpty(actionData.fuseRoadsInfo) then return end
local road1Data = actionData.fuseRoadsInfo[1]
local function flipSelectedRoadsDirection()
if tableIsEmpty(selectedRoadsIds) then return end
if not tableIsEmpty(roads) then
editor.history:commitAction(
if selectedNodes and selectedNodes[roadID] then
if not tableIsEmpty(selectedNodes[roadID]) then
anyNodeSelected = true
else
if tableIsEmpty(selectedNodes) then return false end
for _, arrayNodes in pairs(selectedNodes) do
for _, arrayNodes in pairs(selectedNodes) do
if arrayNodes and not tableIsEmpty(arrayNodes) then
anyNodeSelected = true
local nodeId = -1
if tableIsEmpty(selectedNodes) then return nodeId end
local selectedNodesInRoad = selectedNodes[roadID]
local tempNodeIndex = -1
if not roadID or tableIsEmpty(tempNodeIndexes) then
return tempNodeIndex
local isAllSame = true
if tableIsEmpty(valArray) then return false end
local fieldVal = valArray[1]
end
if not tableIsEmpty(oldWidths) then
editor.history:commitAction("SetRoadNodesWidth", {oldWidths = oldWidths, newWidths = newWidths}, setNodesWidthActionUndo, setNodesWidthActionRedo)
if not tableIsEmpty(roadAndNodeIDsTbl) then
local buttonTextSuffix = tableIsEmpty(roadAndNodeIDsTbl) and "" or "s"
if not tableIsEmpty(roadAndNodeIDsTbl) then
local buttonTextSuffix = tableIsEmpty(roadAndNodeIDsTbl) and "" or "s"
if im.Button("Split Road"..buttonTextSuffix, im.ImVec2(0,0)) then
if not tableIsEmpty(selectedRoadsIds) then
im.BeginChild1("RoadOps", im.ImVec2(0, 130), true)
if tableIsEmpty(selectedRoadsIds) then
templateDialogOpen[0] = false
-- Check the selected road first
if not tableIsEmpty(selectedRoadsIds) then
-- Check if a node is hovered over
-- Hovers somewhere else than the selected road
if not tableIsEmpty(selectedRoadsIds) then
local addNodeRefPoint = vec3(0, 0, 0)
end
if not tableIsEmpty(roadInfosTbl) then
editor.history:commitAction("InsertRoadNode", {roadInfos = roadInfosTbl}, insertNodeActionUndo, insertNodeActionRedo, true)
if (not tableIsEmpty(tempNodeIndexes)) and (not editor.keyModifiers.alt) then
finishRoad()
local roadObj = scenetree.findObjectById(hoveredRoadID)
if tableIsEmpty(hoveredNodeInfo) then
if(not Prefab.getPrefabByChild(roadObj)) then
end
elseif not tableIsEmpty(selectedRoadsIds) and tableIsEmpty(hoveredNodeInfo) and not isRectSelectKeyCombinationActive then
selectNode(nil)
end
elseif not tableIsEmpty(selectedRoadsIds) and tableIsEmpty(hoveredNodeInfo) and not isRectSelectKeyCombinationActive then
selectNode(nil)
-- Highlight selected roads
if not tableIsEmpty(selectedRoadsIds) then
local numSelectedRoads = tableSize(selectedRoadsIds)
if not tableIsEmpty(duplicatedRoadIds) then
editor.history:commitAction("DuplicateRoad", {nodes = arrayNodes, roadInfos = arrayRoadInfos}, duplicateRoadActionUndo, duplicateRoadActionRedo)
end
if (not tableIsEmpty(tempNodeIndexes)) and tableIsEmpty(selectedRoadsIds) then
finishRoad()
end
if (not tableIsEmpty(tempNodeIndexes)) and tableIsEmpty(selectedRoadsIds) then
finishRoad()
for _, roadID in ipairs(selectedRoadsIds) do
if selectedNodes[roadID] and not tableIsEmpty(selectedNodes[roadID]) then
tempSelectedNodes[roadID] = deepcopy(selectedNodes[roadID])
@/lua/ge/extensions/editor/resourceChecker/resourceUtil.lua
for _, issues in pairs(mats) do
if not tableIsEmpty(issues) then
hasAny = true
for matName, issues in pairs(mats) do
if not tableIsEmpty(issues) then
out[file][matName] = issues
local objects = getSimObjects(file)
if not tableIsEmpty(objects) then
for _, obj in ipairs(objects) do
end
if not tableIsEmpty(objects) then
log('I', '', 'parsing all materials file: ' .. tostring(fn))
matTable = parseMaterialFiles(materialFiles, job)
if not tableIsEmpty(matTable) then
log('I', '', 'parsing all materials')
job.progress = 20
if not tableIsEmpty(matTable) then
log('I', '', 'parsing all materials')
objects = loadMaterialObjectsFromFile(fn)
if not tableIsEmpty(objects) then
log('I', '', 'parsing all materials file: ' .. tostring(fn))
objects = loadMaterialObjectsFromFile(fn)
if not tableIsEmpty(objects) then
log('I', '', 'parsing all materials file: ' .. tostring(fn))
objects = loadMaterialObjectsFromFile(fn)
if not tableIsEmpty(objects) then
job.yield()
if abort(job) then return end
if not tableIsEmpty(matTable) then
log('I', '', 'parsing all materials')
if item == 1 then
if not tableIsEmpty(selected) then
for k,_ in pairs(selected) do
job.progress = 5
if not tableIsEmpty(materialsToRemove) then
for k,v in pairs(materialsToRemove) do
if item == 2 then
if not tableIsEmpty(selected) then
for k,_ in pairs(selected) do
job.progress = 20
if not tableIsEmpty(shapesToRemove) then
for _,v in pairs(shapesToRemove) do
if item == 3 then
if not tableIsEmpty(selected) then
for k,_ in pairs(selected) do
job.progress = 50
if not tableIsEmpty(texturesToRemove) then
for _,v in pairs(texturesToRemove) do
matTable = parseMaterialFiles(materialFiles, job)
if not tableIsEmpty(matTable) then
log('I', '', 'parsing all materials')
job.sleep(0.001)
if not tableIsEmpty(matTable) then
log('I', '', 'parsing all materials')
if mat and mat.name then
if not mat.Stages or tableIsEmpty(mat.Stages) or tableIsEmpty(mat.Stages[1]) then
count = count + 1
if mat and mat.name then
if not mat.Stages or tableIsEmpty(mat.Stages) or tableIsEmpty(mat.Stages[1]) then
count = count + 1
@/lua/ge/spawn.lua
local pos, rot
if tableIsEmpty(mapData.nodes) then
pos = veh:getPosition()
@/lua/ge/extensions/tech/multiscreen.lua
if not getOrCreateCameraToWindow or not requestCameraToWindowRender then return end
if tableIsEmpty(M.views) then return end
@/lua/vehicle/controller/tirePressureControl.lua
if not hasRegisteredQuickAccess then
if not tableIsEmpty(wheelGroups) then
core_quickAccess.addEntry(
if not tableIsEmpty(wheelData) then
wheelGroups[groupName] = {
@/lua/vehicle/controller/vehicleController/shiftLogic/manualGearbox.lua
return tableIsEmpty(data) and nil or data
end
@/lua/ge/extensions/career/modules/inventory.lua
local zones = freeroam_facilities.getZonesForFacility(garage)
if zones and not tableIsEmpty(zones) then
local dist = zones[1].center:distance(playerPos)
vehicles[vehicleData.id] = vehicleData
if tableIsEmpty(core_vehicles.getModel(vehicleData.model)) or not FS:fileExists(vehicleData.config.partConfigFilename) then
vehicleData.missingFile = true
end
if callback and tableIsEmpty(vehIdToInventoryId) then
callback()
-- if the vehicle doesnt exist (deleted mod) then dont spawn
if tableIsEmpty(core_vehicles.getModel(carModelToLoad)) or not FS:fileExists(vehInfo.config.partConfigFilename) then
return
local function isEmpty()
return tableIsEmpty(vehicles)
end
@/lua/ge/extensions/editor/resourceChecker.lua
elseif duplicateName and not duplicateTable then im.Text("Checking in progress")
elseif duplicateName and tableIsEmpty(duplicateTable) then im.Text("Found 0 duplicates")
else
stage = stage + 1
if not tableIsEmpty(t) then
count = count + 1
local cnt = 0
if not tableIsEmpty(isSelected) then
for k,v in pairs(isSelected) do
im.PushStyleColor2(im.Col_Button, removeButtonCol)
if not tableIsEmpty(isSelected) then
if im.Button("Remove selected files ("..cnt..")", im.ImVec2(buttonWidth,0)) then
end
if not tableIsEmpty(isSelected) then
im.SameLine()
@/lua/common/jbeam/variables.lua
local function applySlotVars(slotVars, _vars)
if tableIsEmpty(_vars) then return deepcopy(slotVars) end
local vars = deepcopy(_vars)
end
if not tableIsEmpty(slotVars) then
for k, v in ipairs(slotVars) do
@/lua/vehicle/controller/vehicleController/shiftLogic/automaticGearbox.lua
return tableIsEmpty(data) and nil or data
end
@/lua/ge/extensions/editor/flowgraph/properties.lua
function C:drawInPins(item)
if (not tableIsEmpty(item.pinInLocal)) and item.pinList and im.TreeNodeEx1('Input Pins##propertiesPinIn_' .. "self_id", im.TreeNodeFlags_DefaultOpen) then
im.Columns(2, 'pinListIn' .. "self_id")
function C:drawOutPins(item)
if (not tableIsEmpty(item.pinOut)) and item.pinList and im.TreeNodeEx1('Output Pins##propertiesPinOut_' .. "self_id", im.TreeNodeFlags_DefaultOpen) then
im.Columns(2, 'pinListOut' .. "self_id")
@/lua/ge/extensions/career/career.lua
local careerData = (savePath and jsonReadFile(savePath .. "/career/" .. saveFile)) or {}
local newSave = tableIsEmpty(careerData)
local levelToLoad = careerData.level or levelName
@/lua/ge/extensions/editor/api/objectHistoryActions.lua
local function deleteSelectedObjectsWithUndo()
if not editor.selection.object or tableIsEmpty(editor.selection.object) then return end
editor.history:beginTransaction("DeleteSelectedObjects")
@/lua/vehicle/main.lua
playerInfo.seatedPlayers = players
playerInfo.anyPlayerSeated = not (tableIsEmpty(players))
playerInfo.firstPlayerSeated = players[0] ~= nil
@/lua/ge/extensions/core/weather.lua
--log('D', 'weather', "Weather preset loaded: " .. tostring(filename) .. ": "..dumps(filePresets))
if tableIsEmpty(filePresets) then
log('E', 'weather', 'preset invalid: ' .. tostring(filename))
@/lua/ge/extensions/core/groundMarkers.lua
M.endWP = (type(wp) == 'table' and wp) or {wp}
if not wp or tableIsEmpty(M.endWP) then
M.routePlanner:clear()
@/lua/ge/extensions/career/modules/milestones/general.lua
local function onClientStartMission(levelPath)
if tableIsEmpty(milestoneConfigs) then
M.onCareerModulesActivated(true)
@/lua/ge/extensions/editor/terrainEditor.lua
if editor.beginWindow(terrainPainterWindowName, "Terrain Painter") then
if tableIsEmpty(terrainBlockProxies) and not selectedPaintMaterialProxy then
im.Text("No terrain blocks.\nAdd at least one for the paint terrain tool to be available.")
@/lua/ge/extensions/editor/aiViz.lua
-- actual algo
while not tableIsEmpty(nodesToCheck) do
local nextNid = getNodeWithSmallestDist(nodesToCheck)
if drawEnabled then
if tableIsEmpty(mapNodes) then
mapNodes = map.getMap().nodes or {}
@/lua/vehicle/beamstate.lua
if (not tableIsEmpty(delayedPrecompBeams)) or (not tableIsEmpty(delayedPrecompTorsionbar)) then
M.update = update
if (not tableIsEmpty(delayedPrecompBeams)) or (not tableIsEmpty(delayedPrecompTorsionbar)) then
M.update = update
end
if not tableIsEmpty(inflatedTires) then
deflateTire(inflatedTires[math.floor(math.random(tableSize(inflatedTires)))])
@/lua/ge/extensions/util/dependencyTree.lua
if tableIsEmpty(entity.deps) then entity.deps = nil end
if tableIsEmpty(entity.provides) then entity.provides = nil end
if tableIsEmpty(entity.deps) then entity.deps = nil end
if tableIsEmpty(entity.provides) then entity.provides = nil end
@/lua/vehicle/controller/vehicleController/shiftLogic/sequentialGearbox.lua
return tableIsEmpty(data) and nil or data
end
@/lua/ge/extensions/core/gamestate.lua
local function loading ()
return not (containsOnly(loadingScreenRequests, false) or tableIsEmpty(loadingScreenRequests))
end
@/lua/common/jbeam/sections/wheels.lua
end
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)")
@/lua/ge/extensions/freeroam/bigMapMode.lua
local missionIds = freeroam_bigMapMarkers.getIdsFromHoveredPoiId(M.hoveredPoiId)
if not tableIsEmpty(missionIds) then
local missionIdsById = {}
@/lua/ge/extensions/editor/flowgraphEditor.lua
dirtyChildren = graph:getDirtyChildren()
if not tableIsEmpty(dirtyChildren) then
im.OpenPopup("Unsaved macros")
dirtyChildren = graph:getDirtyChildren()
if not tableIsEmpty(dirtyChildren) then
im.OpenPopup("Unsaved macros")
@/lua/vehicle/extensions/simpleTripApp.lua
local function shouldExtensionLoad()
return next(wheels.wheels) or not tableIsEmpty(powertrain.getDevices())
end
@/lua/ge/extensions/util/docCreator.lua
-- configured controls
local assigned = not tableIsEmpty(info.bindings or {})
if info.assigned ~= nil then
@/lua/common/jbeam/tableSchema.lua
-- then walk the tables
if type(entry) == "table" and not tableIsDict(entry) and jbeamUtils.ignoreSections[keyEntry] == nil and not tableIsEmpty(entry) then
if tableIsDict(entry) then
@/lua/ge/extensions/editor/mainToolbar.lua
if modesManagerOpen[0] then
if selectedSetIndex and not tableIsEmpty(getModesFromSet(selectedSetIndex)) then
loadModesFromSet(selectedSetIndex)
@/lua/ge/extensions/freeroam/crashCamMode.lua
local parkedList = gameplay_parking.getParkedCarsList()
if tableIsEmpty(trafficList) and tableIsEmpty(parkedList) then return end
local parkedList = gameplay_parking.getParkedCarsList()
if tableIsEmpty(trafficList) and tableIsEmpty(parkedList) then return end