tableValuesAsLookupDict
Definition
-- @/lua/common/utils.lua:626
-- returns the values of a table for key lookup
function tableValuesAsLookupDict(tbl, target)
local res = target or table.new(#tbl, 4)
for _, tb in pairs(tbl) do
res[tb] = 1
end
return res
end
Callers
@/lua/ge/extensions/flowgraph/nodes/vehicle/randomConfigProvider.lua
configs = {},
paints = tableKeys(tableValuesAsLookupDict(v.model.paints or {}))
}
@/lua/ge/extensions/editor/util/vehicleFilterUtil.lua
configs = {},
paints = model and model.model and tableKeys(tableValuesAsLookupDict(model.model.paints or {})) or {}
}
local rangeFilters = tableValuesAsLookupDict({
"Value", "Weight", "Top Speed", "0-100 km/h", "0-60 mph", "Power", "Torque",
@/lua/ge/extensions/flowgraph/graph.lua
else
targetTypes = tableValuesAsLookupDict(targetPin.type)
end
else
sourceTypes = tableValuesAsLookupDict(sourcePin.type)
end
@/lua/ge/extensions/flowgraph/nodes/vehicle/spawnVehicle.lua
else
allPaints = tableKeys(tableValuesAsLookupDict(modelData.model.paints or {})) -- if random paint is true
if configData and configData.aggregates and configData.aggregates["Config Type"] then
@/lua/ge/extensions/core/vehicles.lua
for key, _ in pairs(displayInfo.predefinedUnits) do table.insert(shouldBeNumber, key) end
local shouldBeStringLookup = tableValuesAsLookupDict(shouldBeString)
local shouldBeNumberLookup = tableValuesAsLookupDict(shouldBeNumber)
local shouldBeStringLookup = tableValuesAsLookupDict(shouldBeString)
local shouldBeNumberLookup = tableValuesAsLookupDict(shouldBeNumber)
local shouldBeDictLookup = tableValuesAsLookupDict(shouldBeDict)
local shouldBeNumberLookup = tableValuesAsLookupDict(shouldBeNumber)
local shouldBeDictLookup = tableValuesAsLookupDict(shouldBeDict)
if newData[key][1] ~= nil then
newData[key] = tableValuesAsLookupDict(newData[key])
for k, v in pairs(newData[key]) do
@/lua/ge/extensions/flowgraph/nodes/mission/selectGarage2GarageZones.lua
local availableStartSpots = {}
local usedStartSet = tableValuesAsLookupDict(self.usedStartSpots)
for _, spotData in ipairs(possibleStartSpots) do
local availableEndSpots = {}
local usedEndSet = tableValuesAsLookupDict(self.usedEndSpots)
for _, spotData in ipairs(possibleEndSpots) do
@/lua/ge/extensions/core/funstuff.lua
if not modelInfo then return end
local paints = tableKeys(tableValuesAsLookupDict(modelInfo.model.paints or {}))
local paint1, paint2, paint3 = paints[math.random(1, #paints)], paints[math.random(1, #paints)], paints[math.random(1, #paints)]
configs = {},
paints = tableKeys(tableValuesAsLookupDict(v.model.paints or {}))
}
@/lua/ge/extensions/gameplay/backgroundActivities/g2g.lua
configs = {},
paints = tableKeys(tableValuesAsLookupDict(v.model.paints or {}))
}
@/lua/ge/extensions/editor/missionEditor/progressSingle.lua
self.currentProgressKey = self.missionInstance.currentProgressKey or self.missionInstance.defaultProgressKey or progressKeys[1] or 'default'
if not tableValuesAsLookupDict(progressKeys)[self.currentProgressKey] then
self.currentProgressKey = progressKeys[1] or 'default'
@/lua/ge/extensions/career/modules/playerAttributes.lua
if not reason.tags then reason.tags = {} end
reason.tags = tableValuesAsLookupDict(reason.tags)
@/lua/ge/extensions/ui/freeroamSelector/general.lua
local rangeFilters = tableValuesAsLookupDict({
@/lua/common/utils.lua
if #set1 ~= #set2 then return false end
local lut = tableValuesAsLookupDict(set1)
for _, val in ipairs(set2) do
function setUnion(dst, src)
local lut = tableValuesAsLookupDict(dst)
for _,v in ipairs(src) do
@/lua/ge/extensions/ui/gameplaySelector/general.lua
local rangeFilters = tableValuesAsLookupDict({
@/lua/ge/extensions/ui/apps.lua
appData.typesLookup = tableValuesAsLookupDict(appData.types)
end
appData.typesTranslatedLookup = tableValuesAsLookupDict(appData.typesTranslated)
@/gameplay/missionTypes/garageToGarage/constructor.lua
configs = {},
paints = tableKeys(tableValuesAsLookupDict(v.model.paints or {}))
}
@/lua/ge/extensions/ui/vehicleSelector/general.lua
local rangeFilters = tableValuesAsLookupDict({
"Value",
local dictFilters = tableValuesAsLookupDict({
--"Character Tags",
@/lua/ge/extensions/career/modules/delivery/general.lua
moveToLabel = vehName .. " " .. container.name,
cargoTypesLookup = tableValuesAsLookupDict(container.cargoTypes),
cargoTypesString = table.concat(container.cargoTypes,", "),
@/lua/ge/extensions/editor/trafficSignalsEditor.lua
if currInstance.tempGroupList then
groupInstances = tableValuesAsLookupDict(currInstance.tempGroupList)
end
@/lua/ge/extensions/editor/missionEditor/setupModules.lua
self:setBackwardsCompatibility()
self.blockedSetupModules = tableValuesAsLookupDict(self.missionInstance.blockedSetupModules or {})
@/lua/ge/extensions/flowgraph/nodes/gameplay/dragRace/generateDragOpponents.lua
if modelData and modelData.model and modelData.model.paints then
return tableKeys(tableValuesAsLookupDict(modelData.model.paints))
end
@/lua/ge/extensions/freeroam/gasStations.lua
local center, radius = gasStationCenterRadius(gasStation)
local isElectric = tableValuesAsLookupDict(gasStation.energyTypes or {"any"}).electricEnergy
local elem = {
local playModeIconName = "poi_fuel_round"
if tableValuesAsLookupDict(elem.facility.energyTypes or {"any"}).electricEnergy then
playModeIconName = "poi_charge_round"
local props = {}
local fuelTypes = tableValuesAsLookupDict(elem.facility.energyTypes or {"any"})
local fuelTranslations = {}
@/lua/ge/extensions/flowgraph/nodes/mission/selectGarageSpots.lua
local tmp = deepcopy(possibleStartingSpots)
local usedSpotsByName = tableValuesAsLookupDict(self.usedStartingSpotNames)
table.clear(possibleStartingSpots)
@/lua/ge/extensions/gameplay/drag/dragBridge.lua
local selectedConfig = eligibleVehicles[math.random(eligibleCount)]
local paints = tableKeys(tableValuesAsLookupDict(core_vehicles.getModel(selectedConfig.model_key).model.paints or {}))
local paintCount = #paints
@/lua/ge/extensions/flowgraph/nodes/input/blacklistAction.lua
getActions()
local listKeys = tableValuesAsLookupDict(self.list)
local toggled = false
@/lua/ge/extensions/career/modules/delivery/vehicleTasks.lua
local affectedOffers = {}
local offersById = tableValuesAsLookupDict(offerIds)
for _, taskData in ipairs(vehicleTasks) do
@/lua/ge/extensions/career/modules/delivery/generator.lua
item.type = item.cargoType
--item.logisticTypesLookup = tableValuesAsLookupDict(item.logisticTypes)
item.logisticType = item.logisticTypes[1] -- fix from table to one elem!
fac.logisticTypesProvidedLookup = tableValuesAsLookupDict(fac.logisticTypesProvided)
fac.logisticTypesReceivedLookup = tableValuesAsLookupDict(fac.logisticTypesReceived)
fac.logisticTypesProvidedLookup = tableValuesAsLookupDict(fac.logisticTypesProvided)
fac.logisticTypesReceivedLookup = tableValuesAsLookupDict(fac.logisticTypesReceived)
generator.logisticTypes = generator.logisticTypes or {}
generator.logisticTypesLookup = tableValuesAsLookupDict(generator.logisticTypes)
createGeneratorTemplateCache(generator)
ap.isInspectSpot = elem.isInspectSpot
ap.logisticTypesReceivedLookup = elem.logisticTypesReceived and tableValuesAsLookupDict(elem.logisticTypesReceived) or deepcopy(fac.logisticTypesReceivedLookup)
ap.logisticTypesProvidedLookup = elem.logisticTypesProvided and tableValuesAsLookupDict(elem.logisticTypesProvided) or deepcopy(fac.logisticTypesProvidedLookup)
ap.logisticTypesReceivedLookup = elem.logisticTypesReceived and tableValuesAsLookupDict(elem.logisticTypesReceived) or deepcopy(fac.logisticTypesReceivedLookup)
ap.logisticTypesProvidedLookup = elem.logisticTypesProvided and tableValuesAsLookupDict(elem.logisticTypesProvided) or deepcopy(fac.logisticTypesProvidedLookup)
@/lua/ge/extensions/flowgraph/nodes/gameplay/removeOtherVehicles.lua
local tempIds = {}
local idKeys = tableValuesAsLookupDict(vehIds)
for _, v in ipairs(self.mgr.modules.vehicle:getSpawnedVehicles()) do
@/lua/ge/extensions/core/multiseatCamera.lua
local pos = vec3(0, 0, 0)
local plvehicles = tableValuesAsLookupDict(extensions.core_input_bindings.getAssignedPlayers())
@/lua/ge/extensions/util/configListGenerator.lua
local defaultNumberOfVehicles = 10
local dictFilters = tableValuesAsLookupDict(core_vehicles.getAttributesConvertToDict())
@/lua/ge/extensions/flowgraph/groupHelper.lua
local inLinks, middleLinks, outLinks = {},{},{}
local nodeLookup = tableValuesAsLookupDict(nodeIds)
--dump(nodeLookup)