GE Lua Documentation

Press F to search!

convertVehicleColorsToPaints

Definition


-- @/lua/ge/ge_utils.lua:891

function convertVehicleColorsToPaints(colorTable)
  if type(colorTable) ~= 'table' then
    log('W','vehiclePaint','colorTable parameter should be a table of colors. type = '..type(colors)..' colors = '..dumps(colors))
    colorTable = {}
  end

  local paints = {}
  local colorTableSize = tableSize(colorTable)
  for i = 1, colorTableSize do
    local paint = createVehiclePaint({x = colorTable[i][1], y = colorTable[i][2], z = colorTable[i][3], w = colorTable[i][4]}, {})
    validateVehiclePaint(paint)
    table.insert(paints, paint)
  end
  return paints
end

Callers

@/lua/common/jbeam/sections/paints.lua
  if not paints and vehicleConfig.colors then
    paints = convertVehicleColorsToPaints(vehicleConfig.colors)
  end
@/lua/common/jbeam/loader.lua
  if not vehicleConfig.paints and vehicleConfig.colors then
    vehicleConfig.paints = convertVehicleColorsToPaints(vehicleConfig.colors)
    vehicleConfig.colors = nil