getVehicleName
Definition
-- @/lua/ge/extensions/core/quickAccess.lua:2616
local function getVehicleName(veh)
if not veh then return "No vehicle" end
local vehKey = veh.JBeam
local vehConfig = veh.partConfig
local vehicleNameSTR = {veh.JBeam}
local vehMainInfo = core_vehicles.getModel(vehKey)
if vehMainInfo then
table.clear(vehicleNameSTR)
local config_key = string.match(vehConfig, "vehicles/".. vehKey .."/(.*).pc")
local configInfo = vehMainInfo.configs[config_key] or vehMainInfo.model
-- skip prop traffic
-- build name
table.insert(vehicleNameSTR, vehMainInfo.model["Brand"])
table.insert(vehicleNameSTR, vehMainInfo.model["Name"])
if vehMainInfo.configs[config_key] then
table.insert(vehicleNameSTR, configInfo["Configuration"] or "")
end
-- set icon
if configInfo["Type"] then
if configInfo["Type"]== "Trailer" then vicon = "smallTrailer" end
if configInfo["Type"]== "Prop" then vicon = "trafficCone" end
end
end
local vehicleName = table.concat(vehicleNameSTR, " ")
return vehicleName
end
Callers
@/lua/ge/extensions/scenario/quickRace.lua
local function getVehicleName(scenario)
return scenario.vehicle.file.Name
--highscores.setScenarioHighscores(,M.getVehicleName(),core_vehicles.getVehicleLicenseText(vehicle),scenario.map,scenario.scenarioName,M.getConfigKey(),0)
@/lua/ge/extensions/career/modules/delivery/general.lua
local function getVehicleName(vehId)
local inventoryId = career_modules_inventory.getInventoryIdFromVehicleId(vehId)
for _, container in ipairs(vehCargoContainerData[1]) do
local vehName = getVehicleName(vehId)
local elem = {
@/lua/ge/extensions/ui/vehicleSelector/vehicleOperations.lua
-- Get vehicle name similar to quickAccess.lua
local function getVehicleName(veh)
if not veh then return "No vehicle" end
local managementDetails = {
currentVehicleName = getVehicleName(currentVehicle),
currentVehicleThumb = getCurrentVehicleThumb(currentVehicle)
@/lua/ge/extensions/career/modules/delivery/progress.lua
if not playerVehiclesById[con.vehId] then
playerVehiclesById[con.vehId] = { containers = {}, niceName = dGeneral.getVehicleName(con.vehId), vehId = con.vehId, containersById = {}}
end
@/lua/ge/extensions/core/quickAccess.lua
local currentVehicle = be:getPlayerVehicle(0)
local vehName = {txt = 'ui.radialmenu2.Manage.yourVehicle', context = {name = M.getVehicleName(currentVehicle)}}
table.insert(entries, {
table.insert(entries, {
title = M.getVehicleName(veh),
icon = vicon,
@/lua/ge/extensions/scenario/scenarios.lua
local function getVehicleName(vehicleID)
return scenario and scenario.vehicleIdToName[vehicleID]
@/lua/ge/extensions/career/modules/delivery/cargoScreen.lua
if not uiData.player.vehicles[entry.vehId] then
uiData.player.vehicles[entry.vehId] = { containers = {}, niceName = dGeneral.getVehicleName(entry.vehId), vehId = entry.vehId, hasContainersOfCargoType = {}}
end