getConditions
Definition
-- @/lua/vehicle/partCondition.lua:489
local function getConditions()
if not hasExecutedInitWork then
preparePartData()
end
if tableIsEmpty(hasSetPartCondition) then
return false
end
local result = {}
for partId, _ in pairs(activeParts) do
xpcall(
function()
result[partId] = getCondition(partId)
--log("I", "partCondition.getConditions", string.format("Got condition for partId %25s: ", partId) .. string.sub(serialize(result[partId]), 1, 100))
end,
function(err)
log("E", "partCondition.getConditions", "Unable to get condition for partId " .. dumps(partId) .. ":")
log("E", "partCondition.getConditions", err)
log("E", "partCondition.getConditions", debug.traceback())
end
)
end
return result
end
Callers
@/lua/ge/extensions/core/vehicle/partmgmt.lua
if playerVehicle then
queueCallbackInVehicle(playerVehicle, "extensions.core_vehicle_partmgmt.savePartConfigFileStage2", "partCondition.getConditions("..serialize(filename)..")")
end
@/lua/vehicle/beamstate.lua
local up = obj:getDirectionVectorUp()
local vehicleState = {objId = obj:getId(), partsCondition = partCondition.getConditions(), itemId = v.config.itemId, pos = pos, front = front, up = up}
return vehicleState, ...
@/lua/ge/extensions/career/modules/partShopping.lua
function()
queueCallbackInVehicle(getCurrentVehicleObj(), "career_modules_partShopping.updatePreviewVehicle", "partCondition.getConditions()")
end
@/lua/ge/extensions/career/modules/partInventory.lua
local vehicleObj = getObjectByID(vehObjId)
queueCallbackInVehicle(vehicleObj, "career_modules_partInventory.changedPartsCallback", "partCondition.getConditions()", inventoryId)
end
@/lua/vehicle/extensions/gameplayInterfaceModules/interactPartCondition.lua
local function getConditions(params)
local dataTypeCheck, dataTypeError = checkTableDataTypes(params, {})
end
return {result = partCondition.getConditions()}
end
@/lua/ge/extensions/career/modules/inventory.lua
inventoryIdAfterUpdatingPartConditions = inventoryId
vehicle:queueLuaCommand(string.format("if not partCondition.getConditions() then partCondition.initConditions() end obj:queueGameEngineLua('career_modules_inventory.updatePartConditions(%d, %d)')", vehId, inventoryId))
@/lua/vehicle/partCondition.lua
local function createConditionSnapshot(snapshotKey)
local snapshotData = M.getConditions()
if not snapshotData or not snapshotKey then
end
local data = M.getConditions()