pairs
Definition
-- @/=[C]:-1
function pairs(...)
Callers
@/lua/common/jbeam/sections/assorted.lua
local newTable = {}
for _, v in pairs(vehicle.soundscape) do
newTable[v.name] = v
@/lua/ge/extensions/ui/bindingsLegend.lua
for _, action in pairs(actionsByName) do
table.insert(result, action)
-- get the modifier data from the cache and only update the active state
for actionName, action in pairs(boundModifierActions) do
if actionName == "modifier1modifier2" then
@/lua/ge/extensions/util/configListGenerator.lua
local function doesVehiclePassFiltersList(vehicleInfo, filters)
for filterName, parameters in pairs(filters) do
local popList = {}
for model_key, pop in pairs(modelPops) do
table.insert(popList, {model_key = model_key, pop = pop})
local configData = deepcopy(core_vehicles.getConfigList())
for _, vehicleInfo in pairs(configData.configs) do
if vehicleInfo.aggregates.Type
@/lua/ge/extensions/util/trackBuilder/obstaclePlacer.lua
for name,_ in pairs(shapeNames) do obstacleTypes[#obstacleTypes+1] = name end
local objects = {}
for name,list in pairs(data) do
expandTruncateList(name,#list)
@/lua/ge/spawn.lua
--Walk through the groups until we find a valid object
for i,v in pairs(spawnDefaultGroups) do
if scenetree.findObject(spawnDefaultGroups[i]) then
@/lua/ge/extensions/flowgraph/nodes/vehicle/ai/scriptAI/pathStored.lua
if im.BeginCombo("Selector",tostring(self.currentID)) then
for id, rec in pairs(editor_scriptAIManager.getCurrentRecordings()) do
if im.Selectable1(tostring(id), tostring(id) == self.currentID) then
@/lua/ge/extensions/gameplay/rally/tools/rallyToolbox.lua
-- Preload items: Populates the self.items table
for id, item in pairs(self.racePathAiPath) do
kdT:preLoad(id, item.x, item.y, item.z)
-- -- Preload items: Populates the self.items table
-- for id, item in pairs(self.pacenoteWaypoints) do
-- kdT:preLoad(id, item.x, item.y, item.z)
for id, item in pairs(self.routeWaypointsIndex) do
kdT:preLoad(id, item.pos.x, item.pos.y, item.pos.z)
@/lua/ge/extensions/editor/missionPlaybook/attributeViewer.lua
local data = {}
for key, val in pairs(atts) do
local level, curLvlProgress, neededForNext = career_branches.getBranchLevel(key)
@/lua/ge/extensions/editor/gen/terrain.lua
T.out[cname] = {}
for i,p in pairs(list) do
local v = f and f(p) or p
aloop = {}
for key,_ in pairs(legend) do
T.out[key] = nil
local rdlist = editor.getAllRoads()
for roadID,_ in pairs(rdlist) do
local rd = scenetree.findObjectById(roadID)
end
for _,p in pairs(mask) do
tb:setHeightWs(p, 0)
local function corr(dw1, dw2)
for f,d in pairs(dw2) do
if not f2p[f] then f2p[f] = {list={}} end
-- frequency goes on
for _,p in pairs(f2p[f].list) do
p[2] = p[2] + 1
-- for
for f,d in pairs(f2p) do
for _,p in pairs(d.list) do
for f,d in pairs(f2p) do
for _,p in pairs(d.list) do
waveUp(f, p)
lo('>> regionPlot:'..#aregion)
for i,r in pairs(aregion) do
aregion[i] = {p=r.p, w=r.w}
-- local dmi,imi = math.huge
for k,d in pairs(aregion) do
-- pick strongest
-- toMark(ap, 'white', nil, 0.2, 0.5)
for i,list in pairs(afill) do
aregion[i].amark = {}
aregion[i].amark = {}
for _,p in pairs(list) do
aregion[i].amark[#aregion[i].amark+1] = p+vec3(0,0,forZ(p))
U.dump(ahit, '?? for_HIT:'..#ahit)
for i,d in pairs(ahit) do
lo('?? for_HIT:'..i..':'..path[d.ind].seg.ind)
end
for i,h in pairs(ahit) do
if i>1 and ahit[i-1].isclose then
-- decalUp(dec)
-- for i,p in pairs(ahit) do
end
-- project loop along dir
for i,n in pairs(loop) do
-- local p,s =
local am1 = {}
for i,d in pairs(loop) do
local pp,s = U.toLine(d.p, {a,b})
end
for i,b in pairs(junc.list) do
-- lo('?? for_BR:'..i..':'..b.ind)
if not asli2 or not asli1 then return end
for k,s in pairs(asli2) do
local L = s[1]:distance(s[2])
local dmi,dma,lmi,lma,pmi,pma = math.huge,0
for l,t in pairs(asli1) do
-- s - distance from s[1]
local function ext(asli)
for i,s in pairs(asli) do
if s.w > default.WMI_TOMERGE*D.default.laneWidth then
local dmi,kmi = math.huge
for k,h in pairs(ahit) do
local dist = h.p:distance(s.list[1])
dmi,kmi = math.huge
for k,h in pairs(ahit) do
local dist = h.p:distance(s.list[#s.list])
lo('?? for_SLI1:'..tostring(asli1 and #asli1 or nil)..':'..#loop)
for _,s in pairs(asli1) do
local desc = {list=s, w=(1+U.rand(-0.2,0.4))*D.default.laneWidth, mat='WarningMaterial', skip=true}
--[[
for _,s in pairs(asli2) do
local desc = {list=s, w=(_==1 and 1.4 or 1)*D.default.laneWidth, mat='WarningMaterial', skip=true}
ext(aslice)
for _,s in pairs(asli2) do
local desc = {list=s, w=(1+U.rand(-0.2,0.4))*D.default.laneWidth, mat='WarningMaterial', skip=true}
hasexit = false
for i,s in pairs(asli1) do
if i>1 and aslice[#aslice].w > default.WMI_TOMERGE*D.default.laneWidth then
hasexit = false
for i,s in pairs(asli2) do
if i>1 and aslice[#aslice].w > default.WMI_TOMERGE*D.default.laneWidth then
for i,desc in pairs(aslice) do
decalUp(desc)
--[[
for t,v in pairs(loop) do
lo('?? in_LOOP:'..t..':'..tostring(v.p)..':'..tostring(v.w))
T.out.inplace = true
for i,r in pairs(aregion) do
r.amark = nil
local anode = {}
for key,seg in pairs(dnode) do
for i=1,2 do
local p = vec3(0,0,0)
for _,e in pairs(seg[i]) do
p = p + e
-- build stars
for i,r in pairs(aregion) do
r.star = {} -- indexes of relevant nodes
r.star = {} -- indexes of relevant nodes
for k,n in pairs(anode) do
if #U.index(n.key,i) > 0 then
if i == 4 then
for _,k in pairs(r.star) do
lo('?? for_ang:'..k..':'..U.vang(anode[k].p-r.p, vec3(1,0),true))
local aseg = {}
for i,r in pairs(aregion) do
for k,ni in pairs(r.star) do
for i,r in pairs(aregion) do
for k,ni in pairs(r.star) do
local nito = U.mod(k+1, r.star)
-- place decals
for key,s in pairs(aseg) do
--- add segment
desc.ind = #adec
for _,ir in pairs(s.areg) do
local reg = aregion[ir]
local desc,reg
for k,s in pairs(aseg) do
reg = aregion[s.areg[1]]
local dmi,imi = math.huge
for i,p in pairs(s.list) do
local L = aregion[s.areg[1]].p:distance(p)+aregion[s.areg[2]].p:distance(p)
if reg.arad and #reg.arad > 0 then
for k,d in pairs(reg.arad) do
rmi = rmi + d.list[1]:distance(d.list[#d.list])
lo('?? pre_LOAD:'..#adec)
-- for i,d in pairs(adec) do
-- lo('?? for_DEC:'..i..':'..d.ind)
-- APPEND valency-2 junctions
for i,reg in pairs(aregion) do
local jset
local jset
for j,junc in pairs(ajunc) do
if junc.p:distance(reg.p) < 1 then
junc.list = reg.arad
for i,b in pairs(junc.list) do
if junc.p:distance(b.list[1]) < 1 then
ajunc[#ajunc+1] = {p=reg.p, list=reg.arad}
for i,b in pairs(ajunc[#ajunc].list) do
if ajunc[#ajunc].p:distance(b.list[1]) < 1 then
-- if true then return end
-- for i,c in pairs(ajunc) do
-- lo('?? for_junc:'..i..':'..tostring(c.p))
-- U.dump(across, '?? across:')
for t,reg in pairs(aregion) do
reg.amark = nil
-- lo('?? for_JUNC:'..#ajunc)
for k,c in pairs(ajunc) do
-- lo('?? if_dist:'.._..':'..tostring(c.p)..':'..tostring(reg.p))
if c.p:distance(reg.p) < U.small_dist then
for i,b in pairs(c.list) do
-- lo('?? for_SEC:'..t..':'..i)
-- toMark({junc.list[1].list[1],junc.list[1].list[#junc.list[1].list]}, 'mag', nil, 0.1, 1)
for i,b in pairs(junc.list) do
-- lo('?? for_BR:'..i..':'..b.ind)
local function trim(asli2,asli1)
for k,s in pairs(asli2) do
local L = s[1]:distance(s[2])
local dmi,dma,lmi,lma,pmi,pma = math.huge,0
for l,t in pairs(asli1) do
-- s - distance from s[1]
--[[
for i,r in pairs(aregion) do
for k,s in pairs(aseg) do
for i,r in pairs(aregion) do
for k,s in pairs(aseg) do
if #U.index(s.areg, i) > 0 then
-- render
for i,s in pairs(asli1) do
local desc = {list=s, w=(1+U.rand(-0.2,0.4))*D.default.laneWidth, mat='WarningMaterial', skip=true}
end
for i,s in pairs(asli2) do
local desc = {list=s, w=(1+U.rand(-0.2,0.4))*D.default.laneWidth, mat='WarningMaterial', skip=true}
--[[
for i,s in pairs(asli1) do
local desc = {list=s, w=1*D.default.laneWidth, mat='WarningMaterial'}
if true then return end
for i,s in pairs(asli2) do
local desc = {list=s, w=1*D.default.laneWidth, mat='WarningMaterial'}
for j=i+1,#aregion do
for _,nd in pairs(anode) do
if #U.index(nd.key,i)>0 and #U.index(nd.key,j)>0 then
-- place decals
for key,s in pairs(aseg) do
if #s == 2 then
aregion = jsonDecode(str)
for i,d in pairs(aregion) do
d.p = vec3(d.p.x,d.p.y)
ama = 0
for i,v in pairs(dw) do
if v > ama then
-- aregion = jsonDecode(str)
for i,d in pairs(aregion) do
d.p = vec3(d.p.x,d.p.y)
local loop = aloop[T.out.insector]
for i,rd in pairs(loop.aslice) do
decalDel(rd.ind)
local loop = aloop[T.out.insector]
for i,rd in pairs(loop.aslice) do
decalDel(rd.ind)
local loop = aloop[T.out.insector]
for i,rd in pairs(loop.aslice) do
decalDel(rd.ind)
local loop = aloop[T.out.insector]
for i,rd in pairs(loop.aslice) do
decalDel(rd.ind)
-- clean
for i,rd in pairs(loop.aslice) do
-- lo('?? to_del:'..rd.ind..':'..#adec) --..':'..adec[rd.ind].ind)
local torem
for i,d in pairs(aregion) do
if U.angDist(d.p) < 0.06 then
local dmi,lmi,imi,pmi = math.huge
for i,loop in pairs(aloop) do
local poly = {}
local poly = {}
for j,v in pairs(loop.list) do
poly[#poly+1] = v.p
--[[
for i,reg in pairs(aregion) do
if reg.p:distance(rayCast.pos) < 10 then
local dmi,lmi,imi,pmi = math.huge
for i,loop in pairs(aloop) do
local poly = {}
local poly = {}
for j,v in pairs(loop.list) do
poly[#poly+1] = v.p
--[[
for j,v in pairs(loop.list) do
if v.p:distance(p)
if im.IsMouseReleased(0) then
for key,val in pairs(dval) do
lo('?? for_val:'..key..':'..val)
if w ~= 0 and editor.keyModifiers.ctrl then
for i,d in pairs(aregion) do
if rayCast and d.p:distance(rayCast.pos)/core_camera.getPosition():distance(rayCast.pos) < 0.02 then
local s = 0
for j,o in pairs(aregion) do
s = s + o.w
s = s/#aregion
for j,o in pairs(aregion) do
o.w = o.w/s
--------------------
for i,d in pairs(aregion) do
if true or U._PRD == 1 then
-- lo('?? for_LKEY2:'..tostring(key)..':'..tostring(d.amark and #d.amark or nil)..':'..tostring(legend[key][2])..':'..tostring(d.amark[1]))
for _,p in pairs(d.amark) do
R.sphere(p, legend[key][2], c)
for key,d in pairs(legend) do
if T.out[key] and #T.out[key] > 0 then
-- lo('?? for_mark:'..tostring(T.out[key][1]))
for i,p in pairs(T.out[key]) do
R.sphere(p, legend[key][2], c)
@/lua/ge/extensions/core/checkpoints.lua
local vehicleCheckpoints = M.state.vehicleCheckpoints
for vid,data in pairs(vehicleCheckpoints) do
data.checkTimer = data.checkTimer + dt
resetData()
for _, vid in pairs(scenario.vehicleNameToId or {}) do
initialiseCheckpointData(vid)
@/lua/ge/extensions/util/nodeStream.lua
-- Process each flexbody and collect mapping parameters
for flexKey, flexbody in pairs(vData.vdata.flexbodies) do
local mappingData = {
@/lua/vehicle/powertrain/sequentialGearbox.lua
local reverseGears = {}
for _, v in pairs(jbeamData.gearRatios) do
table.insert(v >= 0 and forwardGears or reverseGears, v)
local gearIndex = device.minGearIndex
for _, v in pairs(gearWhineCoefsOutput) do
device.gearWhineCoefsOutput[gearIndex] = v
local gearIndex = device.minGearIndex
for _, v in pairs(gearWhineCoefsInput) do
device.gearWhineCoefsInput[gearIndex] = v
@/lua/vehicle/controller/pyrotechnicCharge.lua
if eventNodeName then
for cid, node in pairs(v.data.nodes) do
if node.name == eventNodeName then
@/lua/ge/extensions/gameplay/missions/missionManager.lua
for id, v in pairs(setupData.stashedVehicles) do
if v == false and getObjectByID(id) then
for id, v in pairs(setupData.stashedVehicles) do
if v == true and getObjectByID(id) then
local claimPrice = {}
for att, amount in pairs(price) do
claimPrice[att] = {amount = amount}
@/lua/ge/extensions/gameplay/sites/customFields.lua
for name, val in pairs(self.values) do
if self.types[name] == 'vec3' then
table.clear(self.sortedTags)
for k, _ in pairs(self.tags) do
table.insert(self.sortedTags, k)
@/lua/vehicle/mapmgr.lua
buf:put('{')
for k, v in pairs(states) do
buf:putf('[%q]=%s,', k, v)
@/lua/common/libs/resty/template/html.lua
if attr then
for k, v in pairs(attr) do
if type(k) == "number" then
@/lua/common/libs/lua-MessagePack/MessagePack.lua
end
for k, v in pairs(tbl) do
local typek = type(k)
local is_map, n, max = false, 0, 0
for k in pairs(tbl) do
if type(k) == 'number' and k > 0 then
local is_map, n, max = false, 0, 0
for k in pairs(tbl) do
if type(k) == 'number' and k > 0 then
local n = 0
for k in pairs(tbl) do
n = n + 1
@/lua/ge/extensions/editor/dataBlockEditor.lua
inExistingTab = true
for className, dataBlocks in pairs(dataBlockClasses) do
if not tableIsEmpty(dataBlocks) then
im.BeginChild1("New_Child", im.ImVec2(0, 0), false)
for className, _ in pairs(dataBlockClasses) do
im.TreeNodeEx1(className, bit.bor(im.TreeNodeFlags_Leaf))
@/lua/ge/extensions/editor/vehicleEditor/liveEditor/veFlexbodyDebug.lua
for _, nodeID in pairs(vertLocNodes) do
if nodeID ~= -1 then
-- Go through each vertex's locator nodes to render lines
for _, nodeID in pairs(vertLocNodes) do
if nodeID ~= -1 then
@/lua/ge/extensions/career/modules/delivery/progress.lua
}
for skill, _ in pairs(career_branches.getBranches()) do
unlockStatus.skillLevels[skill] = career_branches.getBranchLevel(skill)
TODO: reimplement
for skill, _ in pairs(skillUnlockDescriptions) do
for lvl = unlockStatus.skillLevels[skill], career_branches.getBranchLevel(skill) do
dropOffDataStatus.playerVehicleData = {}
for vehId, vehicleInfo in pairs(playerVehiclesById) do
--table.sort(vehicleInfo.containers, function(a,b) return a.name < b.name end)
-- still waiting for vehicles to be finished
for _, data in pairs(dropOffDataStatus.vehicleData) do
if not data.finished then return end
local manualDropOffItems = {}
for _, vehicleInfo in pairs(dropOffDataStatus.playerVehicleData or {}) do
for _, con in pairs(vehicleInfo.containers) do
for _, vehicleInfo in pairs(dropOffDataStatus.playerVehicleData or {}) do
for _, con in pairs(vehicleInfo.containers) do
for _, cargo in pairs(con.cargo) do
for _, con in pairs(vehicleInfo.containers) do
for _, cargo in pairs(con.cargo) do
cargo.vehicleName = vehicleInfo.name
-- add in rewards keys..?
for key, amount in pairs(cargo.adjustedRewards) do
branchInfo[key] = true
table.insert(confirmedOfferIds, vehData.id)
for key, amount in pairs(vehData.adjustedRewards) do
branchInfo[key] = true
dropOffDataStatus.customAmountPerMaterialType = {}
for _, materialType in pairs(tableKeysSorted(unloadingMaterialInfoByKey)) do
local info = unloadingMaterialInfoByKey[materialType]
for key, _ in pairs(branchInfo) do
branchInfo[key] = {
local maxDelay = 0
for _, delay in pairs(data) do
maxDelay = math.max(delay, maxDelay)
step.makeStepReturnTrueFunction(function()
for vehId, data in pairs(data) do
local veh = scenetree.findObjectById(vehId)
-- 1s delay, no freeze
for vehId, data in pairs(data) do
local veh = scenetree.findObjectById(vehId)
-- still waiting for vehicles to be finished
for _, data in pairs(confirmedDropOffData.offers) do
if not data.finished then return end
-- format each group individually
for gId, group in pairs(cargoByGroupId) do
table.insert(itemNames, string.format("%dx %s", #group, group[1].name))
for _, reward in ipairs(rewards) do
for key, amount in pairs(reward) do
rewardSum[key] = (rewardSum[key] or 0) + amount
for key, _ in pairs(branchInfo) do
local c = 0
for key, v in pairs(facility.progress[direction].countByType) do
c = c + v
else
for label, _ in pairs(soundNames) do
local sound = scenetree.findObjectById(soundObjectIds[label])
@/lua/ge/extensions/flowgraph/modules/timerModule.lua
function C:afterTrigger()
for id, timer in pairs(self.timers) do
-- finalize the pauseFlag
@/lua/ge/extensions/editor/sensorConfigurationEditor.lua
editor.hideWindow(sensorPropWinName)
for _, config in pairs(previewConfigs) do
for _, preview in ipairs(config.openPreviews) do
@/lua/ge/extensions/ui/vehicleSelector/general.lua
if configList then
for _, config in pairs(configList) do
for _, propName in pairs(filtersWhiteList) do
for _, config in pairs(configList) do
for _, propName in pairs(filtersWhiteList) do
local propVal = config[propName]
end
for value, active in pairs(propVal or {}) do
if active then
local filterUiData = {}
for _, propName in pairs(filtersWhiteList) do
if filterByProp[propName] then
local matchesAny = false
for value, active in pairs(propVal or {}) do
if filter.currentFilterValues[value] then
elseif filter.type == 'set' then
for _, option in pairs(filter.options) do
if propVal == option and not filter.currentFilterValues[option] then
p:add("displayData")
for modelName, _ in pairs(core_vehicles.getModelsData()) do
table.insert(modelList, core_vehicles.getModel(modelName).model)
table.insert(modelAndConfigList, core_vehicles.getModel(modelName).model)
for _, config in pairs(core_vehicles.getModel(modelName).configs or {}) do
table.insert(configList, config)
@/lua/vehicle/jbeam/stage2.lua
local dedup = {}
for i, beam in pairs(vehicle.beams) do
if beam.breakGroup == '' then beam.breakGroup = nil end
local cids = {}
for _, rail in pairs(vehicle.rails) do
if rail["links:"] ~= nil then
if rail["broken:"] ~= nil then
for _, nid in pairs(rail["broken:"]) do
brokenmap[nid] = 1
if vehicle.slidenodes == nil then return end
for _, snode in pairs(vehicle.slidenodes) do
local attached = 1
local tbi = tableEndC(vehicle.torsionbars)
for i, hydro in pairs(vehicle.torsionHydros) do
vehicle.torsionbars[tbi] = hydro; tbi = tbi + 1
if vehicle.torsionbars == nil then return end
for _, tb in pairs(vehicle.torsionbars) do
local spring = tb.spring
local n = vehicle.nodes
for _, triangle in pairs(vehicle.triangles) do
if triangle.breakGroup == '' then triangle.breakGroup = nil end
@/lua/vehicle/controller/drivingDynamics/sensors/vehicleData.lua
local totalMass = 0
for _, n in pairs(v.data.nodes) do
totalMass = totalMass + n.nodeWeight
local inertiaZ = 0
for _, v in pairs(v.data.nodes) do
local posNoZ = vec3(v.pos.x, v.pos.y, 0)
local cornerWheels = {}
for _, wheelName in pairs(cornerWheelData) do
cornerWheels[wheelName] = true
--calculate avg wheel position for later being able to determine where a given wheel is
for _, wheel in pairs(wheels.wheels) do
if cornerWheels[wheel.name] then
for _, wheel in pairs(wheels.wheels) do
if cornerWheels[wheel.name] then
@/lua/ge/extensions/util/calibrateESC.lua
local blacklistLookup = {}
for _, v in pairs(vehicleBlacklist) do
blacklistLookup[v] = true
local filteredConfigs = {}
for k, v in pairs(configs) do
if (not vehicleToTest or v.model_key == vehicleToTest) and ((not pcFileToTest or pcFileToTest == "") or v.key == pcFileToTest) and not blacklistLookup[v.model_key] then
local progressCount = 1
for _, v in pairs(filteredConfigs) do
local vehName = v.model_key
log("I", logTag, "Vehicles that are skipped:")
for _, value in pairs(vehicleBlacklist) do
log("I", logTag, value)
@/lua/ge/extensions/util/screenshotCreator.lua
local count = 0
for k, v in pairs(vehList) do
if v[2][0] then
local modelKeys={}
for k,_ in pairs(models) do table.insert(modelKeys,k) end
table.sort(modelKeys)
-- Add the selection
for k, v in pairs(vehList) do
if v[2][0] then
if workOptions.selection == "selectedModels" then -- take thumbnails of the selected models
for _, modelName in pairs(listOfSelectedModels) do
for _, configData in pairs(core_vehicles.getModel(modelName).configs) do
for _, modelName in pairs(listOfSelectedModels) do
for _, configData in pairs(core_vehicles.getModel(modelName).configs) do
if forceQuit then
local isCurrent
for _, configData in pairs(core_vehicles.getModel(currModelName).configs) do
isCurrent = configData.key == currConfigName
@/lua/vehicle/scriptai.lua
local avgWheelNodePos, numOfWheels, maxWheelRadius = vec3(), 0, -math.huge
for _, wheel in pairs(wheels.wheels) do
avgWheelNodePos:setAdd(obj:getOriginalNodePositionRelative(wheel.node1))
@/lua/ge/extensions/editor/tech/roadArchitect/profiles.lua
for k, nativeLaneType in pairs(lNew) do
profile[k] = {
@/lua/ge/extensions/editor/vehicleEditor/staticEditor/vePartTextView.lua
for nodeIdx, v in pairs(vEditor.selectedASTNodeMap) do
numSelectedLines = numSelectedLines + 1
@/lua/ge/extensions/ui/liveryEditor/tools.lua
dump("liveryEditor_editMode_onStateChanged", data)
for k, v in pairs(data) do
M.editModeState[k] = v
@/lua/vehicle/extensions/profiling/p.lua
local t, n = {}, 0
for k in pairs(count1) do
n = n + 1
local ms = 0
for k, v in pairs(count1) do
local pct = floor(v*1000/samples + 0.5)/10
@/lua/common/libs/lua-websockets/websocket/handshake.lua
if req.extra_headers then
for k,v in pairs(req.extra_headers) do
tinsert(lines, string.format('%s: %s',k,v))
@/lua/vehicle/input.lua
if hydros then
for _, h in pairs(hydros.hydros) do
if h.inputSource == "steering_input" then --check if it's a steering hydro
end
for _, h in pairs(hydros.hydros) do
if h.inputSource == "steering_input" then
end
for _, h in pairs(hydros.hydros) do
if h.inputSource == "steering_input" then
for wi, wd in pairs(wheels.wheels) do
if wd.parkingTorque and wd.parkingTorque > 0 then
local debug = false
for wi1, wd1 in pairs(wheels.wheels) do
local long1, side1 = getLongitudinalLateralPrefix(wd1.name)
local rearWheels = {}
for wi2, wd2 in pairs(wheels.wheels) do
local long2, side2 = getLongitudinalLateralPrefix(wd2.name)
vehicleMassCache = 0
for _, n in pairs(v.data.nodes or {}) do
vehicleMassCache = vehicleMassCache + n.nodeWeight
local downforce = 0
for _, wd in pairs(wheels.wheels or {}) do
downforce = downforce + wd.downForce
understeerAssistedSurfacesCache = {}
for k, v in pairs(particles.getMaterialsParticlesTable()) do
understeerAssistedSurfacesCache[k] = understeerAssistedSurfaces[v.name]
-- map the values
for k, e in pairs(M.state) do
local ival = e.val or 0
for k, e in pairs(M.state) do
e.smootherKBD:reset()
@/lua/console/bananabench-csv.lua
for vecname, v in pairs(res.tests) do
for i, test in ipairs(v.tests) do
@/lua/vehicle/controller/vehicleController/shiftLogic/dctGearbox.lua
automaticHandling.availableModeLookup = {}
for _, v in pairs(automaticHandling.availableModes) do
automaticHandling.availableModeLookup[v] = true
@/lua/ge/extensions/flowgraph/nodes/gameplay/race/raceMarkers.lua
local wps = {}
for _, m in pairs(self.minimapMarkers) do
m.mode = 'hidden'
if self.pinIn.ignoreRecovery.value then
for k, v in pairs(wps) do
if v == 'recovery' then
--if not self.pinIn.raceData.value then return end
for _, m in pairs(self.minimapMarkers or {}) do
local clr = m.color
@/lua/vehicle/extensions/gameplayInterfaceModules/interactCargoContainers.lua
local idx = 1
for _, container in pairs(v.data.cargoStorage or {}) do
-- generate an entry for the list that will be sent back to geLua.
-- store all nodes for groups
for _, node in pairs(v.data.nodes) do
if node.cargoGroup and cargoContainerGroupIdToCacheIndex[node.cargoGroup .. node.partPath] then
local hasValidFunction = true
for functionName, _ in pairs(functionFieldNames) do
if node[functionName] then
-- store all beams for groups
for _, beam in pairs(v.data.beams) do
if beam.cargoGroup and cargoContainerGroupIdToCacheIndex[beam.cargoGroup .. beam.partPath] then
local hasValidFunction = true
for functionName, _ in pairs(functionFieldNames) do
if beam[functionName] then
local function clearFunctionResults()
for _, data in pairs(functionCache) do
data.result = nil
anyContainerNeedsUpdate = false
for _, container in pairs(cargoContainerById) do
if not container.reachedTarget then
-- set all container weights according to the params data.
for _, setContainerData in pairs(params[1] or {}) do
-- first check if all containers have proper data
anyContainerNeedsUpdate = false
for id, _ in pairs(cargoContainerById) do
local setContainerData = (params[1] or {})[id]
@/lua/ge/extensions/editor/flowgraph/garbageDebug.lua
for id, gr in pairs(self.mgr.garbageData.graphs) do self:computeStats(gr) gr.meta = {type = "graph", graph = self.mgr.graphs[id]} end
for id, n in pairs(self.mgr.garbageData.nodes) do self:computeStats(n) n.meta = {type = "node", node = self.mgr.graphs[n.graphId].nodes[id]} end
for id, gr in pairs(self.mgr.garbageData.graphs) do self:computeStats(gr) gr.meta = {type = "graph", graph = self.mgr.graphs[id]} end
for id, n in pairs(self.mgr.garbageData.nodes) do self:computeStats(n) n.meta = {type = "node", node = self.mgr.graphs[n.graphId].nodes[id]} end
}
for _, gr in pairs(self.mgr.garbageData.graphs) do
graphSum.total = graphSum.total + gr.total
self.maxValue = 0
for _, gr in pairs(self.mgr.garbageData.graphs) do self:setSortingValue(gr) end
for _, n in pairs(self.mgr.garbageData.nodes) do self:setSortingValue(n) end
for _, gr in pairs(self.mgr.garbageData.graphs) do self:setSortingValue(gr) end
for _, n in pairs(self.mgr.garbageData.nodes) do self:setSortingValue(n) end
self:setSortingValue(self.mgr.garbageData.graphSum)
@/lua/ge/extensions/editor/tech/roadArchitect/decals.lua
local function tryRemoveAll()
for k, _ in pairs(asphalts) do
tryRemove(k)
table.clear(asphalts)
for k, _ in pairs(decals) do
tryRemove(k)
@/lua/ge/extensions/util/maptiles.lua
if m then
for nid, n in pairs(m.getMap().nodes) do
local pos = n.pos
local navgraph = {}
for nid, n in pairs(map.getMap().nodes) do -- remember edges are now single sided
local a = map.getMap().nodes[nid]
local a = map.getMap().nodes[nid]
for lid, link in pairs(n.links) do
local b = map.getMap().nodes[lid]
@/lua/ge/server/server.lua
for _, filename in pairs(jsonFilesToLoad) do
loadingProgress:update(-1, '')
for _, filename in pairs(tsFilesToExecute) do
loadingProgress:update(-1, '')
@/lua/ge/extensions/tech/impactgen/crashOutput.lua
local function fuzzyTableLookup(d, n)
for k, v in pairs(d) do
if string.find(string.lower(k), string.lower(n)) ~= nil then
for k, v in pairs(outParts) do
local data = fuzzyTableLookup(parts, k)
for k, v in pairs(outParts) do
if ret[k] == nil then
for part, v in pairs(parts) do
local partEntry = {}
@/lua/ge/extensions/ui/gridSelectorUtils/tilesModule.lua
local groupsList = {}
for _, group in pairs(groups) do
if #group.tiles > 0 then
-- Convert individual items to tiles
for i, config in pairs(clusteredItems.configsByKey) do
local tile = itemToTileConverter(config, true)
@/lua/ge/extensions/flowgraph/nodes/ui/buttons/getMultipleButtons.lua
for i = old, new+1, -1 do
for _, lnk in pairs(self.graph.links) do
if lnk.sourcePin == self.pinOut['clicked_'..i] then
@/lua/ge/extensions/flowgraph/nodes/career/onRefueling.lua
function C:work(args)
for _, pin in pairs(self.pinOut) do
if pin.type == "flow" then
end
for flag, act in pairs(self.flags) do
self.pinOut[flag].value = act
@/lua/ge/extensions/gameplay/drift/general.lua
local function commonReset()
for extensionName, _ in pairs(loadedExtensions) do
if extensionName ~= "gameplay_drift_general" and extensions.isExtensionLoaded(extensionName) and _G[extensionName].reset then
local function updateExtensions()
for extensionName, data in pairs(variableExtensions) do
if not data.manualLoad then
for extensionName, extensionData in pairs(loadedExtensions) do
if extensionData.loaded then
@/lua/ge/extensions/flowgraph/nodes/ui/imgui/elemental/imText.lua
function C:_executionStarted()
for _, p in pairs(self.pinOut) do
p.value = false
@/lua/ge/extensions/editor/dynamicDecals/loadSave.lua
tblx = {}
for _, mode in pairs(api.loadingModes) do
table.insert(tblx, mode.key)
@/lua/ge/extensions/core/camera.lua
globalCamerasCache = {}
for camName,constructor in pairs(getConstructors()) do
local cam = constructor()
runningCamsOrderCache = {}
for camName,cam in pairs(getGlobalCameras()) do
if cam.runningOrder then
local camConfigs = {}
for camMode,constructor in pairs(getConstructors()) do
if tableFindKey(multicams, camMode) then
local jbeamConfigs = vmcd[camMode] or {}
for i,jbeamConfig in pairs(jbeamConfigs) do
table.insert(camConfigs, {name=camMode.."."..jbeamConfig.name, constructor=constructor, jbeamConfig=jbeamConfig})
local renaminingCamNames = {}
for name, cam in pairs(vdata.cameras) do
local configured = false
if not cameraSet then
for k,v in pairs(configuration) do
if v.enabled and vdata.cameras[v.name] and not vdata.cameras[v.name].hidden then
if not cameraSet then
for k,v in pairs(configuration) do
if vdata.cameras[v.name] then
if vdata then
for camName, camera in pairs(vdata.cameras) do
camera.wasFocused = vdata.focusedCamName == camName
if vdata then
for _, camera in pairs(vdata.cameras) do
if camera.wasFocused == true then
local function proxy_all(functionName, ...)
for vid, vdata in pairs(getVehicleData()) do
for _, cam in pairs(vdata.cameras) do
for vid, vdata in pairs(getVehicleData()) do
for _, cam in pairs(vdata.cameras) do
if cam[functionName] then
end
for _,cam in pairs(getGlobalCameras()) do
if cam[functionName] then
settings.setValue('cameraConfig', "")
for vid, vdata in pairs(getVehicleData()) do
processVehicleCameraConfigChanged(vid, vdata, vdata.focusedCamName)
data.globalCameras = {}
for k,cam in pairs(getGlobalCameras()) do
if cam.onSerialize then cam:onSerialize() end
data.vehicleCameras = {}
for vid, vdata in pairs(getVehicleData()) do
data.vehicleCameras[vid] = {}
data.vehicleCameras[vid].focusedCamName = vdata.focusedCamName
for camName,cam in pairs(vdata.cameras) do
data.vehicleCameras[vid].cameras[camName] = serialize(cam)
-- global cameras
for camName, cam in pairs(getGlobalCameras()) do
if data.globalCameras[camName] then
data.vehicleCameras = convertVehicleNameKeysToVehicleIdKeys(data.vehicleCameras)
for vid, vdata in pairs(getVehicleData()) do
local svdata = data.vehicleCameras[vid]
local svdata = data.vehicleCameras[vid]
for camName,cam in pairs(vdata.cameras) do
if svdata then
@/lua/ge/extensions/career/modules/spawnPoints.lua
for _,spawnPoint in pairs(levelInfo.spawnPoints) do
if not M.isSpawnPointDiscovered(currentLevel, spawnPoint.objectname) then
@/lua/ge/extensions/editor/crawlEditor/presets.lua
local presetList = {}
for name, preset in pairs(self.presets.categories[self.PRESET_CATEGORIES.BOUNDARIES]) do
table.insert(presetList, {name = name, preset = preset})
local presetList = {}
for name, preset in pairs(self.presets.categories[self.PRESET_CATEGORIES.PATHNODES]) do
table.insert(presetList, {name = name, preset = preset})
local presetList = {}
for name, preset in pairs(self.presets.categories[self.PRESET_CATEGORIES.TRAILS]) do
table.insert(presetList, {name = name, preset = preset})
@/lua/ge/extensions/gameplay/drift/saveLoad.lua
local function onSaveCurrentSaveSlot(currentSavePath)
for id, spot in pairs(M.getDriftSpotsById()) do
if spot._dirty then
-- immediately hide the objects found
for id, line in pairs(spotData.spatialInfo.lines) do
for _, name in ipairs(line.markerObjects or {}) do
local spotsForLevel = {}
for _, spot in pairs(getDriftSpotsById()) do
if spot.level == getCurrentLevelIdentifier() then
@/lua/ge/extensions/career/modules/branches/leagues.lua
M.clearLeagueUnlockCache = function()
for _, league in pairs(leaguesById) do league._unlocked = nil end
starsBySkillCache = {}
local ret = {}
for id, _ in pairs(leaguesById) do
ret[id] = M.isLeagueUnlocked(id)
local validSkills = {}
for _, skill in pairs(career_branches.getBranches()) do
if skill.parentBranch == condition.branchId then
local ret = {}
for id, l in pairs(leaguesById) do
local league = formatLeague(l)
local ret = {}
for id, l in pairs(leaguesById) do
if not before[id] and after[id] then
local ret = {}
for id, l in pairs(leaguesById) do
if tableContains(l.missions, missionId) then
local leaguesBySkill = {}
for id, league in pairs(leaguesById) do
if not leaguesBySkill[league.skillId] then
-- Sort leagues within each skill group
for skillId, skillLeagues in pairs(leaguesBySkill) do
-- First sort by skill stars and file order
local dirtyFilesById = {}
for id, league in pairs(leaguesById) do
local validMissionIds = {}
end
for mId, m in pairs(missionsById) do
local lMap = {}
for skillId, list in pairs(missionIdsBySkillWithoutLeague) do
local fallbackLeagueId = "fallback_"..skillId
log("W","","Some ("..tostring(dirty)..") missions were not set up properly for leagues.")
for mId, count in pairs(dirtyFilesById) do
log("W","","Mission " .. mId .. " was not set up properly for leagues " .. count .. " times.")
loadLeagues()
for _, spot in pairs(spotsById) do
spot._isInLeague = nil
end
for id, league in pairs(leaguesById) do
for _, dsId in ipairs(league.driftSpots) do
@/lua/common/jbeamWriter.lua
local tableKeys = tableKeysSorted(v)
for _, kk in pairs(tableKeys) do
local vv = v[kk]
@/lua/ge/extensions/gameplay/util/sortedList.lua
table.clear(self.sorted)
for _, o in pairs(self.objects) do
table.insert(self.sorted, o)
@/lua/ge/extensions/util/jbeamStats.lua
for partName, part in pairs(parts) do
for sectionName, section in pairs(part) do
if not sectionCount[sectionName] then sectionCount[sectionName] = 0 end
local countedRows = 0
for _, row in pairs(section) do
if type(row) == 'table' and row[1] then
local newSectionCount = {}
for s, c in pairs(sectionCount) do
table.insert(newSectionCount, {s, c})
@/gameplay/tutorials/customNodes/registerLocationsNode.lua
--Add the locations to the cars so we can keep track
for _,car in pairs(self.mgr._fgTutoTestCarsStep.carsData) do
car.locationsLeft = {1,2,3}
@/lua/ge/extensions/flowgraph/nodes/mission/ARunForLife.lua
local i = 0
for _, id in pairs(containers) do
local veh = scenetree.findObjectById(id)
coinAvailable = false
for id, t in pairs(buffs) do
if t.available then
function C:doBuffsTime()
for id, t in pairs(buffs) do
if t.useTime then --make sure the current buff actually uses timers
for id, t in pairs(buffs) do
if t.onScreen and t.pos[2] - camPos.y > propDespawn then
function C:getBuffByName(name)
for id, t in pairs(buffs) do
if t.name == name then
function C:getPropByName(name)
for id, t in pairs(propsInfo) do
if t.name == name then
local i = 0
for id, t in pairs(propsInfo) do
if t.decal then
for id, t in pairs(propsInfo) do
if t.decal then
@/lua/ge/extensions/gameplay/traffic/baseRole.lua
self.flowgraph.transient = true -- prevent flowgraph from restarting flowgraphs after ctrl+L
for key, value in pairs(varData or {}) do
if self.flowgraph.variables:variableExists(key) then
local personality = {}
for _, v in pairs({'aggression', 'patience', 'bravery'}) do
local mod = {}
local valid = false
for _, state in pairs(sequence.controllerStates) do
local ctrlState = state.controller.states[state.stateIdx]
for k, v in pairs(derivedClass) do
o[k] = v
@/lua/ge/extensions/flowgraph/nodes/states/transition.lua
-- collect the in-pins of this node
for name, pin in pairs(node.pinInLocal) do
if name ~= 'flow' then
-- collect the out-pins of this node
for name, pin in pairs(node.pinOut) do
if name ~= 'flow' then
self._pinTemplates = {_in = {}, _out = {}}
for name, type in pairs(pins) do table.insert(self._pinTemplates._in, {name = name, type = type}) end
table.sort(self._pinTemplates._in, function(a,b) return a.name < b.name end)
local added = false
for name, pin in pairs(self.pinIn) do
if name ~= 'flow' then
@/lua/ge/extensions/ui/apps/minimap/topomap.lua
-- Find bounds from all navgraph nodes
for nodeId, node in pairs(mapData.nodes) do
if node.pos then
@/lua/ge/extensions/editor/rallyEditor/pacenotes/structuredForm.lua
for cautionVal,cautionText in pairs(mapping.caution) do
if cautionText == '' then
@/lua/ge/extensions/flowgraph/nodes/gameplay/race/raceAiParameters.lua
for id, state in pairs(self.pinIn.raceData.value.states) do
local veh = getObjectByID(id)
@/lua/ge/extensions/editor/dynamicDecalsTool.lua
if editor.isWindowVisible(toolWindowName) then
for _, fn in pairs(onEditorGuiFunctions) do
fn()
for _, onUpdateFn in pairs(editorOnUpdateFunctions) do
onUpdateFn(dtReal, dtSim, dtRaw)
if not selectedLayers then return end
for uid, layer in pairs(selectedLayers) do
editor.selection["dynamicDecalLayer"][uid] = deepcopy(api.getLayerByUid(uid))
if not selectedLayers then return end
for uid, layer in pairs(selectedLayers) do
editor.selection["dynamicDecalLayer"][uid] = deepcopy(api.getLayerByUid(uid))
@/lua/ge/extensions/career/modules/vehicleClassGrouping.lua
for _, model in pairs(core_vehicles.getModelList().models) do
local modelType = model.Type or "Unknown"
if (modelType == "Car" or modelType == "Truck") and not checkFilter(modelFilter, model.key, invertedFilters.modelFilter) then
for _, config in pairs(core_vehicles.getModel(model.key).configs) do
local modelConfigKey = string.format("%s/%s", model.key, config.key)
@/lua/ge/extensions/flowgraph/nodes/ui/imgui/elemental/imButton.lua
function C:_executionStarted()
for _, p in pairs(self.pinOut) do
p.value = false
@/lua/ge/extensions/util/docCreator.lua
local res = {}
for _, l in pairs(locales) do
local key = string.match(l, 'locales/(.*).json')
if type(tbl) == 'table' then
for k, v in pairs(tbl) do
if type(v) == 'table' then
for k,info in pairs(mergedInfo) do
local entry = {}
local materialsClean = {}
for i, m in pairs(materials) do
table.insert(materialsClean, m.name) -- {m.colorR, m.colorG, m.colorB}
@/lua/vehicle/controller/tech/screens.lua
for _, screen in pairs(screens) do
local queueString = string.format("extensions.tech_multiscreen.addVehicleView(%q, %.3f, %.3f, %.3f, %.3f, %.3f, %.3f, %d, %d, %.2f, %.2f, %.2f, %.2f, %d, %d, %d, %s)",
@/lua/ge/extensions/gameplay/sites/sitesManager.lua
}
for fp, site in pairs(sitesCache) do
ret.sitesCache[fp] = site:onSerialize()
currentLevel = data.currentLevel or getCurrentLevelIdentifier()
for fp, s in pairs(data.sitesCache) do
local site = require('/lua/ge/extensions/gameplay/sites/sites')()
@/lua/vehicle/powertrain/shaft.lua
for _, nid in pairs(wheel.nodes) do
local n = v.data.nodes[nid]
device.outputPorts = {}
for _, v in pairs(jbeamData.outputPortOverride) do
device.outputPorts[v] = true
@/lua/ge/extensions/gameplay/police.lua
for id, veh in pairs(policeVehs) do
if getObjectByID(id):getActive() then
for id, veh in pairs(traffic) do
if id ~= targetId and veh.pursuit.mode >= 1 and veh.pos:squaredDistance(targetVeh.pos) < 6400 then -- during active arrest, clear pursuit level of nearby suspects
local tempIds = {}
for pid, p in pairs(policeVehs) do
if p.role.targetId == id then
local tempIds = {}
for pid, p in pairs(policeVehs) do
if p.role.targetId == id then
local tempIds = {}
for pid, p in pairs(policeVehs) do
if p.role.targetId == id then
for id, veh in pairs(gameplay_traffic.getTrafficData()) do
local pursuit = veh.pursuit
for otherId, otherVeh in pairs(policeVehs) do -- first, check for police vehicles that are out of sight
if getObjectByID(otherId):getActive() and otherVeh.role.validTargets[id] and otherVeh.role.validTargets[id].dist > 10000
@/lua/common/extensions/networking/editorToolchain.lua
local messages = server:receiveData()
for _, msg in pairs(messages or {}) do
onData(msg[1], msg[2])
for connection, subs in pairs(subscriptions) do
for _, sub in ipairs(subs) do
local vPos = veh:getPosition()
for _, node in pairs(vData.vdata.nodes) do
local name = node.name or tostring(node.cid)
@/lua/vehicle/extensions/test/csvMetrics.lua
}
for k, v in pairs(electrics.values.wheelThermals) do
table.insert(header, 'BrakeCoreTemp' .. k)
end
for k, v in pairs(powertrain.getDevicesByType('combustionEngine')) do
if v.thermals ~= nil then
}
for k, v in pairs(electrics.values.wheelThermals) do
table.insert(dataRow, v.brakeCoreTemperature or 0)
end
for k, v in pairs(powertrain.getDevicesByType('combustionEngine')) do
table.insert(dataRow, v.thermals.engineBlockTemperature)
@/lua/ge/extensions/editor/vehicleEditor/liveEditor/veTCSDebug.lua
if not didInit then
for k, _ in pairs(vEditor.tcsData.wheelBrakeFactors) do
brakeFactors[k] = {}
for k, _ in pairs(vEditor.tcsData.wheelSlips) do
wheelSlips[k] = {}
for k, _ in pairs(vEditor.tcsData.throttleFactors) do
throttleFactors[k] = {}
for k, _ in pairs(vEditor.tcsData.allWheelSlips) do
allWheelSlips[k] = {}
table.remove(slipThresholds, 1)
for _, v in pairs(brakeFactors) do
table.remove(v, 1)
end
for _, v in pairs(wheelSlips) do
table.remove(v, 1)
local count = 1
for k, v in pairs(vEditor.tcsData.wheelBrakeFactors) do
table.insert(brakeFactors[k], v)
count = 1
for k, _ in pairs(brakeFactors) do
if count > 1 then
count = 2
for k, v in pairs(vEditor.tcsData.wheelSlips) do
table.insert(wheelSlips[k], v)
for k, _ in pairs(wheelSlips) do
im.SameLine()
for _, v in pairs(throttleFactors) do
table.remove(v, 1)
end
for _, v in pairs(allWheelSlips) do
table.remove(v, 1)
count = 1
for k, v in pairs(vEditor.tcsData.throttleFactors) do
table.insert(throttleFactors[k], v)
count = 1
for k, _ in pairs(throttleFactors) do
if count > 1 then
count = 1
for k, v in pairs(vEditor.tcsData.allWheelSlips) do
table.insert(allWheelSlips[k], v)
count = 1
for k, _ in pairs(allWheelSlips) do
if count > 1 then
@/lua/ge/extensions/gameplay/crawl/boundary.lua
for _, objectInfo in pairs(boundaryObjects) do
local pos = objectInfo.finalPosition
for objectId, objectInfo in pairs(boundaryObjects) do
local pos = objectInfo.finalPosition
for objectId, objectInfo in pairs(boundaryObjects) do
local obj = scenetree.findObjectById(objectId)
local function resetBoundaryObjects()
for objectId, objectInfo in pairs(boundaryObjects) do
local obj = scenetree.findObjectById(objectId)
for objectId, objectInfo in pairs(boundaryObjects) do
local obj = scenetree.findObjectById(objectId)
@/lua/common/libs/xlsxlib/tests/TestManager.lua
local testNames = {}
for name, func in pairs(tests) do
if type(func) == "function" and name:match("^test") then
@/lua/ge/extensions/gameplay/discover/newPlayerExperience.lua
local dones = {}
for vehId, setup in pairs(setupVehs) do
local veh = getObjectByID(vehId)
end
for id, _ in pairs(dones) do
setupVehs[id] = nil
for _, discover in pairs(freeroamExperiences) do
table.insert(D.pageInfo.sections[1].discoverIds, discover.id)
end
for _, mission in pairs(missions) do
table.insert(D.pageInfo.sections[2].discoverIds, mission.id)
@/lua/ge/extensions/editor/tech/roadArchitect/geometry.lua
local w_q, hL_q, hR_q = {}, {}, {}
for k, _ in pairs(w1) do
local w1Key, hL1Key, hR1Key = w1[k][0], hL1[k][0], hR1[k][0]
wDisc[ctr], hLDisc[ctr], hRDisc[ctr] = {}, {}, {}
for k, _ in pairs(p1.widths) do
wDisc[ctr][k] = im.FloatPtr(monotonicSteffen(p1.widths[k][0], p2.widths[k][0], p3.widths[k][0], p4.widths[k][0], 0, 1, 2, 3, qPlus1))
wDisc[ctr], hLDisc[ctr], hRDisc[ctr] = {}, {}, {}
for k, _ in pairs(p1.widths) do
wDisc[ctr][k] = im.FloatPtr(monotonicSteffen(p1.widths[k][0], p2.widths[k][0], p3.widths[k][0], p4.widths[k][0], 0, 1, 2, 3, qPlus1))
local numLanes = 0
for k, _ in pairs(nodes[i].widths) do
if nodes[i].widths[k][0] > 2.0 then
local extraHairpinLaneWidth = extraHairpinWidth / numLanes
for k, _ in pairs(nodes[i].widths) do
if nodes[i].widths[k][0] > 2.0 then
if origWidths[i] then
for k, _ in pairs(origWidths[i]) do
nodes[i].widths[k] = im.FloatPtr(origWidths[i][k])
@/lua/common/jbeam/slotSystem.lua
-- traversal of hidden values
hidden = function() return pairs(mt.__index) end,
-- traversal of table ordered: returning index, key
-- traversal of table
pairs = function(self) return pairs(self) end,
-- traversal of table ordered: returning key,value
-- walk and merge all sections
for sectionKey, section in pairs(source) do
if sectionKey == 'slots' or sectionKey == 'slots2' or sectionKey == "information" then
local slotOptionReset = {}
for k4, v4 in pairs(localSlotOptions) do
slotOptionReset[k4] = ""
local localSlotOptions = nil
for k3, v3 in pairs(section) do
if tonumber(k3) ~= nil then
local slotOptionReset = {}
for k4, v4 in pairs(localSlotOptions) do
slotOptionReset[k4] = ""
@/lua/ge/extensions/gameplay/drift/scoring.lua
local function translateTierNames()
for id, data in pairs(driftTiers) do
driftTiers[id].name = translateLanguage(tierTranslationPrefix..data.id, tierTranslationPrefix..data.id, true)
@/lua/ge/extensions/editor/vehicleEditor/staticEditor/vePartTree.lua
node.__selected = nil
for k, v in pairs(node) do
_clearNodeSelection(v)
end
for k, v in pairs(node) do
_selectAndHighlightNode(v)
end
for k, v in pairs(node) do
_deselectAndUnhighlightNode(v)
node.__selected = true
for k, v in pairs(node) do
_selectNode(v)
node.__hidden = hidden
for _, n in pairs(node) do
_setNodeHidden(n, hidden)
--if not part.slotType then return end
for partName, _ in pairs(partsList) do
local part, jbeamFilename = deepcopy(jbeamIO.getPart(ioCtx, partName))
if open then
for k, v in pairs(node) do
if k ~= '__astNodeIdx' and k ~= '__selected' and k ~= '__hidden' and k ~= 'maxIDs' and k ~= 'validTables' and k ~= '__schemaProcessed' then
-- Render and pick the nodes
for _, node in pairs(part.nodes) do
if type(node) == 'table' and node.pos ~= nil then
-- Render and pick the beams
for key, beam in pairs(part.beams) do
if type(beam) == 'table' then
@/lua/ge/extensions/ui/policeInfo.lua
local function resetPursuitTable() -- resets values to zero
for k, v in pairs(lastPursuitData) do
if type(v) == 'number' then
@/lua/ge/extensions/util/autoAnnotation.lua
key = string.lower(key)
for pattern, annotation in pairs(tab) do
pattern = string.lower(pattern)
@/lua/ge/extensions/core/settings/audio.lua
local audioProviderName = TorqueScriptLua.getVar( '$pref::SFX::providerName' )
for n, p in pairs(devices) do
if n == audioProviderName then
local firstProviderName = ''
for n, d in pairs(devices) do
if n ~= 'Null' then
for n, d in pairs(providers) do
if n ~= 'Null' then
@/lua/ge/extensions/flowgraph/basenode.lua
if self.pinSchema then
for _, v in pairs(self.pinSchema) do
local dir = v.dir
if self.pinSchema then
for _, v in pairs(self.pinSchema) do
local dir = v.dir
-- sorts pins
for _, p in pairs(pinOrder) do
if p[1] == pin.name and p[2] == pin.direction then
if self.pinSchema then
for _, v in pairs(self.pinSchema) do
if v.type == 'flow' then
if self.pinSchema then
for _, v in pairs(self.pinSchema) do
if v.dir == 'in' then
for _, p in pairs(self.pinOut) do
p.value = nil
-- remove links
for _, lnk in pairs(self.graph.links) do
if lnk.sourcePin == pin or lnk.targetPin == pin then
if self.clearOutPinsOnStart then
for _, p in pairs(self.pinOut) do
p.value = nil
local targets = {}
for lid, link in pairs(self.graph.links) do
if link.sourceNode.id == self.id then
if editor.getPreference("flowgraph.general.showNodeBehaviours") then
for k, v in pairs(self.behaviour) do iconWidth = iconWidth + 24 end
end
im.TextUnformatted('Errors:')
for k, v in pairs(self._error) do
im.TextUnformatted(v)
builder:Middle()
for k, pin in pairs(self.pinIn) do
im.TextUnformatted('> ' .. k .. '[' .. pin.type .. ']')
end
for k, pin in pairs(self.pinInLocal) do
im.TextUnformatted('L> ' .. k .. '[' .. pin.type .. ']')
end
for k, pin in pairs(self.pinOut) do
im.TextUnformatted(k .. '[' .. pin.type .. '] >')
local hasActivePins = false
for _, pin in pairs(self.pinList) do
if pin:isActive() then
local hiddenCount = 0
for _, pin in pairs(self.pinList) do
local show = not pin.hidden
local inCount = 0
for _, pin in pairs(self.pinList) do
if pin.direction == 'in' then
--for parentNode, _ in pairs(self._flowColors) do
-- im.TextUnformatted(tostring(parentNode.id))
-- outputs
for _, pin in pairs(self.pinList) do
if pin.direction == 'out' and (isSimple or pin.type ~= 'delegate') then
ui_flowgraph_editor.Suspend()
for _, pin in pairs(self.pinList) do
pin:hoverDraw(self.mgr)
local selectedNodes = {}
for id, _ in pairs(self.mgr.selectedNodes) do
table.insert(selectedNodes, self.graph.nodes[id])
for k, v in pairs(self.data) do
for _, pin in pairs(self.pinIn) do
if pin._hardcodedDummyPin then
end
for _, pin in pairs(self.pinList) do
if pin.quickAccess then
-- deserialize data/values
for k, v in pairs(nodeData.data) do
if self.data[k] ~= nil then
if nodeData.hardcodedPins then
for pinName, val in pairs(nodeData.hardcodedPins) do
if nodeData.quickAccess then
for pinName, val in pairs(nodeData.quickAccess.p_in) do
if self.pinInLocal[pinName] then
end
for pinName, val in pairs(nodeData.quickAccess.p_out) do
if self.pinOut[pinName] then
if nodeData.hiddenPins then
for pinName, val in pairs(nodeData.hiddenPins.p_in) do
if val then
end
for pinName, val in pairs(nodeData.hiddenPins.p_out) do
if val then
local baseInit = o.init
for k, v in pairs(derivedClass) do
--print('k = ' .. tostring(k) .. ' = '.. tostring(v) )
@/lua/ge/extensions/ui/console.lua
-- for k,v in pairs(logFiltered) do
-- lines_count = lines_count+1
-- local tmp
-- for k,v in pairs(logFiltered) do
-- if type(v) == number and (i+logsHead+offset) >k and (i+logsHead+offset)<=v then tmp = true; print("brk");break; end
@/lua/ge/extensions/editor/rallyEditor.lua
for _,win in pairs(windows) do
win:setPath(currentPath)
local files = FS:findFiles(notebooksFullPath, '*.notebook.json', -1, true, false)
for _,fname in pairs(files) do
table.insert(paths, fname)
@/lua/ge/extensions/gameplay/traffic/roles/suspect.lua
local policeIds = {}
for id, veh in pairs(gameplay_police.getPoliceVehicles()) do
if not veh.role.flags.pursuit and not veh.role.flags.reset then -- only available police vehicles
@/lua/vehicle/controller/drivingDynamics/CMU.lua
M.updateGFX = debugEnabled and updateGFXDebugEnabled or updateGFXDebugNotEnabled
for _, c in pairs(subControllerLookup) do
if c.typeName ~= "drivingDynamics/CMU" and c.setDebugMode then
@/lua/ge/extensions/flowgraph/groupHelper.lua
local entry, exit = nil, nil
for _, node in pairs(graph.nodes) do
if node.nodeType == 'states/stateEntry' then
--dump(nodeLookup)
for id, lnk in pairs(graph.links) do
local i, o = nodeLookup[lnk.targetNode.id], nodeLookup[lnk.sourceNode.id]
local selectedNodes = {}
for id, _ in pairs(self.mgr.selectedNodes) do
if oldGraph.nodes[id].nodeType ~= 'states/stateEntry' and oldGraph.nodes[id].nodeType ~= 'states/stateExit' then
local graphRect = {math.huge, math.huge, -math.huge, -math.huge} -- minX, minY, maxX, maxY
for nodeId, _ in pairs(selectedNodes) do
local oldNode = oldGraph.nodes[nodeId]
local outputLinks = {}
for lid, link in pairs(oldGraph.links) do
local sourceContained = selectedNodes[link.sourceNode.id]
-- first, the easy links: the completely internal ones
for _, link in pairs(internalLinks) do
local linkData = link:__onSerialize()
inputNode.allowCustomOutPins = true
for _, link in pairs(inputLinks) do
if not groupedPins[link.sourcePin.id] then
for _, link in pairs(outputLinks) do
if not groupedPins[link.sourcePin.id] then
for nodeId, _ in pairs(selectedNodes) do
local node = oldGraph.nodes[nodeId]
if #inputLinks > 0 then
for _, link in pairs(inputLinks) do
if not groupedPins[link.sourcePin.id] then
if #outputLinks > 0 then
for _, link in pairs(outputLinks) do
if not groupedPins[link.sourcePin.id] then
local innerNodes = {}
for id, nd in pairs(groupedGraph.nodes) do
if nd.nodeType ~= 'states/stateEntry' and nd.nodeType ~= 'states/stateExit' then
local gInLinks, gOutLinks = {},{}
for id, lnk in pairs(newGraph.links) do
if lnk.targetNode.id == groupNode.id then
@/lua/ge/extensions/flowgraph/nodes/gameplay/sites/parkingspot.lua
local strLinks = {}
for _, lnk in pairs(self.graph.links) do
if lnk.sourceNode == self and tableContains(self.oldOptions, lnk.sourcePin.name) then
local outPins = {}
for _, pn in pairs(self.pinOut) do
if tableContains(self.oldOptions or {}, pn.name) then
end
for _, pn in pairs(outPins) do
self:removePin(pn)
@/lua/ge/extensions/util/worker.lua
local matFiles = FS:findFiles( path, 'materials.cs', -1, true, false)
for k,v in pairs(matFiles) do
TorqueScriptLua.exec(v)
local matFiles = FS:findFiles( path, '*materials.json', -1, true, false)
for k,v in pairs(matFiles) do
loadJsonMaterialsFile(v)
@/lua/ge/extensions/flowgraph/nodes/mission/selectGarageSpots.lua
local isLocal = self.pinIn.isLocal.value
for name, spot in pairs(self.spots.byName) do
if isLocal then
@/lua/common/jbeam/sections/mirror.lua
if vehicle.mirrors ~= nil then
for _, v in pairs(vehicle.mirrors) do
if v.mesh then
@/lua/ge/extensions/gameplay/crashTest/crashTestBoundaries.lua
for _, zone in pairs(sites.zones.objects) do
zone:drawDebug(nil, isPlayerOutOfBounds and red or white, 2, -0.5, not isPlayerOutOfBounds)
@/lua/ge/extensions/career/modules/milestones/generalMilestones/branches.lua
M.onGeneralMilestonesSetupCallbacks = function()
for attKey, milestone in pairs(attKeyToMilestone) do
M.setNotificationTarget(attKey)
local function onPlayerAttributesChanged(change)
for attKey, val in pairs(change) do
if val > 0 then
@/lua/ge/extensions/scenario/scenariosLoader.lua
local directory_cache = prefabCache[scenarioData.directory.."/"] or {}
for prefabName, prefabPath in pairs(directory_cache) do
if prefabsToFind[prefabName] or string.find(prefabName, scenarioData.scenarioName) then
local levelPath_cache = prefabCache[levelPath] or {}
for prefabName, prefabPath in pairs(levelPath_cache) do
if prefabsToFind[prefabName] or string.find(prefabName, scenarioData.scenarioName) then
scenarioData.previews = {}
for _, p in pairs(tmp) do
if string.startswith(p, scenarioData.directory) then
if scenarioData.directory then
for _,p in pairs(scenarioData.previews) do
table.insert(np, imageExistsDefault(scenarioData.directory.."/"..p))
local mgr = core_flowgraphManager.loadManager(path)
for name, value in pairs(sc.variables or {}) do
mgr.variables:changeBase(name, value)
-- select the scenario again
for k,v in pairs(scenarios) do
if v.levelName == levelName and v.scenarioName == scenarioName and v.sourceFile == sourceFile then
local newPreviews = {}
for _, img in pairs(levelInfo.levelInfo.previews) do
table.insert(newPreviews, directory..'/' .. img)
local tmp = FS:findFiles("/levels/"..levelName.."/",levelName..'_preview*.png', 0, true, false)
for _, p in pairs(tmp) do
table.insert(previews, p)
tmp = FS:findFiles("/levels/"..levelName.."/",levelName..'_preview*.jpg', 0, true, false)
for _, p in pairs(tmp) do
table.insert(previews, p)
local routes = {}
for _, file in pairs(busLineFiles) do
local busLine = jsonReadFile(file)
local busLine = jsonReadFile(file)
for _, route in pairs(busLine.routes) do
-- For now we assume there is only one bus scenario therefore
scenario.stopCount = 0;
for _, task in pairs(route.tasklist) do
scenario.stopCount = scenario.stopCount + 1
@/lua/vehicle/extensions/tech/CANBus/CANBusPeak.lua
if receiveResult == M.errorCodes.OK then
for _, callback in pairs(canMessageCallbacks) do
callback(msg)
M.errorCodeLookup = {}
for key, value in pairs(M.errorCodes) do
M.errorCodeLookup[value] = key
@/lua/ge/extensions/editor/api/valueInspector.lua
local i = 1
for key, _ in pairs(annotationsTbl) do
annotations[i] = key
@/lua/ge/extensions/career/modules/reputation.lua
for i, levelInfo in ipairs(organization.reputationLevels) do
for attributeKey, attributeValue in pairs(levelDefaults[i-2]) do
if levelInfo[attributeKey] then
if type(levelInfo[attributeKey]) == "table" then
for key, value in pairs(attributeValue) do
levelInfo[attributeKey][key] = levelInfo[attributeKey][key] or value
@/lua/ge/extensions/editor/missionEditor/objectives.lua
if next(self.missionInstance.sortedStarKeys or {}) then
for key, act in pairs(m.careerSetup.starsActive) do
starSet = starSet or act
-- check rewards being 0
for key, rewards in pairs(m.careerSetup.starRewards) do
for _, re in ipairs(rewards) do
local sums = {all = {}, defaultOnly = {}, bonusOnly = {}}
for key, rewards in pairs(self.mission.careerSetup.starRewards) do
for _, re in ipairs(rewards) do
@/lua/ge/extensions/gameplay/drag/dragTypes/dragPracticeRace.lua
if dragData.racers then
for _, racer in pairs(dragData.racers) do
table.insert(dials, {vehId = racer.vehId, dial = 0})
local hasDisqualifiedRacer = false
for vehId, racer in pairs(dragData.racers) do
if racer.isDesqualified then
for vehId, racer in pairs(dragData.racers) do
if racer.isFinished then
@/lua/ge/extensions/core/quickAccess.lua
if savedRecentActions then
for category, actions in pairs(savedRecentActions) do
recentActions[category] = {}
recentActions[category] = {}
for key, action in pairs(actions) do
local idx = tonumber(key) -- sometimes the key is a number, sometimes it's a string. stupid json
local savedDynamicSlotSettings = {}
for key, value in pairs(dynamicSlotSettings) do
savedDynamicSlotSettings[key] = {
local baseDynamicSlotSettings = {}
for key, value in pairs(dynamicSlotSettings) do
baseDynamicSlotSettings[key] = {
if savedDynamicSlotSettings then
for key, value in pairs(savedDynamicSlotSettings) do
local slot = dynamicSlotSettings[key]
for path, value in pairs(flatData) do
-- Check if path starts with any valid root
local isValidRoot = nil
for root in pairs(validRoots) do
if string.find(path, "^" .. root) then
-- Add the final value to the leaf node
for k, v in pairs(value) do
v.level = path -- Assign the full path to the leaf node
local function addTitleToTreeItems(tree)
for key, value in pairs(tree.items) do
if value.path then
if value.path then
for key2, value2 in pairs(tree.items) do
if value2["goto"] and value2["goto"] == value.path then
local sortedItems = {}
for key, value in pairs(tree.items) do
value._key = key
local newMenuTreeCopyForUI = {}
for key, value in pairs(menuTreeCopyForUI) do
if string.find(key, dynamicSlotSettingsData.pathFilter) then
end
for key, value in pairs(menuTreeCopyForUI) do
for _, action in pairs(value or {}) do
for key, value in pairs(menuTreeCopyForUI) do
for _, action in pairs(value or {}) do
action.icon = updateIcon(action.icon, action.title)
local replaced = false
for k, v in pairs(menuTree[args.level]) do
if v.uniqueID == args.uniqueID then
if vData and vData.vdata and type(vData.vdata.triggers) == 'table' then
for _, trg in pairs(vData.vdata.triggers or {}) do
local trigger = veh:getTrigger(trg.abid)
-- Check each occupied slot to see if it falls within our range
for slot, _ in pairs(occupiedSlots) do
local normalizedSlot = ((slot - 1) % maxSlotAmount) + 1
for path, items in pairs(menuTreeCopy) do
for _, e in ipairs(items) do
for path, items in pairs(menuTreeCopy) do
for i = #items, 1, -1 do
}
--for _, path in pairs(favoriteActionsPaths) do
-- protectedPaths[path] = true
-- First pass: check all levels for emptiness
for level, items in pairs(menuTreeCopy) do
if level ~= "/root/" and not protectedPaths[level] then
if hasChanges then
for level, items in pairs(menuTreeCopy) do
for i = #items, 1, -1 do
if playerVehId ~= -1 then
for k, vehicleLevel in pairs(vehicleMenuTrees[playerVehId]) do
if menuTreeCopy[k] then
::gotoButtonsStart::
for levelPath, levelInfo in pairs(menuTreeCopy) do
if countLevels(levelPath) >= 2 then
end
for level, tree in pairs(menuTreeCopy) do
local dynamicItems = {}
local function renderTree(node, path)
for key, value in pairs(node) do
local currentPath = (path and (path .. "/" .. key) or key)
-- Check if the current node is a lowest-level table and extract the title if available
for subKey, subValue in pairs(value) do
if type(subValue) == "table" then
@/lua/ge/map.lua
for nid, n in pairs(map.nodes) do
for lid, edge in pairs(n.links) do
for nid, n in pairs(map.nodes) do
for lid, edge in pairs(n.links) do
if not edge.speedLimit then
for _, v in pairs(jsonMap.segments) do
if type(v.nodes) == 'string' then
local splits = {}
for nid, data in pairs(nodesToMerge) do
local edgeId = data[1]
-- for n1id, n2id in pairs(newNodesCreated) do -- TODO: remove debug
-- local n1 = map.nodes[n1id]
-- check for private roads joining public roads
for nid, n in pairs(map.nodes) do
local privateCount, count = 0, 0
local privateCount, count = 0, 0
for lnid, d in pairs(n.links) do -- first, get any private links that exist from the current node
if d.type == 'private' then
if otherCount == 1 and privateCount == count - 1 then
for lnid, d in pairs(n.links) do
if d.type ~= 'private' then -- processes non-private segment due to it being the only one compared to the other links
elseif privateCount >= 1 and otherCount >= 1 then
for lnid, d in pairs(n.links) do
if d.type == 'private' then
local numOfEdges = 0
for n1id, n1 in pairs(map.nodes) do
noOfNodes = noOfNodes + 1
local degree = 0
for n2id, data in pairs(n1.links) do
if n1id ~= n2id then
visualLog = {}
for nid, n in pairs(map.nodes) do
local linksize = tableSize(n.links)
-- local maxColorCode = 0
-- for nodeId, node in pairs(mapNodes) do
-- if node.junction then
-- local dist = {}
-- for k, v in pairs(mapNodes) do
-- if v.debugColorCode then
-- for nodeId, node in pairs(mapNodes) do
-- if node.debugColorCode then node.debugColorCode = node.debugColorCode / maxColorCode end
local colorCode = -1 -- initialize color code (-- TODO: can we get something from random initialization?)
for nodeId, node in pairs(mapNodes) do
if node.junction then
local dist = {}
for k, v in pairs(mapNodes) do
if v.debugColorCode then
numOfColorCodes = 1 / (numOfColorCodes-1)
for nodeId, node in pairs(mapNodes) do
if node.debugColorCode then node.debugColorCode = node.debugColorCode * numOfColorCodes end
local nodeDrivabilities = {}
for k, n in pairs(mapNodes) do
nodeDrivabilities[k] = be:getTerrainDrivability(n.pos, n.radius)
for nid, n in pairs(mapNodes) do -- edges are now single sided
local nPos = n.pos
edgeTab[1] = nid
for lid, data in pairs(n.links) do
local edgeDrivability = min(1, max(1e-30, (nodeDrivabilities[lid] + nidDrivability) * 0.5 * data.drivability))
if not customMapNodes then
for nodeName, v in pairs(manualWaypoints) do
if mapNodes[nodeName] == nil or gp.graph[nodeName] == nil then
local minX, minY, maxX, maxY = math.huge, math.huge, -math.huge, -math.huge
for nid, n in pairs(m.nodes) do
local pos = n.pos - terrainPosition
if includeLinks then
for nid, n in pairs(m.nodes) do
for lid, dif in pairs(n.links) do
for nid, n in pairs(m.nodes) do
for lid, dif in pairs(n.links) do
local p1 = n.pos - terrainPosition
local nodes = svg.Group()
for nid, n in pairs(m.nodes) do
local p = n.pos - terrainPosition
end
for node2id, edgeData in pairs(node.links) do
if node.junction then
local function onFilesChanged(files)
for _,v in pairs(files) do
if v.filename == mapFilename then
be:sendToMailbox("updateDrivabilities", lpack.encodeBinWorkBuffer(changeSet)) -- mailbox is cleared when map is loaded
for objId, _ in pairs(M.objects) do
be:queueObjectLua(objId, "mapmgr.updateDrivabilities()")
local function getState()
for k, v in pairs(M.objectNames) do
if type(k) == 'string' then
end
for k, v in pairs(M.objects) do
v.name = v.name or ''
@/lua/ge/extensions/editor/flowgraph/references.lua
function C:findNodesRecursive(nodeDirectory)
for k, _ in pairs(nodeDirectory) do
if k == "nodes" then
if k == "nodes" then
for node, nodeData in pairs(nodeDirectory[k]) do
if not initialCheck then
for _, nodeData in pairs(self.nodeTable) do
nodeData.amount = 0
for node in self.mgr:allNodes() do
for k, v in pairs(self.nodeTable) do
if v.displayName == node.name then
for k, v in pairs(self.nodeStatistics.categories) do
table.insert(res, { category = k, nodeTypeAmount = v.nodeTypeAmount, nodeInstancesAmount = v.nodeInstancesAmount })
if data then
for _, graph in pairs(data.graphs or {}) do
for _, node in pairs(graph.nodes) do
for _, graph in pairs(data.graphs or {}) do
for _, node in pairs(graph.nodes) do
self:updateNodeOccurrence(string.gsub(node.type, "(.*/)(.*)", "%2"), filename)
if self.filterMode == 'All' then
for k, v in pairs(self.nodeTable) do
if string.find(k, ffi.string(self.searchText)) then
if not alreadyExist then
for k, v in pairs(self.nodeTable) do
if v.displayName == node.name then
elseif self.filterMode == 'Unused' then
for k, v in pairs(self.nodeTable) do
if v.amount == 0 then
local res = {}
for k, v in pairs(self.nodeTable[self.inspectedNode].amountForProjects) do
table.insert(res, { projectFile = k, amount = v })
im.TableNextColumn()
for _, categoryData in pairs(self.sortedCategories) do
im.TableSetBgColor(im.TableBgTarget_CellBg, im.GetColorU322(columnBackground), 0)
local rowCount = 1
for _, n in pairs(self.filteredNodes) do
if editor.uiIconImageButton(editor.icons.subdirectory_arrow_right, im.ImVec2(24, 24)) then
im.TableNextColumn()
for behaviour, _ in pairs(self.nodeTable[self.inspectedNode].behaviour) do
editor.uiIconImage(editor.icons[ui_flowgraph_editor.getBehaviourIcon(behaviour)], buttonSize)
@/lua/common/graphpath.lua
local i, edgeData = 0, table.new((edgeCount or 0) * 3, 0)
for node1, links in pairs(self.graph) do
for node2, linkData in pairs(links) do
for node1, links in pairs(self.graph) do
for node2, linkData in pairs(links) do
if node1 > node2 then
-- Consider succesors of node
for adjNode, value in pairs(graph[node]) do
if value.drivability == 1 then
else -- get all scc of the map graph
for node, _ in pairs(graph) do
if nodeData[node] == nil then
local isJunctionNode = {}
for nid, n in pairs(graph) do
if tableSize(n) ~= 2 then
local graphMinor, visited = {}, {}
for nid in pairs(graph) do
if isJunctionNode[nid] then
-- if there exist an edge to another junction/end node, add it to the minor graph
for n2id in pairs(graph[nid]) do
-- check if both n1id and n2id are junction nodes and also avoid including an edge twice
if node == goal then break end
for child, data in pairs(graph[node]) do
if road[child] == nil then -- if the shortest path to child has not already been found
edgeId[1] = fNode
for child, data in pairs(graph[fNode]) do
if child ~= bNode then -- a three way turn only makes sense to include at the start of the search, not mid way
local parent = road[node]
for child, data in pairs(graph[node]) do
local edgeCost
local parent = road[node]
for child, edgeData in pairs(nodeLinks) do
local edgeCost
local linkCount = max(1, tableSize(graph[node]) - (minParent[node] and 1 or 0))
for child, edgeData in pairs(graph[node]) do
if road[child] == nil then
table.clear(tab)
for k, _ in pairs(graph[node]) do
if road[k] == nil and road1[k] == nil then tab[k] = true end
local linkCountCheck = next(gnode, linkCountGT1) or (not minParent[node] and not startMinParent and linkCountGT1) -- node has more than 2 neighboors or is start node with more than 1 neighboors (the only node without a minParent at this point is the start node)
for child, edgeData in pairs(graph[node]) do
if road[child] == nil and child ~= startMinParent then -- TODO: child ~= startMinParent -> in the case of a dead end it will not be able to turn back
local linkCountCheck = next(gnode, linkCountGT1) or (not minParent1[node] and linkCountGT1) -- node has more than 2 neighboors or is start node with more than 1 neighboors
for child, edgeData in pairs(graph[node]) do
if not prevPathSet[child] and road1[child] == nil and road[child] == nil then
if node == goal then break end
for child, data in pairs(graph[node]) do
if road[child] == nil then
if node == target then break end
for child, data in pairs(graph[node]) do
if road[child] == nil then
if node == goal then break end
for child, data in pairs(graph[node]) do
if road[child] == nil then
if posNodeDist < radius * radius then
for child, _ in pairs(graph[node]) do
if visited[child] == nil then
local childCount = 0
for child, _ in pairs(graph[node]) do
if visited[child] == nil then
for child, link in pairs(graph[prevNode]) do
local childPos = graphpos[child]
for child, link in pairs(graph[prevNode]) do
local pathVec = graphpos[child] - curPos
local edgeDirVec = (positions[parent] - nodePos):normalized()
for child, data in pairs(graph[node]) do
if road[child] == nil then
@/lua/console/json-performance.lua
local totalSize = 0
for _, filename in pairs(filenames) do
fileContent[filename] = readFile(filename)
for i = 1, reruns do
for filename, content in pairs(fileContent) do
--print(' * ' ..tostring(filename))
local luaContent = {}
for filename, content in pairs(fileContent) do
--print(' * ' ..tostring(filename))
for i = 1, reruns do
for filename, content in pairs(luaContent) do
--print(' * ' ..tostring(filename))
for i = 1, reruns do
for filename, content in pairs(lpackContent) do
--print(' * ' ..tostring(filename))
for i = 1, reruns do
for filename, content in pairs(luaContent) do
--print(' * ' ..tostring(filename))
for i = 1, reruns do
for filename, content in pairs(luaContent) do
strbufContent[filename] = tostring(buffer.encode(content))
for i = 1, reruns do
for filename, content in pairs(strbufContent) do
buffer.decode(content)
@/lua/vehicle/powertrain/hydraulicAccumulator.lua
device.consumerJbeamData = {}
for _, ph in pairs(v.data.powertrainHydros) do
if ph.connectedPump == device.name then
local ptoSupplyNodeNames = jbeamData.hydraulicPTOSupplyCouplerNodeNames or {}
for _, nodeName in pairs(ptoSupplyNodeNames) do
if beamstate.nodeNameMap[nodeName] then
local ptoConsumerNodeNames = jbeamData.hydraulicPTOConsumerCouplerNodeNames or {}
for _, nodeName in pairs(ptoConsumerNodeNames) do
if beamstate.nodeNameMap[nodeName] then
@/lua/ge/extensions/gameplay/drift/scoreboard.lua
local function populateTierNames()
for _, tierData in pairs(gameplay_drift_scoring.getDriftTiers()) do
tiersAndScore[tierData.id] = {totalScore = 0, count = 0, name = tierData.name, order = tierData.order}
local function populateQuickMessagesNames()
for quickMessageId, quickMessageData in pairs(gameplay_drift_quickMessages.getQuickMessages()) do
quickMessages[quickMessageId] = {count = 0, totalScoreEarned = 0, msg = quickMessageData.msg}
for quickMessageId, quickMessageData in pairs(quickMessagesToBeConfirmed) do
local qmScoreEarnedWithMulti = quickMessageData.totalScoreEarned * data.combo
-- translate all at once
for name, data in pairs(compiledStats) do
data.name = translateLanguage("missions.drift.stats."..name, "missions.drift.stats."..name, true)
@/lua/ge/extensions/freeroam/facilities/fuelPrice.lua
cachedPriceData = {}
for k,v in pairs(facilitiesData.gasStations) do
if not v.prices then goto continueStation end
if not v.prices then goto continueStation end
for fuelType,v2 in pairs(v.prices) do
if v2.disabled and v2.displayObjects then
end
for k,v in pairs(cachedPriceData) do
if not v.prices then goto continueStation end
if not v.prices then goto continueStation end
for fuelType,v2 in pairs(v.prices) do
if v2.displayObjects then
@/lua/vehicle/controller/pneumatics/autoLevelSuspension.lua
return pairs(groups)
end
local function updateFixedStep(dt)
for _, controlGroup in pairs(controlGroups) do
local controlBeamId = controlGroup.controlBeamId
local function reset()
for _, g in pairs(controlGroups) do
g.targetLength = g.defaultTargetLength or 0
for _, v in pairs(actuatorGroupsData) do
controlBeamNames[v.controlBeamName] = true
for _, v in pairs(beams) do
if v.name and controlBeamNames[v.name] then
controlGroups = {}
for _, groupData in pairs(actuatorGroupsData) do
local controlBeamName = groupData.controlBeamName
@/lua/ge/extensions/flowgraph/nodes/career/onMissionPromptShown.lua
self.pinOut.openedMenu.value = false
for flag, act in pairs(self.flags) do
self.pinOut[flag].value = act
@/lua/console/resave-pcs.lua
local configCount = 0
for _,vdir in pairs(vehicles) do
--do we have a vehicle that is known to fail on spawning?
if #configs == 0 then goto skipme end
for _,config in pairs(configs) do
io.write("\tresaving config " .. config .. "\n")
@/lua/ge/extensions/core/weather.lua
for objClassStr, attribTable in pairs(p) do
local objs = getObjectsByClass(objClassStr)
formerValues[objClassStr] = {}
for _, obj in pairs(objs) do
local id = obj:getId()
local fields = obj:getFields()
for attrName, attrValue in pairs(attribTable) do
formerValues[objClassStr][id][attrName] = {}
formerValues[objClassStr][id][attrName]['value'] = stringToTable(obj:getField(attrName, ' '))
for k,v in pairs(formerValues[objClassStr][id][attrName]['value']) do
formerValues[objClassStr][id][attrName]['value'][k] = tonumber(v)
formerValues[objClassStr][id][attrName]['value'] = stringToTable(obj:getField(attrName, ' '))
for k,v in pairs(formerValues[objClassStr][id][attrName]['value']) do
formerValues[objClassStr][id][attrName]['value'][k] = tonumber(v)
formerValues[objClassStr][id][attrName]['value'] = stringToTable(obj:getField(attrName, ' '))
for k,v in pairs(formerValues[objClassStr][id][attrName]['value']) do
formerValues[objClassStr][id][attrName]['value'][k] = tonumber(v)
local t = {}
for k,v in pairs(ta) do
t[k] = v - tb[k]
for objClassStr, objs in pairs(formerValues) do
diff[objClassStr] = {}
diff[objClassStr] = {}
for id, obj in pairs(objs) do
diff[objClassStr][id] = {}
diff[objClassStr][id] = {}
for attrName, attrVal in pairs(obj) do
if type(attrVal.value) == 'number' and p[objClassStr][attrName] ~= nil then
for objName, objVal in pairs(formerValues) do
local objects = getObjectsByClass(objName)
values[objName] = {}
for k,object in pairs(objects) do
values[objName][object:getId()] = object
local function multiplyTable( tbl, factor )
for k,v in pairs(tbl) do
tbl[k] = tbl[k] * factor
if diff and formerValues then
for objClassStr, obs in pairs(formerValues) do
for id, o in pairs(obs) do
for objClassStr, obs in pairs(formerValues) do
for id, o in pairs(obs) do
for attrName, attrVal in pairs(o) do
for id, o in pairs(obs) do
for attrName, attrVal in pairs(o) do
values[objClassStr][id][attrName] = formerValues[objClassStr][id][attrName]['setter'](formerValues[objClassStr][id][attrName]['value'], diff[objClassStr][id][attrName])
for objClassStr, attribTable in pairs(p) do
if type(objClassStr) ~= 'string' or type(attribTable) ~= 'table' then
else
for _, obj in pairs(objs) do
for attrName, attrValue in pairs(attribTable) do
for _, obj in pairs(objs) do
for attrName, attrValue in pairs(attribTable) do
local fields = obj:getFields()
local globalFiles = FS:findFiles('art/weather/', '*.json', -1, true, false) -- {"art/weather/defaults.json"}
for _, v in pairs(globalFiles) do
loadPreset(v)
local levelFiles = FS:findFiles(levelDir..'/weather/', '*.json', -1, true, false) -- {"levels/driver_training/weather/weather.json"}
for _, v in pairs(levelFiles) do
loadPreset(v)
local p = {}
for k,v in pairs(presets) do
table.insert(p,k)
@/lua/vehicle/extensions/dynoClient.lua
local rearAxis = 0.0
for k,wd in pairs(v.data.wheels) do
frontAxis = math.min( frontAxis, v.data.nodes[wd.node1].pos.y )
@/lua/common/jbeam/sections/vropes.lua
local function findPropIdByName(vehicle, propName)
for _, prop in pairs(vehicle.props) do
if prop.name == propName then
-- After tableSchema processing, ropes is now a dictionary/object
for ropeName, ropeConfig in pairs(vehicle.vropes) do
--dump({"ropeName", ropeName, "ropeConfig", ropeConfig})
@/lua/vehicle/partCondition.lua
local partTypeTags
for k, v in pairs(partData) do
if type(v) == "table" then
local partTypeTags = {}
for _, flexbody in pairs(v.data.flexbodies) do
--TODO: check maybe a tag that tells us if the flexbody can change color (and how?), paint vs glas vs plastic etc
local beamsPerPart = {}
for _, beam in pairs(v.data.beams) do
if beam.partPath then
for partId, partData in pairs(beamsPerPart) do
if partData.deformableBeams > 0 or partData.breakableBeams > 0 then
activeParts = {}
for partId, partTypeName in pairs(v.data.activeParts) do
activeParts[partId] = v.data.activePartsData[partTypeName]
for partId, partData in pairs(activeParts) do
--save root part id for later
if powertrainClues then
for part, types in pairs(powertrainClues) do
partTypeData[part] = partTypeData[part] or {}
partTypeData[part] = partTypeData[part] or {}
for _, partType in pairs(types) do
table.insert(partTypeData[part], partType)
if flexbodyClues then
for part, types in pairs(flexbodyClues) do
partTypeData[part] = partTypeData[part] or {}
partTypeData[part] = partTypeData[part] or {}
for _, partType in pairs(types) do
table.insert(partTypeData[part], partType)
if jbeamClues then
for part, types in pairs(jbeamClues) do
partTypeData[part] = partTypeData[part] or {}
partTypeData[part] = partTypeData[part] or {}
for _, partType in pairs(types) do
table.insert(partTypeData[part], partType)
for partId, types in pairs(partTypeData) do
local deduplication = {}
local deduplication = {}
for _, partType in pairs(types) do
deduplication[partType] = true
partTypeData[partId] = {}
for partType, _ in pairs(deduplication) do
table.insert(partTypeData[partId], partType)
local function setAllPartPaints(paints, paintOdometer)
for partId, _ in pairs(activeParts) do
setPartPaints(partId, paints, paintOdometer)
local result = {}
for partId, _ in pairs(activeParts) do
xpcall(
log("I", "partCondition.initConditions", "Parts condition not provided for vehicle, assuming fresh vehicle state for vehicle Id: " .. dumps(objectId))
for partId, _ in pairs(activeParts) do
initCondition(partId, fallbackOdometer or 0, fallbackIntegrityValue or 1, fallbackVisualValue or 1, defaultPaints)
end
for partId in pairs(activeParts) do
local odometer, integrity, visual
@/lua/vehicle/extensions/tech/CANBus/ProjectBavariaKombi.lua
local payload = {counter + counterHighBits}
for _, dataByte in pairs(data) do
table.insert(payload, dataByte)
local payload = {counter}
for _, dataByte in pairs(data) do
table.insert(payload, dataByte)
local payload = {counter}
for _, dataByte in pairs(data) do
table.insert(payload, dataByte)
local payload = {firstByte, (counter + lshift(counterHighBits, 4))}
for _, dataByte in pairs(data) do
table.insert(payload, dataByte)
@/lua/ge/extensions/campaign/rewards.lua
local inv = players[player] or {}
for k, v in pairs(inv) do
callback(k, v)
for k,v in pairs(data.rewards) do
-- ignore all keys for medals
earned[k] = earned[k] or {}
for _,value in pairs(data) do
table.insert(earned[k], value)
if rewards then
for k,data in pairs(rewards) do
if statistics_statistics.getMedalRanking(k) >= 0 then
if statistics_statistics.getMedalRanking(k) >= 0 then
for subKey,value in pairs(data) do
if subKey == 'choices' then
local finalResultInfo = {}
for k,v in pairs(earned) do
finalResultInfo[k] = v
for k,v in pairs(pendingChoice) do
finalResultInfo[k] = v
if choices then
for k,v in pairs(choices) do
core_inventory.addItem("$$$_"..k, v[selectionIndex])
@/lua/ge/extensions/flowgraph/nodes/ui/updatedUI/startScreenDial.lua
end
for racerId, racerData in pairs(dragData.racers) do
table.insert(self.panel.dials,
@/lua/ge/extensions/flowgraph/nodes/macro/integrated.lua
for _, node in pairs(graph.nodes) do
if node.nodeType == "macro/io" then
if self.inputNode then
for _, pin in pairs(self.inputNode.pinList) do
table.insert(inPins, self:createPin('in', pin.type, pin.name, pin.default, pin.description, true))
if self.outputNode then
for _, pin in pairs(self.outputNode.pinList) do
table.insert(outPins,self:createPin('out', pin.type, pin.name, pin.default, pin.description, true))
if self.inputNode then
for name, pin in pairs(self.pinIn) do
if not pin._hardcodedDummyPin then
if self.outputNode then
for name, pin in pairs(self.pinOut) do
self.pinOut[name].value = self.outputNode.pinIn[name].value
function C:_executionStarted()
for _, pin in pairs(self.pinIn) do
if pin._hardcodedDummyPin then
function C:_executionStopped()
for _, pin in pairs(self.pinIn) do
if pin._hardcodedDummyPin then
@/lua/vehicle/extensions/gameplayInterface.lua
local function registerModule(name, actions, lookups)
for k, _ in pairs(actions) do
if registeredActions[k] then
end
for k, _ in pairs(lookups) do
if registeredLookups[k] then
@/gameplay/missionTypes/targetjump/customNodes/CalculateZonePointRewardNode.lua
end
for _, z in pairs(zones.objects) do
local points = z.customFields:get('points') or 0
@/lua/common/libs/copas/copas/limit.lua
-- all tasks done, resume the waiting tasks so they can unblock/return
for coro in pairs(self.waiting) do
copas.wakeup(coro)
@/lua/ge/extensions/flowgraph/nodes/states/stateExit.lua
if self.graph:getParent() then
for id, node in pairs(self.graph:getParent().nodes) do
if node.targetGraph and node.targetGraph.id == self.graph.id then
@/lua/ge/extensions/gameplay/rally/loop/rallyEventLog.lua
local penalties = {}
for penaltyType, data in pairs(groupData.penaltyTypes) do
table.insert(penalties, {
@/lua/vehicle/powertrain/electricServo.lua
for _, nid in pairs(wheel.nodes) do
local n = v.data.nodes[nid]
@/lua/console/bananabench-async.lua
local timeTotalSum = 0
for k,vehicle in pairs(vehicles) do
local testVehicle = 'vehicles/' .. vehicle .. '/'
@/gameplay/missionTypes/chase/constructor.lua
unlockedStars.completeTraffic = false
for id, v in pairs(gameplay_traffic.getTrafficData()) do
if be:getObjectActive(id) and v.roleName == 'standard' then
@/lua/vehicle/powertrain/combustionEngine.lua
for k, v in pairs(device.torqueCurve) do
if type(k) == "number" and k < maxRPM then
for k, v in pairs(device.torqueCurve) do
if type(k) == "number" and k < maxRPM then
for k, v in pairs(device.torqueCurve) do
if type(k) == "number" and k < maxRPM then
for k, v in pairs(device.torqueCurve) do
if type(k) == "number" and k < maxRPM then
for k, v in pairs(device.torqueCurve) do
if type(k) == "number" and k < maxRPM then
for k, v in pairs(device.torqueCurve) do
if type(k) == "number" and k < maxRPM then
for k, v in pairs(device.torqueCurve) do
if type(k) == "number" and k < maxRPM then
for k, v in pairs(device.torqueCurve) do
if type(k) == "number" and k < maxRPM then
local function updateEnergyStorageRatios(device)
for _, s in pairs(device.registeredEnergyStorages) do
local storage = energyStorage.getStorage(s)
local remainingFuelRatio = 0
for _, s in pairs(device.registeredEnergyStorages) do
local storage = energyStorage.getStorage(s)
local nodeCids = {}
for _, nodePair in pairs(exhaustNodeIDPairs) do
table.insert(nodeCids, nodePair[2])
local nodeCids = {}
for _, nodePair in pairs(exhaustNodeIDPairs) do
table.insert(nodeCids, nodePair[2])
endNodeIDPairs = {}
for _, v in pairs(endNodes) do
maxExhaustAudioOpennessCoef = min(max(maxExhaustAudioOpennessCoef, v.exhaustAudioOpennessCoef), 1)
bdebug.clearTypeNodeDebugText("CombustionEngine " .. device.name)
for _, soundData in pairs(device.soundLocations) do
for _, nodeCid in ipairs(soundData.nodes) do
endNodeIDPairs = {}
for _, v in pairs(device.thermals.exhaustEndNodes) do
maxExhaustAudioOpennessCoef = min(max(maxExhaustAudioOpennessCoef, v.exhaustAudioOpennessCoef), 1)
endNodeIDPairs = {}
for _, v in pairs(exhaustEndNodes) do
maxExhaustAudioOpennessCoef = min(max(maxExhaustAudioOpennessCoef, v.exhaustAudioOpennessCoef), 1)
local hasValidReactioNodes = true
for _, v in pairs(torqueReactionNodes_nodes) do
if type(v) ~= "number" then
local maxAvailableRPM = 0
for _, v in pairs(baseTorqueTable) do
maxAvailableRPM = max(maxAvailableRPM, v.rpm)
local rawTorqueMultPoints = {}
for _, v in pairs(multTorqueTable) do
maxAvailableRPM = max(maxAvailableRPM, v.rpm)
local rawIntakePoints = {}
for _, v in pairs(intakeTorqueTable) do
maxAvailableRPM = max(maxAvailableRPM, v.rpm)
local rawExhaustPoints = {}
for _, v in pairs(exhaustTorqueTable) do
maxAvailableRPM = max(maxAvailableRPM, v.rpm)
local rawPoints = {}
for _, v in pairs(compressionBrakeTorqueTable) do
maxAvailableRPM = max(maxAvailableRPM, v.rpm)
tempBurnEfficiencyTable = {}
for k, v in pairs(copy) do
if type(k) == "number" then
device.invBurnEfficiencyCoef = 1
for k, v in pairs(tempBurnEfficiencyTable) do
device.invBurnEfficiencyTable[k] = 1 / v
@/lua/ge/extensions/editor/audioEventsList.lua
for _, event in pairs(eventsList) do
local entry = {name = event.eventName, score = 1}
@/lua/common/tcpServer.lua
for connection, dataChunks in pairs(recData) do
for _, dataRaw in ipairs(dataChunks) do
@/lua/ge/extensions/flowgraph/nodes/vehicle/touching.lua
local ids = {}
for k,v in pairs(cols) do
table.insert(ids,k)
@/lua/ge/extensions/editor/toolUtilities/render.lua
local nodes = navGraph.nodes
for _, v in pairs(nodes) do
if hoverNode and v == hoverNode then
@/lua/ge/extensions/editor/dynamicDecals/notification.lua
im.BeginChild1("DynamicDecals_Notification_NotificationsChild", im.ImVec2(0, im.GetContentRegionAvail().y - (math.ceil(im.GetFontSize()) + 2*style.ItemSpacing.y)), true)
for sectionName, sectionData in pairs(notifications) do
@/lua/ge/extensions/career/modules/computer.lua
-- convert keys of the table to string, because js doesnt support number keys
for inventoryId, computerFunction in pairs(computerFunctions.vehicleSpecific) do
computerFunctionsForUI.vehicleSpecific[tostring(inventoryId)] = computerFunction
@/lua/vehicle/controller/driveModes.lua
local function updateSimpleControlButtons()
for _, buttonData in pairs(simpleControlButtons) do
updateSimpleControlButton(buttonData)
local function updateGFX(dt)
for _, buttonData in pairs(simpleControlButtons) do
local desiredColor = (electrics.values[buttonData.offColorElectric] and electrics.values[buttonData.offColorElectric] >= 1) and buttonData.offColor or buttonData.color
local defaultSettingData = tableFromHeaderTable(defaults)
for _, v in pairs(defaultSettingData) do
local key = v.key or v.controllerName or v.type
local modeData = {}
for k, v in pairs(jbeamData) do
if k:sub(1, #"modes") == "modes" then
if k:sub(1, #"enabledModes") == "enabledModes" then
for _, modeKey in pairs(v) do
enabledModeKeys[modeKey] = true
for k, mode in pairs(modeData) do
if driveModes[mode.order] then
driveModes[k].settingsOrder = {}
for _, newSetting in pairs(modeSettings) do
local key = newSetting.key or newSetting.deviceName or newSetting.electricsName or newSetting.controllerName or newSetting.type
for settingsKey, _ in pairs(driveModes[k].settings) do
table.insert(driveModes[k].settingsOrder, settingsKey)
for _, mode in pairs(modeSorting) do
table.insert(enabledDriveModes, mode.key)
-- for name, mode in pairs(modeSorting) do
-- if driveModeOrder[mode.order] then
@/lua/ge/extensions/career/modules/speedTraps.lua
local function hasLicensePlate(inventoryId)
for partId, part in pairs(career_modules_partInventory.getInventory()) do
if part.location == inventoryId then
@/lua/ge/extensions/freeroam/levelStats.lua
local result = {}
for levelName, data in pairs(getStats().levels) do
table.insert(result, { levelName = levelName, count = data.count, lastUsed = data.lastUsed })
local result = {}
for spawnPointName, data in pairs(getStats().levels[levelName] and getStats().levels[levelName].spawnPoints or {}) do
table.insert(result, { spawnPointName = spawnPointName ~= "__default__" and spawnPointName or nil, count = data.count, lastUsed = data.lastUsed })
@/lua/ge/extensions/editor/crawlEditor/boundaries.lua
if data.boundary then
for index, pos in pairs(data.old) do
if data.boundary.vertices[index] then
if data.boundary then
for index, pos in pairs(data.new) do
if data.boundary.vertices[index] then
for idx, obj in pairs(objects) do
local distNodeToCam = (obj.pos - mouseInfo.camPos):length()
@/lua/vehicle/extensions/tech/platooning.lua
local keys = {}
for key in pairs(tbl) do
table.insert(keys, key)
local function getMass() -- !!!!!!!!!!!!!!!!!!
for _, n in pairs(v.data.nodes) do
mass = mass + n.nodeWeight
local sum = 0
for _,v in pairs(t) do
sum = sum + v
local vehicles, ctr = {}, 1
for k, v in pairs(mapmgr.getObjects()) do
if k == tonumber(vehicleInfront) then -- for dmpc key
for i, vehicles in ipairs(relayVehicles) do
for k, v in pairs(mapmgr.getObjects()) do
if k == tonumber(vehicles) then
if next(simData) ~= nil then -- simData contains the data of the closest vehicles
for k, v in pairs(simData) do
if type(v) == "table" then
if k =="closestVehicles1" then -- closest detected vehicle
for k2,v2 in pairs(v) do
if k2 == "distToPlayerVehicleSq" then
@/lua/ge/extensions/gameplay/playmodeMarkers.lua
playmodeKd = nil
for _, marker in pairs(markersByClusterId) do
marker:clearObjects()
local poisByMarkerType = {}
for markerType, _ in pairs(playmodeMarkerTypeNames) do
poisByMarkerType[markerType] = {}
-- let each markertype cluster their own markers in their own way
for markerType, _ in pairs(playmodeMarkerTypeNames) do
local factory = require('lua/ge/extensions/gameplay/markers/'..markerType)
@/lua/ge/extensions/flowgraph/states.lua
for name, state in pairs(self.states) do
-- clear extProxy
-- find all links that have our node as the source node.
for id, link in pairs(stateGraph.links) do
if link.sourceNode.id == node.id then
local deps = {}
for k, i in pairs(kDeps) do
table.insert(deps, k)
for _, node in ipairs(hooks) do
for k, func in pairs(node) do
if string.sub(k, 1, 2) == 'on' and type(func) == 'function' then
function C:startAutoStartStates()
for name, state in pairs(self.states) do
if state.autoStart then
-- find out if there is a connection from the entry node to any exit node. if so, this subgraph is invalid.
for _, link in pairs(graph.links) do
if link.sourceNode.nodeType == "states/stateEntry" and link.targetNode.nodeType == "states/stateExit" then
table.insert(currentDepth, graph.id)
for _, node in pairs(graph.nodes) do
if node.nodeType ~= 'debug/comment' then
local parent = nil
for id, nd in pairs(group) do
if nd.targetGraph.id == node.graph.id then
for _, link in pairs(graph.links) do
local elem = {
local validNodes = {}
for id, node in pairs(nodes) do
if not node.isConnector then
local rootNodes = {}
for id, node in pairs(nodes) do
if node.isRoot then
for _, root in ipairs(rootNodes) do
for name, port in pairs(root.ports or {}) do
for _, targetId in ipairs(port.targets) do
-- now that the heavy work is done, we can build the actual states :)
for id, node in pairs(portedNodes) do
if not node.stopProjectWhenReached then
local deps = {}
for id, state in pairs(self.states) do
table.insert(deps, state.extProxy.extName)
function C:getStateIdForNode(node)
for id, state in pairs(self.states) do
if state.graph.id == node.graph:getRootGraph().id then return id end
function C:findStateNodeInStateGraphRecursive(graph, id)
for _, node in pairs(graph.nodes) do
if node.nodeType == 'states/stateNode' and node.targetGraph and node.targetGraph.id == id then return node end
local ret = nil
for _, child in pairs(graph:getChildren()) do
if not ret then
log("D","","Adding to transition stack of " .. dumps(self.states[id].name).."/"..dumps(id)..":")
for key, val in pairs(onStates[id][3] or {}) do
self.states[id].transitionStack[key] = val
end
for key, val in pairs(onStates[id][2] or {}) do
self.states[id].transitionStack[key] = val
local ids = {}
for id, state in pairs(self.states) do
if tableContains(state.depth, lastId) then
function C:broadcastCall(functionName, ...)
for id, state in pairs(self.states) do
if state.extProxy and state.extProxy.hookProxies and state.extProxy.hookProxies[functionName] then
function C:broadcastCallReturn(functionName, results, ...)
for id, state in pairs(self.states) do
if state.extProxy and state.extProxy.hookProxies and state.extProxy.hookProxies[functionName] then
@/lua/vehicle/controller/lightbar.lua
-- Apply each static electrical value
for k, value in pairs(currentMode.electricsOnce) do
-- Set the electrical output, scaled by the electric's value (capped at 1.0)
-- Reset all pattern timers and states
for k, v in pairs(currentMode.electrics) do
v.timer = 0 -- Reset pattern timing
-- Update each electrics pattern
for k, v in pairs(currentMode.electrics) do
if electrics.values[lightbarElectric] > 0 then
-- Reset all pattern states and timers for the new mode
for k, v in pairs(currentMode.electrics) do
v.timer = 0 -- Reset pattern timing
modes = tableFromHeaderTable(jbeamData.modes)
for _, vm in pairs(modes) do
-- Convert mode config into usable format
-- Process each config entry into pattern states
for _, j in pairs(configEntries) do
-- Create new pattern if it doesn't exist
-- Optimize: Move single-state patterns to electricsOnce for better performance
for electricName, data in pairs(vm.electrics) do
if #data.states == 1 then
-- Create menu entry for each available mode
for k, v in pairs(modes) do
local entry = {
@/lua/ge/extensions/scenario/scenarios.lua
if scenario.vehicleNameToId then
for k, vid in pairs(scenario.vehicleNameToId) do
local bo = getObjectByID(vid)
randomseed(os.time())
for vName, vObjId in pairs(scenario.vehicleNameToId) do
if scenario.vehicles[vName] then
if type(scenario.vehicles[vName].driver["command"]) == "table" then
for i,v in pairs(scenario.vehicles[vName].driver["command"]) do
helper.queueLuaCommandByName(vName, scenario.vehicles[vName].driver["command"][i])
scenario.vehicleIdToName[vid] = nil
-- for index, name in pairs(scenario.playerUsableVehicles) do
-- if name == vehicleName then
if not initialLevelState then return end
for objName, objFields in pairs(initialLevelState) do
local levelObj = scenetree.findObject(objName)
if levelObj and levelObj.obj then
for field, value in pairs(objFields) do
--log('D', logTag, 'setting [' .. tostring(objName)..'] field:'..tostring(field)..' value:'..tostring(value))
if type(scenario.levelObjects) ~= 'table' then return end
for objName, objFields in pairs(scenario.levelObjects) do
local levelObj = scenetree.findObject(objName)
initialLevelState[objName] = initialLevelState[objName] or {}
for field, value in pairs(objFields) do
--log('D', logTag, 'setting [' .. tostring(objName)..'] field:'..tostring(field)..' value:'..tostring(value))
for _, v in pairs(statData.stats) do
if data ~= nil then
for _, v in pairs(stats.stats) do
local value = v.value or 0
scenario.startingTransforms = {}
for vecName, vid in pairs(scenario.vehicleNameToId) do
local vehicle = getObjectByID(vid)
if type(vehicleConf.extensions) == 'table' then
for vek, ve in pairs(vehicleConf.extensions) do
to.obj:queueLuaCommand('extensions.scenario_' .. vek .. '.onVehicleScenarioData(' .. serialize(ve) .. ')')
if drawDebug and scenario.nodes then
for nid, n in pairs(scenario.nodes) do
if (n.pos - focusPos):length() < debugDrawDistance then
local maxPlayers = scenario.playersCountRange.max
for devName, _ in pairs(assignedPlayers) do
local devicetype = string.split(devName, "%D+")[1] -- strip trailing number, if it exists (xinput0 -> xinput)
for vehicleID,_ in pairs(scenario.aiControlledVehiclesById) do
local vehicle = getObjectByID(vehicleID)
for vName, vObjId in pairs(scenario.vehicleNameToId) do
if scenario.vehicles[vName] then
local reportedEvents = {}
for vehName,data in pairs(scenario.vehicleTrackingTable) do
local vehicle = scenetree.findObject(vehName)
local objectCollisions = (vehicleData and vehicleData.objectCollisions) or {}
for otherObjID, state in pairs(objectCollisions) do
if state == 1 then
for vName, _ in pairs(scenario.vehicleNameToId or {}) do
local vehicle = scenetree.findObject(vName)
-- spawn.lua setVehicleObject() by default
for vehicleName, vehicleData in pairs(scenario.multiseatDeletedVehicles or {}) do
local vehicle = scenetree.findObject(vehicleName)
-- It would have been better to put them back in the correct prefab object, but its not required.
for vehicleName, _ in pairs(scenario.multiseatDeletedVehicles or {}) do
local vehicle = scenetree.findObject(vehicleName)
@/lua/ge/extensions/editor/gen/region.lua
local star = U.forStar(astem, adec)
for i,s in pairs(star) do
if s.rdi == ri and s.ndi == s.fr + dir then
local vlist = parity == 1 and {abase[i][3 + ishift], abase[i][4 + ishift]} or {abase[i][4 + ishift], abase[i][3 + ishift]}
for _,p in pairs(vlist) do
prd,ni,s = p2side(p, side, side.fr)
local asnxt = {aside[i % #aside + 1]}
for _,sidenxt in pairs(asnxt) do
local dplus = (i >= #aside - 1) and mm_depth[2] or 0
local dplus = (i >= #aside - 1) and mm_depth[2] or 0
for _,bc in pairs({base[2 + ishift], base[3 + ishift]}) do
local prd = p2side(bc, sidenxt, sidenxt.fr)
local dma = 0
for _,p in pairs(list) do
local prd,ni,s = p2side(p, side)
out.apath = {}
for _,b in pairs(abase) do
out.apath[#out.apath + 1] = b
local s = ''
for _,a in pairs(acLen) do
s = s..','..a
asadj[#asadj + 1] = aside[i - 1]
for _,sadj in pairs(asadj) do
local anobjthem = editor.getNodes(scenetree.findObjectById(adec[sadj.rd].id))
--- find closest edge
for ind,r in pairs(adec) do
for i = 1,#r.list-1 do
local akey = {}
for key,_ in pairs(across[rmi]) do
akey[#akey+1] = key
local ib,ie
for i,key in pairs(akey) do
-- lo('?? for_key:'..key..'/'..nmi)
for i,s in pairs(star) do
-- U.dump(s, '?? for_stem:'..i)
akey = {}
for key,_ in pairs(across[stem.rdi]) do
akey[#akey+1] = key
out.avedit = {}
for _,p in pairs(acorner) do
out.avedit[#out.avedit + 1] = adec[p.rd].list[p.to]
--- find closest edge
for ind,r in pairs(adec) do
for i = 1,#r.list-1 do
local akey = {}
for key,_ in pairs(across[rmi]) do
akey[#akey+1] = key
local ib,ie
for i,key in pairs(akey) do
-- lo('?? for_key:'..key..'/'..nmi)
for i,s in pairs(star) do
-- U.dump(s, '?? for_stem:'..i)
akey = {}
for key,_ in pairs(across[stem.rdi]) do
akey[#akey+1] = key
out.avedit = {}
for _,p in pairs(acorner) do
out.avedit[#out.avedit + 1] = adec[p.rd].list[p.to]
if not list then return end
for _,p in pairs(list) do
local r = rma * math.sqrt((p - core_camera.getPosition()):length())
if out.apath ~= nil then
for _,p in pairs(out.apath) do
for i = 2,#p do
local c = vec3(0,0,0)
for _,p in pairs(base) do
c = c + p
local adist = {}
for i,p in pairs(base) do
local a,b = base[i] + desc.pos,base[i % #base + 1] + desc.pos
local agrid = {}
for _,a in pairs({-1,0,1}) do
for _,b in pairs({-1,0,1}) do
for _,a in pairs({-1,0,1}) do
for _,b in pairs({-1,0,1}) do
if i+a < 1 or i+a > gmax or j+b < 1 or j+b > gmax then
local w
for _,ij in pairs(agrid) do
-- if ij[1] == 101 and ij[2] == 101 then
lo('?? for_NODE:'..ij[1]..':'..ij[2], true)
for ind,dec in pairs(aref[ij[1]][ij[2]]) do
local rd = adec[ind].list
lo('?? obi:'..tostring(scenetree.findObjectById(desc.id)))
-- for _,s in pairs(dforest) do
-- editor.removeForestItem(fdata, s.item)
@/lua/ge/extensions/editor/roadRiverCacheHandler.lua
for _, group in ipairs(groups) do
for _, name in pairs(group:getObjects()) do
local object = scenetree.findObject(name)
@/lua/ge/extensions/editor/assetDeduplicator.lua
job.allfiles = #jobData.selectedLinks
for k,v in pairs(selectedLinks) do
if job.status == 0 then
local isTexture = false
for _,b in pairs(cases) do
if string.lower(leftPath):find(b) then isTexture = true end
local isTexture = false
for _,b in pairs(cases) do
if string.lower(rightPath):find(b) then isTexture = true end
local sortedKeys = {}
for k in pairs(matches) do
sortedKeys[#sortedKeys + 1] = k
end
for path, _ in pairs(stockLevels) do
local filenames = FS:findFiles(path, "*.jpg\t*.png\t*.dds\t*.dae\t*.cdae\t*.glb\t*.gltf", -1, true, false)
end
for path, _ in pairs(modLevels) do
local filenames = FS:findFiles(path, "*.jpg\t*.png\t*.dds\t*.dae\t*.cdae\t*.glb\t*.gltf", -1, true, false)
local currentLevelRoot
for p in pairs(currentLevelData) do
job.yield()
local assetsByKey = {}
for path, info in pairs(assetData) do
if not isBlacklisted(path) and allowedByModLink(info) then
local artByKey = {}
for path, info in pairs(artData) do
if not isBlacklisted(path) and allowedByModLink(info) then
local stockByKey = {}
for _, folderTable in pairs(stockLevelsData) do
if type(folderTable) == "table" then
if type(folderTable) == "table" then
for path, info in pairs(folderTable) do
if not isBlacklisted(path) and allowedByModLink(info) then
if modLink then
for _, folderTable in pairs(modLevelsData) do
if type(folderTable) == "table" then
if type(folderTable) == "table" then
for path, info in pairs(folderTable) do
if not isBlacklisted(path) then
for path in pairs(currentLevelData) do
if not isBlacklisted(path) then
for curPath, info in pairs(currentLevelData) do
if not isBlacklisted(curPath) then
@/lua/ge/extensions/flowgraph/nodes/ui/customUiLayout.lua
local sorted = {}
for key, layout in pairs(layouts) do
if type(layout) == "table" and #layout > 0 then
@/lua/ge/extensions/career/modules/insurance/history.lua
for _, event in pairs(list) do
event.date = os.date("%c", event.time)
@/lua/vehicle/extensions/scenario/functionFreezer.lua
if mode == 1 then -- freeze everything
for _,funcString in pairs(functionNames) do
if loadstring("return "..funcString.."_freeze_backup")() == nil then
else -- revert function to its original code
for _,funcString in pairs(functionNames) do
if loadstring("return "..funcString.."_freeze_backup")() == nil then
@/lua/ge/extensions/editor/gen/lib/ui.lua
local alib = {}
for _,p in pairs(apth) do
unrequire(p)
if editor.texObj then
for key,p in pairs(aicon) do
dicon[key] = editor.texObj('/lua/ge/extensions/editor/gen/assets/_icon/'..(aicon[key][3] or key)..(p.suf or '.png'))
if im.BeginTable(id, #adim, cbsort and tableFlags or tableFlagsNoSort) then
for i,c in pairs(adim) do
im.TableSetupColumn(ahead and ahead[i] or 'C_'..i
if data then
for k,v in pairs(data) do
cb(k,v)
while next do
for i,v in pairs(row) do
if v.list then
local cbg = im.GetColorU322(im.ImVec4(0.3, 0.3, 0.3, 0.8)) --im.GetColorU321(im.ImVec4(0.3, 0.3, 0.3, 1)) -- im.Col_FrameBg)
for i,row in pairs(htree) do
if #htree == 1 then
im.SameLine()
for _,c in pairs(row) do
local k,v = c[1],c[2]
local padding = 2
for i,row in pairs(htree) do
-- im.Indent(10)
local nextline = false
for _,c in pairs(row) do
if _ == 1 then
@/gameplay/missionTypes/targetjump/customNodes/DrawSitesNode.lua
for _, z in pairs(zones.objects) do
z:drawDebug('faded', self.pointsColors[z.color or z.customFields:get('points') or 50])
@/lua/ge/extensions/editor/createObjectTool.lua
if actionData.onBuildFuncFields then
for _, val in pairs(actionData.onBuildFuncFields) do
obj:setField(val[1], val[2], val[3])
if fieldsSetOnBuildFunc[currentCreateObjectItem.classname] then
for _, val in pairs(fieldsSetOnBuildFunc[currentCreateObjectItem.classname]) do
-- If this field has been set in buildFunc, serialize it.
@/lua/ge/extensions/career/modules/milestones/generalMilestones/missions.lua
table.insert(careerMissions, mission)
for branchKey, _ in pairs(mission.unlocks.branchTags or {}) do
missionsByBranch[branchKey] = missionsByBranch[branchKey] or {}
@/lua/common/json-ast.lua
local function _convertTableSchema(fileRoot)
for _, partRoot in pairs(fileRoot) do
if type(partRoot) == 'table' then
end
for k, v in pairs(node) do
_cleanupData(v)
@/lua/ge/extensions/editor/util/editorElementHelper.lua
table.sort(sortedKeys)
for _, key in pairs(sortedKeys) do
if key ~= "fieldName" and string.startswith(key, "fieldName") then
-- find all field with fieldname
for _, key in pairs(sortedKeys) do
if key ~= "fieldName" and string.startswith(key, "fieldName") then
C.__index = C
for k, v in pairs(derivedClass) do
o[k] = v
@/lua/vehicle/controller/vehicleController/shiftLogic/electricMotor.lua
local totalMaxBrakeTorque = 0
for _, wd in pairs(wheels.wheels) do
totalMaxBrakeTorque = totalMaxBrakeTorque + wd.brakeTorque * (wd.brakeInputSplit + (1 - wd.brakeInputSplit) * wd.brakeSplitCoef)
local totalBrakeTorque = 0
for _, wd in pairs(wheels.wheels) do
totalBrakeTorque = totalBrakeTorque + wd.brakeTorque * (min(brakeCoef, wd.brakeInputSplit) + max(brakeCoef - wd.brakeInputSplit, 0) * wd.brakeSplitCoef)
local totalRegenTorque = 0
for _, motor in pairs(motors) do
totalRegenTorque = totalRegenTorque + regenCoef * motor.maxRegenTorque * motor.cumulativeGearRatio
automaticHandling.availableModeLookup = {}
for _, v in pairs(automaticHandling.availableModes) do
automaticHandling.availableModeLookup[v] = true
@/lua/ge/extensions/flowgraph/nodes/career/onMissionRunstateChanged.lua
self.pinOut.started.value = false
for flag, act in pairs(self.flags) do
self.pinOut[flag].value = act
@/lua/ge/extensions/editor/trafficDebug.lua
if var[0] then
for id, veh in pairs(traffic) do
veh.debugLine = true
im.BeginChild1("Vehicles##trafficDebug", im.ImVec2(180 * im.uiscale[0], 0 ), im.WindowFlags_ChildWindow)
for id, veh in pairs(traffic) do
if not veh.isAi then
if im.TreeNode1("Personality Info") then
for k, v in pairs(currVeh.role.driver.personality) do
doBulletTextInfo(k, v)
@/lua/vehicle/extensions/tech/GPS.lua
local function updateGFX(dtSim)
for sensorId, _ in pairs(GPSs) do
updateGPSGFXStep(dtSim, sensorId, false, nil)
local function onVehicleDestroyed(vid)
for sensorId, _ in pairs(GPSs) do
if vid == objectId then
@/lua/ge/extensions/tech/lidarTest.lua
local ctr = 0
for i, s in pairs(activeLidarSensors) do
ctr = ctr + 1
local ctr = 0
for i, s in pairs(lidarPointCloud) do
ctr = ctr + 1
@/gameplay/missionTypes/drift/customNodes/extractWaypointsNode.lua
for _, pathNode in pairs(self.pinIn.pathData.value.pathnodes.sorted) do
table.insert(self.extractedWaypoints, pathNode.pos)
@/lua/ge/extensions/editor/assemblySpline/populate.lua
meshPools[splineId] = meshPools[splineId] or {}
for meshPath, neededCount in pairs(neededMeshes) do
meshPools[splineId][meshPath] = meshPools[splineId][meshPath] or {}
-- Delete meshes for paths that are no longer needed.
for meshPath, pathPool in pairs(meshPools[splineId]) do
if not neededMeshes[meshPath] then
-- Clear the existing meshes by path table for reuse.
for path, meshList in pairs(existingMeshesByPath) do
table.clear(meshList)
table.clear(counters)
for meshPath, _ in pairs(neededMeshes) do
counters[meshPath] = 1
if meshPools[splineId] then
for _, pathPool in pairs(meshPools[splineId]) do
for i = #pathPool, 1, -1 do
@/lua/ge/extensions/editor/vehicleEditor/staticEditor/vePartList.lua
for partName, _ in pairs(partsList) do
local part, jbeamFilename = jbeamIO.getPart(ioCtx, partName)
partsViewCount = 0
for _, v in pairs(parts) do
local partName = tostring(v[2])
local isSelectedPart = false
for k, v in pairs(parts) do
if v[1] then
@/lua/ge/extensions/editor/shortcutLegend.lua
if editor.editMode and not tableIsEmpty(currentActionNames) then
for controlFlag, title in pairs(currentActionNames) do
local control
local control
for modifierFlag, modifierName in pairs(modifierNames) do
if type(controlFlag) == "number" then
if editor.editMode and editor.editMode.auxShortcuts then
for controlFlag, title in pairs(editor.editMode.auxShortcuts) do
local control
local control
for modifierFlag, modifierName in pairs(modifierNames) do
if type(controlFlag) == "number" then
@/lua/ge/extensions/editor/gen/utils.lua
local alib = {}
for _,p in pairs(apth) do
unrequire(p)
if U.out.agraph then
for _,g in pairs(U.out.agraph) do
Render.graph(g.list, g.c, g.w)
end
for _,s in pairs(U.out.aset) do
-- lo('?? U_draw_set:')
end
for _,o in pairs(U.out.atext) do
Render.label(o.list, o.c)
else
for o,e in pairs(t) do
-- lo(type(o)..':'..type(e)..':'..o..':'..tostring(e))
if not lvlma or lvl < lvlma then
for o,e in pairs(t) do
-- lo(type(o)..':'..type(e)..':'..o..':'..tostring(e))
if not list then return end
for _,p in pairs(list) do
local r = rma * math.sqrt((p - core_camera.getPosition()):length())
local out = {}
for _,v in pairs(list) do
out[#out + 1] = v + plus
local s = ''
for _,step in pairs(path) do
s = s..step..'/'
local s = ''
for _,v in pairs(arr) do
s = s..tostring(v)..delim
if not list then return apos end
for i,_ in pairs(list) do
-- for i = 1,#list do
local isprop = type(cb) == 'string'
for k,v in pairs(list) do
ret[#ret+1] = isprop and v[cb] or cb(k,v)
local tnew = {}
for k,v in pairs(arr) do
tnew[k] = v
if not b then return a end
for j,q in pairs(b) do
if #index(a, q) == 0 then
local c = vec3(0,0,0)
for _,x in pairs({ob.minExtents.x, ob.maxExtents.x}) do
for _,y in pairs({ob.minExtents.y, ob.maxExtents.y}) do
for _,x in pairs({ob.minExtents.x, ob.maxExtents.x}) do
for _,y in pairs({ob.minExtents.y, ob.maxExtents.y}) do
for _,z in pairs({ob.minExtents.z, ob.maxExtents.z}) do
for _,y in pairs({ob.minExtents.y, ob.maxExtents.y}) do
for _,z in pairs({ob.minExtents.z, ob.maxExtents.z}) do
out.avedit[#out.avedit+1] = vec3(x, y, z)
if type(ai) == 'table' then
for o,i in pairs(ai) do
ai[o] = (i - 1) % n + 1
local mi = math.huge
for i,p in pairs(aplane) do
local d = intersectsRay_Plane(line[1], line[2]-line[1], p[1], (p[2]-p[1]):cross(p[3]-p[1]))
sence = sence or 0
for _,p in pairs(list) do
if (a-p):cross(b-p):length() > sence then
local L,d = (a-b):length()
for _,p in pairs(list) do
d = math.abs((p-a):length()+(p-b):length()-L)
local dmi,imi = math.huge
for i,v in pairs(base) do
local d = p:distance(v)
local pleft,pright
for i,p in pairs(ahit) do
local dp = p[2]-a
local mi,ma = vec3(math.huge,math.huge,math.huge),-vec3(math.huge,math.huge,math.huge)
for i,v in pairs(set) do
if v.x < mi.x then
local imap12 = {}
for k,v in pairs(map) do
imap12[#imap12+1] = imap[v]
local imap21 = {}
for k,v in pairs(map) do
imap21[#imap21+1] = imap[v]
-- initial objects linking
for i,loop in pairs(aeref) do
-- nvert = nvert + #loop
local c,d
for i,e in pairs(ae) do
-- isend = false
lo('??______________________________________ is_3_5:')
for i,_ in pairs(estamp) do
lo('?? if_STAMP:'..i..':'.._)
local ama,ima = -math.huge
for _,iv in pairs(astar) do
local u = (v4e[iv[1].ind].p - v4e[n2].p):normalized()
local rc = {}
for i,list in pairs(e4v) do
lo('?? for_edge:'..i)
local pth = {}
for _,p in pairs(rc) do
pth[#pth+1] = v4e[p].p
--[[
for _,rc in pairs(arc) do
local pth = {}
local pth = {}
for _,p in pairs(rc) do
pth[#pth+1] = v4e[p].p
local morig,mscale = mrc[1],mrc[2] --{0,0},{1,1}
for _,n in pairs(v4e) do
av[#av+1] = n.p
local e4v,v4e = {},{}
for i,pth in pairs(aeref) do
for j=2,#pth do
local iep = 0
for i,loop in pairs(aloop) do
for j,p in pairs(loop) do
for i,loop in pairs(aloop) do
for j,p in pairs(loop) do
iep = iep + 1
local ie = 0
for ir,pth in pairs(aeref) do
-- cmi = nil
end
for i,pth in pairs(aeref) do
-- dump(pth, '?? for_pth:'..i..'/'..#aloop)
local dmi,imi,cmi = math.huge
for i,e in pairs(ae) do
-- lo('?? for_edge:'..i..':'..tostring(e[1])..':'..tostring(e[2]))
local ae = {}
for i,loop in pairs(aloop) do
for j = 1,#loop-1 do
for i,loop in pairs(aloop) do
dump(loop, '?? for_loop:'..i..'/'..#loop)
dump(loop, '?? for_loop:'..i..'/'..#loop)
for j,p in pairs(loop) do
-- lo('?? for_p:'..j..':'..tostring(p))
for i = fr,to,-dir do
-- for i,e in pairs(ae) do
if (ae[i][1][axis] - p[axis])*dir <= 0 then
local aex,aey = {},{} --clone(ahole)
for i,h in pairs(ahole) do
-- aex[#aex+1] = {h[1],{h[1].x,h[2].y},i,1}
for i,e in pairs(aex) do
U.dump(e, '??======================== for_E_VERT:'..i)
local aflag = {}
for _,c in pairs(astem) do
local lst = ard[c[1]].list
local av = {}
for _,p in pairs(apos) do
local pproj = U.proj2D(p)
for i=1,#list do
-- for i,rc in pairs(list) do
local rc = prop == nil and list[i] or list[i][prop]
@/lua/ge/extensions/util/nodeBeamExport.lua
for _, b in pairs(vdata.vdata.beams or {}) do
if b and b.id1 and b.id2 then
@/lua/common/libs/luasocket/socket/ftp.lua
local u = url.parse(t.url)
for i,v in base.pairs(t) do
u[i] = v
@/lua/ge/extensions/freeroam/dragRace.lua
local function resetLights()
for _,group in pairs(lights) do
for _,light in pairs(group) do
for _,group in pairs(lights) do
for _,light in pairs(group) do
if light.obj then
local vehicleConfigs = {}
for i,v in pairs(configs.configs) do
local model = core_vehicles.getModel(v.model_key).model
for _,v in pairs(vehicleConfigs) do
if currentConfig == (v.model_key .. " " .. v.key) then
for i,v in pairs(vehicleConfigs) do
if (v["0-100 km/h"] and zeroToHundred)then
for i,v in pairs(similarVehicles) do
similarVehicleCount = similarVehicleCount + 1
local vehiclesConfigs = {}
for _,v in pairs(vehicleConfigs) do
table.insert(vehiclesConfigs, v)
if started == true then
for i,v in pairs(vehicles) do
if v.lane == "right" and v.id == data.subjectID then
@/lua/ge/extensions/editor/sitesEditor/sortedListDisplay.lua
for _, o in pairs(self.objects) do
for _, tag in ipairs(o.customFields.sortedTags) do
end
for _, o in pairs(self.objects) do
o._drawMode = 'normal'
for _, o in pairs(self.objects) do
o._drawMode = 'faded'
for _, o in pairs(self.objects) do
o._drawMode = 'normal'
else
for t, _ in pairs(self.sharedSelectedTags or {}) do
if im.GetCursorPosX() + im.CalcTextSize(t).x + 10 > totalWidth then
if im.BeginCombo("##tagSelect", "...") then
for tag, _ in pairs(self.currTags) do
if im.Selectable1(tag) then
@/lua/common/extensions/ui/improfiler.lua
local t, n = {}, 0
for k in pairs(count1) do
n = n + 1
local ms = 0
for k, v in pairs(count1) do
local pct = floor(v*100/samples + 0.5)
@/lua/ge/extensions/flowgraph/nodes/activity/missionAttemptStars.lua
local pinData = {}
for name, pin in pairs(self.pinInLocal) do
if not pin.fixed and pin.type ~= 'flow' then
@/lua/ge/main.lua
for _, fn in pairs(filenames or {}) do
log('I', 'resaveCSFiles', 'converting ts script: ' .. tostring(fn) )
local newKnownObjects = {}
for k, v in pairs(knownObjects) do
newKnownObjects[v] = 1
local newObjects = {}
for _, oName in pairs(knownObjects2) do
if not knownObjects[oName] then
for _, obj in pairs(newObjects) do
log('I', '', ' * ' .. tostring(obj:getClassName()) .. ' - ' .. tostring(obj:getName()) )
for _, obj in pairs(newObjects) do
local className = obj:getClassName()
-- dump(filenames)
for _, fn in pairs(filenames) do
log('I', 'resaveCSFiles', 'converting ts script: ' .. tostring(fn) )
local newKnownObjects = {}
for k, v in pairs(knownObjects) do
newKnownObjects[v] = 1
local newObjects = {}
for _, oName in pairs(knownObjects2) do
if not knownObjects[oName] then
for _, obj in pairs(newObjects) do
log('I', '', ' * ' .. tostring(obj:getClassName()) .. ' - ' .. tostring(obj:getName()) )
for _, obj in pairs(newObjects) do
local className = obj:getClassName()
local fsInfo = Engine.Platform.getFSInfo()
for k,v in pairs(fsInfo) do
if v then
for _,v in pairs(files) do
--print("onFileChanged: " .. tostring(v.filename) .. ' : ' .. tostring(v.type))
@/lua/ge/extensions/gameplay/traffic/roles/police.lua
for k, v in pairs(self.baseActions) do
self.actions[k] = v
for id, veh in pairs(traffic) do
if id ~= self.veh.id and veh.role.name ~= 'police' then
function C:onTrafficTick(dt)
for id, veh in pairs(gameplay_traffic.getTrafficData()) do -- update data of potential targets
if id ~= self.veh.id and veh.role.name ~= 'police' and not veh.ignorePolice and not self.flags.cooldown then
@/lua/ge/extensions/gameplay/drag/dragTypes/headsUpDrag.lua
if dragData.racers then
for _,racer in pairs(dragData.racers) do
table.insert(dials, {vehId = racer.vehId, dial = 0})
dragData = dData
for _, racer in pairs(dragData.racers) do
racer.currentPhase = pIndex
local isActivityFinished = true
for vehId, racer in pairs(dragData.racers) do
if not racer.isFinished then
local dependenciesCompleted = true
for _, r in pairs(dragData.racers) do
if not r.phases[r.currentPhase].completed then
-- for vehId, racer in pairs(dragData.racers) do
-- funcPhases[phase.name](vehId, dtSim)
@/lua/ge/extensions/editor/sitesEditor/tags.lua
end
for k, _ in pairs(self.tags) do
table.insert(self.sortedTags, k)
@/lua/ge/extensions/editor/dynamicDecals/widgets.lua
if im.BeginPopup(string.format("WidgetTypePopup_%s", widgetId)) then
for name, id in pairs(api.widgetTypes[propType]) do
if im.Selectable1(name, id == (property.widgetType or 0)) then
local function editModeUpdate(dtReal, dtSim, dtRaw)
for id, _ in pairs(highlightedWidgets) do
highlightedWidgets[id].time = highlightedWidgets[id].time - dtReal
@/lua/ge/extensions/core/vehiclePaints.lua
multiPaintSetupsByIdCache = {}
for _, paintFilePath in pairs(core_vehicles.getPaintFiles()) do
local paintFile = core_vehicles.getFilesParsed()[paintFilePath]
for id, paint in pairs(paintFile.paints or {}) do
paint.sources = nil
end
for id, collection in pairs(paintFile.collections or {}) do
for _, paintName in pairs(collection.paints) do
for id, collection in pairs(paintFile.collections or {}) do
for _, paintName in pairs(collection.paints) do
paintCollectionsByIdCache[id] = collection
end
for id, setup in pairs(paintFile.multiPaintSetups or {}) do
multiPaintSetupsByIdCache[id] = setup
end
for cId, collection in pairs(paintCollectionsByIdCache) do
local cleanCollection = {}
local cleanCollection = {}
for pId, paint in pairs(collection.paints) do
if type(paint) == 'string' then paint = {id = paint} end
end
for id, paint in pairs(paintsByIdCache) do
paint.id = id
local multiNames = 0
for name, paints in pairs(paintsByNameAsListCache) do
if #paints > 1 then
-- add names to old paint format
for name, paint in pairs(model.paints) do
paint.name = name
-- convert paint names from library to actual paint data
for _, paint in pairs(model.libraryPaints or {}) do
if type(paint) == 'string' then paint = {id = paint} end
-- convert paint collections to actual paint data
for _, collectionId in pairs(model.paintCollections or {}) do
local collection = getPaintCollectionById(collectionId)
if collection then
for _, paint in pairs(collection) do
debugLog("adding paint from model.paintCollections to model: " .. dumps(paint.id) .. "/" .. dumps(paint.name) .. " (from collection " .. dumps(collectionId) .. ")")
-- process all the setups already in the model
for _, multiPaintSetup in pairs(multiPaintSetupsToProcess) do
local multiPaintSetupWithNames = resolveMultiPaintSetupHelper(model, multiPaintSetup, paintIdsToPaintNames, multiPaintSetupsByIdOrName)
-- process configs
for _, config in pairs(configs) do
debugConfigKey = config.key
-- validate paints and set up factory and custom paints lists
for _, paint in pairs(model.paints) do
if not paint.class then
model.customPaintNames = {}
for _, paint in pairs(model.paints) do
if paint.class == 'factory' then
local newRandomPaintDistributionModel = {}
for paintNameOrId, probability in pairs(model.randomPaintDistribution) do
local paint = model.paints[paintNameOrId]
-- then add all the remaining paint names with 1 probability
for paintName, _ in pairs(model.paints) do
newRandomPaintDistributionModel[paintName] = newRandomPaintDistributionModel[paintName] or defaultRandomPaintProbability
local newRandomMultiPaintDistributionModel = {}
for multiPaintSetupNameOrId, probability in pairs(model.randomMultiPaintDistribution) do
local multiPaintSetup = multiPaintSetupsByName[multiPaintSetupNameOrId]
local allPaintResults = {}
for paintName, probability in pairs(newRandomPaintDistributionModel) do
totalProbability = totalProbability + probability
end
for multiPaintSetupName, probability in pairs(newRandomMultiPaintDistributionModel) do
totalProbability = totalProbability + probability
debugLog("model " .. dumps(key) .. " has " .. #allPaintResults .. " paint results with total probability " .. totalProbability)
for _, paintResult in pairs(allPaintResults) do
debugLog("paint result: " .. dumps(paintResult.type) .. ", " .. dumps(paintResult.paintName1) .. ", " .. dumps(paintResult.paintName2) .. ", " .. dumps(paintResult.paintName3) .. ", probability: " .. dumps(paintResult.probability))
-- now do the same for each config
for _, config in pairs(configs) do
debugConfigKey = config.key
local newRandomPaintDistributionConfig = {}
for paintNameOrId, probability in pairs(config.randomPaintDistribution or {}) do
local paint = model.paints[paintNameOrId]
if not config.ignoreModelRandomPaintDistribution then
for paintName, probability in pairs(newRandomPaintDistributionModel) do
newRandomPaintDistributionConfig[paintName] = newRandomPaintDistributionConfig[paintName] or newRandomPaintDistributionModel[paintName] or probability
-- then add all the remaining paint names with 1 probability
for paintName, _ in pairs(model.paints) do
newRandomPaintDistributionConfig[paintName] = newRandomPaintDistributionConfig[paintName] or defaultRandomPaintProbability
local newRandomMultiPaintDistributionConfig = {}
for multiPaintSetupNameOrId, probability in pairs(config.randomMultiPaintDistribution or {}) do
local multiPaintSetup = multiPaintSetupsByName[multiPaintSetupNameOrId]
if not config.ignoreModelRandomMultiPaintDistribution then
for multiPaintSetupName, probability in pairs(newRandomMultiPaintDistributionConfig) do
newRandomMultiPaintDistributionConfig[multiPaintSetupName] = newRandomMultiPaintDistributionModel[multiPaintSetupName] or probability
local allPaintResults = {}
for paintName, probability in pairs(newRandomPaintDistributionConfig) do
totalProbability = totalProbability + probability
end
for multiPaintSetupName, probability in pairs(newRandomMultiPaintDistributionConfig) do
totalProbability = totalProbability + probability
debugLog("config " .. dumps(config.key) .. " has " .. #allPaintResults .. " paint results with total probability " .. totalProbability)
for _, paintResult in pairs(allPaintResults) do
debugLog("paint result: " .. dumps(paintResult.type) .. ", " .. dumps(paintResult.paintName1) .. ", " .. dumps(paintResult.paintName2) .. ", " .. dumps(paintResult.paintName3) .. ", probability: " .. dumps(paintResult.probability))
local sortedResults = {}
for name, count in pairs(resultsByName) do
table.insert(sortedResults, {name = name, count = count})
@/lua/ge/extensions/career/modules/playerDriving.lua
for k, v in pairs(gameplay_traffic.getTrafficData()) do
if v.role.name == "police" then
playerData.preStartTicks = playerData.preStartTicks - 1
for k, v in pairs(freeroam_specialTriggers.getTriggers()) do
if not v.vehIds[be:getPlayerVehicleID(0)] then
@/lua/ge/extensions/editor/resourceChecker.lua
local isTexture = false
for _,b in pairs(cases) do
if string.lower(res):find(b) then isTexture = true goto safeCnt end
local count = 0
for k,v in pairs(duplicateTable) do
count = count + 1
if im.TreeNode1("File: "..k) then
for l,b in pairs(v) do
count = count + 1
end
for j,c in pairs(b) do
count = count + 1
local stage = 0
for s,t in pairs(c) do
stage = stage + 1
if im.TreeNode1("Stage "..stage..":") then
for m,x in pairs(t) do
count = count + 1
local txtstring = m..": "
for a,f in pairs(x) do
txtstring = txtstring..tostring(f)..", "
if im.Button("Save changes and close window", im.ImVec2(220* im.uiscale[0],0)) then
for k,v in pairs(duplicateTable) do
if FS:fileExists(k) and v.modified == true then
local materialFile = jsonReadFile(k) or {}
for l,b in pairs(v) do
if materialFile[l] and b ~= "removed" then
local cases = {".dds", ".png", ".bmp", ".jpg", ".jpeg", ".tga"}
for _,b in pairs(cases) do
if string.lower(res):find(b) then imageToPreview = res editor.showWindow(imageWindowName) end
local cases = {".dae", ".dts", ".cdae", ".cached.dts"}
for _,b in pairs(cases) do
if string.lower(res):find(b) then editor_shapeEditor.showShapeEditorLoadFile(res) end
local count = 0
for k,v in pairs(data) do
if count < maxLines then
end
for i,h in pairs(v) do
if count < maxLines then
end
for d,g in pairs(h) do
if count < maxLines then
end
for a,o in pairs(g) do
if count < maxLines then
local count = 0
for k,v in pairs(data) do
if searchFilter == true and skipK[k] then
local count = 0
for k,v in pairs(data) do
if searchFilter == true and not string.match(string.lower(v), string.lower(ffi.string(searchTxt))) then
if not tableIsEmpty(isSelected) then
for k,v in pairs(isSelected) do
cnt = cnt + 1
local tempSel = isSelected
for k,v in pairs(itemsList) do
if not tempSel[v] then
local filesCount, subdirCount = 0, 0
for _,ch in pairs(n.children or {}) do
if ch.isDir then subdirCount = subdirCount + 1 end
if n.isDir and n.children then
for _, ch in pairs(n.children) do
computeDerived(ch)
if n.children then
for _,ch in pairs(n.children) do dfs(ch) end
end
local kids = {}
for _,ch in pairs(n.children or {}) do kids[#kids+1] = ch end
table.sort(kids, function(a,b) return (a.bytes or 0) > (b.bytes or 0) end)
@/lua/common/tech/techUtils.lua
if type(tbl) ~= 'table' then return tbl end
for k, v in pairs(tbl) do
local newV = tableToVec3OrQuat(v)
if type(tbl) ~= 'table' then return tbl end
for k, v in pairs(tbl) do
if migrateKeysMapping[k] ~= nil then
@/lua/vehicle/thrusters.lua
-- clusters
for nodeId, thruster in pairs(clusterThrust) do
local ttl = thruster[2]
activeThrusters = {}
for _, thruster in pairs(v.data.thrusters) do
if thruster.control == "auto" then
for _, thruster in pairs(activeThrusters) do
thruster.factor = thruster.factor or 1
@/lua/ge/extensions/core/flowgraphManager.lua
local uniqueName = ""
for nm, m in pairs(uniqueManagers) do
if mgr.id == m.id then uniqueName = nm end
end
for name,u in pairs(uniqueManagers) do
local index = -1
@/lua/vehicle/powertrain/combustionEngineThermals.lua
local emitLargeParticulates = particleTicks.exhaustSmokeParticleTick > 1 and particulateEmission >= 0.3
for _, n in pairs(nodes.exhaustEnds) do
--regular exhaust smoke
--if a node is underwater we want to increase the block to air cooling to simulate water cooling of the block
for _, v in pairs(nodes.engine) do
underWaterBlockCoolingCoef = underWaterBlockCoolingCoef + (obj:inWater(v) and 1000 or 0)
--if a node is underwater we want to increase the block to air cooling to simulate water cooling of the block
for _, v in pairs(nodes.engine) do
underWaterBlockCoolingCoef = underWaterBlockCoolingCoef + (obj:inWater(v) and 100 or 0)
for _, n in pairs(nodes.exhaustEnds) do
if particleTicks.exhaustOilParticleTick > 1 and not parentEngine.isDisabled then
for k, child in pairs(branch.children) do
--if at this point something broke away or we reached the original end of the branch
--search for the exhaust start node
for _, n in pairs(v.data.nodes) do
if n.isExhaust and (type(n.isExhaust) == "boolean" or n.isExhaust == parentEngine.name) then
--find all exhaust beams
for _, b in pairs(v.data.beams) do
if b.isExhaust and (type(b.isExhaust) == "boolean" or b.isExhaust == parentEngine.name) then
local function exhaustBeamBroken(id, exhaustTree)
for _, v in pairs(exhaustTree.children) do
--if the broken beam matches one of our tree beams
local function resetExhaustTree(exhaustTree)
for _, v in pairs(exhaustTree.children) do
--if one of the children are already broken
for k, _ in pairs(exhaustBeams) do
exhaustBeams[k] = true
burnEfficiencyCoef = {}
for k, v in pairs(parentEngine.invBurnEfficiencyTable) do
burnEfficiencyCoef[k] = v - 1
end
for _, n in pairs(jbeamData.engineBlock._engineGroup_nodes) do
engineBlockMass = engineBlockMass + v.data.nodes[n].nodeWeight
@/lua/ge/extensions/career/modules/playerAttributes.lua
-- make statistic
for attributeName, value in pairs(change) do
attributes[attributeName] = attributes[attributeName] or deepcopy(baseAttribute)
attribute.value = clamp(attribute.value + value, attribute.min or -math.huge, attribute.max or math.huge)
for tag, en in pairs(reason.tags) do
if en and value > 0 then
local ch = {}
for attributeName, newValue in pairs(newValues) do
local attribute = attributes[attributeName] or deepcopy(baseAttribute)
for name, data in pairs(jsonData) do
local mappedName = oldAttributeNamesToNewNames[name] or name
attributes[mappedName] = attributes[mappedName] or deepcopy(baseAttribute)
for k,v in pairs(data) do
attributes[mappedName][k] = v
local updatedChanges = {}
for oldName, value in pairs(change.attributeChange) do
local newName = oldAttributeNamesToNewNames[oldName] or oldName
local msg = "Updated attribute names:"
for oldName, newName in pairs(updatedNames) do
msg = msg .. string.format("\n %s -> %s", oldName, newName)
local function onCareerModulesActivated()
for orgId, organization in pairs(freeroam_organizations.getOrganizations()) do
if not attributes[orgId .. "Reputation"] then
@/lua/vehicle/controller/vehicleController/shiftLogic/automaticGearbox.lua
automaticHandling.availableModeLookup = {}
for _, v in pairs(automaticHandling.availableModes) do
automaticHandling.availableModeLookup[v] = true
if jbeamData.hShifterModePositions then
for mode, index in pairs(jbeamData.hShifterModePositions) do
automaticHandling.hShifterModeLookup[index] = mode
@/lua/ge/extensions/flowgraph/nodes/vehicle/ai/scriptAI/playRecording.lua
local lastP
for _, p in pairs(self.recording.recording.path) do
debugDrawer:drawSphere(vec3(p), 0.1, ColorF(1,0,1,1))
@/lua/ge/extensions/ui/topBar.lua
local visibleItemObjects = {}
for _, item in pairs(Config.TopBarEntries) do
local isBlacklisted = item.blackListStates and M.state.currentUIState and
local visibleItems = {}
for _, item in pairs(visibleItemObjects) do
table.insert(visibleItems, item.id)
-- check if any substate matches the state
for _, item in pairs(Config.TopBarEntries) do
if item.targetState == M.state.currentUIState then
elseif item.substates and #item.substates > 0 then
for _, substate in pairs(item.substates) do
if string.sub(M.state.currentUIState, 1, #substate) == substate then
@/lua/ge/extensions/gameplay/rally/notebook/structured.lua
-- init all fields to defaults
-- for fieldName, _ in pairs(Schema.schema) do
-- self.fields[fieldName] = Schema.schema[fieldName].default
-- overwrite fields with data
for fieldName, _ in pairs(Schema.schema) do
if data[fieldName] ~= nil then
@/lua/ge/extensions/gameplay/traffic/roles/standard.lua
for k, v in pairs(self.baseActions) do
self.actions[k] = v
@/lua/ge/extensions/gameplay/delivery/delivery.lua
local lCount = 0
for _, loc in pairs(self.sites.locations.objects) do
if loc.customFields.tags[tag] then
@/lua/ge/extensions/flowgraph/nodes/gameplay/removeOtherVehicles.lua
for i = old, new+1, -1 do
for _, lnk in pairs(self.graph.links) do
if lnk.targetPin == self.pinInLocal[pinName..i] then
@/lua/console/bananabench.lua
local timeTotalSum = 0
for k,vehicle in pairs(vehicles) do
local testVehicle = 'vehicles/' .. vehicle .. '/'
@/lua/common/utils/simpleHttpServer.lua
-- simple file server
for _, v in pairs(handlers) do
--print("** " .. tostring(req.uri.path) .. ' ~= ' .. tostring(v[1]))
@/lua/ge/extensions/ui/vehicleVicinityApp.lua
if vData and vData.vdata and vData.vdata.nodes then
for nodeId, node in pairs(vData.vdata.nodes) do
if (node.couplerTag and node.couplerTag:find('fifthwheel')) or (node.tag and node.tag:find('fifthwheel')) then
@/lua/ge/extensions/core/busRouteManager.lua
local jFiles = FS:findFiles(mapFolder.."/buslines/", '*.buslines.json', -1, true, false)
for _,jFilename in pairs(jFiles) do
local data = jsonReadFile(jFilename)
if data.version == 1 then
for k,v in pairs(data.routes) do table.insert( busLines.routes, v ) end
end
--checking triggers exist
for _,route in pairs(busLines.routes) do
local task_data = {}
local task_data = {}
for i,task in pairs(route.tasklist) do
if triggerPos[task] then
local function setLine(vehId, routeID, variance)
for k,v in pairs(busLines.routes) do
if (v.routeID == routeID and v.variance == variance) then
@/lua/ge/extensions/career/modules/linearTutorial.lua
if saveData.linearStep == -1 then
for key, _ in pairs(saveData.flags) do
saveData.flags[key] = true
for k, v in pairs(gameplay_traffic.getTrafficData()) do
if v.role.name == "police" then
for k, v in pairs(gameplay_traffic.getTrafficData()) do
if v.role.name == "police" then
for key, values in pairs(introPopupTable) do
M[key] = function()
M.showNonTutorialWelcomeSplashscreen()
for key, values in pairs(introPopupTable) do
M[key]()
@/lua/ge/extensions/editor/crawlEditor/paths.lua
for idx, obj in pairs(objects) do
local distNodeToCam = (obj.pos - mouseInfo.camPos):length()
@/gameplay/missionTypes/drift/customNodes/updateTaskListObjectivesNode.lua
local context = {}
for key, value in pairs(data) do
if type(value) == 'string' or type(value) == 'number' then
local unflattenedSettings = {}
for k, v in pairs(mission.lastUserSettings) do
table.insert(unflattenedSettings, {key = k, value = v})
@/lua/vehicle/powertrain/automaticGearbox.lua
local reverseGears = {}
for k, v in pairs(jbeamData.gearRatios) do
if type(k) == "number" then
local gearIndex = device.minGearIndex
for _, v in pairs(gearWhineCoefsOutput) do
device.gearWhineCoefsOutput[gearIndex] = v
local gearIndex = device.minGearIndex
for _, v in pairs(gearWhineCoefsInput) do
device.gearWhineCoefsInput[gearIndex] = v
@/lua/ge/extensions/editor/terraform/fetchSources.lua
local meshRoadsInSelection = {}
for _, v in pairs(editor.selection.object) do
local sel = scenetree.findObjectById(v)
@/lua/ge/extensions/gameplay/missions/progress.lua
for key, val in pairs(attempt.unlockedStars or {}) do
local bonusStarsUnlockedCount = 0
for key, _ in pairs(mission.careerSetup._activeStarCache.defaultStarKeysByKey) do
if attempt.unlockedStars[key] then
end
for key, _ in pairs(mission.careerSetup._activeStarCache.bonusStarKeysByKey) do
if attempt.unlockedStars[key] then
end
for star, _ in pairs(attempt.unlockedStars or {}) do
if mission.careerSetup.starsActive[star] then
local sumChange = {}
for key, amount in pairs(starRewards.sums) do
sumChange[key] = (sumChange[key] or 0) + amount
local rewardsByAttribute = {}
for star, rewards in pairs(starRewards.originalRewardsPerStar) do
for _, reward in ipairs(rewards) do
-- Create single breakdown entry with total for each attribute
for _, rewardData in pairs(rewardsByAttribute) do
if rewardData.total > 0 then
for progressKey, defaults in pairs(mission.defaultAggregateValues or {}) do
if progressKey ~= "all" then
end
--for key, val in pairs(defaults) do
-- prog[progressKey].aggregate[key] = val
-- iterate over progressKeys
for progressKey, progressData in pairs(saveData.progress) do
-- iterate over progressKeys
for progressKey, progressData in pairs(saveData.progress) do
if saveData.unlockedStars then
for k, v in pairs(saveData.unlockedStars) do
if v == false then saveData.unlockedStars[k] = 0 end
mission.careerSetup._activeStarCache.sortedStarRewardsByKey = {}
for key, list in pairs(mission.careerSetup.starRewards) do
local newList = {}
if career_career.isActive() then
for key, starCount in pairs(mission.saveData.unlockedStars) do
if mission.careerSetup.starsActive[key] then
-- automaticData column headers
for _, col in pairs(mission.autoUiAttemptProgress or {}) do
local value = tryFormatValueForFunction(getValueForAttemptUiProgressType(attempt, col), col.formatFunction, mission)
-- genericData column headers
for _, col in pairs(genericUiAttemptProgress[leaderboardKey] or {}) do
table.insert(res.labels, col.columnLabel)
-- automaticData column headers
for _, col in pairs(mission.autoUiAttemptProgress or {}) do
table.insert(res.labels, col.columnLabel)
-- genericData cells
for _, col in pairs(genericUiAttemptProgress[leaderboardKey] or {}) do
if col.customValue then
-- automaticData cells
for _, col in pairs(mission.autoUiAttemptProgress or {}) do
table.insert(row, tryFormatValueForFunction(getValueForAttemptUiProgressType(attempt, col), col.formatFunction, mission))
-- genericData cells
for _, col in pairs(genericUiAttemptProgress[leaderboardKey] or {}) do
if col.customValue then
-- automaticData cells
for _, col in pairs(mission.autoUiAttemptProgress or {}) do
table.insert(row, tryFormatValueForFunction(getValueForAttemptUiProgressType(attempt, col), col.formatFunction, mission))
-- genericData column headers
for _, col in pairs(genericUiAggregateProgress or {}) do
table.insert(res.labels, col.columnLabel)
-- automaticData column headers
for _, col in pairs(mission.autoUiAggregateProgress or {}) do
table.insert(res.labels, col.columnLabel)
-- build rows
for _, m in pairs(missions) do
if not onlySelf or (m == mission) then
-- genericData cells
for _, col in pairs(genericUiAggregateProgress or {}) do
table.insert(row, tryFormatValueForFunction(getValueForAggregateUiProgressType(aggregateForProgressKey, col), col.formatFunction, m))
-- automaticData cells
for _, col in pairs(mission.autoUiAggregateProgress or {}) do
local value = table.insert(row, tryFormatValueForFunction(getValueForAggregateUiProgressType(aggregateForProgressKey, col), col.formatFunction, m))
local context = {}
for key, value in pairs(data) do
if type(value) == 'string' or type(value) == 'number' then
for key, conf in pairs(bigmapConf.aggregates or {}) do
local sd = mission.saveData.progress[conf.progressKey or mission.defaultProgressKey]
for key, value in pairs(aConds) do
count = count + 1
local attempt = M.newAttempt(mission:getRandomizedAttempt())
for k, v in pairs(addAttemptData) do
attempt[k] = v
@/lua/common/libs/luasocket/socket/url.lua
local parsed = {}
for i,v in base.pairs(default or parsed) do parsed[i] = v end
-- empty url is parsed to nil
@/lua/ge/extensions/editor/flowgraph/examples.lua
function C:findExamples(match)
for _, info in pairs(examplesLookup.lookup) do
self.search:queryElement({
local sortedExamples = {}
for k, v in pairs(element.examples) do if k ~= folderName then table.insert(sortedExamples, k) end end
local sortedKeys = {}
for k, v in pairs(element) do if k ~= folderName then table.insert(sortedKeys, k) end end
table.sort(sortedKeys, function(a,b)
@/lua/ge/extensions/flowgraph/nodes/ui/endScreen.lua
function C:_executionStarted()
for _, p in pairs(self.pinOut) do
p.value = false
local strLinks = {}
for _, lnk in pairs(self.graph.links) do
if lnk.sourceNode == self and tableContains(self.oldOptions, lnk.sourcePin.name) then
local outPins = {}
for _, pn in pairs(self.pinOut) do
if tableContains(self.oldOptions, pn.name) then
end
for _, pn in pairs(outPins) do
self:removePin(pn)
local inPins = {}
for _, pn in pairs(self.pinInLocal) do
if tableContains(self.oldOptions, pn.name) then
end
for _, pn in pairs(inPins) do
self:removePin(pn)
function C:buttonPushed(action)
for nm, pn in pairs(self.pinOut) do
if nm == action then
self:closeDialogue()
for _,pn in pairs(self.pinOut) do
pn.value = false
@/lua/ge/extensions/freeroam/gasStations.lua
local fuelTranslations = {}
for fuelType, _ in pairs(fuelTypes) do
if fuelType ~= "unknown" then
@/lua/ge/extensions/editor/preferences.lua
for key, val in pairs(keys) do
if preferencesPagesSortIndex[key] then
@/lua/ge/extensions/flowgraph/nodes/ui/imgui/elemental/imColor.lua
function C:_executionStarted()
for _, p in pairs(self.pinOut) do
p.value = false
@/lua/common/libs/lustach/src/lustache/renderer.lua
local max, n = 0, 0
for k, _ in pairs(array) do
if not (type(k) == "number" and k > 0 and math_floor(k) == k) then
@/lua/ge/extensions/career/modules/payment.lua
local function canPay(price)
for currency, info in pairs(price) do
if not info.canBeNegative and info.amount > 0 and career_modules_playerAttributes.getAttributeValue(currency) < info.amount then
local change = {}
for currency, info in pairs(price) do
change[currency] = -info.amount
@/lua/common/libs/luamqtt/mqtt/client.lua
for key, value in pairs(args) do
if type(key) ~= "string" then
end
for event, func in pairs(events) do
assert(type(event) == "string", "expecting event to be a string")
@/lua/ge/extensions/flowgraph/nodes/ui/multiDescription.lua
for i = old, new+1, -1 do
for _, lnk in pairs(self.graph.links) do
if lnk.sourcePin == self.pinInLocal['value_'..i] then
@/lua/ge/extensions/editor/toolUtilities/geom.lua
-- Check each graph node in turn.
for key, node in pairs(nodes) do
local a, b = intersectsRay_Sphere(rayPos, rayDir, node, mouseToNodetol) -- Get any intersection points between the ray and node sphere.
@/gameplay/missionTypes/aiRace/constructor.lua
unlockedStars.trafficRace = false
for id, v in pairs(gameplay_traffic.getTrafficData()) do
if be:getObjectActive(id) and v.roleName == 'standard' then
@/lua/ge/extensions/flowgraph/nodes/ui/endStats.lua
for _, p in ipairs(pinsPerStat) do
for _, lnk in pairs(self.graph.links) do
if lnk.targetPin == self.pinInLocal[p[1]..'_'..i] then
@/lua/ge/extensions/editor/rallyEditor/static.lua
for name,variants in pairs(self.systemPacenotes) do
for i,variant in ipairs(variants) do
-- for _,spn in ipairs(self.path.static_pacenotes.sorted) do
-- for lang,langData in pairs(spn.notes) do
-- im.Text(spn.name)
@/lua/ge/extensions/editor/vehicleEditor/staticEditor/veJBeamBeautifier.lua
for partName, part in pairs(luaDataRaw) do
if partName ~= '__astNodeIdx' then
local astIdxToPart = {}
for partName, part in pairs(luaDataRaw) do
if partName ~= '__astNodeIdx' then
local testedKeys = {}
for k1, v1 in pairs(t1) do
local v2 = t2[k1]
end
for k2, v2 in pairs(t2) do
if not testedKeys[k2] then
@/lua/ge/extensions/career/modules/partShopping.lua
if tree.children then
for slotName, childNode in pairs(tree.children) do
tableMerge(result, flattenPartsTree(childNode))
local function getPartSlotFromPartIdInShoppingCart(partId)
for _, part in pairs(shoppingCart.partsIn) do
if part.partId == partId then
-- Add matching parts from inventory
for partId, inventoryPart in pairs(career_modules_partInventory.getInventory()) do
local partSlotOfThisPartInShoppingCart = getPartSlotFromPartIdInShoppingCart(partId)
if treeNode.children then
for childSlot, childNode in pairs(treeNode.children) do
generatePartFromTree(childNode, childSlot, partInfo.slotInfoUi[childSlot], currentVehicleData, availableParts, vehicleObj)
for partName, partInfo in pairs(availableParts) do
if partInfo.slotInfoUi then
if partInfo.slotInfoUi then
for slotName, slotInfo in pairs(partInfo.slotInfoUi) do
slotsNiceName[slotName] = slotInfo.description
if node.children then
for childSlot, childNode in pairs(node.children) do
traverseTree(childNode, childSlot)
local searchSlotList = {}
for path, slotInfo in pairs(searchSlotDict) do
table.insert(searchSlotList, slotInfo)
for path, part in pairs(shoppingCart.partsIn) do
shoppingCart.partsOut[path] = career_modules_partInventory.getInventory()[slotToPartIdMap[currentVehicle][path]]
end
for path, partName in pairs(initialVehicle.partList) do
if partName ~= "" and (not previewVehicle.partList[path] or previewVehicle.partList[path] == "") then
local counter = 1
for slot, part in pairs(shoppingCart.partsIn) do
shoppingCart.slotList[counter] = slot
for slot, part in pairs(shoppingCart.partsOut) do
if not slotsAdded[part.containingSlot] then
local total = 0
for slot, part in pairs(shoppingCart.partsIn) do
total = total + part.finalValue
shoppingData.vehicleSlotToPartMap = {}
for partId, part in pairs(career_modules_partInventory.getInventory()) do
if part.location == currentVehicle then
local availableParts = jbeamIO.getAvailableParts(currentVehicleData.ioCtx)
for _, partName in pairs(initialVehicle.partList) do
if partName and partName ~= "" then
local function getFittingPartFromInventory(parentPart, slotName, currentVehicleData)
for partId, inventoryPart in pairs(career_modules_partInventory.getInventory()) do
local partSlotOfThisPartInShoppingCart = getPartSlotFromPartIdInShoppingCart(partId) -- for checking if the part is already in the shopping cart
local combinedSlotToPartMap = {}
for containingSlot, partId in pairs(slotToPartIdMap[inventoryId]) do
combinedSlotToPartMap[containingSlot] = deepcopy(career_modules_partInventory.getInventory()[partId])
end
for _, part in pairs(parts) do
combinedSlotToPartMap[part.containingSlot] = deepcopy(part)
for path, part in pairs(combinedSlotToPartMap) do
local jbeamData = jbeamIO.getPart(currentVehicleData.ioCtx, part.name)
local resultParts = deepcopy(parts)
for _, part in pairs(parts) do
if part.description.slotInfoUi then
if part.description.slotInfoUi then
for slotName, slotInfo in pairs(part.description.slotInfoUi) do
local path = part.containingSlot .. slotName .. "/"
-- Traverse through the vehicle parts tree
for slotName, childNode in pairs(node.children) do
local subPartName = childNode.chosenPartName
for path, part in pairs(vehicleParts) do
-- Remove the root part
if initialNode.children then
for slotName, initialChildNode in pairs(initialNode.children) do
-- Create preview child node if it doesn't exist
addedParts, werePartsAdded = getNeededAdditionalParts(addedParts, currentVehicle)
for path, part in pairs(addedParts) do
local node = getNodeFromSlotPath(previewVehicle.config.partsTree, part.containingSlot)
for containingSlot, part in pairs(removedParts) do
-- If there was another part in the slot before, put the initial part back in, otherwise leave the slot empty
-- Add new parts to preview vehicle data
for _, part in pairs(shoppingCart.partsIn) do
local node = getNodeFromSlotPath(previewVehicle.config.partsTree, part.containingSlot)
local incompatibleParts = findIncompatiblePartsInShoppingCart()
for slot, partName in pairs(incompatibleParts) do
shoppingCart.partsIn[slot] = nil
-- Add the partCondition of the new parts to the previewVehicle
for _, part in pairs(shoppingCart.partsIn) do
previewVehicle.partConditions[part.partPath] = part.partCondition
local function removePartBySlot(slot)
for _, part in pairs(shoppingCart.partsIn) do
if part.containingSlot == slot then
local vehicle = career_modules_inventory.getVehicles()[currentVehicle]
for slot, part in pairs(shoppingCart.partsOut) do
part.location = 0
for slot, part in pairs(shoppingCart.partsIn) do
if part.emptyPlaceholder then
@/lua/ge/extensions/core/commandhandler.lua
uiReady = true
for k, v in pairs(cachedSchemes) do
onSchemeCommand(v.sc, v.startArg)
@/lua/vehicle/extensions/tech/techCore.lua
sensorRequest = request['sensors']
for k, v in pairs(sensorRequest) do
data = getSensorData(v)
@/lua/ge/extensions/tech/ultrasonicTest.lua
local ctr = 0
for i, s in pairs(activeUltrasonicSensors) do
ctr = ctr + 1
for k, v in pairs(sensorData) do
print("ultrasonic reading: "..k.." reading value: "..v)
@/lua/ge/extensions/editor/meshSpline/populate.lua
if meshesBySpline then
for _, v in pairs(meshesBySpline) do
local numMeshesByShape = #v
@/lua/ge/extensions/editor/vehicleEditor/api/nodeTransformer.lua
for _,node in pairs(vEditor.selectedNodes) do
lastPickedNodesPos[node.name] = node.pos
-- Center transforming axes arrows on node selection
for _, node in pairs(vEditor.selectedNodes) do
axesArrowPos:setAdd(node.pos)
@/lua/ge/extensions/flowgraph/nodes/gameplay/race/raceNodeReached.lua
for name, pin in pairs(self.pinOut) do
if not pin.fixed then
self.pinOut.nodeName.value = nil
for name, pin in pairs(self.pinOut) do
if not pin.fixed then pin.value = nil end
@/lua/ge/extensions/editor/flowgraphEditor.lua
for id,graph in pairs(mgr.graphs) do
if graph.type == "graph" or not graph.macroPath then
end
for id,macro in pairs(mgr.macros) do
if not macro.macroPath then
im.Text('The unsaved macros are the following: ')
for id,_ in pairs(dirtyChildren) do
im.Text(mgr.macros[id].name)
local originalFileNames = {}
for fo, elem in pairs(filesByOriginal) do
table.insert(originalFileNames, fo)
im.PopStyleVar()
for _, win in pairs(windows) do
win:draw(dtReal,dtSim,dtRaw)
local stateIds = {}
for id, state in pairs(mgr.states.states) do
if state.active then
if mgr.selectedLinkCount == 1 then
for lId, _ in pairs(mgr.selectedLinks) do
local link = mgr.graph.links[lId]
local onCount, offCount = 0,0
for lId, _ in pairs(mgr.selectedLinks) do
local link = mgr.graph.links[lId]
end
for lId, _ in pairs(mgr.selectedLinks) do
local link = mgr.graph.links[lId]
if mgr.selectedLinkCount == 0 then
for _, link in pairs(mgr.graph.links) do
if mgr.selectedNodes[link.targetNode.id] or mgr.selectedNodes[link.sourceNode.id] then
if mgr.selectedNodeCount == 0 and mgr.selectedLinkCount == 1 then
for lId, _ in pairs(mgr.selectedLinks) do
local link = mgr.graph.links[lId]
local connectedIds = {}
for nId, _ in pairs(mgr.selectedNodes) do
local node = mgr.graph.nodes[nId]
if mgr.selectedNodeCount == 2 then
for nId, _ in pairs(mgr.selectedNodes) do
local node = mgr.graph.nodes[nId]
local availableA, availableB = {},{}
for _, pin in pairs(nodeA.pinOut) do
if not pin.hidden then
end
for _, pin in pairs(nodeB.pinInLocal) do
if not pin.hidden and not pin:getFirstConnectedLink() and pin.pinMode ~= "hardcoded" then
if mgr.selectedNodeCount == 0 then
for lId, _ in pairs(mgr.selectedLinks) do
local link = mgr.graph.links[lId]
else
for _, link in pairs(mgr.graph.links) do
if mgr.selectedNodes[link.targetNode.id] and not mgr.selectedNodes[link.sourceNode.id]
if #linksToRemove == 0 then
for _, link in pairs(mgr.graph.links) do
if mgr.selectedNodes[link.targetNode.id] and mgr.selectedNodes[link.sourceNode.id] then
@/lua/ge/extensions/gameplay/rally/util.lua
-- function printFields(obj)
-- for k, v in pairs(obj) do
-- -- if type(v) == "function" then
@/lua/ge/extensions/career/modules/milestones/milestones.lua
milestone.filter = milestone.filter or {missingFilter=true}
for key, _ in pairs(milestone.filter) do
filters[key] = true
@/lua/ge/extensions/editor/buildingEditor.lua
local alib = {}
for _,p in pairs(apth) do
unrequire(p)
if UU._PRD == 0 or UU._HERE then
for k,d in pairs(dexp) do
if d.obj and d.obj.isactive and d.obj.out.up or (UU._PRD==0 and d.onstart) then
local aang = {}
for i,v in pairs(apos) do
aang[#aang + 1] = {i, math.atan2(v.y, v.x) % (2*math.pi)}
local s = '{ '
for o,e in pairs(t) do
-- lo(type(o)..':'..type(e)..':'..o..':'..tostring(e))
local star, anear = {}, {}
for _,iuse in pairs(ause) do
anear[#anear + 1] = iuse - 1
end
for _,j in pairs(anear) do
if j > 0 and j <= #path then
local dma = 0
for i,n in pairs(anode) do
local step = U.stamp({cp, i})
local crossed, xc, yc
for o,p in pairs(ap) do
local w = wa * p.d/dma + wb * p.ang/math.pi + (1 - (wa + wb)) * p.used
end
for _,pth in pairs(apath) do
crossed = forCross(pth)
apath[#apath + 1] = path
for _,s in pairs(path) do
jointpath[#jointpath + 1] = s
local aang, angp = {}, 0
for _,i in pairs(star) do
local v = anode[i].pos - anode[s].pos
-- relative to p
for o,_ in pairs(aang) do
aang[o][2] = (aang[o][2] - angp) % (2*math.pi)
local an = {}
for _,p in pairs(apos) do
an[#an + 1] = {pos = p, width = w}
-- get branches
for i,r in pairs(roads) do
local inpath = U.index(r.path, icirc)
-- U.dump(r.apin, '?? r:'..i)
for _,j in pairs(inpath) do
inedge[#inedge + 1] = {i, r.apin[r.path2dec[j]][1]}
local adir = {}
for _,s in pairs(inedge) do
lo('?? for_s:'..s[1]..':'..s[2])
--------------------------
for i,r in pairs(roads) do
inedge[i] = {}
local indec = {}
for k,v in pairs(r.dec2path) do
-- lo('?? d2p:'..k..':'..i)
local aee = {}
for o,e in pairs(inedge[i]) do
local av, step = r.av, r.avstep
local mi, hmi = 1/0, nil
for i,h in pairs(hmap) do
-- lo('?? height4edge:'..i..':'..h)
local ro, ri
for _,e in pairs(exits) do
if e.meshid == idobj then
end
for _,e in pairs(exits) do
if e.to[1] == ro.to[1] and e.to[2] == ro.to[2] and e.meshid ~= idobj then
local p = pth[o]
-- for o,p in pairs(dec) do
local set = 0
-- reset heights
for o,n in pairs(adec) do
if dbg then
-- build decal
for _,r in pairs(roads) do
local rd = Net.path2decal(r, wHeighway)
state = {}
for i,l in pairs(lines) do
local a = U.split(l,',')
local apair = {}
for o,s in pairs(edges.astamp) do
if (edges.infaces[s] ~= nil and math.abs(edges.infaces[s]) == 1) or #edges.astamp == 1 then
if W.out.border ~= nil then
for _,base in pairs(W.out.border) do
for i = 1,#base do
if W.out.apath ~= nil then
for _,p in pairs(W.out.apath) do
for i = 2,#p do
if D.out.apath ~= nil then
for _,p in pairs(D.out.apath) do
for i = 2,#p do
if W.out.apick ~= nil then
for _,s in pairs(W.out.apick) do
local r = 0.01*math.sqrt((s-core_camera.getPosition()):length())
if D.out.apick ~= nil then
for _,s in pairs(D.out.apick) do
local r = 0.03*math.sqrt((s-core_camera.getPosition()):length())
if W.out.avedit ~= nil then
for _,s in pairs(W.out.avedit) do
local r = 0.02*math.sqrt((s-core_camera.getPosition()):length())
if W.out.apoint ~= nil then
for _,p in pairs(W.out.apoint) do
local r = 0.03*math.sqrt((p-core_camera.getPosition()):length())
if D.out.apoint ~= nil then
for _,p in pairs(D.out.apoint) do
local r = 0.03*math.sqrt((p-core_camera.getPosition()):length())
for _,s in pairs(adbg) do
-- lo('?? DS:'..tostring(s[1]))
-- circles
for o,n in pairs(anode) do
local clr = color(255,255,255,255)
-- paths
for i,l in pairs(apath) do
for j,s in pairs(l) do
for i,l in pairs(apath) do
for j,s in pairs(l) do
if j > 1 then
-- decals sceletons
for i,rd in pairs(roads) do
local path = {}
lo('?? BE.fdata2:'..#list, true)
for _,f in pairs(list) do
editor.removeForestItem(fdata, f)
-- print('?? to_RELOAD:')
for k,d in pairs(dexp) do
if d.obj and d.obj.isactive and d.obj.out.up or d.onstart then
for i,d in pairs(dexp) do
-- lo('?? for_EXP:'..tostring(d.label)..':'..tostring(d.obj.isactive))
editor.addWindowMenuItem("LandscapeGenerator (WIP)", onUp, {groupMenuName = 'Experimental'})
for k,d in pairs(dexp) do
editor.addWindowMenuItem(d.label, function()
editor.addWindowMenuItem("LandscapeGenerator (WIP)", onUp, {groupMenuName = 'Experimental'})
for k,d in pairs(dexp) do
d.obj = assign({'/lua/ge/extensions/editor/gen/'..d.lib})
@/lua/ge/extensions/flowgraph/variableStorage.lua
local list = {}
for name, elem in pairs(self.variables) do
table.insert(list, {name = name, index = elem.index})
local ret = 0
for _,v in pairs(self.variables) do
if v.index > ret then ret = v.index end
local all = {}
for _, gr in pairs(self.mgr.graphs) do if gr.type ~= "instance" then table.insert(all, gr) end end
for _, gr in pairs(self.mgr.macros) do if gr.type ~= "instance" then table.insert(all, gr) end end
for _, gr in pairs(self.mgr.graphs) do if gr.type ~= "instance" then table.insert(all, gr) end end
for _, gr in pairs(self.mgr.macros) do if gr.type ~= "instance" then table.insert(all, gr) end end
local vNodes = {}
local vNodes = {}
for _, graph in pairs(all) do
for _, node in pairs(graph.nodes) do
for _, graph in pairs(all) do
for _, node in pairs(graph.nodes) do
if node.nodeType == 'types/getVariable' or node.nodeType == 'types/setVariable' then
local all = {}
for _, gr in pairs(self.mgr.graphs) do if gr.type ~= "instance" then table.insert(all, gr) end end
for _, gr in pairs(self.mgr.macros) do if gr.type ~= "instance" then table.insert(all, gr) end end
for _, gr in pairs(self.mgr.graphs) do if gr.type ~= "instance" then table.insert(all, gr) end end
for _, gr in pairs(self.mgr.macros) do if gr.type ~= "instance" then table.insert(all, gr) end end
local vNodes = {}
local vNodes = {}
for _, graph in pairs(all) do
for _, node in pairs(graph.nodes) do
for _, graph in pairs(all) do
for _, node in pairs(graph.nodes) do
if node.nodeType == 'types/getVariable' or node.nodeType == 'types/setVariable' then
function C:finalizeChanges()
for name, _ in pairs(self.variableChanges) do
self.variables[name].mergeFuns.finalize(self.variables[name])
table.clear(self.variableChanges)
for name, var in pairs(self.variables) do
if not var.keepAfterStop then
}
for name, val in pairs(self.variables) do
table.insert(ret.list, {
@/lua/ge/extensions/editor/tech/roadArchitect/render.lua
if isGroupMode or (div[lIdx][7]:squaredDistance(camPos) < innerCullLimSq) then
for lane, _ in pairs(roadLanes) do
local dL = div[lane]
@/lua/ge/extensions/editor/flowgraph/nodePreview.lua
for id, node in pairs(self.hover.nodes) do
ui_flowgraph_editor.SetCurrentEditor(self.fgEditor.ectx)
for _, link in pairs(self.hover.links) do
link:draw()
@/lua/ge/extensions/flowgraph/nodes/ui/missionPopup.lua
function C:_executionStarted()
for _, p in pairs(self.pinOut) do
p.value = false
function C:_executionStarted()
for _, p in pairs(self.pinOut) do
p.value = false
function C:buttonPushed(action)
for nm, pn in pairs(self.pinOut) do
self.pinOut[nm].value = nm == action
self:reset()
for _,pn in pairs(self.pinOut) do
pn.value = false
@/lua/ge/extensions/flowgraph/nodes/activity/autoStarGoals.lua
local context = {}
for key, value in pairs(data) do
if type(value) == 'string' or type(value) == 'number' then
@/lua/ge/extensions/ui/vehicleSelector/tiles.lua
context.profiler:add("setupValidFilters")
for _, config in pairs(data.configs) do
-- VEHICLE-SPECIFIC: Uses vehicle-specific filter logic
local favouriteGroup, recentGroup = {tiles = {}}, {tiles = {}}
for _, config in pairs(validConfigs) do
-- GENERIC: Get groups for item (could work for any item type)
local groupsForConfig = context.groupingModule.getGroupsForConfig(config, data.displayData.groupMode, data.displayData)
for _, group in pairs(groupsForConfig) do
local groupName, groupOrder = group.groupName, group.groupOrder
-- GENERIC: Process each group to create tiles
for _, group in pairs(groups) do
-- Skip clustering for special groups in unclustered mode
-- Convert configs directly to tiles without clustering
for _, config in pairs(group.unclusteredConfigs) do
local tile = context.itemToTileConverter(config, true)
-- GENERIC: Create tiles for each cluster
for _, clusteredItems in pairs(itemsClustered) do
local tiles = context.processClusteredItems(clusteredItems, group, data.displayData.clusterMode)
-- GENERIC: Add tiles to groups and handle special groups (favourites/recent)
for _, tile in pairs(tiles) do
table.insert(group.tiles, tile)
-- GENERIC: Automatic sorting based on group type and display settings
for _, group in pairs(groups) do
--print(string.format("sorting group %s with mode %s %s (in handleAllModelsPath)", group.key, data.displayData.sortMode, data.displayData.groupMode))
-- VEHICLE-SPECIFIC: Iterate through vehicle configurations
for _, config in pairs(model.configs) do
-- VEHICLE-SPECIFIC: Filter by vehicle submodel
@/lua/ge/extensions/editor/dynamicDecals/layerTypes/linkedSet.lua
for _, child in ipairs(layer.children) do
for _, property in pairs(properties) do
if im.BeginPopup(string.format("%s_%s_AddPropertyPopup", layer.uid, guiId)) then
for cat, properties in pairs(api.properties) do
im.TextColored(editor.color.beamng.Value, cat)
@/lua/vehicle/powertrain/torsionReactor.lua
device.torqueReactionNodes = {}
for _, v in pairs(jbeamData.torqueReactionNodes_nodes or {}) do
if type(v) == "number" then
@/lua/vehicle/controller/propAnimation/dualAxisLever.lua
local modeId = 1
for _, coordinate in pairs(modeCoordinateTable) do
modeCoordinates[coordinate.modeName] = {x = coordinate.x, y = coordinate.y, position = modeId}
local impulseModeCoordinateTable = tableFromHeaderTable(jbeamData.impulseModeCoordinates or {})
for _, impulseMode in pairs(impulseModeCoordinateTable) do
--we only support modes here with a length of at least 2
for _, modeChange in pairs(modeChangesTable) do
local index1 = modeChange.mode1 .. modeChange.mode2
modeChanges[index2] = {}
for _, pos in pairs(modeChange.intermediateCoordinates) do
--normal order as per jbeam
@/lua/ge/extensions/ui/vehicleSelector/vehicleSpecifications.lua
end
for _, paint in pairs(modelDetails.paints) do
table.insert(paintData.factoryPaints, paint)
@/lua/vehicle/controller/playerController.lua
local function debugDraw(focusPos)
for _, v in pairs(debugVectors) do
obj.debugDrawProxy:drawNodeVector3d(v.thickness or 0.05, v.cid, v.vector, v.color)
isTouchingGround = false
for nodeCid, _ in pairs(ballNodes) do
isTouchingWater = isTouchingWater or obj:inWater(nodeCid)
for _, beam in pairs(v.data.beams) do
if beam.tag == jbeamData.stabilizationBeamFront then
for _, node in pairs(v.data.nodes) do
if node.tag == "ball" then
@/lua/ge/extensions/editor/sitesEditor.lua
end
for name, list in pairs(spotsByName) do
if #list > 1 then
local emptyLevelNamesSorted = {}
for level, sites in pairs(levelSites) do
if #sites > 0 then
@/lua/ge/extensions/flowgraph/nodes/scene/raceLineParking.lua
self:_executionStopped()
for _, p in pairs(self.pinOut) do p.value = nil end
end
@/lua/ge/extensions/util/compileMeshes.lua
local matFiles = FS:findFiles( path, 'materials.cs', -1, true, false)
for k,v in pairs(matFiles) do
TorqueScriptLua.exec(v)
local matFiles = FS:findFiles( path, '*materials.json', -1, true, false)
for k,v in pairs(matFiles) do
loadJsonMaterialsFile(v)
log('I', 'work', 'Will process .dae meshes in following dirs: ')
for k,v in pairs(compilePaths) do
log('I', 'work', v )
-- we need to load the separate folders isolated, as the names of materials and objects will clash otherwise
for _, baseDir in pairs(compilePaths) do
local dirs = getDirectories(baseDir)
for _, dir in pairs(dirs) do
local inited = false
else
for i, f in pairs(allFilesCheckOnly) do
if not compiledFiles[f] and not isPathIgnored(f) then
@/lua/ge/extensions/editor/windows.lua
local windows = {}
for name, data in pairs(windowsData) do
table.insert(windows, data.title or name)
im.Columns(2, "windowsColumns")
for _, name in pairs(windows) do
if im.ImGuiTextFilter_PassFilter(filter, name) then
@/lua/ge/extensions/core/multiSpawn.lua
for k, filter in pairs(params.filters) do -- each inner table pair should have a coefficient: {Type = {car = 1, truck = 0.4}}
local configValue = config[k] or 'default' -- unsure about this actually
local filterKeyFound = false
for k, v in pairs(configValue) do
if type(filter[k]) == 'number' then -- filter value
for _, model in pairs(core_vehicles.getModelList().models) do
local officialModel = isOfficialSource(model)
for _, config in pairs(core_vehicles.getModel(model.key).configs) do
local officialConfig = isOfficialSource(config)
@/lua/ge/extensions/editor/dynamicDecals/export.lua
tblx = {}
for _, fileType in pairs(exportTexturesFileTypes) do
table.insert(tblx, fileType)
@/lua/ge/extensions/core/settings/settings.lua
local cloudValues = {}
for k, v in pairs(values) do
if values[k] == M.impl.defaultValues[k] then -- TODO do a deep table compare instead
if withValue then
for k,o in pairs(options) do
if type(o.get) == 'function' then
end
for k,o in pairs(options) do
if type(o.getModes) == 'function' then
for _, l in pairs(locales) do
local key = string.match(l, 'locales/(.*).json')
local sortedKeys = {}
for k,_ in pairs(newState) do
if not tableContains(graphicQualityGroups, k) then
-- fix the options up and combine the keys and values into the dict
for k,v in pairs(options) do
if v.keys and v.values and not v.dict then
-- add C++ propagation wherever possible
for k,v in pairs(M.impl.defaults) do
if CppSettings[k] ~= nil then -- check if C++ side cares about this setting
local settingFileChanged = false
for _,v in pairs(files) do
if (v.filename == M.impl.pathLocal or v.filename == M.impl.pathCloud) and (os.clock()-lastSavedTime) > 5 then
@/lua/ge/extensions/flowgraph/nodes/vehicle/ai/scriptAI/pathFromFile.lua
if im.BeginCombo("File##file" , self.fnShort) then
for _, fileName in pairs(self.files) do
local fnShort = string.sub(fileName, string.len(trackFilePath) + 1)
@/lua/ge/extensions/editor/gen/mesh.lua
end
for _,b in pairs(base) do
auv[#auv+1] = {u = (b-ref):dot(u), v = (b-ref):dot(v)}
if not auv then auv = {} end
-- for _,b in pairs(base) do
for i=istart,istart+#base-1 do
local poly = {}
for i,b in pairs(base) do
poly[#poly+1] = b
-- append all
for _,uv in pairs(tuv) do
auv[#auv+1] = uv
-- if isnan(an) then
for i,v in pairs(an) do
-- lo('?? z3_n:'..i..':'..tostring(v))
local auv = auv ~= nil and auv or {}
for i,y in pairs(ay) do
local row = {}
local row = {}
for j,x in pairs(ax) do
auv[#auv + 1] = {u = u1 + (u2 - u1)*x/X, v = v1 + (v2 - v1)*(Y - y)/Y}
auv = auv ~= nil and auv or {}
for i,y in pairs(ay) do
for j,x in pairs(ax) do
for i,y in pairs(ay) do
for j,x in pairs(ax) do
av[#av + 1] = u*x + v*y
for i,y in pairs(ay) do
for j,x in pairs(ax) do
for i,y in pairs(ay) do
for j,x in pairs(ax) do
av[#av + 1] = u*x/X + v*y/Y
if node.kids ~= nil then
for _,kid in pairs(node.kids) do
if kid.name == 'geometry' then
lo('?______ for_aint:'..#kid.kids..':'..tostring(kid.attr.count))
for _,k in pairs(kid.kids) do
-- lo('?? skid:'..k.name)
if node.kids ~= nil then
for _,kid in pairs(node.kids) do
if kid.name == 'geometry' then
local str = ''
for _,v in pairs(list) do
if step == 3 then
lo('?______ for_aint:'..#kid.kids)
for _,k in pairs(kid.kids) do
-- lo('?? skid:'..k.name)
local str = ''
for o,f in pairs(ageom[cgeom].faces) do
str = str..f.v..' '..f.n..' '..f.u..' '
if node.kids ~= nil then
for _,kid in pairs(node.kids) do
if kid.name == 'float_array' then
local nmatch,akid = 0,{}
for _,kid in pairs(node.kids) do
-- U.dump(path, '?? for_PATH:'..lvl)
-- lo('?? if_VEC:'..tostring(isvec))
for _,d in pairs(ad) do
if isvec then
else
for k,v in pairs(d) do
s = s..v..' '
local af = {}
for _,f in pairs(m.faces) do
af[#af+1] = {f.v, f.n, f.u}
local auv = {}
for _,uv in pairs(m.uvs) do
auv[#auv+1] = {uv.u, uv.v}
local out = {}
for i,b in pairs(aobeam) do
-- for i,b in pairs(data.beams) do
for i,b in pairs(aobeam) do
-- for i,b in pairs(data.beams) do
if not dbeam[b.partOrigin] then dbeam[b.partOrigin] = {} end
-- U.dump(dbeam,'?? m.dbeam:',nil,1)
for part,set in pairs(dbeam) do
-- if part == 'pickup_axle_R' then
local madam = -math.huge
for i,b in pairs(set) do
if b.deform and b.deform > madef then
-- normalize dynamic vals
for i,b in pairs(set) do
-- if #U.index({'rb8r_rb8rr','b3ll_rf1l'},b.stamp) > 0 then
local av,auv = {},{}
for i,n in pairs(data.nodes) do
av[#av+1] = n.pos
-- U.dump(abag, '?? aBAG:')
for i,b in pairs(abag) do
local mi,ma = math.huge,-math.huge
for i,f in pairs(data.triangles) do
if f.id1
--[[
for j,b in pairs(abag) do
if b[f.id1] then
auv = {{u=0,v=0},{u=1,v=0},{u=0,v=1}}
for i,t in pairs(data.triangles) do
an[#an+1] = -(av[t.id1]-av[t.id2]):cross(av[t.id1]-av[t.id3]):normalized()
-- local po = {}
for i,b in pairs(data.beams) do
if not dbeam[b.partOrigin] then dbeam[b.partOrigin] = {} end
local alpha = 0.1
for i,c in pairs(abin) do
c[#c+1] = alpha
local dgeo = {}
for i,m in pairs(am) do
local c = U.mod(i,abin)
--[[
for i,b in pairs(abin) do
local mat = abin[i]
if ndmat then
for i,k in pairs(ndmat.kids) do
-- lo('?? if_MAT:'..i..':'..tostring(k.name))
-- local k = ndgeo.kids[i]
for i,k in pairs(ndgeo.kids) do
-- print('?? for_i:'..i)
dgeo[k.attr['id']] = {}
for j,m in pairs(am) do
local c = U.mod(#amat,abin)
local area,nface = 0,0
for i,g in pairs(dgeo[s]) do
area = area + g.m.area
if nd.kids then
for i,k in pairs(nd.kids) do
if k.name == name then
local refnode = forNode(nd, {'mesh','vertices'})
for i,k in pairs(refnode.kids) do
-- lo('?? for_k:'..k.name)
local ndtri = atri[1]
for i,k in pairs(ndtri.kids) do
if k.name == 'input' then
local av,an,auv,af = {},{},{},{}
for i,k in pairs(ndmesh.kids) do
if k.name == 'source' then
local stride = 0
for i,k in pairs(ndtri.kids) do
if k.name == 'input' then
local zma = -math.huge
for i,t in pairs(atri) do
-- lo('??*************** for_TR:'..t.attr.material)
end
for j,v in pairs(av) do
if v.z > zma then
U.dump(dmat, '?? geoFrom_mat:'..tostring(t.attr.material))
for k,v in pairs(dmat) do
if string.find(k,tostring(t.attr.material),1,true) == 1 then
-- lo('?? if_v:'..v:getClassName())
-- for k,val in pairs(v) do
-- lo('?? for_v:'..val)
-- if true then return end
for i,m in pairs(am) do
-- U.dump(m, '?? for_m:'..m.material)
-- for i,s in pairs(amat) do
-- local ndmat = M.toNode(matlib, 'material', {id='idmat_'..i, name='WarningMaterial'})
local ndlod = M.toNode(kid, 'node', {id='idlod_'..alod[1], name='nm_L'..alod[1], type='NODE'})
for j,gid in pairs(agid) do
kid = M.toNode(ndlod, 'instance_geometry', {url='#'..agid[j]})
kid = M.toNode(kid, 'technique_common', {})
for i,s in pairs(amat) do
M.toNode(kid, 'instance_material', {target='#idmat_'..i, symbol='idmat_'..i})
local an,av,af,auv = {},{},{},{}
for i,n in pairs(m.an) do
vec2buf(n, an)
end
for i,v in pairs(m.av) do
vec2buf(v, av)
local f = m.af[i]
-- for i,f in pairs(m.af) do
af[#af+1] = f.v
local uvo,scalex,scaley = {0.2,0.0}
for ii,f in pairs(dlod.afloor) do
-- hc = forHeight(dlod.afloor, ii)/H
-- lo('?? for_HEIGHT:'..ii..':'..hp..':'..hc)
for j,w in pairs(f.awall) do
-- lo('?? for_V:'..ii..':'..j..':'..tostring(w.pos))
local H = 0
for _,f in pairs(desc.afloor) do
H = H + f.h
if not obj then obj = {} end
for key,val in pairs(obj) do
kid.attr[#kid.attr+1] = {name=key, value=val}
if not nd then return end
for key,val in pairs(obj) do
if not nd.attr then nd.attr = {} end
local match
for i,a in pairs(nd.attr) do
if a.name == key then
if node.kids ~= nil then
for _,kid in pairs(node.kids) do
if kid.name == prop and not val then
--[[
for _,k in pairs(kid.kids) do
-- lo('?? skid:'..k.name)
-- lo('?? if_mat:'..tostring(scenetree.findObject(nm))..':'..mat:getField("translucentBlendOp", 0))
-- for t,c in pairs({orange='1 0.5 0 1', green='0 1 0 1', blue='0 0 1 1',yellow='1 1 0 1'}) do
-- end
if node.kids ~= nil then
for _,kid in pairs(node.kids) do
print('?? for_kid:'.._)
]]
for _,s in pairs({'library_images', 'library_materials', 'library_effects'}) do
kidsList(node, 1, s) --, nil, nil, true)
local dmi,imi = math.huge
for k,m in pairs(am) do
local av = m.verts
local ngeo = 0
for key,g in pairs(afloat) do
ngeo = ngeo + 1
for i,list in pairs(aint[key]) do
lo('?? FOF:'..i..':'..key..':'..ngeo..':'..(#list/step))
local amesh = {}
for ord,m in pairs(tmesh.data) do
amesh[#amesh + 1] = m
local avi,ani,auvi = {},{},{}
for ord,m in pairs(tmesh.sel) do
for _,f in pairs(m.faces) do
for ord,m in pairs(tmesh.sel) do
for _,f in pairs(m.faces) do
if #U.index(avi, f.v) == 0 then
local m = tmesh.sel[1]
for o,i in pairs(avi) do
dvi[i] = o
-- lo('?? vrts:'..tostring(verts[1])..':'..tostring(m.verts[dvi[avi[1]]]))
for o,i in pairs(ani) do
dni[i] = o
end
for o,i in pairs(auvi) do
duvi[i] = o
local afaces = {}
for ord,m in pairs(tmesh.sel) do
afaces[ord] = {}
afaces[ord] = {}
for _,f in pairs(m.faces) do
-- U.dump(f, '?? for_f:'.._..':'..tostring(dvi[f.v])..':'..tostring(dni[f.n])..':'..tostring(duvi[f.u]))
if mat == nil and list ~= nil then mat = 'WarningMaterial' end
for ord,m in pairs(fr) do
if mode ~= -1 and to[ord] == nil then
else
for _,f in pairs(fr[ord].faces) do
to[ord].faces[#to[ord].faces + 1] = f
elseif list[ord] ~= nil then
for _,i in pairs(list[ord]) do
if mode ~= -1 then
out.avedit = {}
for ord,m in pairs(mdata) do
for _,f in pairs(m.faces) do
for ord,m in pairs(mdata) do
for _,f in pairs(m.faces) do
out.avedit[#out.avedit + 1] = m.verts[f.v + 1]
local mi,imi = math.huge,0
for ord,m in pairs(adata) do
local av = m.verts
local dmi,imi = math.huge
for ord,m in pairs(fr) do
local av = m.verts
local center,n = vec3(0,0,0),0
for _,f in pairs(tri) do
path[#path + 1] = sto[triord].verts[f.v+1]
local tri,triord = {}
for ord,m in pairs(fr) do
local av = m.verts
to[ord].faces = {}
for _,f in pairs(to[ord].ref) do
to[ord].faces[#to[ord].faces + 1] = f
local center,n = vec3(0,0,0),0
for _,f in pairs(tri) do
center = center + sto[triord].verts[f.v+1]
local tri,triord = {}
for ord,m in pairs(fr) do
local av = m.verts
lo('?? INV:')
for _,t in pairs(mto.ref) do
local d, bx, by = intersectsRay_Triangle(
to[ord].faces = {}
for key,list in pairs(to[ord].ref) do
for _,f in pairs(list) do
for key,list in pairs(to[ord].ref) do
for _,f in pairs(list) do
to[ord].faces[#to[ord].faces + 1] = f
local center,n = vec3(0,0,0),0
for _,f in pairs(tri) do
center = center + sto[triord].verts[f.v+1]
local tri,triord = {}
for ord,m in pairs(fr) do
local av = m.verts
local center,n = vec3(0,0,0),0
for _,f in pairs(tri) do
center = center + sto[triord].verts[f.v+1]
--[[
for _,m in pairs(sto) do
-- for i = 1,3 do
-- local f = m.faces[i]
for i,f in pairs(m.faces) do
center = center + m.verts[f.v+1]
-- loops to edges
for j,loop in pairs(aloop) do
-- cut off intersections with holes
for i,e in pairs(ae) do
for j,loop in pairs(aloop) do
for i,e in pairs(ae) do
for j,loop in pairs(aloop) do
-- U.dump(aloop, '?? fP_ALOOP:')
for i,l in pairs(aloop) do
local nvert = #av
-- U.dump(l,'?? inloop:'..i)
for j,p in pairs(l) do
-- lo('?? for_loop:'..i..':'..j..':'..tostring(l[j]))
local apath = {}
for i,l in pairs(aloop) do
for j,p in pairs(l) do
for i,l in pairs(aloop) do
for j,p in pairs(l) do
edgeUp(nvert+j, nvert+U.mod(j+1,#l), 1)
local mi,ma,pmi,pma = math.huge,-math.huge
for j,p in pairs(aloop[1]) do
local proj = (p-ref):dot(u)
local s = 0
-- for i,d in pairs(astep) do
for i=1,#astep-1 do
-- for s = step,w-step+0.1,step do
-- for i,s in pairs(astep) do
-- aline[#aline+1] = {pmi+u*s,pmi+u*s+dir}
local np = 0
for i,l in pairs(aloop) do
for j,p in pairs(l) do
for i,l in pairs(aloop) do
for j,p in pairs(l) do
l[j] = {pos=p, ind=np+j}
-- lo('?? for_LK:'..a..':'..b..':'..tostring(l)..':'..tostring(k))
-- for a,l in pairs(aloop[i]) do
-- for b,k in pairs(aloop[j]) do
-- for a,l in pairs(aloop[i]) do
-- for b,k in pairs(aloop[j]) do
-- U.dump(l, '?? for_a:'..a)
local ifrto,jfrto = {},{}
for a,p in pairs(aloop[i]) do
if p.ind == frtoa[1] then
end
for a,p in pairs(aloop[j]) do
if p.ind == frtob[1] then
-- av = {}
for _,v in pairs(av) do
v.skip = true
end
for _,l in pairs(aloop) do
-- local nvert = #av
-- local nvert = #av
for _,p in pairs(l) do
-- lo('?? vert_RESET:'..p.ind)
av = {}
for _,l in pairs(aloop) do
-- local nvert = #av
-- local nvert = #av
for _,p in pairs(l) do
av[p.ind] = {pos=p.pos, star={}}
apath = {}
for i,l in pairs(aloop) do
apath[#apath+1] = deepcopy(l)
apath[#apath] = U.map(apath[#apath], 'pos')
for j,p in pairs(l) do
edgeUp(p.ind, U.mod(j+1,l).ind, 1)
local l = aline[i]
--` for _,l in pairs(aline) do
local across = {}
local across = {}
for stamp,_ in pairs(de) do
local seg = U.split(stamp, '_')
local apt = {{pfr[2],pto[1]},{pto[2],pfr[1]}}
for _,aind in pairs(apt) do
pfr,pto = aind[1],aind[2]
local ami,imi = math.huge
for ind,_ in pairs(b.star) do
if ind ~= e[1] then
done = true
for k,e in pairs(de) do
-- lo('?? for_LOOPS:'..N..':'..tostring(e))
local dle = {}
for j,ind in pairs(ai) do
local stmp = U.stamp({ind,U.mod(j+1,ai)},true)
local askip = {}
for _,d in pairs(aconc) do
-- if nloop == 3 then
local dmi1,dmi2 = math.huge,math.huge
for k,_ in pairs(dle) do
local ift = U.split(k,'_')
-- check if hit conq
for ic,dc in pairs(aconc) do
if dc[2] == ind then
for _,s in pairs(anew) do
dle[s] = de[s] --true
cdone = true
for stamp,_ in pairs(dle) do
if dle[stamp] == 2 then
-- end)
for i,p in pairs(sav) do
if not av[i] then
end
for i,p in pairs(av) do
avert[i] = p.pos + vec3(0,0,0.1)
local anorm = {}
for i,l in pairs(acloop) do
local pth,map = U.polyStraighten(U.map(l,function(k,v)
if false then
for j,ind in pairs(ai) do
if ind ~= d[1] and ind ~= d[2] then
else
for i,ind in pairs(ai) do
local stamp = U.stamp({ind, U.mod(i+1,ai)}, true)
local astick = {} -- vertices which lie on boundary
for i,b in pairs(base) do
av[#av+1] = {p=b,star={}}
local aestamp = {}
for _,l in pairs(aloop) do
--[[
local pth = {}
for _,iv in pairs(l) do
pth[#pth+1] = av[iv].p
local iseq = {}
for j,v in pairs(pth) do
iseq[#iseq+1] = p[map[j] ]
local p = {}
for i,b in pairs(l) do
av[#av+1] = {p=b,star={}}
local iseq = {}
for j,v in pairs(pth) do
iseq[#iseq+1] = p[map[j]]
local function crossBoundary(loop, k)
for i,ie in pairs(aebound) do
-- lo('?? onBound:'..)
if not p then return end
for i,ie in pairs(aebound) do
-- U.dump(ae[ie],'?? onBoundary:'..i..':'..ie)
local start = #base
for i,loop in pairs(aloop) do
-- U.dump(loop, '?? for_loop:'..i) --..':'..#loop..':'..tableSize(loop))
local idupe -- = start+U.mod(#loop-k+1,#loop)
for ii,e in pairs(ae) do
if dstamp == U.stamp(e) then
--[[
for i,e in pairs(ae) do
aline[#aline+1] = {av[e[1] ].p,av[e[2] ].p}
for i,v in pairs(av) do
if U.index(astick,i)[1] then goto continue end
local dmi,pmi,emi,smi=math.huge
-- for iv,_ in pairs(v.star) do
-- U.dump(forSprouts(v),'?? if_V:'..i)
-- end
for iv,_ in pairs(asprout) do
for k,e in pairs(ae) do
for iv,_ in pairs(asprout) do
for k,e in pairs(ae) do
-- if i == 12 then
local aeo = {} -- oriented edges
for i,e in pairs(ae) do
table.sort(e)
local pth = {}
for _,iv in pairs(p) do
pth[#pth+1] = av[iv].p
local iseq = {}
for j,v in pairs(pth) do
iseq[#iseq+1] = p[map[j]]
-- go over star for maximal left turn angle
for c,d in pairs(av[b].star) do
if c ~= a then
local nia = 0
for ia,s in pairs(aeo) do
nia = nia + 1
-- U.dump(s, '?? for_S:'..ia)
for ib,d in pairs(s) do
-- lo('??______________________________ in_STAR:'..ia..'>'..ib)
apath[#apath+1] = path -- U.polyStraighten(path)
for k,ib in pairs(path) do
local a,b = ib,U.mod(k+1,path)
local avert,af,auv = {},{},{}
for i,v in pairs(av) do
avert[#avert+1] = v.p + vec3(0,0,0.01)
-- U.dump(base,'??_____________ rcPave:'..tostring(an[1]))
for i,p in pairs(apath) do
--- straighten path
local pth = {}
for _,iv in pairs(p) do
pth[#pth+1] = av[iv].p
local iseq = {}
for j,v in pairs(pth) do
-- avert[#avert+1] = v
aline = {}
for i,e in pairs(ae) do
aline[#aline+1] = {av[e[1]].p,av[e[2]].p}
local ne = tableSize(ae)
for i,e in pairs(ae) do
-- lo('?? ff:'..i)
-- edgeDown(ie)
for j,ie in pairs(iecheck) do
-- U.dump(ae[ie], '?? for_edge:'..j..':'..ie..':'..#ae)
local irc
for i,loop in pairs(aloop) do
local isout
local b = U.mod(k,loop)
-- for k,b in pairs(loop) do
if not U.inRC(b, {rc}) then
-- initial objects linking
for i,loop in pairs(aeref) do
-- nvert = nvert + #loop
end
for i,l in pairs(aloopstick) do
local c,d
for i,e in pairs(ae) do
-- isend = false
lo('??______________________________________ is_3_5:')
for i,_ in pairs(estamp) do
lo('?? if_STAMP:'..i..':'.._)
local ama,ima = -math.huge
for _,iv in pairs(astar) do
local u = (v4e[iv[1].ind].p - v4e[n2].p):normalized()
local rc = {}
for i,list in pairs(e4v) do
-- U.dump(list, '??___________________ for_edge:'..i)
local pth = {}
for _,p in pairs(rc) do
pth[#pth+1] = v4e[p].p
--[[
for _,rc in pairs(arc) do
local pth = {}
local pth = {}
for _,p in pairs(rc) do
pth[#pth+1] = v4e[p].p
local morig,mscale = mrc[1],mrc[2] --{0,0},{1,1}
for _,n in pairs(v4e) do
av[#av+1] = n.p
-- table.remove(arc, 10)
for i,a in pairs(arc) do
local stamp = U.stamp(deepcopy(a))
if istest then U.dump(auv, '?? AF:'..#af..':'..#auv) end
for i,uv in pairs(auv) do
auv[i].v = -auv[i].v
end
for i,f in pairs(af) do
-- f.u = (f.u - istart + 1) % #auv -- U.mod(f.u+1 + istart,#auv)
local amdel = {}
for i,m in pairs(am) do
-- U.dump(m, '?? for_m:'.._)
local afdel = {}
for _,f in pairs(m.faces) do
if not f.u or not f.v or not f.n then
end
for j,d in pairs(m.uvs) do
if not d.u or not d.v then
local afpos = {}
for i,s in pairs(ahole) do
-- lo('??====== for_HOLE:'..i..':'..s.p.x..'/'..csstep)
local loop = {}
for _,p in pairs(s.list) do
-- lo('?? in_LOOP:'.._..':'..tostring(p)..':'..j..':'..istep)
-- }
for i,l in pairs(awloop) do
-- if i > 5 then break end
local av,d = {}
for i,v in pairs(mbody.verts) do
d = (v-pmi).x
local isvalid = true
for i,v in pairs(av) do
-- lo('?? lifting:'..i..' v.d:'..tonumber(v.d)..':'..csind..'/'..#adist..' ad[ci]:'..tonumber(adist[csind])..':'..N..':'..tostring(tonumber(v.d)>tonumber(adist[csind])))
-- U.dump(anorm, '?? v_vs_n:'..#mbody.verts..':'..#anorm)
for i,f in pairs(mbody.faces) do
f.n = f.v
-- local invalid
for i,l in pairs(aseq) do
local loop = U.map(l, function(k,v)
local aface,av = {},m.verts
for i,f in pairs(m.faces) do
aface[#aface+1] = {v=f.v+1,u=f.u+1,n=f.n+1,ae={}}
local function vnext(iv)
for i,iu in pairs(astar[iv]) do
if not U.index(acand,iu)[1] then
hit = false
for i,lst in pairs(astar) do
if #lst>0 then
-- clean stars
for j,u in pairs(astar[cv]) do
U.pop(astar[u],cv)
-- U.dump(abag, '?? aBAG:'..N)
-- for i,bag in pairs(abag) do
-- end
for i=1,#aface,3 do
for s,d in pairs(abag) do
if U.index(d, aface[i].v)[1] then
local bag4surf = {}
for i,f in pairs(m.faces) do
aface[#aface+1] = {v=f.v+1,u=f.u+1,n=f.n+1,ae={}}
local w4v,avert = {},{}
for i,v in pairs(m.verts) do
local s = U.v2stamp(v, 1)
local function vnext(iv)
for i,iu in pairs(astar[iv]) do
if not U.index(acand,iu)[1] then
hit = false
for i,lst in pairs(astar) do
if #lst>0 then
-- clean stars
for j,u in pairs(astar[cv]) do
U.pop(astar[u],cv)
-- U.dump(abag, '?? aBAG:'..N)
-- for i,bag in pairs(abag) do
-- end
for i=1,#aface,3 do
for s,d in pairs(abag) do
if U.index(d, aface[i].v)[1] then
local hit
for j,ind in pairs(set) do
for s,d in pairs(abag) do
for j,ind in pairs(set) do
for s,d in pairs(abag) do
if U.index(d, ind)[1] then
local n,cfi,ang = 0
for _,e in pairs(face.ae) do
if #dedge[e] == 1 then
--- if has boundary
for _,e in pairs(cf.ae) do
if #dedge[e] == 1 then
for i,b in pairs(fbag) do
-- for i=2,2 do
dedge = {}
for j,f in pairs(b) do
-- lo('?? in_BAG:'..i..':'..f)
-- look for boundary face
for k,af in pairs(dedge) do
-- lo('?? if_BOUND:'..k)
-- update adges
for _,e in pairs(face.ae) do
U.pop(dedge[e],f)
if not b.af then return end
for k,p in pairs(a.aiv) do
local dmi,imi,fmi,d = math.huge
-- pick b-face
for _,f in pairs(b.af) do
-- lo('?? for_AB:'..k..'>'.._..':'..tostring(p)..':'..tostring(f.p)..':'..tostring(f.vn))
local list = {}
for i,b in pairs(fbag) do
b.af = U.map(b.list,function(k,v)
-- pick a-vertex
for k,p in pairs(a.av) do
local dmi,imi,fmi,d = math.huge
-- pick b-face
for _,f in pairs(b.af) do
-- lo('?? for_AB:'..tostring(p)..':'..tostring(f.p)..':'..tostring(f.vn))
-- local am = {}
for i,m in pairs(am) do
local ds = nm == 1 and sma or sma*(i-(nm - 1)/2-1)
if M.out.agraph then
for _,g in pairs(M.out.agraph) do
Render.graph(g.list, g.c, g.w)
-- if true then return end
for _,s in pairs(M.out.aset) do
lo('?? to_SET:')
end
for _,o in pairs(M.out.atext) do
Render.label(o.list, o.c)
@/lua/vehicle/extensions/telemetryLogger.lua
local headers = "frame,"
for _, p in pairs(csvHeaders) do
headers = headers .. escapeCSV(p) .. ","
f:write(headers .. "\r\n")
for k, v in pairs(telemetryData) do
local s = k .. ","
local s = k .. ","
for _, p in pairs(csvHeaders) do
s = s .. escapeCSV(v[p]) .. ","
@/lua/vehicle/controller/controlModes.lua
local control = controlModes[M.controlModeIndex].electrics
for _, v in pairs(control) do
local config = configurations[v]
inputs = {}
for _, v in pairs(config) do
configurations[v.electric] = v
generator = function(entries)
for k, v in pairs(controlModes) do
local entry = {
@/lua/ge/extensions/flowgraph/nodes/ui/selectButtons.lua
function C:_executionStarted()
for _, p in pairs(self.pinOut) do
p.value = false
local strLinks = {}
for _, lnk in pairs(self.graph.links) do
if lnk.sourceNode == self then
local outPins = {}
for _, pn in pairs(self.pinOut) do
if tableContains(self.oldOptions, pn.name) then
end
for _, pn in pairs(outPins) do
self:removePin(pn)
local inPins = {}
for _, pn in pairs(self.pinInLocal) do
if tableContains(self.oldOptions, pn.name) then
end
for _, pn in pairs(inPins) do
self:removePin(pn)
function C:_executionStarted()
for _, p in pairs(self.pinOut) do
p.value = false
function C:buttonPushed(action)
for nm, pn in pairs(self.pinOut) do
self.pinOut[nm].value = nm == action
end
for _,pn in pairs(self.pinOut) do
pn.value = false
@/lua/ge/extensions/gameplay/missions/missions.lua
}
for _, att in pairs(additionalAttributes) do
att.valuesByKey = {}
local bonusStarKeysCache = {}
for key, act in pairs(mission.careerSetup.starsActive or {}) do
if act then
mission.careerSetup._activeStarCache.bonusStarCount = #bonusKeysSorted
for key, list in pairs(mission.careerSetup.starRewards) do
for _, reward in ipairs(list) do
mission.careerSetup._activeStarCache.sortedStarRewardsByKey = {}
for key, list in pairs(mission.careerSetup.starRewards) do
local newList = {}
-- update starRewards attributeKey for backwards compatibility
for _, list in pairs(missionData.careerSetup.starRewards) do
for _, reward in ipairs(list) do
-- sort starReward entries by attributeKey
for _, list in pairs(missionData.careerSetup.starRewards) do
-- only order if there's at least 2 elements
local isNonNumeric = false
for idx, key in pairs(missionData.careerSetup.defaultStarKeys) do
if type(idx) ~= "number" then
missionData.recommendedAttributes = {}
for k, v in pairs(missionData.recommendedAttributesKeyBasedCache or {}) do
if v then
if data.careerSetup.starRewards then
for key, list in pairs(data.careerSetup.starRewards) do
for _, reward in ipairs(list) do
local missionConstructor = require(customPath)() -- gets it as if it was a module, then merges all non-init pairs
for k, v in pairs(missionConstructor) do
if k ~= "init" then
local ret = {}
for _, mission in pairs(missionsById) do
if mission.missionType == type then
@/lua/ge/extensions/core/vehicleBridge.lua
if not M.vehicleData[vehId] then return end
for key, value in pairs(data) do
M.vehicleData[vehId].data[key] = value
@/lua/ge/extensions/flowgraph/nodes/gameplay/rally/countdownSynced.lua
-- set out pins according to flags and reset flags
for pName, val in pairs(self.flags) do
self.pinOut[pName].value = val
@/gameplay/missionTypes/dragStripAPM/constructor.lua
local vehiclesUsedPerStar = saveData.vehiclesUsedPerStar or {}
for star, achieved in pairs(attempt.unlockedStars or {}) do
if achieved then
@/lua/ge/extensions/editor/sitesEditor/parkingSpots.lua
if mouseInfo.down then
for idx, node in pairs(objects) do
local tmpSpotAmount = 1
local currScale = "Custom"
for name, vehScale in pairs(psVehScales) do
if self.current.scl == vehScale then
if im.BeginCombo("##psScaleSelect", currScale) then
for name, vehScale in pairs(psVehScales) do
if im.Selectable1(name) then
@/lua/ge/extensions/editor/gen/test.lua
local list = groupBat:getObjects()
for _,o in pairs(list) do
local om = scenetree.findObjectById(tonumber(o))
local list = fdata:getItems()
for _,f in pairs(list) do
editor.removeForestItem(fdata, f)
-- lo('??^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ onVal_gen_unique:'..tostring(pth)..':'..tableSize(amesh))
for i,s in pairs(list) do
-- lo('?? for_file:'..i..':'..s)
list = FS:findFiles(pth, '*.json', -1, true, false)
for i,s in pairs(list) do
FS:removeFile(s)
-- lo('?? onVal_gen_unique:'..tostring(pth)..':'..tableSize(amesh))
for i,s in pairs(list) do
-- lo('?? for_file:'..i..':'..s)
-- refresh static mmeshes
for _,o in pairs(list) do
local om = scenetree.findObjectById(tonumber(o))
if true then
for id,desc in pairs(adesc) do
houseUp(nil, id)
local ref = vec3(0,0,0)
for i,v in pairs(am[1].verts) do
local ang = U.vang(vec3(1,1,0),U.proj2D(v),true)
local stamp
for i,desc in pairs(adesc) do
desc.selection = {}
-- desc.selection[2] = {1,6} --{1,3,2}
for j,aw in pairs(desc.selection) do
if not desc.aspline then desc.aspline = {} end --{aij={}} end
for i,d in pairs(adesc) do
d.selection = {}
base = {}
for j,aw in pairs(d.selection) do
table.sort(aw)
local isvalid = true
for k,iw in pairs(aw) do
if k>1 and aw[k]-aw[k-1]>1 then
ref = vec3(0.0,0)
for i,b in pairs(base) do
base[i] = base[i]-ref
lo('?? if_frst:'..tostring(#list))
for _,o in pairs(list) do
lo('?? if_ctx:'..tostring(o:getContextID())) --..tostring(o.ctxid)..':'..tostring(o.contextID)) --o:getContextID())
lo('?? fdata:'..#list)
for _,f in pairs(list) do
-- lo('?? for_it:'..tostring(f:getPosition()))
-- {'b_22946.dae','b_22934.dae'}
for _, nm in pairs(list) do
if not scenetree.findObject(nm) then
local dirname = editor.getLevelPath()..'bat/'
for k,d in pairs(adesc) do
local pth = dirname..'emat_2s.dae' -- 'emat_'..d.id..'.dae'
if true then return end
for k,d in pairs(adesc) do
lo('?? for_DAE:'..k)
local dirname = editor.getLevelPath()..'bat/'
for k,d in pairs(adesc) do
lo('?? for_DESC:'..tostring(d.id))
lo('?? sdf:'..tostring(m.obj:getStaticDataFieldbyIndex(1, 1)))
for k,f in pairs(fields) do
lo('?? fof:'..tostring(k)..':'..tostring(f))
-- U.dump(m, '?? for_OBJ:')
-- for k,v in pairs(m.obj) do
-- lo('?? for_Key:'..tostring(k))
for i,desc in pairs(adesc) do
local ascan = W.buildingScan(desc, function(ascan)
lo('??+++++++++++++++ if_TST:'..tostring(tst))
for _,k in pairs(tst.kids) do
lo('?? for_TST_KID:'.._..':'..tostring(k.type))
-- U.dump(nd_maingeo)
-- for _,k in pairs(nodevs.kids) do
-- lo('?? for_KID:'.._..':'..tostring(k.name))
if false then
for _,d in pairs(adesc) do
W.buildingScan(d)
lo('?? for_node:'..tostring(xml))
-- for i,k in pairs(xml.kids) do
-- lo(k.name)
-- for _,d in pairs(data) do
if false then
-- lo('?? for_am:'..#adata)
for i,d in pairs(adata) do
-- set heights
local mat
for t,c in pairs({orange='1 0.5 0 1', green='0 1 0 1', blue='0 0 1 1',yellow='1 1 0 1'}) do
mat = createObject("Material")
local matFiles = FS:findFiles('/art/shapes/objects/', pref..'materials.json', -1, true, false)
for _,f in pairs(afile) do
matFiles[#matFiles+1] = f
-- local list = {}
for k,f in pairs(matFiles) do
lo('?? for_mat_FILE:'..tostring(f))
-- loadJsonMaterialsFile(v)
-- for _,f in pairs(afile) do
local desc = jsonReadFile(f)
if desc then
for k,v in pairs(desc) do
local ind = U.index(amat, k)[1]
local ref = base[1]
for _,b in pairs(base) do
av[#av+1] = b
local af = {}
for _,c in pairs(achunk) do
af = M.zip(c, af)
for _,e in pairs(out.fwhite) do
e[1] = e[1] + vec3(-265,1148,1)
if out.fyell then
for _,e in pairs(out.fyell) do
for i,n in pairs(e) do
for _,e in pairs(out.fyell) do
for i,n in pairs(e) do
e[i] = e[i] + vec3(-265,1148,1)
end
for _,e in pairs(out.flbl) do
e[1] = e[1] + vec3(-265,1148,1)
@/lua/ge/extensions/editor/vehicleEditor/liveEditor/veNodeTriSelfCollisionDetector.lua
for nodeId, tris in pairs(resultData.nodeTriPairs) do
local node = nodes[nodeId]
for triId, nodeTriData in pairs(tris) do
local tri = triangles[triId]
for k,v in pairs(vdata) do
if type(v) == 'table' then
@/lua/vehicle/controller/esc.lua
table.clear(allWheelSlips)
for k, v in pairs(throttleFactorData) do
throttleFactors[k] = v.throttleFactor
end
for k, v in pairs(throttleFactorData) do
v.integral = 0
end
for k, v in pairs(throttleFactorData) do
v.integral = 0
for _, v in pairs(throttleFactorData) do
v.lastSlip = v.peakSlip
end
for _, v in pairs(throttleFactorData) do
v.integral = 0
local maxUsefulThrottleIntegral = (1 - currentESCConfiguration.minThrottleFactor) / currentESCConfiguration.throttleIntegralFactor
for k, v in pairs(throttleFactorData) do
local doUseTCS = (tcsThrottleMode == "reduce" and v.allWheelSlip > 0) and v.tcsActive
generator = function(entries)
for k, v in pairs(escConfigurations) do
local entry = {
local totalMass = 0
for _, v in pairs(v.data.nodes) do
tmp = tmp + vec3(v.pos) * v.nodeWeight
local twRight = 0
for _, n in pairs(v.data.nodes) do
if n.cid == wheelCache[frontRightWheelId].node1 then
for id, wd in pairs(wheels.wheels) do
if actionedWheelLookup[wd.name] then
throttleFactorData = {}
for _, v in pairs(throttleFactorAssingment) do
throttleFactorWheelLookup[v.wheelName] = v.throttleFactorName
wheelIdCache = {}
for k, _ in pairs(wheelCache) do
table.insert(wheelIdCache, k)
local tmpConfigs = {}
for name, config in pairs(escConfigs.configurations) do
if type(config) == "table" and config.escConfigurationEnabled then
)
for _, config in pairs(tmpConfigs) do
escConfigurations[counter] = config
for _, config in pairs(escConfigurations) do
if type(config) == "table" and config.escConfigurationEnabled and config.characteristicSpeed <= 0 then --calculate char. speed if no override is provided
if escConfigs.blacklistedEngines and type(escConfigs.blacklistedEngines) == "table" then
for _, v in pairs(escConfigs.blacklistedEngines) do
blacklistedEngines[v] = true
revLimiterEngines = {}
for _, v in pairs(engines) do
--make sure the device supports temp rev limiters, otherwise we'll just run into issues
@/lua/ge/extensions/flowgraph/nodes/vehicle/randomConfigProvider.lua
}
for _, c in pairs(v.configs) do
if c["Top Speed"] and c["Top Speed"] > 10 then
@/lua/ge/extensions/flowgraph/pin.lua
function C:highlightLinks()
for i, lnk in pairs(self.links) do
lnk._highlight = true
@/lua/ge/extensions/editor/tech/roadArchitect/export.lua
local widthCubics = {}
for key, _ in pairs(laneKeys) do
local k = laneKeys[key]
local laneHOffsets = {}
for key, _ in pairs(laneKeys) do
local k = laneKeys[key]
@/lua/vehicle/controller/drivingDynamics/supervisors/components/motorTorqueControl.lua
for k, v in pairs(wheelGroupControlData) do
debugPacket.wheelGroups[k] = debugPacket.wheelGroups[k] or {}
if controlParameters.tractionControl then
for k, v in pairs(controlParameters.tractionControl.wheelGroupSettings) do
debugPacket.tractionControl.wheelGroupControl[k] = debugPacket.tractionControl.wheelGroupControl[k] or {}
if controlParameters.tractionControl then
for k, _ in pairs(controlParameters.tractionControl.wheelGroupSettings) do
wheelGroupControlData[k].tractionControlPID:reset()
if controlParameters.tractionControl then
for k, v in pairs(controlParameters.tractionControl.wheelGroupSettings) do
wheelGroupControlData[k].slipThreshold = v.slipThreshold
for _, setting in pairs(jbeamPIDSettings) do
controlParameters.yawControl.PIDSettings[setting.type] = {
controlParameters.yawControl.controlledMotorNames = {}
for _, v in pairs(yawControlledMotors) do
relevantMotorNames[v] = true
for k, _ in pairs(relevantMotorNames) do
table.insert(controlledMotors, k)
for k, _ in pairs(wheelGroupControlData) do
CMU.applyParameter(controlParameters, initialControlParameters, parameters, "tractionControl.wheelGroupSettings." .. k .. ".kP")
@/lua/ge/extensions/util/trackBuilder/segmentToProceduralMesh.lua
local meshes = {}
for _,m in pairs(basicBorders.getMeshes(segment)) do meshes[#meshes+1] = m end
for _,m in pairs(basicCenters.getMeshes(segment)) do meshes[#meshes+1] = m end
for _,m in pairs(basicBorders.getMeshes(segment)) do meshes[#meshes+1] = m end
for _,m in pairs(basicCenters.getMeshes(segment)) do meshes[#meshes+1] = m end
for _,m in pairs(borderWall.getMeshes(segment)) do meshes[#meshes+1] = m end
for _,m in pairs(basicCenters.getMeshes(segment)) do meshes[#meshes+1] = m end
for _,m in pairs(borderWall.getMeshes(segment)) do meshes[#meshes+1] = m end
for _,m in pairs(ceilingMesh.getMeshes(segment)) do meshes[#meshes+1] = m end
for _,m in pairs(borderWall.getMeshes(segment)) do meshes[#meshes+1] = m end
for _,m in pairs(ceilingMesh.getMeshes(segment)) do meshes[#meshes+1] = m end
@/lua/vehicle/controller/propAnimation/singleAxisLever.lua
minExistingGearCoordinateIndex = 0
for _, coordinate in pairs(gearCoordinateTable) do
gearCoordinates[coordinate.gearIndex] = coordinate.value
@/lua/ge/extensions/ui/gameplaySelector/tileClustering.lua
for _itemKey, item in pairs(clusteredItems.itemsByKey) do
local favouriteIdx = backend.isFavourite(item.key) or 0
for _, item in pairs(clusteredItems.itemsByKey) do
if item.type ~= "Freeroam Spawnpoint" then
for _, item in pairs(clusteredItems.itemsByKey) do
if firstMissionTypeLabel == nil and item.missionTypeLabel then
local itemsList = {}
for _, item in pairs(clusteredItems.itemsByKey) do
table.insert(itemsList, item)
local sourceIconsLookup = {}
for _, item in pairs(clusteredItems.itemsByKey) do
for _, source in pairs(item.sourceIcons or {}) do
for _, item in pairs(clusteredItems.itemsByKey) do
for _, source in pairs(item.sourceIcons or {}) do
sourceIconsLookup[source.icon or source.svg] = true
local sourceIcons = {}
for source, active in pairs(sourceIconsLookup) do
if string.endswith(source, ".svg") then
local sourceIconsWithOrder, sourceIconsWithoutOrder = {}, {}
for _, sourceIcon in pairs(sourceIcons) do
if sourceIconsOrder[sourceIcon.icon or sourceIcon.svg] then
local auxiliarySum = true
for _, item in pairs(clusteredItems.itemsByKey) do
auxiliarySum = auxiliarySum and item.isAuxiliary
for _, item in pairs(items) do
local group = clusterModeFunctions[clusterMode](item) or "Other..."
@/lua/ge/extensions/tech/openDriveExporter.lua
coords2d = {}
for k, p in pairs(coords3d) do
coords2d[k] = vec3(p.x, p.y, 0.0)
local ctr = 0
for k, v in pairs(table) do
if type(v) == 'table' then
local function doesCollectionContainSegment(collection, testSeg)
for k, trialSeg in pairs(collection) do
local matches = 0
local matches = 0
for k1, v1 in pairs(trialSeg) do
for k2, v2 in pairs(testSeg) do
for k1, v1 in pairs(trialSeg) do
for k2, v2 in pairs(testSeg) do
if v1 == v2 then
local function doesSegmentContainKey(currentPath, nextSuccessorKey)
for k, v in pairs(currentPath) do
if v == nextSuccessorKey then
local keys = {}
for key in pairs(tbl) do
table.insert(keys, key)
local ctr = 1
for headKey, v1 in pairs(graph) do
local firstChildren = getChildren(graph[headKey])
-- Remove condition that filtered out nodes with 2 children
for childKey, v2 in pairs(successors) do
local currentPath = {}
local allSuccessorsVisited = true
for nextSuccessorKey, _ in pairs(nextSuccessors) do
if not doesSegmentContainKey(currentPath, nextSuccessorKey) then
local didFind = false
for nextSuccessorKey, v3 in pairs(nextSuccessors) do
if doesSegmentContainKey(currentPath, nextSuccessorKey) == false then
local avgWidths = {}
for k, seg in pairs(pathSegments) do
local subTotal = 0.0
local ctr = 0
for i, key in pairs(seg) do
subTotal = subTotal + widths[key]
local ctr = 1
for i, v in pairs(pathSegments) do
-- Use the sorted iteration map to choose the segment processing order here.
local ctr = 0
for i, seg in pairs(pathSegments) do
-- Test if the path segment's first node is a true junction (no dead ends). Only add if we haven't already found it previously.
local function updateConnectivityData()
for k, r in pairs(roads) do
local predecessor = 'none'
for j, r2 in pairs(roads) do
if k ~= j and r['start'] == r2['finish'] then
local successor = 'none'
for j, r2 in pairs(roads) do
if k ~= j and r['finish'] == r2['start'] then
local jCtr = 1
for key, id in pairs(junctionMap) do
local connectionRoads = {}
local ctr = 1
for rid, r in pairs(roads) do
if key == r['start'] then
-- Write the road data.
for rid, r in pairs(roads) do
-- Write the junction data, in order.
for jid, j in pairs(junctions) do
f:write('\n')
local ctr = 0
for i1, ra in pairs(j['connectionRoads']) do
for i2, rb in pairs(j['connectionRoads']) do
for i1, ra in pairs(j['connectionRoads']) do
for i2, rb in pairs(j['connectionRoads']) do
if i1 ~= i2 then
@/lua/ge/extensions/editor/missionEditor/startTrigger.lua
local startTriggersSorted = {}
for k, _ in pairs(startTriggerTypes) do table.insert(startTriggersSorted, k) end
table.sort(startTriggersSorted)
@/lua/vehicle/ai.lua
local avgWheelNodePos, numOfWheels = vec3(), 0
for _, wheel in pairs(wheels.wheels) do
-- obj:getNodePosition is the pos vector of query node (wheel.node1) relative to ref node in world coordinates
local avgBackWheelPos, backWheelCount = vec3(), 0
for _, wheel in pairs(wheels.wheels) do
local wheelPos = obj:getNodePosition(wheel.node1)
else
for k, v in pairs(mapmgr.objects) do
if k ~= objectId then
else
for k, v in pairs(mapmgr.objects) do
if k ~= objectId and v.active == true then
local i = 0
for id in pairs(mapmgr.getObjects()) do
if id ~= objectId then
local outEdgeDir, maxOutflow, minNode = vec3(), 0, nil
for k, v in pairs(mapData.graph[wp2]) do
if k ~= wp1 then
for nodeId, edgeData in pairs(graph[newNode.id]) do
if nodeId ~= newNode.nextNodeInPath and nodeId ~= prevNodeInPath then -- and not mapmgr.signalsData.nodes[newNode.id]
local nextPosibleNode = nil
for k, v in pairs(graph[newNode.id]) do
if k ~= newNode.prevNodeInPath then
table.clear(traffic.trafficTable)
for plID, v in pairs(mapmgr.getObjects()) do
if plID ~= objectId and (M.mode ~= 'chase' or plID ~= player.id or internalState.chaseData.playerState == 'stopped') then
for plID, v in pairs(mapmgr.getObjects()) do
if plID ~= objectId and (M.mode ~= 'chase' or plID ~= player.id or internalState.chaseData.playerState == 'stopped') then
edgeDict = {}
for nid, n in pairs(mapData.graph) do
if currentSCC[nid] or not opt.driveInLaneFlag then
if currentSCC[nid] or not opt.driveInLaneFlag then
for lid, data in pairs(n) do
if (currentSCC[lid] or not opt.driveInLaneFlag) and (data.drivability > cutOffDrivability) then
for plID, v in pairs(mapmgr.getObjects()) do
if plID ~= objectId and v.states then
-- Check if there's a vehicle next to this one
for otherID, v in pairs(mapmgr.getObjects()) do
if otherID ~= objectId and v.pos and otherID ~= trafficStates.action.nearestPoliceId and v.dirVec and v.dirVec:dot(ego.dirVec) < 0 then
if not giveWay and drivability < 1 then
for _, edgeData in pairs(mapData.graph[nid1]) do
if edgeData.drivability > drivability then
if prevNode and tableSize(mapData.graph[nid1]) == 3 then
for k, v in pairs(mapData.graph[nid1]) do
if k ~= prevNode and k ~= nid2 then
local distToJcenter = tSi.turnNode and ego.pos:distance(mapData.positions[tSi.turnNode]) or 1
for vId, v in pairs(mapmgr.getObjects()) do
if vId ~= objectId then
-- get most distant non walked edge
for k, v in pairs(edgeDict) do
if v <= lim then
local nodeDegree = 1
for lid, _ in pairs(mapData.graph[target]) do
-- we're looking for neighboring nodes other than the targetLink
for vehId in pairs(mapmgr.getObjects()) do
if vehId ~= objectId then
for _, d in pairs(visDebug.debugSpots) do
debugDrawer:drawSphere(0.2, d[1], d[2])
if dt then
for k, v in pairs(mapmgr.getObjects()) do
if k ~= objectId then
debugDrawer:drawSphere(0.1, refNodePos, color(255,0,0,255))
for _, wheel in pairs(wheels.wheels) do
local wheelRadius = wheel.radius
@/lua/common/libs/LuaIRC/asyncoperations.lua
if not b then
for k,v in pairs(self.channels) do
self.channels[k] = nil
@/lua/ge/extensions/flowgraph/modules/buttonModule.lua
local data = { }
for id, btn in pairs(self.buttons) do
if btn.active.value then
self.buttonsChanged = nil
for id, btn in pairs(self.buttons) do
self.variables:change(id.."clicked", false)
@/lua/ge/extensions/editor/flowgraph/missionVariableHelper.lua
local notFound = 0
for name, value in pairs(missionTypeData) do
if mgr.variables:variableExists(name) then
@/lua/ge/extensions/core/paths.lua
local namesCounter = {}
for _, filename in pairs(camPathFiles) do
local path = loadPath(filename)
@/lua/common/extensions/ui/flowgraph/editor.lua
local types = {}
for type, color in pairs(typeColors) do
types[type] = { ['color'] = color }
-- some style setup
for g, info in pairs(graphTypes) do
info.tabColor = info.tabColor or lerpVec4(info.color, im.ImVec4(1, 1, 1, 1), 0.4)
local sortedConfigs = { }
for k, v in pairs(self.configs) do
table.insert(sortedConfigs, { key = k, value = v })
local sortedConfigs = { }
for k, v in pairs(self.configs) do
table.insert(sortedConfigs, { key = k, value = v })
local sortedConfigs = { }
for k, v in pairs(self.configs) do
table.insert(sortedConfigs, { key = k, value = v })
for mIdx, m in ipairs(self.models) do
for cIdx, c in pairs(core_vehicles.getModel(m.key).configs) do
vehSearch:queryElement({
local sortedConfigs = { }
for k, v in pairs(self.configs) do
table.insert(sortedConfigs, { key = k, value = v })
@/lua/ge/extensions/freeroam/specialTriggers.lua
for k, _ in pairs(triggers[key].objects) do
if scenetree.findObject(k) then
for k, v in pairs(triggers[key].objects) do
local obj = scenetree.findObject(k)
triggers[key].objects = {}
for k, v in pairs(data.objects) do
triggers[key].objects[k] = {
if useOrigState then
for k, v in pairs(triggers) do
removeTrigger(k, useOrigState)
for k, v in pairs(data) do
addTrigger(k, v)
if not active then
for _, vState in pairs(trigger.vehIds) do
if vState then
if trigger.objects then
for _, objData in pairs(trigger.objects) do
objData.timer = 0
for k, v in pairs(triggers) do
if v.type == 'zone' and zones.byName[k] and not v.vehIds[0] then -- veh id of 0 blocks detection
for k, v in pairs(triggers) do
if v.vehIds and isVehicleValid(k, newId) then
for k, v in pairs(triggers) do
if v.vehIds then
local zoneExists = false
for k, v in pairs(triggers) do
if v.type == 'zone' then
if v.objects then
for name, data in pairs(v.objects) do
local obj = scenetree.objectExists(name)
@/lua/ge/extensions/c2/panelPlugins/vehicleManager.lua
local needAll = false
for _, sub in pairs(subscribers) do
if sub.all then
local vehicles = getAllVehicles()
for _, veh in pairs(vehicles) do
table.insert(vehicleData, getVehicleData(veh))
-- Only fetch specific IDs
for _, sub in pairs(subscribers) do
if sub.vid then
-- Send appropriate data to each subscriber
for peerId, sub in pairs(subscribers) do
local dataToSend = {}
@/lua/vehicle/extensions/tech/powertrainSensor.lua
local function updateGFX(dtSim)
for sensorId, _ in pairs(powertrains) do
updatePowertrainGFXStep(dtSim, sensorId, false, nil)
local function onVehicleDestroyed(vid)
for sensorId, _ in pairs(powertrains) do
if vid == objectId then
@/lua/ge/extensions/editor/scriptAIEditor.lua
local out = {}
for id, tr in pairs(trajectories) do
out[id] = ptr2ValTraj(tr)
table.clear(trajectories)
for id, tr in pairs(data) do
trajectories[id] = val2PtrTraj(tr)
local function detachTrajectory(str)
for k, tr in pairs(trajectories) do
if tr.vehicle == str then
local polyLinesToExecute = {} -- First, format all the trajectories so they can be run by the scriptAI backend.
for k, tr in pairs(trajectories) do
if tr.vehicle ~= "" and tr.vid ~= nil then
end
for vid, p in pairs(polyLinesToExecute) do -- Execute all the vehicle trajectories using the scriptAI backend.
scenetree.findObject(vid):queueLuaCommand('ai.startFollowing(' .. serialize(p) .. ')')
local function stopExecute()
for k, tr in pairs(trajectories) do -- Stop executing all the vehicle scripts.
local vid = tr.vid
local vehicles, numTrajectories, numVehicles = data.vehicles, 0, 0 -- Compute valid starting positions for all the vehicles which are to be spawned.
for k, tr in pairs(trajectories) do
numTrajectories = numTrajectories + 1
end
for k, tr in pairs(vehicles) do
numVehicles = numVehicles + 1
local ctr = 1
for k, tr in pairs(trajectories) do
local polyLine = tr.polyLine
local ctr = 1 -- Spawn all the vehicles which are required.
for k, data in pairs(vehicles) do
local _ = core_vehicles.spawnNewVehicle(data.jBeam, { pos = spawnPositions[ctr], config = data.config })
local alreadyAttachedVehicles = {}
for id, tr in pairs(trajectories) do
local vehicle = tr.vehicle
end
for k, v in pairs(d.ratios) do -- Project each time position to the mouse-controlled interval.
if k ~= lLock and k ~= uLock then
local isHovered = false
for k, tr in pairs(trajectories) do
local boxData = tr.boxData
local dClosest, trClosest, nClosest = 1e30, nil, nil
for id, tr in pairs(trajectories) do
if tr.isDisplay[0] == true then
-- Iterate over the full array of trajectories and ignore those which are not marked for display.
for k, tr in pairs(trajectories) do
local c = tr.col
local numTrajectories = 0
for k, tr in pairs(trajectories) do
numTrajectories = numTrajectories + 1
toolWinData.tStart, toolWinData.tEnd = 0.0, 0.0
for k, tr in pairs(trajectories) do
local polyLine = getPolyRef(tr)
if editor.uiIconImageButton(editor.icons.watch_later, im.ImVec2(28, 28), nil, nil, nil, 'normalizeTrajectory') then
for k, tr in pairs(trajectories) do
local poly = getPolyRef(tr)
local vehicleAttachState = "[not attached]"
for k, tr in pairs(trajectories) do
if tr.vehicle ~= nil and tr.vehicle == vehicle.string then
table.remove(sceneVehicles, i)
for tIdx, tr in pairs(trajectories) do
if tr.vid == selectedVehicle.vid then
local idx = nil
for k, tr in pairs(trajectories) do
if vehicle.vid == tr.vid then
if im.BeginListBox("", im.ImVec2(170, 180), im.WindowFlags_ChildWindow) then
for k, tr in pairs(trajectories) do
im.Columns(3, "columns3", false)
local numTrajectories = 0
for k, tr in pairs(trajectories) do
numTrajectories = numTrajectories + 1
end
for k, tr in pairs(trajectories) do
if tr.vid == vid then
@/lua/common/extensions/ui/imguiUtils.lua
if imgui.BeginPopup(label) then
for k, item in pairs(items) do
local lbl = item.label .. "###" .. label .. tostring(k)
if imgui.BeginPopup(label) then
for k, item in pairs(items) do
local curX = imgui.GetCursorPosX()
if imgui.BeginPopup(label.."rmb") then
for k, item in pairs(itemsRMB) do
if imgui.SmallButton(item.label.."##") then
if imgui.BeginPopup(label) then
for k, item in pairs(items) do
if excludeCurrent then
if tbl then
for k,v in pairs(tbl) do
if type(v) ~= 'table' then
local tableType = 0
for _, tv in pairs(t) do
if type(tv) == 'table' then
local sortedKeys = {}
for k in pairs(t) do table.insert(sortedKeys, k) end
table.sort(sortedKeys)
@/lua/ge/extensions/gameplay/traffic/vehicle.lua
function C:checkCollisions() -- checks for contact with other tracked vehicles
for id, veh in pairs(map.objects) do
if self.id ~= id then
for otherId, otherVeh in pairs(gameplay_traffic.getTrafficData()) do -- notify other traffic vehicles of collision
if not otherVeh.otherCollisionFlag and otherId ~= self.id and otherId ~= id then
for id, coll in pairs(self.collisions) do
local veh = gameplay_traffic.getTrafficData()[id]
for id, veh in pairs(gameplay_traffic.getTrafficData()) do
if id ~= self.id then
for id, _ in pairs(self.collisions) do
self:trackCollision(id, dtSim)
-- queued functions
for k, v in pairs(self.queuedFuncs) do
if not v.timer then v.timer = 0 end
@/lua/vehicle/extensions/scenario/shiftBooster.lua
--[[
for _, node in pairs(v.data.nodes) do
print("node = " .. tostring(node.cid) .. ' > ' .. tostring(forceVec))
@/lua/ge/extensions/editor/flowgraph/nodelibrary.lua
function C:hasFoldersOnly(dir)
for k,v in pairs(dir) do
if type(v) == 'table' then
local sorted = {}
for dir, v in pairs(self.filteredTemplates) do if not v.isEmpty then table.insert(sorted,dir) end end
table.sort(sorted)
if im.TreeNodeEx1("Project Variables") then
for _, nm in pairs(self.mgr.variables.sortedVariableNames) do
local var = self.mgr.variables:getFull(nm)
if im.TreeNodeEx1("Graph Variables") then
for _, nm in pairs(self.mgr.graph.variables.sortedVariableNames) do
local var = self.mgr.graph.variables:getFull(nm)
self:refreshMacro()
for mn,data in pairs(self.filteredMacro) do
self:displayMacro(mn,data,menuPos)
if parent then
for _, nd in pairs(parent.nodes) do
if nd:representsGraph() and nd:representsGraph().id == self.mgr.graph.id then
if nd:representsGraph() and nd:representsGraph().id == self.mgr.graph.id then
for _, pin in pairs(nd.pinOut) do
table.insert(exits, pin.name)
local sorted = {}
for dir, v in pairs(self.filteredTemplates) do if not v.isEmpty then table.insert(sorted,dir) end end
table.sort(sorted)
local _, flat = core_flowgraphManager.getAvailableNodeTemplates()
for path, info in pairs(flat) do
if not info.node.hidden and self:pinsFilter(info) and (editor.getPreference("flowgraph.general.showObsoleteNodes") or not info.node.obsolete) then
function C:findVar(source, sourceName, sourceNameTag)
for _, nm in pairs(source.sortedVariableNames) do
local var = source:getFull(nm)
local _, flat = core_flowgraphManager.getAvailableStateTemplates()
for path, info in pairs(flat) do
self.search:queryElement({
if parent then
for _, nd in pairs(parent.nodes) do
if nd:representsGraph() and nd:representsGraph().id == self.mgr.graph.id then
if nd:representsGraph() and nd:representsGraph().id == self.mgr.graph.id then
for _, pin in pairs(nd.pinOut) do
table.insert(exits, pin.name)
for k,v in pairs(dir) do
if k == mode then
if k == mode then
for nName, nVal in pairs(v) do
local passedNameFilter = true--self:namesFilter(nVal, mode)
local dirs = {}
for n, d in pairs(dir) do
if n ~= mode then
local res = nil
for k,v in pairs(dir) do
local passedNameFilter = true--self:macroNameFilter(k)
self.stateTemplatesSorted = {}
for name, s in pairs(self.stateTemplates) do
table.insert(self.stateTemplatesSorted, name)
self.filteredFolders = {}
for k,v in pairs(templates) do
local nd = self:filterNodes(v, filterPins, mode)
end
for name, dir in pairs(self.filteredTemplates) do
if name ~= mode then
-- display subfolder tree nodes
for dirName, dirVal in pairs(dir) do
if dirName ~= elementFieldName and dirName ~= 'isEmpty' then
if dir[elementFieldName] then
for elemName, elem in pairs(dir[elementFieldName]) do
elementFunction(self, dir, menuPos, elemName, elem)
local p = nil
for _, pin in pairs(node.pinOut) do
p = pin
local availablePins = {}
for _, pin in pairs(n.pinInLocal) do
if self.mgr.graph:canCreateLink(self.newNodeLinkPin, pin) then
local availablePins = {}
for _, pin in pairs(n.pinOut) do
if self.mgr.graph:canCreateLink(pin, self.newNodeLinkPin) then
local pins = {names = {}, pins = {}}
for dir, list in pairs(self.mgr:getAvailableNodeTemplates()) do
self:recursiveGetTags(list, tags, pins)
table.insert(libtxt, header)
for dir, list in pairs(self.mgr:getAvailableNodeTemplates()) do
self:printDir(list, dir, tags, libtxt)
for nName, node in pairs(dir.nodes) do
local vals = {}
end
for dName, dir in pairs(dir) do
if dName ~= 'nodes' then
function C:recursiveGetTags(dir, list, pins)
for dName, c in pairs(dir) do
if dName ~= 'nodes' then
end
for nName, node in pairs(dir.nodes) do
-- manage Tags
-- manage Tags
for _, tag in pairs(node.node.tags or {} ) do
if arrayFindValueIndex(list, tag) == false then
@/lua/ge/extensions/flowgraph/nodes/ui/updatedUI/endScreenBegin.lua
function C:_executionStarted()
for _, p in pairs(self.pinOut) do
p.value = false
local strLinks = {}
for _, lnk in pairs(self.graph.links) do
if lnk.sourceNode == self and tableContains(self.oldOptions, lnk.sourcePin.name) then
local outPins = {}
for _, pn in pairs(self.pinOut) do
if tableContains(self.oldOptions, pn.name) then
end
for _, pn in pairs(outPins) do
self:removePin(pn)
local inPins = {}
for _, pn in pairs(self.pinInLocal) do
local contained = false
end
for _, pn in pairs(inPins) do
self:removePin(pn)
function C:buttonPushed(action)
for nm, pn in pairs(self.pinOut) do
if nm == action then
canPayFee = true
for key, value in pairs(entryFee) do
hasEntryFee = hasEntryFee or value > 0
function C:onNodeReset()
for _,pn in pairs(self.pinOut) do
pn.value = false
@/lua/ge/extensions/editor/vehicleEditor/liveEditor/veJBeamPicker.lua
local function renderPickedJBeamObjs()
for k, node in pairs(pickedNodes) do
local nodeID = node.cid
for k, beam in pairs(pickedBeams) do
local dispText = getBeamDisplayText(beam)
if im.BeginCombo("##beamTypesCombobox", "Set beam types to pick...", im.ComboFlags_HeightLarge) then
for k, enabled in pairs(beamTypesRendering) do
local beamType = beamTypesNames[k]
-- Populate beamTypesRendering table
for k,v in pairs(beamTypesNames) do
beamTypesRendering[k] = im.BoolPtr(true)
@/lua/common/jbeam/optimization.lua
end
for k, v in pairs(vehicle.beams) do
if type(v) == "table" and type(v.id1) == "number" and type(v.id2) == "number" and v.id1 > v.id2 then
-- recurse
for k, v in pairs(d) do
if type(v) == 'string' and v == '' and k ~= 'mesh' then -- 'mesh' is a hack to prevent from cleaning flexbody.mesh values. Backward compatibility
if vehicle.nodes then
for _, n in pairs(vehicle.nodes) do
if n.collision == true then n.collision = nil end -- the default
if vehicle.beams then
for _, b in pairs(vehicle.beams) do
if b.beamType == 0 then b.beamType = nil end -- the default
if vehicle.triangles then
for _, t in pairs(vehicle.triangles) do
t.cid = nil
if vehicle.hydros then
for _, hydro in pairs(vehicle.hydros) do
hydro.beamCID = hydro.beam.cid
if vehicle.wheels then
for _, wheel in pairs(vehicle.wheels) do
if wheel.sideBeams then
if wheel.sideBeams then
for k, b in pairs(wheel.sideBeams) do
wheel.sideBeams[k] = b.cid
if wheel.rimBeams then
for k, b in pairs(wheel.rimBeams) do
wheel.rimBeams[k] = b.cid
if wheel.peripheryBeams then
for k, b in pairs(wheel.peripheryBeams) do
wheel.peripheryBeams[k] = b.cid
if wheel.treadBeams then
for k, b in pairs(wheel.treadBeams) do
wheel.treadBeams[k] = b.cid
if wheel.reinfBeams then
for k, b in pairs(wheel.reinfBeams) do
wheel.reinfBeams[k] = b.cid
if wheel.pressuredBeams then
for k, b in pairs(wheel.pressuredBeams) do
wheel.pressuredBeams[k] = b.cid
if wheel.treadNodes then
for k, tn in pairs(wheel.treadNodes) do
wheel.treadNodes[k] = tn.cid
if wheel.nodes then
for k, tn in pairs(wheel.nodes) do
wheel.nodes[k] = type(tn) == 'table' and tn.cid or tn
-- removing disabled sections
for keyEntry, entry in pairs(vehicle) do
if type(entry) == "table" and tableIsDict(entry) and jbeamUtils.ignoreSections[keyEntry] == nil and tableIsDict(entry[0]) and entry[0]['disableSection'] ~= nil then
@/inspector/Models/Cookie.js
// Set-Cookie: = ( ";" SP )*?
// NOTE: Some attributes can have pairs (e.g. "Path=/"), some are only a
// single word (e.g. "Secure").
@/lua/vehicle/controller/gauges/analogOdometer.lua
--dump(configData)
for k, v in pairs(jbeamData) do
if k:sub(1, #"configuration_") == "configuration_" then
@/lua/ge/extensions/flowgraph/nodes/activity/getProgress.lua
for key, val in pairs(aggregate) do
if self.pinOut[key] then
@/lua/ge/extensions/career/modules/delivery/generator.lua
local validAps = {}
for name, ap in pairs(accessPointsByName) do
if ap[typeLookupKey] and ap[typeLookupKey][logisticType] then
log("E","","Could not find any access point with logisticType " .. logisticType .. " in this list via " .. typeLookupKey)
for name, ap in pairs(accessPointsByName) do
print(name .. " -> " .. dumps(ap[typeLookupKey]))
for _,file in ipairs(files) do
for k, v in pairs(jsonReadFile(file) or {}) do
local item = v
if f.logisticTypesReceivedLookup[template.logisticType] then
for name, ap in pairs(f.accessPointsByName) do
if ap.logisticTypesReceivedLookup[template.logisticType] then
for _,file in ipairs(files) do
for id, filter in pairs(jsonReadFile(file) or {}) do
filter.id = id
for _,file in ipairs(files) do
for id, data in pairs(jsonReadFile(file) or {}) do
data.id = id
local facLocation = {type = "facilityParkingspot", facId = fac.id, psPath = fac.dropOffSpots[1]:getPath()}
for materialType, storage in pairs(fac.materialStorages) do
if storage.isReceiver then
local facLocation = {type = "facilityParkingspot", facId = fac.id, psPath = fac.pickUpS pots[1]:getPath()}
for materialType, storage in pairs(fac.materialStorages) do
if storage.isProvider then
--dump(fac.logisticTypeLookup)
for key, _ in pairs(generator.logisticTypesLookup) do
match = match or item.logisticType == key
--local systems = generatorToSystem[generator.type](generator)
--for sys, _ in pairs(systems) do
-- fac[dir][sys] = true
for name, ap in pairs(accessPointsByName) do
ap.name = name
allTypes[type] = true
for sys, en in pairs(logisticTypeToSystem(type, fac)) do
if en then
allTypes[type] = true
for sys, en in pairs(logisticTypeToSystem(type, fac)) do
if en then
@/lua/ge/extensions/util/trackBuilder/splineTrack.lua
copy = {}
for orig_key, orig_value in pairs(orig) do
copy[orig_key] = orig_value
if segment.noPoints then return end
for name, index in pairs(segment.submeshIndexes) do
segment.mesh:setMaterial(index, segment.selected and 'track_editor_grid' or segment.materialInfo[name])
pieces[index].materialInfo = {}
for key, val in pairs(pieceBefore.materialInfo) do
pieces[index].materialInfo[key] = val
end
for key, val in pairs(p.materialInfo) do
if not export.materials[s] then export.materials[s] = {} end
for s,subMats in ipairs(import.materials) do
for field, mats in pairs(subMats) do
for mat, list in pairs(mats) do
for field, mats in pairs(subMats) do
for mat, list in pairs(mats) do
for _, index in pairs(list) do
for mat, list in pairs(mats) do
for _, index in pairs(list) do
subPieces[s][index].materialInfo[field] = mat
@/lua/ge/extensions/gameplay/crashTest/scenarioManager.lua
local objects = {}
for objId, _ in pairs(map.objects) do
local object = getObjectByID(objId)
local playerWasInvolved = false
for vehId, _ in pairs(crashEndData.sanitizedData.touchedVehIds) do
if vehId == currentStepParameters.plVehId then
@/lua/ge/extensions/editor/perfProfiler.lua
-- self.search:setSameScoreResolvingFunction(sortFun)
for idx, col in pairs(columns) do
search:queryElement({
for _, group in ipairs({"osInfo","cpuInfo","gpuInfo","buildInfo","settingsInfo"}) do
for key, _ in pairs(allFiles[1][group]) do
table.insert(columns, {keys = {group, key}, enabled = false})
@/lua/ge/extensions/editor/aiViz.lua
local res
for nid, _ in pairs(nodes) do
if distances[nid] < min or not res then
-- remove all nodes that are too far away
for otherNid, data in pairs(mapNodes) do
if data.pos:squaredDistance(node.pos) > square(maxConnectionRenderDistance) then
-- remove the links
for otherNid2, _ in pairs(data.links) do
if nodesToCheck[otherNid2] then
for neighbor, otherLinkData in pairs(nextNodeData.links) do
if nodesToCheck[neighbor] and otherLinkData.inNode == nextNid then
-- Add distances to the links that are close enough, but not on any shortest route from any node
for otherNid, data in pairs(mapNodes) do
if distancesOfLinks[otherNid] then
if distancesOfLinks[otherNid] then
for neighbor, linkData in pairs(data.links) do
if distancesOfLinks[neighbor] and not distancesOfLinks[otherNid][neighbor] then
-- map.nodes is single sided i.e. edge between nodes a, b is either in map.nodes[a].links[b] or map.nodes[b].links[a] but not both
for lid, data in pairs(n.links) do
if mapNodes[lid] then
if mapNodes then
for nid, n in pairs(mapNodes) do
local nPos = n.pos
for otherNid, link in pairs(node.links) do
if link.inNode == nid then
drawMode = nil
for k, v in pairs(drawModes) do
if v then drawMode = k end
if enabled then
for k, v in pairs(drawModes) do
drawModes[k] = false
@/lua/ge/extensions/ui/liveryEditor/resources.lua
M.textures = {}
for tag, taggedTextures in pairs(taggedTextures) do
local categorizedTextures = {
for key, file in pairs(taggedTextures) do
local _, filename, _ = path.split(file)
@/lua/ge/extensions/flowgraph/nodes/util/getMapObjectsDynField.lua
local objects = {}
for objId, _ in pairs(map.objects) do
local object = getObjectByID(objId)
@/lua/ge/extensions/gameplay/drag/times.lua
if not dragData or not dragData.racers then return end
for _, racer in pairs(dragData.racers) do
racer.timersStarted = false
racer.timersStarted = false
for timerId,t in pairs(racer.timers) do
if t.type ~= "dialTimer" then
if not dragData or not dragData.racers or dragData.isCompleted then return end
for _, racer in pairs(dragData.racers) do
if not racer.timersStarted then goto continue end
for timerName, timer in pairs(timers) do
if addFrameHistoryDebug[timerName] and not timer.isSet and timer.type == "distanceTimer" then
timer.frameHistory[#timer.frameHistory+1] = string.format("Racer: %d Went over threshold at %0.5fs (%d%% of this frames duration plus the previous frames) (so between frame %d and %d)", racer.vehId, timer.value, t*100, #timer.frameHistory-1, #timer.frameHistory)
-- for _, frame in pairs(timer.frameHistory) do
-- end
@/lua/ge/extensions/gameplay/crawl/debug.lua
if debugData.completedPathnodes then
for _ in pairs(debugData.completedPathnodes) do
debugData.completedCount = debugData.completedCount + 1
if allStates then
for crawlerId, state in pairs(allStates) do
if state and state.active then
@/lua/common/libs/StackTracePlus/StackTracePlus.lua
local t = { lines = {} }
for k,v in pairs(Dumper) do t[k] = v end
local txt = "{"
for k,v in pairs(value) do
txt = txt..safe_tostring(k)..":"..safe_tostring(v)
end
--for k,v in pairs(info) do print(k,v) end
fun_name = fun_name or GuessFunctionName(info)
local first = true
for k,v in pairs(message) do
if first then
--print(info.namewhat, info.name)
--for k,v in pairs(info) do print(k,v, type(v)) end
local function_name = m_user_known_functions[info.func] or m_known_functions[info.func] or info.name or tostring(info.func)
--print("tail")
--for k,v in pairs(info) do print(k,v, type(v)) end--print(info.namewhat, info.name)
dumper:add_f("\n(%d) tail call", level_to_show)
if not function_name or function_name == "?" then
--for k,v in pairs(info) do print(k,v, type(v)) end
function_name = GuessFunctionName(info)
local first = true
for k,v in pairs(message) do
if first then
--print(info.namewhat, info.name)
--for k,v in pairs(info) do print(k,v, type(v)) end
local function_name = m_user_known_functions[info.func] or m_known_functions[info.func] or info.name or tostring(info.func)
--print("tail")
--for k,v in pairs(info) do print(k,v, type(v)) end--print(info.namewhat, info.name)
dumper:add_f("(%d) tail call\n", level_to_show)
if not function_name or function_name == "?" then
--for k,v in pairs(info) do print(k,v, type(v)) end
function_name = GuessFunctionName(info)
@/lua/ge/extensions/core/environment.lua
local knownProblems = {hydrodnamicFriction='hydrodynamicFriction', flowBehaviourIndex='flowBehaviorIndex'}
for j, _ in pairs(v) do
if knownProblems[j] then
local newGms = {}
for k, v in pairs(gms) do
if string.len(k) > 31 then
local sortedGmNames = {}
for k, v in pairs(gms) do
if k ~= 'ASPHALT' then
-- filter paths to only return filename without extension
for _,fn in pairs(files) do
tableMerge(allGroundModels, loadGroundModelFile(fn));
local function onFilesChanged(files)
for _,v in pairs(files) do
local filename = v.filename
filename = string.upper(filename)
for _, f in pairs(M.loadedGroundModelFiles) do
if string.upper(f) == filename then
local function onClientEndMission()
for k,v in pairs(myTexture) do
myTexture[k] = nil
@/lua/ge/extensions/scenario/race_marker.lua
local function hide()
for _, m in pairs(idToMarker) do
m:hide()
local function show()
for _, m in pairs(idToMarker) do
m:show()
--if not markers[name] then return end
for id, marker in pairs(markers[name] or {}) do
marker:clearMarkers()
-- blend all markers.
for _, m in pairs(idToMarker) do
m:update(dt, dtSim)
local function setModes(wpModes)
for name, marker in pairs(markers[markerListName] or {}) do
marker:setMode(wpModes[name] or 'hidden')
local function setToCheckpoints(data)
for name, marker in pairs(markers[markerListName] or {}) do
if data[name] then
local function drawOnMinimap(td)
for _, marker in pairs(markers[markerListName] or {}) do
if marker.drawOnMinimap then
@/lua/common/luaBinding.lua
while mt ~= nil do
for k, v in pairs(rawget(mt, 1)) do
workgetters[k] = workgetters[k] or v
for k, v in pairs(rawget(mt, 2)) do
worksetters[k] = worksetters[k] or v
for k, v in pairs(mt) do
if type(k) == "string" then
if luaVMname ~= 'vlua' then
for k, classtable in pairs(classes) do
-- search for SimObject's metatables
for k, v in pairs(classes) do
-- optimize metatables
if rawget(v, '__newindex') == nil then
for f, getter in pairs(v) do
if type(f) ~= 'number' then
else
for f, getter in pairs(v) do
if type(f) ~= 'number' then
@/lua/common/libs/LuLPeg/lulpeg.lua
acc[#acc+1] = "{\n"
for k, v in pairs( tbl ) do
local str_indent = 1
local res = {}
for k,v in pairs(t1) do
res[k] = {v, t2[k]}
end
for k,v in pairs(t2) do
if res[k] == nil then
for i = 1, select('#', ...) do
for k,v in pairs((select(i, ...))) do
destination[k] = v
local function checkpatterns(g)
for k,v in pairs(g.aux) do
if not LL_ispattern(v) then
function add_elements(a, res)
for k in pairs(a) do res[k] = true end
return res
, (type(b) == "number") and set_new{b} or b
for el in pairs(a) do
if a[el] and not b[el] then
local list = {}
for el in pairs(s) do
t_insert(list,el)
print(offset..prefix.."Grammar")
for k, pt in pairs(pt.aux) do
local prefix = ( type(k)~="string"
if Builder.proxymt then
for k, v in pairs(LL) do
if k:match"^__" then
@/lua/ge/extensions/flowgraph/nodes/ui/customButtonTEST.lua
function C:buttonPushed(action)
for nm, pn in pairs(self.pinOut) do
self.pinOut[nm].value = nm == action
@/lua/common/extensions/tech/techCapture.lua
local filteredFiles = {}
for i, file in pairs(files) do -- this is a more fine-grained filter to preserve files with similar capture names
local _, filename = path.split(file)
elseif t == 'table' then
for k, v in pairs(data) do
data[k] = convertBinaryDataToString(v)
local requestData = {}
for key, value in pairs(request) do
if key ~= 'skt' and key ~= 'handled' then
@/lua/ge/extensions/gameplay/discover/discover_037.lua
for _, discover in pairs(freeroamExperiences) do
table.insert(D.pageInfo.sections[1].discoverIds, discover.id)
table.insert(D.pageInfo.sections[1].discoverIds, "johnson_valley")
for _, mission in pairs(missions) do
table.insert(D.pageInfo.sections[2].discoverIds, mission.id)
@/lua/ge/extensions/scenario/waypoints.lua
-- add all successors of successors to a list and render them
for _, from in pairs(nextWps) do
for i, s in pairs(M.state.branchGraph[from.branch][from.index].successors) do
for _, from in pairs(nextWps) do
for i, s in pairs(M.state.branchGraph[from.branch][from.index].successors) do
if not (M.state.branchGraph[from.branch][from.index].isFinalWaypoint and not (w.lap + 1 < scenario.lapCount or scenario.lapCount == 0)) then
-- insert successors into graph
for _,f in pairs(from) do
-- if the branch does nt exist, create it
end
for _,t in pairs(to) do
-- check if successor already exists
local existing = false
for _,s in pairs(M.state.branchGraph[f.branch][f.index].successors) do
if s.index == t.index and s.branch == t.branch then
local paths = {}
for name, branch in pairs(scenario.lapConfigBranches or {}) do
paths[name] = branch
M.state.lapConfigName = name
for pName, path in pairs(paths) do
--M.state.branchGraph[pName] = {}
if scenario.BranchLapConfig then
for bName, branch in pairs(scenario.lapConfigBranches or {}) do
M.state.waypointBranches[bName] = {}
if scenario.BranchLapConfig then
for bName, branch in pairs(scenario.lapConfigBranches or {}) do
M.state.waypointBranches[bName] = {}
local allWPs = {}
for _, wpb in pairs(M.state.branchGraph) do
for _, wp in pairs(wpb) do
for _, wpb in pairs(M.state.branchGraph) do
for _, wp in pairs(wpb) do
allWPs[wp.cpName] = true
local wpList = {}
for wp, _ in pairs(allWPs) do
local node = scenario.nodes[wp]
if scenario.lapConfig and #scenario.lapConfig > 0 then
for _, vid in pairs(scenario.vehicleNameToId) do
initialiseVehicleData(vid)
local vehicleWaypointsData = M.state.vehicleWaypointsData or {}
for vid, vehWpData in pairs(vehicleWaypointsData) do
local vehicle = getObjectByID(vid)
if successors and vehicle and vehicleData then
for k, v in pairs(successors) do
local nextWp = scenario.nodes[v.cpName]
local function drawDebug()
for vid, vehWpData in pairs(M.state.vehicleWaypointsData or {}) do
for i = 1, #vehWpData.previousCorners do
@/lua/ge/extensions/statistics/statistics.lua
for _, instance in pairs(statEntry.instances) do
local vehicle = nil
for dataKey,data in pairs(vehicleTable) do
local entry = {}
if data.instances then
for _,instance in pairs(data.instances) do
if instance.maxPoints and instance.maxPoints ~= 0 then
local totalMaxPoints = 0
for _, entryName in pairs(statsOrder) do
local data = scenarioStats[entryName]
for k,v in pairs(statData) do
if not tableFindKey(ignoreInstanceFields, k) then
local goalVehicles = scenario_scenarios.getScenario().goals.vehicles or {}
for _, goal in pairs(goalVehicles) do
if goal.id ~= 'wayPointAction' then
for _, vehicleName in pairs(vehicles) do
if not map.objectNames[vehicleName] or not map.objects[map.objectNames[vehicleName]] then
for _,instance in pairs(statData.instances) do
if statData.enabled then
local totalMaxPoints = 0
for key, statsData in pairs(vehicleTable) do
local statPoints = calculateStatPoints(key, statsData)
end
for _, instance in pairs(statsData.instances) do
if instance.maxPoints and instance.maxPoints > 0 then
local function stopStatsGathering(scenario)
for vehicleID, vehicleTable in pairs(statsTable) do
local data = vehicleTable[getStatKey('distance')]
-- 1 mile = 1609.34 meters
for _,instance in pairs(data.instances) do
value = value + (instance.value or 0)
if data and data.enabled then
for _,instance in pairs(data.instances) do
value = value + (instance.value or 0)
if damageData and damageData.enabled then
for _,instance in pairs(damageData.instances) do
if instance.source then
if scenario.state == 'post' then
for vehicleID, vehicleTable in pairs(statsTable) do
captureFinalDamageData(vehicleTable[getStatKey('damage')])
for vehicleID, vehicleTable in pairs(statsTable) do
local data = vehicleTable[getStatKey('distance')]
if data and data.enabled then
for _,instance in pairs(data.instances) do
local vehicle = nil
if data and data.enabled then
for _,instance in pairs(data.instances) do
local vehicle = nil
if data and data.enabled then
for _,instance in pairs(data.instances) do
local vehicleData = nil
local function onRaceInit()
for vehicleID, vehicleTable in pairs(statsTable) do
local data = vehicleTable[getStatKey('distance')]
if data and data.enabled then
for _,instance in pairs(data.instances) do
local vehicle = nil
if data and data.enabled then
for _,instance in pairs(data.instances) do
local vehicle = nil
local function captureTimeData(time)
for vehicleID, vehicleTable in pairs(statsTable) do
local data = vehicleTable[getStatKey('time')]
if data and data.enabled then
for _,instance in pairs(data.instances) do
instance.value = time
@/lua/ge/extensions/editor/tech/roadArchitect/junctions.lua
-- Create the Road Architect roads from each unique road in the hash table.
for k, uniqueRoad in pairs(roadNetwork) do
local nodesIn, roadType = uniqueRoad.splineNodes, uniqueRoad.type -- TODO: road_type is not used currently.
for nodeId, intersectionData in pairs(intersections) do
local roadIds = intersectionData.connectedRoads
@/lua/ge/extensions/editor/vehicleEditor/staticEditor/veJBeamModifierLeakVis.lua
-- recursive replace
for k, v in pairs(val) do
val[k] = replaceSpecialValues(v)
for sectionName, section in pairs(part) do
if type(section) == "table" and #section > 1 then
-- Line is dictionary, so it declares modifier(s)
for mod, modVal in pairs(lineData) do
if mod ~= "__astNodeIdx" then
end
for mod, modData in pairs(modsScalers) do
partsModsScalers[modData.partPath] = partsModsScalers[modData.partPath] or {}
for mod, modData in pairs(newSectionModifiers) do
--local vehDataModVal = item[mod]
for mod, modData in pairs(newSectionModifiers) do
local vehDataModVal = item[mod]
for sectionName, section in pairs(part) do
local outModsSection = outMods[sectionName]
-- Line is dictionary, so it declares modifier(s)
for mod, modVal in pairs(lineData) do
if mod ~= "__astNodeIdx" then
if type(colData) == 'table' and tableIsDict(colData) and #lineData > headerSize then
for mod, modVal in pairs(colData) do
if mod ~= "__astNodeIdx" then
-- If current modifiers part origin is not equal to current part and the modifier is not a default value, modifiers are considered leaking
for mod, modData in pairs(sectionModsCopy) do
if modsScalers[mod] then
local mods = partsModsScalers[partName]
for mod, modVal in pairs(mods) do
for sectionName, outModsSection in pairs(outMods) do
for mod, modVal in pairs(mods) do
for sectionName, outModsSection in pairs(outMods) do
outModsSection[partName] = outModsSection[partName] or {}
if runTest then
for k,v in pairs(testSectionsWrongCounter) do
print(k .. ": " .. v .. " errors")
local sortedTbl = tableKeysSorted(sectionsPartsMods)
for k,v in pairs(sortedTbl) do
sectionNamesSorted[k] = v
sectionsModNamesSorted = {}
for sectionName, mods in pairs(outSectionsAllModNames) do
sortedTbl = tableKeysSorted(mods)
for k,v in pairs(sortedTbl) do
sectionsModNamesSorted[sectionName][k] = v
str = "{"
for k,v in pairs(tbl) do
if i > 1 then str = str .. ", " end
@/lua/ge/extensions/editor/driftDataEditor.lua
transformsUtils = {}
for lineName, lineData in pairs(currDriftSpots[selectedDriftSpotId].spatialInfo.lines) do
transformsUtils[lineName.."driftBox"] = createNewTransform("Sign pos", true, true, true, lineData.pos, quatFromEuler(lineData.rot.x, lineData.rot.y, lineData.rot.z), lineData.scl)
}
for lineName, lineData in pairs(spotData.spatialInfo.lines) do
local newLineData = {
local tempSpot
for _, spotData in pairs(gameplay_drift_saveLoad.loadAndSanitizeDriftFreeroamSpotsCurrMap()) do
tempSpot = sanitizeDriftSpot(spotData)
currDriftSpots[spotId] = nil
for key, value in pairs(currDriftSpots) do
selectDriftSpot(key)
local function saveCurrentDriftSpots()
for spotId, spotData in pairs(currDriftSpots) do
local newSpotData = {
local name = spotId:match("([^/]+)$")
for lineName, lineData in pairs(spotData.spatialInfo.lines) do
local newLineData = {
im.TextWrapped("Drift spots in the current level: ")
for spotId, spotData in pairs(currDriftSpots) do
if im.Selectable1(spotId, spotId == selectedDriftSpotId) then
im.Separator()
for lineName, lineData in pairs(currDriftSpots[selectedDriftSpotId].spatialInfo.lines) do
im.Text(lineName)
@/lua/ge/extensions/editor/missionEditor/progressSingle.lua
for _,l in pairs(currentAttemptsByKey.labels) do
im.TableSetupColumn(l)
im.TableNextColumn()
for _, missionData in pairs(currentAttemptsByKey.rows) do
for _, c in pairs(missionData) do
for _, missionData in pairs(currentAttemptsByKey.rows) do
for _, c in pairs(missionData) do
im.Text(tostring(c.text or "(notext?)"))
@/lua/ge/extensions/scenario/raceGoals.lua
local invalidValue = false
for k,g in pairs(goalSchema) do
invalidKey=false
invalidType = false
for kl,vl in pairs(g) do
invalidValue = false
if type(v.value) == "table" then
for gkey,val in pairs(v.value) do
checkGoalItem(goalSchema, v.id, gkey, val)
local function istable(t)
for k, _ in pairs(t) do
if type(k) ~= "number" then
for _, goal in pairs(goals) do
goal.init(scenario)
-- iterate over all vehicles in the scene and find if goals exist
for vName, vObjId in pairs(scenario.vehicleNameToId) do
local tempGoals = nil
if tempGoals then
for k, v in pairs(tempGoals) do
local goal = {}
local goals = M.state.goals
for i, goal in pairs(goals) do
goal.updateFinalStatus(scenario)
local goals = M.state.goals
for i, goal in pairs(goals) do
goal.processState(scenario, 'onRaceStart')
local goals = M.state.goals
for i, goal in pairs(goals) do
goal.processState(scenario, 'onRaceInit')
local goals = M.state.goals
for i, goal in pairs(goals) do
goal.processState(scenario, 'onRaceWaypointReached', data)
local goals = M.state.goals
for i, goal in pairs(goals) do
goal.processState(scenario, 'onRaceTick', data)
local goals = M.state.goals
for i, goal in pairs(goals) do
goal.processState(scenario, 'onRaceResult')
local goals = M.state.goals
for i, goal in pairs(goals) do
goal.processState(scenario, 'onCountdownEnded')
@/lua/ge/extensions/core/funstuff.lua
}
for _, c in pairs(v.configs) do
local passConfig = true
@/lua/vehicle/controller/loggerTemplate.lua
local storages = energyStorage.getStorages()
for _, storage in pairs(storages) do
-- filter for electric batteries
@/lua/ge/extensions/scenario/busdriver.lua
-- clamp all stats
for k,v in pairs(result) do
result[k].fill = clamp(v.fill, 0,100)
if #markers == 0 then
for k,v in pairs(nameMarkers) do
local mk = scenetree.findObject(v)
local mapData = map.getMap()
for k, v in pairs(currentLine.navhelp) do
for _, wp in pairs(v) do
for k, v in pairs(currentLine.navhelp) do
for _, wp in pairs(v) do
if not mapData.nodes[wp] then
-- if bext.y*1.25 < w then w = bext.y*1.25 end
for k,marker in pairs(markers)do
if k == 1 then --top left
local function isTriggerOnBusLine(tasks,tname)
for k,v in pairs(tasks) do
if v[1] == tname then return true end
if currentLine.navhelp then
for k,v in pairs(currentLine.navhelp) do --reset passedWp because of navhelp
for i2,v2 in ipairs(v) do
@/lua/ge/ge_utils.lua
local fields = player:getFields()
for k, f in pairs(fields) do
if k ~= 'dataBlock' and k ~= 'parentGroup' then -- why do we need to exclude these?
function setAudioChannelsVolume(data)
for k, v in pairs(data) do
local AudioChannel = scenetree[k]
if not o or #o == 0 then return nil end
for _, v in pairs(o) do
table.insert(res, scenetree.findObject(v))
local obj = SimGroup()
for k, v in pairs(t) do
obj[k] = v
for k, v in pairs(modelDataPaints) do
local bc = v.baseColor
result = {}
for vid,v in pairs(data) do
local vehicle = getObjectByID(vid)
result = {}
for vehicleName,v in pairs(data) do
local vehicle = scenetree.findObject(vehicleName)
local residx = 1
for _, value in pairs(files) do
-- because for some reason there are files inside the result if recursive level is >0
local n = 0
for k, v in pairs(t) do
n = n + 1
local dirs = {}
for _,v in pairs(files) do
if FS:directoryExists(v) and not FS:fileExists(v) then
}
for _, f in pairs(files) do
--print( ' - ' .. string.upper(f) .. ' = ' .. hashStringSHA1(string.upper(f)))
local resSorted = {}
for k, v in pairs(res) do
table.insert(resSorted, k);
@/lua/ge/extensions/flowgraph/nodes/ui/contextTranslation.lua
for nm, pin in pairs(self.pinInLocal) do
if nm ~= 'flow' and nm ~= 'translationString' then
if self.variablesState == 2 then
for nm, pin in pairs(self.pinInLocal) do
if nm ~= 'flow' and nm ~= 'translationString' then
@/lua/ge/extensions/gameplay/missions/proceduralMissionGenerators/busModeMissions.lua
local hasData = false
for _, file in pairs(busLineFiles) do
local busLine = jsonReadFile(file)
local busLine = jsonReadFile(file)
for _, route in pairs(busLine.routes) do
-- we save the data per route. route key is unfortunately a composite key of id and variance :(
@/lua/ge/extensions/gameplay/speedTraps.lua
local res = {}
for _, obj in pairs(objs) do
if obj.speedTrapType == speedTrapType then
@/lua/common/jbeam/tableSchema.lua
-- recursive replace
for k, v in pairs(val) do
val[k] = replaceSpecialValues(v)
-- walk everything and look for options
for keyEntry, entry in pairs(vehicle) do
if type(entry) ~= "table" then
-- then walk all (keys) / entries of that vehicle
for keyEntry, entry in pairs(vehicle) do
-- verify key names to be proper formatted
@/lua/ge/extensions/util/inputSystemUtils.lua
local res = {}
for k, v in pairs(tbl) do
table.insert(res, {k, v})
@/lua/ge/extensions/editor/gen/exp_frame.lua
local i = 1
for k,d in pairs(body) do
if not d.g then d.g = {} end
else
for j,_ in pairs(d.ac) do
if j == 1 then
local taa = {}
for k,d in pairs(body) do
-- lo('?? for_part:'..k..':'..#d.ac)
-- lo('?? for_part:'..k..':'..#d.ac)
for _,c in pairs(d.ac) do
taa[#taa+1] = c
-- U.dump(body,'>> build:'..#ac..':'..cfix)
for k,d in pairs(body) do
for j,_ in pairs(d.ac) do
for k,d in pairs(body) do
for j,_ in pairs(d.ac) do
-- if i == ind then
local list = {}
for k,d in pairs(body) do
list[#list+1] = {dnode[d.frto[1] ],dnode[d.frto[2] ]}
if sdw then
for i,v in pairs(adw[ind[2]]) do
if sdw[i] then
aa = {}
for k,d in pairs(body) do
lo('?? for_part:'..k..':'..#d.ac)
lo('?? for_part:'..k..':'..#d.ac)
for _,c in pairs(d.ac) do
if d.fix then
lo('?? for_L0:'..tostring(L)..':'..#aa)
for k,c in pairs(aa) do
local cac = step(aa, k, s)
list = {}
for k,d in pairs(body) do
list[#list+1] = {dnode[d.frto[1]],dnode[d.frto[2]]}
local set = {}
for _,d in pairs(dnode) do
set[#set+1] = d
list = {}
for k,d in pairs(body) do
list[#list+1] = {dnode[d.frto[1]],dnode[d.frto[2]]}
local list = {}
for k,d in pairs(body) do
list[#list+1] = {dnode[d.frto[1]],dnode[d.frto[2]]}
local akey = {}
for key,d in pairs(body) do
akey[#akey+1] = key
im.Columns(2)
for _,key in pairs(akey) do
local d = body[key]
im.Indent(80)
for i,val in pairs(d.ac) do
ord = ord + 1
akey = {}
for key,d in pairs(dw) do
akey[#akey+1] = key
local tot = 0
for i,key in pairs(akey) do
im.Text(key)
@/lua/ge/extensions/editor/toolShortcuts.lua
local sortedKeys = {}
for key, mode in pairs(editor.editModes) do
if key ~= "objectSelect" and key ~= "createObject" and mode.icon then table.insert(sortedKeys, key) end
@/lua/ge/extensions/gameplay/crawl/flowgraphBridge.lua
local allStates = gameplay_crawl_utils.getAllCrawlStates()
for crawlerId, state in pairs(allStates) do
if state and state.active then
@/lua/common/libs/lunajson/lunajson/encoder.lua
local tmp = i
for k, v in pairs(o) do
if type(k) ~= 'string' then
@/lua/ge/extensions/flowgraph/nodes/gameplay/dragRace/setDragVehicle.lua
for i = old, new+1, -1 do
for _, lnk in pairs(self.graph.links) do
if lnk.sourcePin == self.pinInLocal['vehId_'..i] then
@/lua/vehicle/powertrain/turbocharger.lua
if type(turbo.wastegateStart) == "table" then
for k, v in pairs(turbo.wastegateStart) do
wastegateStart[k] = v * constants.psiToPascal
if type(turbo.wastegateLimit) == "table" then
for k, v in pairs(turbo.wastegateLimit) do
wastegateLimit[k] = v * constants.psiToPascal
else
for k, v in pairs(wastegateStart) do
wastegateLimit[k] = v + 0.01 * constants.psiToPascal
maxWastegateRange = 1
for k, v in pairs(wastegateStart) do
local start = v
for k, _ in pairs(assignedEngine.torqueCurve) do
if type(k) == "number" and k < assignedEngine.maxRPM then
@/lua/ge/extensions/gameplay/missions/missionTypes/editorHelper.lua
table.sort(sortedKeys)
for _, key in pairs(sortedKeys) do
if key ~= "fieldName" and string.startswith(key, "fieldName") then
-- find all field with fieldname
for _, key in pairs(sortedKeys) do
if key ~= "fieldName" and string.startswith(key, "fieldName") then
C.__index = C
for k, v in pairs(derivedClass) do
o[k] = v
@/lua/ge/extensions/career/modules/milestones/general.lua
local rewardsLabel = {}
for _, reward in pairs(milestoneConfig.getRewards(step)) do
sumChange[reward.attributeKey] = (sumChange[reward.attributeKey] or 0) + reward.rewardAmount
@/lua/vehicle/wheels.lua
if wheelData.treadBeams ~= nil then
for _, beamcid in pairs(wheelData.treadBeams) do
obj:setBeamSpringDamp(beamcid, v.data.beams[beamcid].beamSpring * beamCoef, 2, -1, -1)
if wheelData.sideBeams ~= nil then
for _, beamcid in pairs(wheelData.sideBeams) do
obj:setBeamSpringDamp(beamcid, 0, 10, -1, -1)
if wheelData.peripheryBeams ~= nil then
for _, beamcid in pairs(wheelData.peripheryBeams) do
obj:setBeamSpringDamp(beamcid, v.data.beams[beamcid].beamSpring * beamCoef, 2, -1, -1)
if wheelData.reinfBeams ~= nil then
for _, beamcid in pairs(wheelData.reinfBeams) do
obj:setBeamSpringDamp(beamcid, v.data.beams[beamcid].beamSpring * beamCoef, 0.7, 0, 0)
if brakeThermalsEnabled then
for _, wd in pairs(M.wheelRotators) do
if wd.enableBrakeThermals then
for _, wd in pairs(M.wheelRotators) do
if wd.enableBrakeThermals then
local node2Pos = vec3(v.data.nodes[wheel.node2].pos)
for _, n in pairs(wheel.nodes) do
local wheelNode = v.data.nodes[n]
if wd.axleBeams then
for _, name in pairs(wd.axleBeams) do
if not axleBeamLookup[name] then
local avgWheelPos = vec3(0, 0, 0)
for _, rotator in pairs(M.wheelRotators) do
if rotator.brakeTorque > 0 then
for _, rotator in pairs(M.wheelRotators) do
local wheelNodePos = vec3(v.data.nodes[rotator.node1].pos) --find the wheel position
@/lua/ge/extensions/editor/gen/world.lua
if not list then list = {} end
for k,v in pairs(matFiles) do
loadJsonMaterialsFile(v)
}
for _,nm in pairs(wrCommon) do
local mo = scenetree.findObject(nm)
local terrBlockName = ffi.string(terrainImpExp.terrainName)
for tbName, tbData in pairs(terrainBlockProxies) do
if string.lower(tbName) == string.lower(terrBlockName) then
local pref,prep = forPrefix(afile[1])
for i,p in pairs(afile) do
-- get world box
local ma,ima = 0
for i,c in pairs({'x','y','z'}) do
local L = math.abs(ddae[p].fr[c]-ddae[p].to[c])
end
for i,d in pairs(daePath[tp]) do
local str = type(d) == 'string' and d or d[1]
local adsc = {}
for _,id in pairs(aid) do
adsc[#adsc+1] = adesc[id]
end
for i,f in pairs(desc.afloor) do
for j,w in pairs(f.awall) do
for i,f in pairs(desc.afloor) do
for j,w in pairs(f.awall) do
local tocall = false
if forall and desc.aspline and desc.aspline[i] then
for key,s in pairs(desc.aspline[i]) do
if aij and #U.index(aij[i], key) > 0 then
if U._PRD == 0 then
for id,d in pairs(adesc) do
cedit.mesh = id
forBuilding(desc, function(w,ij)
for pth,list in pairs(w.df) do
for _,id in pairs(list) do
for pth,list in pairs(w.df) do
for _,id in pairs(list) do
local item = dforest[id].item
if desc and desc.selection and scope=='wall' and tableSize(desc.selection)==1 then
for i,f in pairs(desc.selection) do
for _,key in pairs(f) do
for i,f in pairs(desc.selection) do
for _,key in pairs(f) do
if not tonumber(key) then
end
for i,f in pairs(desc.afloor) do
aij[#aij + 1] = {}
local akey = {}
for k,r in pairs(buf) do
akey[#akey+1] = k
local aij = forSide({akey[1], buf[akey[1]][1]})
for i,row in pairs(buf) do
if not aij[i] then
end
for _,j in pairs(row) do
if #U.index(aij[i],j) == 0 then
if not tosave then
for j,c in pairs(shmap) do
for i,h in pairs(c) do
for j,c in pairs(shmap) do
for i,h in pairs(c) do
tb:setHeightWs(vec3(j,i), h)
if desctop and desctop.df ~= nil then
for dae,list in pairs(desctop.df) do
for i,key in ipairs(list) do
if forestoff ~= false then
for _,s in pairs(dforest) do
editor.removeForestItem(fdata, s.item)
end
for id,d in pairs(adesc) do
local obj = scenetree.findObjectById(id)
local aid = {}
for id,d in pairs(jdesc) do
lo('?? for_desc:'..id..':'..tostring(adesc[tonumber(id)]))
adesc[cid] = U.fromJSON(d)
for i,d in pairs(adesc) do
if d.idr == cid then
if d.acorner_ then
for i,c in pairs(d.acorner_) do
for _,s in pairs(c.list) do
for i,c in pairs(d.acorner_) do
for _,s in pairs(c.list) do
for j,p in pairs(s) do
for _,s in pairs(c.list) do
for j,p in pairs(s) do
if s[j..''] and tonumber(j) then
end
for _,f in pairs(d.afloor) do
f.awplus = {}
end)
for i,f in pairs(desc.afloor) do
forestClean(f)
for _,s in pairs(dforest) do
editor.removeForestItem(fdata, s.item)
desc.selection = nil
for i,f in pairs(desc.afloor) do
if f.achild then
if f.achild then
for k,c in pairs(f.achild) do
c.id = nil
c.id = nil
for ci,cf in pairs(c.afloor) do
for cj,cw in pairs(cf.awall) do
for ci,cf in pairs(c.afloor) do
for cj,cw in pairs(cf.awall) do
cw.id = nil
cw.id = nil
for dae,cd in pairs(cw.df) do
cw.df[dae] = {scale = cd.scale}
end
for dae,cd in pairs(cf.top.df) do
cf.top.df[dae] = {scale = cd.scale}
end
for j,w in pairs(f.awall) do
w.id = nil
w.id = nil
for dae,d in pairs(w.df) do
w.df[dae] = {scale = d.scale}
end
for dae,d in pairs(f.top.df) do
f.top.df[dae] = {scale = d.scale}
forBuilding(desc, function(w,ij)
for pth,list in pairs(w.df) do
for _,id in pairs(list) do
for pth,list in pairs(w.df) do
for _,id in pairs(list) do
local item = dforest[id].item
lo('??+++++++++++++++++ f_CLEAN:'..#W.out.adf[desc.idpersist])
for _,df in pairs(W.out.adf[desc.idpersist]) do
for dae,list in pairs(df) do
for _,df in pairs(W.out.adf[desc.idpersist]) do
for dae,list in pairs(df) do
for i,key in ipairs(list) do
forBuilding(desc, function(w, ij)
for pth,list in pairs(w.df) do
for _,id in pairs(list) do
for pth,list in pairs(w.df) do
for _,id in pairs(list) do
local item = dforest[id].item
local its = fdata:getItemsCircle(pos, 1.2)
for i,o in pairs(its) do
local key = o:getKey()
lo('?? to_HIDE:'..tableSize(dhide))
for k,f in pairs(dhide) do
f:setPosition(f:getPosition()+vec3(0,0,-100))
if FS:directoryExists(dirname) then
for _,o in pairs(list) do
local om = scenetree.findObjectById(tonumber(o))
lo('?? for_path:'..tostring(ok))
for _,tp in pairs({'balcony','corner','doors','pillar','store_front','stairs',
'windows',
end
for k,v in pairs(W.adae) do
cnt[k] = v
if U._MODE == 'conf' then
for _,p in pairs(decalPath) do
adec = D.decalsLoad()--, grid)
local aid = {}
for id,d in pairs(adesc) do
aid[#aid+1] = id
for i,id in pairs(aid) do
lo('??^^^^^^^^^^^^^^^^^^^ recover_house:'..id)
-- clean up awplus
for i,wp in pairs(f.awplus) do
if wp.id then
local adec = editor.getAllRoads()
for id,_ in pairs(adec) do
local obj = scenetree.findObjectById(id)
if mode ~= 'conf' and forest then
for id,desc in pairs(adesc) do
local obj = scenetree.findObjectById(id)
if obj ~= nil then
for i,f in pairs(desc.afloor) do
for j,w in pairs(f.awall) do
for i,f in pairs(desc.afloor) do
for j,w in pairs(f.awall) do
forestClean(w)
end
for _,s in pairs(dforest) do
editor.removeForestItem(fdata, s.item)
local list = fdata:getItems()
for _,f in pairs(list) do
editor.removeForestItem(fdata, f)
base = {}
for k,iw in pairs(aw) do
local wall = desc.afloor[ifloor].awall[iw]
if #saforest>0 and inupdate and not sdata.spacefit then
for ind,_ in pairs(aforest) do
if ind<=#saforest then
-- update forest positions
for _,d in pairs(aforest) do
d.p.x = d.p.x + dwl
lo('?? for_AFOR:'..#aforest)
for i,d in pairs(aforest) do
local w,h = d.list and d.list[2]:distance(d.list[1]) or ddae[d.dae].w,ddae[d.dae].h
if not sdata.ahole then sdata.ahole = {} end
for i,h in pairs(sdata.ahole) do
ahole[#ahole+1] = h
local margin = 0.06
for i,d in pairs(aforest) do
if d.scale then
end
for i,d in pairs(afpos) do
aforest[i].pos = (d[1]+d[2])/2 + vec3(0,0,d[3].y)
local pos = 0
for k,dae in pairs(desc.storefront.adae) do
local a = U.vang(U.vturn(desc.u, -math.pi/2), ddae[dae].front, true)
if desc.arcext then
for _,rce in pairs(desc.arcext) do
arc[#arc+1] = rce
local am = {alod[1].list[1].m}
for _,d in pairs(alod[1].list) do
for k,v in pairs(d.m.verts) do
for _,d in pairs(alod[1].list) do
for k,v in pairs(d.m.verts) do
d.m.verts[k] = d.m.verts[k] + shift
local pset = {}
for i,v in pairs(am[1].verts) do
local a = desc[tp].skew
end
for i,n in pairs(am[1].normals) do
local ang = U.vang(vec3(1,1,0),n)
U.dump(aplinth, '??____ APLINTH_:')
for _,p in pairs(aplinth) do
local list = M.fillSegment(
local ckey
for _,d in pairs(list) do
local k = d:getKey()
if list then
for _,d in pairs(list) do
local k = d:getKey()
local ckey
for _,d in pairs(list) do
ckey = d:getKey()
local vn = desc.v:normalized()
for k,p in pairs(mbody.verts) do
mbody.verts[k] = un*p.x + vn*p.y
if false then
for _,plus in pairs(desc.avplus) do
lo('??____________________________________ desc_plus:'..tostring(desc.plus))
af[#af + 1] = {v = #av+1, n = 0, u = #av+1}
for _,p in pairs(plus) do
av[#av + 1] = p -- desc.pos
af[#af + 1] = {v = #av+2, n = 0, u = #av+2}
for _,p in pairs(plus) do
av[#av + 1] = p -- desc.pos
-- set position
for o,v in pairs(av) do
av[o] = av[o] + desc.pos -- desc.pos is the bottom-left corner
out.avedit = {}
for _,v in pairs(b1) do
out.avedit[#out.avedit + 1] = v + vec3(0,0,1)
local base = {}
for i,b in pairs(cbase) do
base[#base+1] = vec3(b.x,b.y)
end
for _,p in pairs(base) do
p.z = lift
local aid = #asel > 0 and asel or {cedit.mesh}
for _,id in pairs(aid) do
local dfcorner = {}
U.dump(desc.acorner_, '?? frame_CORNER:')
for i,c in pairs(desc.acorner_) do
for j,f in pairs(c.list) do
for i,c in pairs(desc.acorner_) do
for j,f in pairs(c.list) do
if not dfcorner[f[1]] then
local H = forHeight(desc.afloor,ij[1]-1)
for _,d in pairs(s.aforest) do
if d.dae == forestMeshName then
end
for i,b in pairs(desc.aspline[ij[1]][ij[2]].base) do
out.dyell[ij[1]][i] = {b+vec3(0,0,H),b+vec3(0,0,H+desc.afloor[ij[1]].h)}
if w.df[forestMeshName] then
for _,key in pairs(w.df[forestMeshName]) do
local h = ddae[forestMeshName].to.z - ddae[forestMeshName].fr.z
else
for d,list in pairs(w.df) do
for _,key in ipairs(list) do
if desc.aspline and desc.aspline[ij[1]] then
for key,_ in pairs(desc.aspline[ij[1]]) do
local aw = U.split(key,'_')
if w['win'..'_inf'] and w['win'..'_inf'].ddae then
for k,dae in pairs(w['win'..'_inf'].ddae) do
-- get key
if w.df[dae] then
for _,key in pairs(w.df[dae]) do
if cedit.fscope ~= 1 or key == cedit.forest then
U.dump(cw.pilaster, '?? has_PIL:'..j..':'..#cw.df[forestMeshName])
for _,key in pairs(cw.df[forestMeshName]) do
akey[#akey+1] = key
end
for _,key in pairs(akey) do
out.aforest[#out.aforest + 1] = dforest[key].item:getPosition()
elseif ({corner=1})[ddae[forestMeshName].type] and desc.acorner_ then
for i,s in pairs(desc.acorner_) do
for _,n in pairs(s.list) do
for i,s in pairs(desc.acorner_) do
for _,n in pairs(s.list) do
if n[1] == ij[1] and n[2] == ij[2] then
local H = forHeight(desc.afloor,cij[1]-1)
for _,d in pairs(s.aforest) do
if #U.index(cedit.aforest, d.key)>0 then
local base = U.polyMargin(child.base, child.margin or 0)
for _,p in pairs(base) do
pth[#pth+1] = adesc[cedit.mesh].pos + floor.pos + p + vec3(0,0,h+(child.fat or 0)) + posplus
local achunk = T.forChunks(floor.base)
for k,rc in pairs(achunk) do
for _,i in pairs(rc) do
for k,rc in pairs(achunk) do
for _,i in pairs(rc) do
local p = floor.base[i]
local base = U.polyMargin(floor.base, marginplus + (floor.top.margin or 0))
for _,p in pairs(base) do
pth[#pth+1] = adesc[cedit.mesh].pos + floor.pos + p + vec3(0,0,h+(floor.top.fat or 0)) + posplus
if desc.achild then
for i,c in pairs(desc.achild) do
if c.id then
local ax, ay = {0}, {0}
for k,list in pairs(mskip) do
for s in pairs(list) do
for k,list in pairs(mskip) do
for s in pairs(list) do
if k % 2 == 0 then
else
for _,c in pairs(floor.top.achild) do
c.shape = 'flat'
floor.top.body = {}
for _,c in pairs(floor.top.achild) do
-- cleanup
if floor.top.shape ~= 'flat' then
for _,w in pairs(floor.awall) do
if w.roofborder then
floor.top.ridge.on = false
for _,c in pairs(floor.top.achild) do
if c.id then
local cheight = 0
for i,f in pairs(desc.afloor) do
cheight = cheight + f.h
cheight = cheight + f.h
for j,w in pairs(f.awall) do
if ij ~= nil then
-- update walls
for j,w in pairs(floor.awall) do
w.u = U.proj2D(U.mod(j+1,base) - base[j])
end
for _,m in pairs(am) do
for i=1,#m.verts do
local ref = base[1]
for _,a in pairs(arc) do
local ai = {}
M.zip(ai,af) --,true)
for k,b in pairs(a) do
av[#av+1] = b
local ref = base[1]
for _,a in pairs(arc) do
local ai = {}
M.zip(ai,af) --,true)
for _,b in pairs(a) do
av[#av+1] = b
if not av or #av == 0 then return end
for i,_ in pairs(av) do
av[i] = av[i] + prn.pos + vec3(0,0,H)
local amdata = {mdata}
for _,m in pairs(am) do
amdata[#amdata+1] = m
if desctop.df ~= nil then
for dae,list in pairs(desctop.df) do
for i,key in pairs(list) do
for dae,list in pairs(desctop.df) do
for i,key in pairs(list) do
if key == cedit.forest then
dC = 0.17
-- for i,v in pairs(dsc.av) do
-- lo('?? for_v:'..i..':'..tostring(v-desc.pos))
local c = desctop.achild[1]
-- for _,c in pairs(desctop.achild) do
-- U.dump(c, '?? for_child:')
lo('!! houseUp_NODESC:'..tostring(toedit)..':'..tableSize(adesc)..':'..tostring(adesc[tonumber(toedit)])..':'..tostring(adesc[toedit..'']))
-- for k,d in pairs(adesc) do
-- return
local mdata
for i,f in pairs(desc.afloor) do
forestClean(f.top)
if not f.awplus then f.awplus = {} end
for k,wp in pairs(f.awplus) do
-- U.dump(wp, '?? for_WP:'..i..':'.._)
lo('?? FLOOR_children:'..#f.achild, true)
for _,c in pairs(f.achild) do
lo('?? child_id:'..tostring(c.id)..':'..tostring(c.prn),true)
lo('?? if_SPLINE:'..i..':'..#desc.aspline..':'..#cedit.aforest) --..':'..tostring(s))
for k,s in pairs(desc.aspline[i]) do
local ij = {i,k}
local iforest = {}
for fi,d in pairs(afpos) do
local dz = aforest[fi].type == 'win' and -ddae[wall.win].fr.z*(aforest[fi].scale and aforest[fi].scale.z or 1) or 0
local botext
for j,w in pairs(f.awall) do
-- check splined
-- U.dump(desc.aspline,'??_______________ ASPLINE:'..i)
for ifloor,aw in pairs(desc.aspline) do
if ifloor == i then
-- U.dump(aw,'??****************** for_SPLf:'..ifloor..':'..j)
for kwall,s in pairs(aw) do
if string.find(kwall, '_'..j..'_') then
-- initialize
for je,b in pairs(base) do
fe.awall[je].arcext = nil
end
for je,b in pairs(base) do
local un = we.u:normalized()
for k,rc in pairs(arcext) do
-- lo('?? to_check:'..tostring(base[je])..':'..tostring(U.mod(je+1,base))..'<'..tostring(f.base[j]+(w.u:normalized()*rc[1].x)))
end
for ie,v in pairs(rc) do
rc[ie] = rc[ie] - vec3(ds,f.h,0) -- (U.mod(j+1,f.base) - f.base[j]):normalized()*ds
if dext[je] then
for _,v in pairs(dext[je]) do
bote[#bote+1] = v
if f.top.achild and #f.top.achild>0 then
for k,c in pairs(f.top.achild) do
-- U.dump(c, '??^^^^^^^^^^^^^^^^^ for_CEST:'..k)
local botec
for icb,je in pairs(c.imap) do
if botext[je] then
desc.afloor[i+1].botext = nil
for k,w in pairs(desc.afloor[i+1].awall) do
w.arcext = nil
-- link forest items
for dae,list in pairs(w.df) do
for _,key in ipairs(list) do
local isvalid = true
for _,m in pairs(cam) do
if not m or #m.faces == 0 or #m.verts == 0 then
if not indrag then lo('?? for_cover: i='..i..' ifchild:'..#f.top.achild..':'..cheight..':'..tostring(forsplit)..':'..tostring(dirty)..':'..#f.top.achild) end
for _,w in pairs(f.awall) do
w.avplus = {}
local auvdim = {}
for ic,c in pairs(f.top.achild) do
if c.uvref then
else
for ic,c in pairs(f.top.achild) do
if auvdim[ic] then
elseif mdata then
for j,q in pairs(cbase) do
for k,p in pairs(mdata.verts) do
for j,q in pairs(cbase) do
for k,p in pairs(mdata.verts) do
if (U.proj2D(p) - U.proj2D(q)):length() < small_dist then
local ref = base[1]
for _,a in pairs(arc) do
local ai = {}
M.zip(ai,af) --,true)
for _,b in pairs(a) do
av[#av+1] = b
-- if forsplit or (ischild and dsc.id == nil) then
for i,m in pairs(adata) do
if false and m.material == out.defmat then
-- to solid building
for _,d in pairs(adata) do
am[#am + 1] = d
end
for ic,c in pairs(f.top.achild) do
lo('?? for_CHILD:'..ic..':'..tostring(c.shape)..':'..tostring(c.fat))
end
for k,d in pairs(amd) do
asi = forFat(d, c.base, c)
local am = {}
for _,d in pairs(desctop.adata) do
if desctop.uvref then
end
for k,sd in pairs(asubdata) do
am[#am+1] = sd
end
for k,d in pairs(amd) do
asi = forFat(d, f.base, f.top)
local am = {}
for _,d in pairs(desctop.adata) do
if desctop.uvref then
-- add side plates
for k,sd in pairs(asubdata) do
am[#am+1] = sd
-- end
for _,uv in pairs(auvb) do
uv.u = uv.u*f.top.border.uvscale[1]
end
for k,n in pairs(base) do
-- if k > 4 then break end
-- U.dump(f.awplus,'??++++++++++++ for_SUBROOF:'..i)
for k,wp in pairs(f.awplus) do
-- lo('?? for_K:'..k)
-- U.dump(wp.list, '?? for_AWP:'..i..':'..tostring(dirty))
for _,list in pairs(wp.list) do
-- U.dump(list,'??++++++++++++++++ for_WP:')
-- U.dump(list,'??++++++++++++++++ for_WP:')
for key,p in pairs(list) do
-- lo('?? if_key:'..tostring(key)..':'..tostring(tonumber(key)))
-- U.dump(desc.acorner_, '??>>>>>> for_CORNER:'..tableSize(desc.acorner_))
for i,s in pairs(desc.acorner_) do
-- if i > 1 then break end
if false then
for i,f in pairs(desc.afloor) do
if f.achild then
if f.achild then
for k,c in pairs(f.achild) do
lo('??^^^^^^^^^^^^^^^^+++++++++++++++ to_CHILD_PRN:'..k,true)
if desctop and desctop.df ~= nil then
for dae,list in pairs(desctop.df) do
for _,key in ipairs(list) do
lo('?? for_child:'..desc.floor) --#desc.prn.afloor[desc.floor].achild)
for k,c in pairs(adesc[desc.prn].afloor[desc.floor-1].achild) do
-- lo('?? for_child:'..k..':'..tostring(c.id))
if not fkeep then
for i,f in pairs(desc.afloor) do
for j,w in pairs(f.awall) do
for i,f in pairs(desc.afloor) do
for j,w in pairs(f.awall) do
forestClean(w)
else
for i,f in pairs(desc.afloor) do
for j,w in pairs(f.awall) do
for i,f in pairs(desc.afloor) do
for j,w in pairs(f.awall) do
adf[#adf+1] = w.df
local fnew = deepcopy(desc.afloor[i])
for j,w in pairs(fnew.awall) do
w.id = nil
w.id = nil
for dae,d in pairs(w.df) do
w.df[dae] = {scale = d.scale}
lo('??^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ building4test:'..tostring(pth)..':'..tableSize(amesh))
for i,s in pairs(list) do
-- lo('?? for_file:'..i..':'..s)
list = FS:findFiles(pth, '*.json', -1, true, false)
for i,s in pairs(list) do
FS:removeFile(s)
-- lo('?? onVal_gen_unique:'..tostring(pth)..':'..tableSize(amesh))
for i,s in pairs(list) do
-- lo('?? for_file:'..i..':'..s)
desc.id = nil
for i,f in pairs(desc.afloor) do
for j,w in pairs(f.awall) do
for i,f in pairs(desc.afloor) do
for j,w in pairs(f.awall) do
w.id = nil
-- toJSON(desc)
-- for key,b in pairs(adesc) do
-- U.dump(adesc[key].afloor[1].base, '<< buildingGen:'..key..':'..tostring(adesc[key].pos))
local xma,yma = 0,0
for _,path in pairs(apth) do
local img = imguiUtils.texObj(path)
local cx = 0
for i,img in pairs(aimg) do
arc[#arc+1] = {fr={cx/xma,(1-img.size.y/yma)}, to={(cx+img.size.x)/xma,1}}
else
for i,c in pairs(desctop.achild) do
if cb then cb(c) end
local v = -u:cross(vec3(0,0,1))
for i,uv in pairs(mesh.uvs) do
uv.u = suvs[i].u + ds:dot(u)
-- U.dump(w.agrid, '?? for_AGRID:')
for _,xy in pairs(w.agrid) do
-- lo('?? for_XY1:'..tostring(xy[1])..':'..tostring(xy[2]), true)
-- lo('?? duvs:'..ij[1]..':'..ij[2]..' suvs:'..#suvs..' verts:'..#mesh.verts)
for i,p in pairs(mesh.verts) do
auv[#auv+1] = {}
local auv = {}
for _,xy in pairs(desc.agrid) do
auv = M.uv4grid({desc.uv[1], desc.uv[3]}, {desc.uv[2], desc.uv[4]},
local function bufToggle(buf, ij, yes)
for i,r in pairs(buf) do
for j,c in pairs(r) do
for i,r in pairs(buf) do
for j,c in pairs(r) do
for k,cij in pairs(c) do
for j,c in pairs(r) do
for k,cij in pairs(c) do
if ij[1] == cij[1] and ij[2] == cij[2] then
local hit
for i,s in pairs(acorner) do
if (s.pos-U.proj2D(v)):length() < small_dist then
lo('?? f_SPLINE:'..ij[2]..':'..tostring(s))
for _,d in pairs(s.aforest) do
if #U.index(cedit.aforest,d.key)>0 then
end
for d,list in pairs(w.df) do
iforest = U.index(w.df[d], cedit.forest)[1]
-- U.dump(forspline.aforest, '?? for_SPLINE:'..cedit.forest..':'..cedit.fscope..':'..tp)
for i,d in pairs(forspline.aforest) do
if d.type == tp then
local hmax = 0
for _,w in pairs(floor.awall) do
-- local dae = w[tp]
if desc and desc.selection then
for i,row in pairs(desc.selection) do
for _,key in pairs(row) do
for i,row in pairs(desc.selection) do
for _,key in pairs(row) do
-- lo('?? for_SPLINE:'..i..':'..key..':'.._)
if #dmesh[cmesh].sel == 0 then
for _,m in pairs(dmesh[cmesh].data) do
m.material = nm
lo('?? for selection:')
for _,m in pairs(dmesh[cmesh].sel) do
m.material = nm
local info = currentMaterial:getFieldInfo('normalMap', 1)
for k,v in pairs(info) do
-- lo('?? KV:'..tostring(k)..':'..tostring(v))
elseif #floor.top.achild > 0 then
for _,c in pairs(floor.top.achild) do
c.mat = nm
--[[
for _,f in pairs(desc.afloor) do
for o,w in pairs(f.awall) do
for _,f in pairs(desc.afloor) do
for o,w in pairs(f.awall) do
w.mat = nm
local mat = adesc[cedit.mesh].afloor[cij[1] ].top.mat
for i,m in pairs(dmat.roof) do
-- lo('?? for_mat:'..tostring(m))
local apair,amult = T.pairsUp(base)
for _,m in pairs(amult) do
if #m > 1 then
local len,pos
for i,r in pairs(aij) do
for j,n in pairs(r) do
for i,r in pairs(aij) do
for j,n in pairs(r) do
if desc.afloor[i].awall[n].doorind then
lo('?? hide_AFOREST:'..#cedit.aforest..':'..tostring(s))
for i,d in pairs(s.aforest) do
if d.skip then
local s = adesc[cedit.mesh].selection[ij[1] ][ij[2] ]
for i,d in pairs(s.aforest) do
if d.skip then
local dae = dforest[cedit.forest].item:getData():getShapeFile()
for k,key in pairs(dsc.df[dae]) do
if key == cedit.forest then
forBuilding(desc, function(w, ij)
for _,akey in pairs(w.df) do
if #U.index(akey, key) > 0 then
if achunk then
for i,c in pairs(achunk) do
table.insert(floor.top.achild, floor.top.cchild, {
--!! houseUp(adesc[cedit.mesh], cedit.mesh)
for ic,wp in pairs(floor.awplus) do
if wp.id then
local bpos = floor.pos + adesc[cedit.mesh].pos + vec3(0, 0, aint[1][1].z) -- basic outer position
for j,v in pairs(floor.base) do
local p = v + bpos
end
for k,v in pairs(avclose) do
if v[2] == 0 then
local list = {}
for i,rc in pairs(arc) do
floor.top.body[#floor.top.body + 1] = rc
list = {}
for i,rc in pairs(arc) do
floor.top.body[#floor.top.body + 1] = rc
if desctop.achild then
for i,c in pairs(desctop.achild) do
local cobj = scenetree.findObjectById(c.id)
local jmi = math.huge
for i,r in pairs(buf) do
table.sort(r)
if j < jmi then jmi = j end
-- for _,j in pairs(r) do
local ij = {i,j}
--[[
for _,ij in pairs(aij) do
end
end
for i,r in pairs(buf) do
for _,j in pairs(r) do
for i,r in pairs(buf) do
for _,j in pairs(r) do
-- split walls
for i,e in pairs(out.asplit) do
U.dump(e, '?? u:'..i..':'..e.u..':'..tostring(base2world(adesc[cedit.mesh], e.ij)))
local desc = adesc[cedit.mesh]
for _,e in pairs(out.asplit) do
local base = desc.afloor[e.ij[1]].base
if #its > 0 then
for _,itm in pairs(its) do
local key = itm:getKey()
-- U.dump(desctop.base,'??^^^^^^^^^^^^^^^^^^^^^ ifHit:'..tostring(desctop.shape)..':'..tostring(phit)..':'..tostring(p))
for k,c in pairs(floor.top.achild) do
local cbase = {}
local base = c.base or floor.base
for _,b in pairs(base) do
cbase[#cbase+1] = base2world(desc,{i,1},b)+vec3(0,0,floor.h)
local arc = coverUp(cbase)
for _,rc in pairs(arc) do
for j=1,#rc do
if floor.top.achild then
for i,c in pairs(floor.top.achild) do
if c.id then
local function floorClean(floor)
for j,w in pairs(floor.awall) do
for dae,r in pairs(w.df) do
for j,w in pairs(floor.awall) do
for dae,r in pairs(w.df) do
w.df[dae] = {scale = r.scale or 1}
end
for dae,r in pairs(floor.top.df) do
floor.top.df[dae] = {scale = r.scale or 1}
local ima = 0
for i,r in pairs(house.selection) do
if i > ima then ima = i end
afloor[#afloor+1] = f
for j,w in pairs(f.awall) do
for dae,_ in pairs(w.df) do
for j,w in pairs(f.awall) do
for dae,_ in pairs(w.df) do
w.df[dae] = {scale = w.df[dae].scale or 1}
end
for dae,_ in pairs(f.top.df) do
f.top.df[dae] = {scale = f.top.df[dae].scale or 1}
end
-- for k,f in pairs(afloor) do
for k = #afloor,1,-1 do
-- table.insert(house.afloor, ito, newfloor)
for j,w in pairs(newfloor.awall) do
for dae,_ in pairs(w.df) do
for j,w in pairs(newfloor.awall) do
for dae,_ in pairs(w.df) do
w.df[dae] = {scale = w.df[dae].scale or 1}
end
for dae,_ in pairs(newfloor.top.df) do
newfloor.top.df[dae] = {scale = newfloor.top.df[dae].scale or 1}
floor.top.body = coverUp(floor.base)
for i,c in pairs(floor.top.achild) do
c.ridge = {}
desc.afloor[#desc.afloor + 1] = newfloor
for i,w in pairs(floor.awall) do
w.roofborder = {yes=false}
W.floorClear(desc.afloor[#desc.afloor-1])
for j,w in pairs(newfloor.awall) do
w.ij[1] = newfloor.ij[1]
-- lo('>> forHit:')
for i,f in pairs(desc.afloor) do
-- lo('?? forHit_f:'..i)
local cbase = {}
for _,b in pairs(base) do
cbase[#cbase+1] = base2world(desc,{i,1},b)+vec3(0,0,f.h)
--[[
for _,b in pairs(desctop.base) do
base[#base+1] = base2world(desc,{i,1},b)
if #f.top.achild > 0 then -- and not f.top.ridge then -- (not f.top.ridge or not f.top.ridge.on) then
for _,c in pairs(f.top.achild) do
-- U.dump(c.base,'?? forHit_child:'..i..':'..tostring(c.shape)..':'.._)
if false and f.awplus then
for j,wp in pairs(f.awplus) do
-- U.dump(wp, '?? for_WP:'..i..':'..j)
-- U.dump(wp, '?? for_WP:'..i..':'..j)
for k,r in pairs(wp.list) do
local vn = (r[2]-r[1]):cross(r[3]-r[2])
-- walls
for j,w in pairs(f.awall) do
-- local phit = U.ray2plane(ray,p,vec3(0,0,1))
-- lo('?? for_build:'..ij[1]..':'..ij[2])
for _,akey in pairs(w.df) do
local cind = U.index(akey, key)
dae = desc[tp][1]
for _,akey in pairs(desc.df) do
local cind = U.index(akey, key)
local desc = (id and adesc[id]) and adesc[id] or adesc[cedit.mesh] --or adesc[id]
-- for _,f in pairs(desc.afloor) do
-- f.top.cchild = nil
-- data = cedit.cval['Drag_Z'][2]
for ord,m in pairs(data) do
-- for i = 1,6,6 do
local dpop,dtrans = forFaces(cedit.cval['Drag_Z'].afaces)
for ord,m in pairs(dmesh[meshID].data) do
m.faces = U.clone(cedit.cval['Drag_Z'].afaces[ord])
local dpopsel,dtranssel = forFaces(cedit.cval['Drag_Z'].aselfaces)
for ord,m in pairs(dmesh[meshID].sel) do
m.faces = U.clone(cedit.cval['Drag_Z'].aselfaces[ord])
dmesh[meshID].buf = {}
for ord,m in pairs(cedit.cval['Drag_Z'].abuffaces) do
dmesh[meshID].buf[ord] = {
-- dtranssel->dtrans
for ord,list in pairs(dtranssel) do
for _,i in pairs(list) do
for ord,list in pairs(dtranssel) do
for _,i in pairs(list) do
-- dtrans[ord][#dtrans[ord] + 1] = i
-- dtrans->dpop
for ord,list in pairs(dtrans) do
for _,i in pairs(list) do
for ord,list in pairs(dtrans) do
for _,i in pairs(list) do
dpop[ord][#dpop[ord] + 1] = i
for ord,m in pairs(dmesh[meshID].data) do
amesh[#amesh + 1] = m
-- if true then return end
for i,f in pairs(desc.selection) do
-- lo('?? fsel:'..tableSize(f))
if tableSize(f) == 1 then
for j,key in pairs(f) do
-- lo('?? if_SPL:'..tostring(s))
if s.base then
for k,b in pairs(s.base) do
-- lo('?? if_NODE:'..k..':'..tostring(b+vec3(0,0,s.box.minExtents.z))..':'..tostring(b+vec3(0,0,s.box.maxExtents.z)))
local aind = U.split(key,'_')
for _,iw in pairs({aind[1],aind[#aind]+1}) do
-- lo('?? for_I:'..iw)
lo('?? rcp:'..tostring(rayCast.pos))
for i,d in pairs(desc.aspline[ij[1]][ij[2]].aforest) do
if d.key == cedit.forest then
cedit.cval['DragPos'].cpos = p
for i,d in pairs(desc.aspline[ij[1]][ij[2]].aforest) do
if d.key == cedit.forest then
local db = (U.proj2D(rayCast.pos - base2world(desc, out.acorner[1].ij))):dot(u)
for k,e in pairs(out.acorner) do
desc.afloor[e.ij[1]].base[e.ij[2]] = desc.afloor[e.ij[1]].base[e.ij[2]] + db*u
--------------------
for k,c in pairs(incorner) do
-- corossing with opposite side
for j,b in pairs(base) do
if math.abs(j-ind) > 1 then
-- U.dump(floor.top.achild, '?? achild:')
for i,c in pairs(floor.top.achild) do
if c.id then
if db:length() > 0 then
for k,e in pairs(incorner) do
-- for k,e in pairs(out.acorner) do
for k,e in pairs(incorner) do
-- for k,e in pairs(out.acorner) do
-- db = vec3(0.1,0,0)
-- _dbdrag = true
for i,s in pairs(cedit.cval['DragPos'].insplit) do
local base = desc.afloor[s.floor].base
if desc and desc.selection and scope=='wall' and tableSize(desc.selection)==1 then
for i,f in pairs(desc.selection) do
for _,key in pairs(f) do
for i,f in pairs(desc.selection) do
for _,key in pairs(f) do
if not tonumber(key) then
cedit.cval['DragPos'] = {}
for _,f in pairs(desc.afloor) do
cedit.cval['DragPos'][#cedit.cval['DragPos'] + 1] = U.clone(f.base)
U.dump(side, '?? SIDE:'..tostring(cij))
for i,f in pairs(side) do
for j,w in pairs(f) do
for i,f in pairs(side) do
for j,w in pairs(f) do
local ij = {i, w}
lo('?? dv:'..tostring(dirhit)..':'..tostring(dv))
for ord,m in pairs(dmesh[cmesh].data) do
for i = 1,#m.verts do
]]
for ord,m in pairs(dmesh[cmesh].data) do
afaces[#afaces+1] = U.clone(m.faces)
if dmesh[cmesh].trans[ord] ~= nil then
for _,f in pairs(dmesh[cmesh].trans[ord].faces) do
list[#list + 1] = f
if dmesh[cmesh].buf[ord] ~= nil then
for _,f in pairs(dmesh[cmesh].buf[ord].faces) do
-- list[#list + 1] = f
--[[
for _,m in pairs(dmesh[cmesh].trans) do
-- afaces[#afaces+1] = U.clone(m.faces)
local aselfaces = {}
for _,m in pairs(dmesh[cmesh].sel) do
aselfaces[#aselfaces+1] = U.clone(m.faces)
local abuffaces = {}
for _,m in pairs(dmesh[cmesh].buf) do
abuffaces[#abuffaces+1] = U.clone(m.faces)
-- TODO: use childRebase?
for _,c in pairs(floor.top.achild) do
if c.imap then
-- U.dump(c.imap, '?? for_c_map:'..ij[2])
for k,m in pairs(c.imap) do
if m == ij[2] then
local floor = desc.afloor[ij[1]]
for i,c in pairs(incorner) do
if c.ij[1] == ij[1] and c.ij[2] == ij[2] then
-- TODO: use childRebase?
for _,c in pairs(floor.top.achild) do
if c.imap then
-- U.dump(c.imap, '?? for_c_map:'..ij[2])
for k,m in pairs(c.imap) do
if m == ij[2] then
local dmi,bmi = near_dist
for k,q in pairs(base) do
local d = a:distanceToLine(U.mod(k+1,base), q)
local hit = false
for j,p in pairs(floor.base) do
a = p + floor.pos
end
for k,q in pairs(floorpre.base) do
b = q + floorpre.pos
-- local dmi,imi = math.huge
for k,q in pairs(floorpre.base) do
local d = a:distanceToLineSegment(U.mod(k+1,floorpre.base), q)
local ishit
for i1,f1 in pairs(desc.afloor) do
for i2,f2 in pairs(adesc[desc.prn].afloor) do
for i1,f1 in pairs(desc.afloor) do
for i2,f2 in pairs(adesc[desc.prn].afloor) do
a,b,tp = forNear(f1, f2, desc)
local isperp = true
for k,v in pairs(ashift) do
lo('?? if diff:'..i1..':'..i2..':'..k..':'..U.vang(v, b-a)..':'..tostring(U.vang(v, b-a) % math.pi))
forBuilding(adesc[cedit.mesh], function(w, ij)
for _,k in pairs({'plinth','roofborder'}) do
if w[k] then
local dmi,ijmi,ds=math.huge
for i,a in pairs(basea) do
for j,b in pairs(baseb) do
for i,a in pairs(basea) do
for j,b in pairs(baseb) do
local d = (a+pa-b+pb):length()
dmi,ds=math.huge,nil
for i,a in pairs(basea) do
for j,b in pairs(baseb) do
for i,a in pairs(basea) do
for j,b in pairs(baseb) do
local d = U.toLine(a+pa,{b+pb,U.mod(j+1,baseb)+pb})
U.dump(out.ahole, '??__________ inhole:'..tostring(base2world(adesc[cedit.mesh], cij))..':'..tostring(cw.u))
for i=1,4 do -- in pairs(out.ahole) do
rc[#rc+1] = world2wall(out.ahole[i], cw)
local aij = forSide(cij)
for i,r in pairs(aij) do
if i == cij[1] then
local jmi = math.huge
for _,j in pairs(r) do
awall[#awall+1] = floor.awall[j]
lo('?? if_edit:'..tostring(cedit.mesh)..':'..tostring(id)..':'..tableSize(adesc))
-- for k,d in pairs(adesc) do
-- lo('?? if_DESC:'..k..':'..tostring(adesc[k]))
cedit.aforest = {}
for i,f in pairs(desc.aspline) do
for key,s in pairs(f) do
for i,f in pairs(desc.aspline) do
for key,s in pairs(f) do
if s.id == id then
-- dforest[key].type
for i,p in pairs(cw.achild[ihole].base) do
-- lo('?? for_p:'..tostring(cw.pos)..':'..tostring(p)..':'..tostring(cw.u)..':'..tostring(cw.v))
-- out.ahole = nil
-- for _,c in pairs(cw.achild) do
-- end
elseif inrc ~= nil then
for i,c in pairs(floor.top.achild) do
-- U.dump(c, '?? for_LIST:'..i..':'..inrc..' scch:'..tostring(scchild)..':'..#U.index(c.list, inrc))
else
for i,m in pairs(dmat.wall) do
if tostring(m) == cmat then
-- for i,f in pairs(desc.afloor) do
-- end
--[[
for ord,m in pairs(dmesh[id].sel) do
for _,f in pairs(m.faces) do
for ord,m in pairs(dmesh[id].sel) do
for _,f in pairs(m.faces) do
out.avedit[#out.avedit + 1] = m.verts[f.v + 1]
local apick = {}
for _,f in pairs(m.faces) do
if #U.index(apick, f.v) == 0 then
out.avedit = {}
for _,x in pairs({ob.minExtents.x, ob.maxExtents.x}) do
for _,y in pairs({ob.minExtents.y, ob.maxExtents.y}) do
for _,x in pairs({ob.minExtents.x, ob.maxExtents.x}) do
for _,y in pairs({ob.minExtents.y, ob.maxExtents.y}) do
for _,z in pairs({ob.minExtents.z, ob.maxExtents.z}) do
for _,y in pairs({ob.minExtents.y, ob.maxExtents.y}) do
for _,z in pairs({ob.minExtents.z, ob.maxExtents.z}) do
out.avedit[#out.avedit+1] = vec3(x, y, z)
local function forNear(floor, floorpre, child)
for j,p in pairs(floor.base) do
local a = p + floor.pos
local hit = false
for k,q in pairs(floorpre.base) do
local b = q + floorpre.pos
local dmi,imi = math.huge
for j,q in pairs(floorpre.base) do
local d = a:distanceToLineSegment(U.mod(j+1,floorpre.base), q)
forBuilding(desc, function(w, ij)
for d,list in pairs(w.df) do
for _,k in ipairs(list) do
if inrc ~= nil then
for i,c in pairs(floor.top.achild) do
-- U.dump(c, '?? for_LIST2:'..i..':'..inrc..' scch:'..tostring(scchild)..':'..#U.index(c.list, inrc))
out.asplit = nil
for i,a in pairs(desc.aspline) do
local H = forHeight(desc.afloor, i-1)
local H = forHeight(desc.afloor, i-1)
for j,d in pairs(a) do
-- U.dump(d, '?? for_D:'..d.id..':'..id..':'..tostring(tostring(d.id) == tostring(id)))
local hit = false
for k,v in pairs(d.base) do
if true then
local center = vec3(0,0,0)
for _,v in pairs(dmesh[cmesh].apick) do
center = center + m.verts[v+1]
local dr = dirobj*0.02
for _,v in pairs(dmesh[cmesh].apick) do
m.verts[v+1] = m.verts[v+1] + dir*dr
local amesh = dmesh[cmesh].data
for _,m in pairs(amesh) do
for _,v in pairs(m.verts) do
for _,m in pairs(amesh) do
for _,v in pairs(m.verts) do
center = center + v
local dr = dirobj*0.02
for i,m in pairs(amesh) do
local m = amesh[i]
local m = amesh[i]
for j,v in pairs(m.verts) do
m.verts[j] = m.verts[j] + dir*dr
set(floor, 'h', floor.h + dir*0.02) -- 0.2 * dir)
for _,w in pairs(floor.awall) do
set(w, 'v', vec3(0,0,floor.h))
local floor = house.afloor[#house.afloor]
for _,w in pairs(floor.awall) do
for i,key in pairs(w.df[w.win]) do
for _,w in pairs(floor.awall) do
for i,key in pairs(w.df[w.win]) do
-- for i,key in pairs(w.awin) do
for i,key in pairs(w.df[w.win]) do
-- for i,key in pairs(w.awin) do
editor.removeForestItem(fdata, dforest[key].item)
--- update u's
for j,w in pairs(f.awall) do
w.u = base[j % #base + 1] - base[j]
if desc.selection then
for _,s in pairs(desc.selection) do
forWall(U.split(s, '_'))
-- U.dump(asij, '?? asij:')
for i,f in pairs(asij) do
for _,j in pairs(f) do
for i,f in pairs(asij) do
for _,j in pairs(f) do
-- lo('?? for_wall:'..tostring(f)..':'..tostring(j))
_dbdrag = true
for i,floor in pairs(adesc[cedit.mesh].afloor) do
-- forFloor(floor, i)
local function floor2level(f, ind)
for _,w in pairs(f.awall) do
w.ij[1] = ind
if f.achild then
-- for _,c in pairs(f.achild) do
-- end
-- floor2level(desc.afloor[cij[1]], cij[1])
for _,w in pairs(floor.awall) do
w.ij[1] = w.ij[1]+dir
end
for _,w in pairs(desc.afloor[cij[1] ].awall) do
w.ij[1] = w.ij[1]-dir
if floor.achild then
for _,c in pairs(floor.achild) do
c.floor = c.floor + dir
if desc.afloor[cij[1]].achild then
for _,c in pairs(desc.afloor[cij[1]].achild) do
c.floor = c.floor - dir
--[[
for _,w in pairs(floor.awall) do
w.ij[1] = w.ij[1]+dir
end
for _,w in pairs(desc.afloor[cij[1] ].awall) do
w.ij[1] = w.ij[1]-dir
local ima = 0
for i,r in pairs(house.selection) do
if i > ima then ima = i end
afloor[#afloor+1] = f
for j,w in pairs(f.awall) do
for dae,_ in pairs(w.df) do
for j,w in pairs(f.awall) do
for dae,_ in pairs(w.df) do
w.df[dae] = {scale = w.df[dae].scale or 1}
end
for dae,_ in pairs(f.top.df) do
f.top.df[dae] = {scale = f.top.df[dae].scale or 1}
end
-- for k,f in pairs(afloor) do
for k = #afloor,1,-1 do
-- table.insert(house.afloor, ito, newfloor)
for j,w in pairs(newfloor.awall) do
for dae,_ in pairs(w.df) do
for j,w in pairs(newfloor.awall) do
for dae,_ in pairs(w.df) do
w.df[dae] = {scale = w.df[dae].scale or 1}
end
for dae,_ in pairs(newfloor.top.df) do
newfloor.top.df[dae] = {scale = newfloor.top.df[dae].scale or 1}
floor.h, floor.awall[1], cij[1] + 1)
for j,w in pairs(awall) do
w.mat = floor.awall[j].mat
floor2level(f, i)
-- for j,w in pairs(f.awall) do
-- w.ij[1] = w.ij[1] + 1
newfloor.top.ij = {#house.afloor}
for j,w in pairs(newfloor.awall) do
w.ij[1] = newfloor.ij[1]
floor = house.afloor[#house.afloor]
for _,w in pairs(floor.awall) do
forestClean(w)
lo('?? unsel:'..#dmesh[cmesh].sel..':'..#dmesh[cmesh].data)
-- for _,m in pairs(dmesh[cmesh].sel) do
-- end
local amesh = {} --dmesh[cmesh].data
for _,m in pairs(dmesh[cmesh].data) do
amesh[#amesh + 1] = m
end
for _,m in pairs(dmesh[cmesh].sel) do
amesh[#amesh + 1] = m
local floor = desc.afloor[ind]
for j,w in pairs(floor.awall) do
forestClean(w)
elseif floor.top.achild then
for i,c in pairs(floor.top.achild) do
local cobj = scenetree.findObjectById(c.id)
if string.find(cmd, 'scope') then
for _,t in pairs({'building','floor','wall','top'}) do
if string.find(cmd, t) then
if scope == 'top' then
for _,t in pairs({'gable','shed','pyramid','flat'}) do
if string.find(cmd,t) then
local dset = {o=0,y=0,g=0,b=0}
for _,list in pairs(conf.set) do
for j,p in pairs(list) do
for _,list in pairs(conf.set) do
for j,p in pairs(list) do
if p == 'a' then
-- lo('?? for_save:')
-- for j,f in pairs(desc.afloor) do
-- lo('?? for_child:'..j..':'..tostring(f.achild))
floor.top.cchild = nil
for i,c in pairs(floor.top.achild) do
if c.id then
lo('?? for_child:'..desc.floor) --#desc.prn.afloor[desc.floor].achild)
for k,c in pairs(adesc[desc.prn].afloor[desc.floor-1].achild) do
-- lo('?? for_child:'..k..':'..tostring(c.id))
end
for i,f in pairs(desc.afloor) do
for j,w in pairs(f.awall) do
for i,f in pairs(desc.afloor) do
for j,w in pairs(f.awall) do
forestClean(w)
local floor = desc.afloor[cij[1] ]
for j,w in pairs(floor.awall) do
forestClean(w)
-- lo('?? for_fwhite:'..#out.fwhite)
for _,v in pairs(out.fwhite) do
debugDrawer:drawLine(v[1], v[2], ColorF(1,1,1,1), 4)
if out.fmtop then
for _,pth in pairs(out.fmtop) do
for i=1,#pth-1 do
if false and out.dyell then
for i,row in pairs(out.dyell) do
for j,pth in pairs(row) do
for i,row in pairs(out.dyell) do
for j,pth in pairs(row) do
local incorner
U.dump(out.acorner, '?? acorn:')
for i,c in pairs(out.acorner) do
if c.ij[1] == i and c.ij[2] == j then
-- lo('?? for_fwhite:'..#out.fwhite)
for _,pth in pairs(out.fyell) do
-- Render.path(pth, color(255,255,150,155), 4)
for i=2,#out.ahole do
-- for _,v in pairs(out.ahole) do
debugDrawer:drawLine(out.ahole[i-1], out.ahole[i], ColorF(1,1,0,1), 4)
if out.aforest then
for _,s in pairs(out.aforest) do
local r = 0.02*math.sqrt((s-core_camera.getPosition()):length())
for i = 1,#out.aedge.e-1 do
-- for _,d in pairs(out.aedge.e) do
debugDrawer:drawLine(out.aedge.e[i], out.aedge.e[i+1], ColorF(1,1,1,1), 4)
if out.flbl then
for _,l in pairs(out.flbl) do
if l[2] then
-- U.dump(out.asplit, '?? mark_split:')
for _,e in pairs(out.asplit) do
debugDrawer:drawLine(e[1], e[2], ColorF(1,1,0,1))
-- lo('?? for_DYELL:')
for i,row in pairs(out.dyell) do
-- if row.noz then
-- end
for j,pth in pairs(row) do
-- if not tonumber(j) and j ~= 'len' then
-- U.dump(out.acorner, '?? acorn:')
for _,c in pairs(out.acorner) do
if i==c.ij[1] then
local floor = desc.afloor[ij[1]]
for k,p in pairs({
base2world(desc, ij),
-- lo('?? ab:'..tostring(a)..':'..tostring(b)..':'..tostring(desc.pos)..':'..tostring(rayCast.pos))
for k,p in pairs({a, b}) do
local campos = core_camera.getPosition()
-- if scope == 'floor' then
-- for i,_ in pairs(base) do
-- end
local pmi,pma,mi,ma = math.huge,0
for i,r in pairs(aside) do
if i == cij[1] then
if i == cij[1] then
for _,j in pairs(r) do
local prj = (U.mod(j,base) - base[cij[2]]):dot(u)
local jp = cij[2]
for k,j in pairs(aside[cij[1]]) do
local p1,p2 = (base[j] - base[cij[2]]):dot(u),(U.mod(j+1,base) - base[cij[2]]):dot(u)
end)
for i,f in pairs(desc.afloor) do
forestClean(f)
desc.id = nil
for i,f in pairs(desc.afloor) do
for j,w in pairs(f.awall) do
for i,f in pairs(desc.afloor) do
for j,w in pairs(f.awall) do
w.id = nil
if tableSize(incopy) == 1 then
for id,buf in pairs(incopy) do
local akey = {}
local akey = {}
for k,r in pairs(buf) do
akey[#akey + 1] = k
local afloor = {}
for _,k in pairs(akey) do
-- for i,r in pairs(buf) do
for _,k in pairs(akey) do
-- for i,r in pairs(buf) do
local r = buf[k]
-- append floors
for _,f in pairs(afloor) do
floorClean(f)
if tableSize(incopy) == 1 then
for id,b in pairs(incopy) do
buf = b
local akey = {}
for k,r in pairs(buf) do
akey[#akey+1] = k
local jmi = math.huge
for _,j in pairs(buf[akey[1]]) do
-- for j,_ in pairs(buf[akey[1]]) do
for _,j in pairs(buf[akey[1]]) do
-- for j,_ in pairs(buf[akey[1]]) do
awall[#awall+1] = deepcopy(dsrc.afloor[akey[1]].awall[j])
--[[
for _,j in pairs(buf[akey[1] ]) do
-- for j,_ in pairs(buf[akey[1] ]) do
for _,j in pairs(buf[akey[1] ]) do
-- for j,_ in pairs(buf[akey[1] ]) do
end
end
for _,j in pairs(buf[akey[1] ]) do
-- for j,_ in pairs(buf[akey[1] ]) do
for _,j in pairs(buf[akey[1] ]) do
-- for j,_ in pairs(buf[akey[1] ]) do
end
local L = amm.L[1] + (amm.L[2] - amm.L[1])*c
for j,q in pairs(ain.base) do
if ain.dir < 0 then
local n = 0
for _,j in pairs(buf[akey[1]]) do
-- for j,_ in pairs(buf[akey[1]]) do
for _,j in pairs(buf[akey[1]]) do
-- for j,_ in pairs(buf[akey[1]]) do
local w = awall[n+1] -- deepcopy(dsrc.afloor[akey[1]].awall[j])
local w = awall[n+1] -- deepcopy(dsrc.afloor[akey[1]].awall[j])
for dae,r in pairs(w.df) do
w.df[dae] = {scale = r.scale}
n = 1
for _,j in pairs(buf[akey[1]]) do
-- for j,_ in pairs(buf[akey[1]]) do
for _,j in pairs(buf[akey[1]]) do
-- for j,_ in pairs(buf[akey[1]]) do
-- lo('?? inserting:'..(ij[2]+n), true)
-- cleanup
for j,w in pairs(floor.awall) do
forestClean(w)
end
for j,w in pairs(newfloor.awall) do
for dae,r in pairs(w.df) do
for j,w in pairs(newfloor.awall) do
for dae,r in pairs(w.df) do
w.df[dae] = {scale = r.scale or 1}
end
for dae,r in pairs(newfloor.top.df) do
newfloor.top.df[dae] = {scale = r.scale or 1}
local buf = {}
for i,r in pairs(desc.selection) do
table.sort(r)
U.dump(buftgt, '?? BT:')
for i,r in pairs(buftgt) do
ftgt = desc.afloor[i]
lo('?? for_row:'..i..':'..tostring(desc)..':'..tostring(ftgt))
for j,_ in pairs(r) do
acol[#acol+1] = j
lo('?? ftgt_pre:'..#acol..':'..jmi..':'..#ftgt.base)
for o,j in pairs(acol) do
if o > 1 then
-- insert
for n,j in pairs(acol) do
local akeytgt = {}
for k,r in pairs(buftgt) do
akeytgt[#akeytgt+1] = k
local awall = {}
for _,j in pairs(buf[akey[1]]) do
-- for j,_ in pairs(buf[akey[1]]) do
for _,j in pairs(buf[akey[1]]) do
-- for j,_ in pairs(buf[akey[1]]) do
lo('?? for_wall:'..j)
local w = awall[#awall]
for dae,d in pairs(w.df) do
w.df[dae] = {scale = d.scale}
-- lo('?? iind:'..iind)
for j,w in pairs(awall) do
-- to base
dnew.afloor[1].top.ij[1] = #akey - #dnew.afloor + 1
for _,w in pairs(dnew.afloor[1].awall) do
for dae,r in pairs(w.df) do
for _,w in pairs(dnew.afloor[1].awall) do
for dae,r in pairs(w.df) do
w.df[dae] = {scale = w.df[dae].scale}
if i == 1 then
for j,w in pairs(desc.afloor[akey[i]].awall) do
objDown(w)
-- U.dump(out.acorner, '?? AC2:')
for _,e in pairs(out.acorner) do
debugDrawer:drawLine(e.line[1], e.line[2], ColorF(1,1,0,1), 2)
-- U.dump(out.asplit, '?? mark_split:')
for _,e in pairs(out.asplit) do
debugDrawer:drawLine(e.line[1], e.line[2], ColorF(1,1,0,1))
if out.fcyan then
for _,v in pairs(out.fcyan) do
debugDrawer:drawLine(v[1], v[2], ColorF(0,1,1,1), 4)
-- U.dump(s.aforest,'>> windowsToggle:'..tostring(s))
for _,h in pairs(s.areg) do
local av = U.spline2plane(h, s.ap, s.adist)
-- U.dump(desc.acorner_, '?? to_SUBTRACT:', true)
for n,p in pairs(acorner) do
-- local isext
local hit
for m,q in pairs(desc.acorner_) do
-- local hit
for i,a in pairs(p.list) do
for j,b in pairs(q.list) do
for i,a in pairs(p.list) do
for j,b in pairs(q.list) do
if a[1] == b[1] and a[2] == b[2] then
local hit
for i,a in pairs(p.list) do
for j,b in pairs(q.list) do
for i,a in pairs(p.list) do
for j,b in pairs(q.list) do
if a[1] == b[1] and a[2] == b[2] then
if not daePath[tp..'_corner'] then return end
for _,s in pairs(daePath[tp..'_corner']) do
-- parse the name
local p = U.proj2D(cw.pos)
for _,d in pairs(awall) do
if U.proj2D(d.pos):distance(p) < small_dist and math.abs(d.u:length() - cw.u:length()) < small_dist then
local p = U.proj2D(cw.pos)
for k,d in pairs(desc.afloor[i].awall) do
-- lo('?? if_POS:'..i..':'..k..':'..tostring(U.proj2D(d.pos))..':'..tostring(p)..':'..tostring(d.pilaster))
U.dump(dfirst,'?? to_DEL:'..ndel)
for f,jfirst in pairs(dfirst) do
for j = 1,ndel do
--[[
for _,d in pairs(adel) do
local buf = {}
local lastrow = 0
for i,row in pairs(desc.selection) do
for _,j in pairs(row) do
for i,row in pairs(desc.selection) do
for _,j in pairs(row) do
if not p then
-- U.dump(desc.selection, '?? for_SPLIT:'..lastrow)
for i,s in pairs(asplit) do
-- U.dump(s, '??______************ for_S:'..i..':'..s[1]..'/'..lastrow)
if U._PRD == 0 then list = deepcopy(daePath[tp]) end
for i,pth in pairs(list) do
local m = ddae[pth]
-- U.dump(desc.acorner_, '?? to_SUBTRACT:', true)
for _,p in pairs(acorner) do
for _,q in pairs(desc.acorner_) do
for _,p in pairs(acorner) do
for _,q in pairs(desc.acorner_) do
if (p.pos-q.pos):length() < small_dist then
local hit
for i,a in pairs(p.list) do
for j,b in pairs(q.list) do
for i,a in pairs(p.list) do
for j,b in pairs(q.list) do
if a[1] == b[1] and a[2] == b[2] then
for i=#list,1,-1 do
-- for i,d in pairs(list) do
if ddae[list[i]] and ddae[list[i]].mute then
local apair = T.pairsUp(base)
for i,p in pairs(apair) do
if ij[2] == p[1] then
local base,imap = U.polyStraighten(floor.base)
for k,v in pairs(imap) do
if v == ij[2] then
if apair then
for i,p in pairs(apair) do
local fit
local vb,ve = sbase[U.mod(j,#sbase)], sbase[U.mod(j+1,#sbase)]
for k,c in pairs(achild) do
-- for top children
-- for top children
for _,ib in pairs({j,U.mod(j+1,#sbase)}) do
-- if wall ends are in the child vertex mapping
-- U.dump(c, '?? for_child: floor:'..i..' wall:'..j..':'..#aind)
for _,ic in pairs(aind) do
local pchild = cbase[k][ic] --c.base[ic]
local rebuild
for i,row in pairs(buf) do
local floor = adesc[cedit.mesh].afloor[i]
for _,r in pairs(row) do
-- local v = -U.perp(U.mod(r+1, base) - base[r]):normalized()
w.id = nil
for dae,d in pairs(w.df) do
w.df[dae] = {scale = d.scale}
w.id = nil
for dae,d in pairs(w.df) do
w.df[dae] = {scale = d.scale}
-- move base
for _,j in pairs(row) do
-- walls to move
local vb,ve = asbase[i][U.mod(j,#asbase[i])],asbase[i][U.mod(j+1,#asbase[i])]
for k,c in pairs(floor.top.achild) do
-- for top children
-- for top children
for _,ib in pairs({j,U.mod(j+1,#base)}) do
-- U.dump(c.imap, '?? in_map:'..ib..' j:'..j)
-- U.dump(c, '?? for_child: floor:'..i..' wall:'..j..':'..#aind)
for _,ic in pairs(aind) do
local pchild = acbase[i][k][ic] --c.base[ic]
local av = {}
for _,f in pairs(m.faces) do
if #U.index(av, f.v) == 0 then
U.dump(av, '?? h_IVERTS:'..tostring(w.u)..':'..tostring(dmesh[w.id]))
for _,v in pairs(av) do
-- lo('?? for_v:'..tostring(m.verts[v+1]))
lo('?? mat2xml.for_node:'..tostring(xml))
-- for i,k in pairs(xml.kids) do
-- lo(k.name)
local list = {}
for i,desc in pairs(ahouse) do
editor.clearObjectSelection()
-- U.dump(w.df, '?? for_wall:'..ij[1]..':'..ij[2])
for pth,list in pairs(w.df) do
for _,id in pairs(list) do
for pth,list in pairs(w.df) do
for _,id in pairs(list) do
local item = dforest[id].item
if desc.selection and tableSize(desc.selection) == 1 then
for j,aw in pairs(desc.selection) do
if not desc.aspline then desc.aspline = {} end --{aij={}} end
-- clean folder
for i,s in pairs(amesh) do
lo('?? for_file:'..i..':'..s)
scope = 'building'
for _,d in pairs(adesc) do
if not df[d.id] then df[d.id] = {list={},apos={}} end
forBuilding(d, function(w, ij)
for pth,list in pairs(w.df) do
for _,id in pairs(list) do
for pth,list in pairs(w.df) do
for _,id in pairs(list) do
local item = dforest[id].item
local list = groupBat:getObjects()
for _,o in pairs(list) do
local om = scenetree.findObjectById(tonumber(o))
local item,key
for id,list in pairs(dpos) do
for _,p in pairs(list) do
for id,list in pairs(dpos) do
for _,p in pairs(list) do
for _,o in pairs(df[id].list) do
for _,p in pairs(list) do
for _,o in pairs(df[id].list) do
local mtx = o.mtx
--[[
for i,o in pairs(af) do
item = fdata:createNewItem(o.obj, o.mtx, o.scale)
local df = {}
for _,d in pairs(sdesc) do
for _,p in pairs(dpos[d.id]) do
for _,d in pairs(sdesc) do
for _,p in pairs(dpos[d.id]) do
lo('?? topos:'..d.id..':'..tostring(p))
forBuilding(d, function(w, ij)
for pth,list in pairs(w.df) do
for _,id in pairs(list) do
for pth,list in pairs(w.df) do
for _,id in pairs(list) do
local item = dforest[id].item
if false then
for i,desc in pairs(adesc) do
local ascan = W.buildingScan(desc, function(ascan)
scope = nil
for _,d in pairs(adesc) do
local nm = 'b_'..d.id
lo('?? deld:'..tostring(scope))
for _,nm in pairs(list) do
if not scenetree.findObject(nm) then
local i = 1
for id,d in pairs(adesc) do
if i > istart then
]]
for i,id in pairs(aid) do
lo('??^^^^^^^^^^^^^^^^^^^ recover_house:'..id)
local aid = {}
for id,d in pairs(adesc) do
d.id = nil
end
for i,id in pairs(aid) do
lo('??^^^^^^^^^^^^^^^^^^^ recover_house:'..id)
-- top childs to floor childs
for _,c in pairs(floor.top.achild) do
-- new floor child
child.awall = {}
for i,b in pairs(child.base) do
child.awall[#child.awall+1] = deepcopy(floor.awall[c.imap[i]])
for _,w in pairs(child.awall) do
for dae,r in pairs(w.df) do
for _,w in pairs(child.awall) do
for dae,r in pairs(w.df) do
w.df[dae] = {scale = w.df[dae].scale}
end
for j,w in pairs(floor.awall) do
objDown(w)
out.avedit = {}
for i,a in pairs(cchild.base) do
for _,c in pairs(achild) do
for i,a in pairs(cchild.base) do
for _,c in pairs(achild) do
if _ ~= desc.afloor[cij[1] ].top.cchild then
if _ ~= desc.afloor[cij[1] ].top.cchild then
for j,b in pairs(c.base) do
if (a-b):length() < small_dist then
f.ij[1] = f.ij[1]+1
for j,w in pairs(f.awall) do
w.ij[1] = w.ij[1]+1
-- U.dump(desc.acorner_, '?? corners_shift:')
for i,b in pairs(desc.acorner_) do
for j,f in pairs(b.list) do
for i,b in pairs(desc.acorner_) do
for j,f in pairs(b.list) do
f[1] = f[1] + 1
if desc.acorner_ then
for i,b in pairs(desc.acorner_) do
for j,f in pairs(b.list) do
for i,b in pairs(desc.acorner_) do
for j,f in pairs(b.list) do
f[1] = f[1] - 1
if desc.afloor[2] then
for _,w in pairs(desc.afloor[2].awall) do
w.doorstairs = nil
if floor.top.achild then
for j,c in pairs(floor.top.achild) do
cbase[#cbase+1] = U.clone(c.base)
-- U.dump(dmove, '?? to_move:')
for ic,c in pairs(cedit.cval['DragPos'].cbase) do
for ib,b in pairs(c) do
for ic,c in pairs(cedit.cval['DragPos'].cbase) do
for ib,b in pairs(c) do
floor.top.achild[ic].base[ib] = b + dmove[ic][ib]
out.ahole = {}
for i,p in pairs(b.base) do
out.ahole[#out.ahole+1] = cw.pos + p.x*cw.u:normalized() + p.y*cw.v:normalized()
local floor = desc.afloor[#desc.afloor]
for _,w in pairs(floor.awall) do
forestClean(w)
cedit.cval['DragVal'] = {}
for i,f in pairs(desc.afloor) do
cedit.cval['DragVal'][#cedit.cval['DragVal'] + 1] = {base = U.clone(f.base), achild = {}}
local achild = cedit.cval['DragVal'][#cedit.cval['DragVal']].achild
for i,c in pairs(f.top.achild) do
-- cedit.cval['DragVal'][#cedit.cval['DragVal']].achild[cedit.cval['DragVal'][#cedit.cval['DragVal']].achild+1] = U.clone(c.base)
local fchild = {}
for i,d in pairs(f.achild) do
fchild[i] = {}
fchild[i] = {}
for j,fc in pairs(d.afloor) do
fchild[i][#fchild[i]+1] = U.clone(fc.base)
local base = cedit.cval['DragVal'][ij[1]].base
for j,_ in pairs(base) do
desc.afloor[ij[1]].base[j] = center + U.vturn(base[j]-center, 2*math.pi*val/360)
-- if ij[1] == #desc.afloor and floor.top.achild then
for k,c in pairs(floor.top.achild) do
-- U.dump(c, '?? for_child:'..k)
if floor.achild then
for i,d in pairs(floor.achild) do
local basechild = cedit.cval['DragVal'][ij[1]].fchild[i]
local basechild = cedit.cval['DragVal'][ij[1]].fchild[i]
for j,f in pairs(d.afloor) do
-- U.dump(basechild, '?? fo_fch:'..i..':'..j)
local u = (base[2]-base[1]):normalized()
for j,_ in pairs(base) do
desc.afloor[ij[1] ].base[j] = base[j] + u*(base[j]-center):dot(u)*(val-1)
cedit.cval['DragVal'] = {}
for i,f in pairs(desc.afloor) do
cedit.cval['DragVal'][#cedit.cval['DragVal'] + 1] = U.clone(f.base)
local u = (base[2]-base[1]):normalized()
for j,_ in pairs(base) do
desc.afloor[ij[1]].base[j] = base[j] + u*(base[j]-center):dot(u)*(val-1)
cedit.cval['DragVal'] = {}
for i,f in pairs(desc.afloor) do
cedit.cval['DragVal'][#cedit.cval['DragVal'] + 1] = U.clone(f.base)
local u = U.perp(base[2]-base[1]):normalized()
for j,_ in pairs(base) do
desc.afloor[ij[1]].base[j] = base[j] + u*(base[j]-center):dot(u)*(val-1)
local cbase = {} -- children bases
for f,_ in pairs(desc.selection) do
abase[f] = U.clone(desc.afloor[f].base)
cbase[f] = {}
for j,c in pairs(desc.afloor[f].top.achild) do
-- check consistency with top children
-- U.dump(abase[f], '??^^^^^^^^^^^ for_fbase:'..j..':'..f)
for a,isel in pairs(desc.selection[f]) do
if c.base then
if c.base then
for b,ic in pairs(c.base) do
lo('?? if_cross:'..a..':'..isel..':'..b..':'..tostring(abase[f][isel]))
floor.top.shape = 'flat'
for _,c in pairs(floor.top.achild) do
scenetree.findObjectById(c.id):delete()
-- U.dump(desc.afloor[cij[1]].top.achild, '?? AW_children:')
for _,wp in pairs(desc.afloor[cij[1]].awplus) do
wp.dirty = true
-- clear previous
for j,w in pairs(cedit.cval['DragExt'].awall) do
if w.id then
cedit.cval['DragPos'] = {dpos={}} --, val = val}
for i,d in pairs(s.aforest) do
if d.key == cedit.forest or #U.index(cedit.aforest,d.key)>0 then
end
for i,d in pairs(s.aforest) do
if d.key == cedit.forest or #U.index(cedit.aforest,d.key)>0 then
cedit.cval['DragPos'] = {dpos={}} --, val = val}
for i,d in pairs(s.aforest) do
if d.key == cedit.forest or #U.index(cedit.aforest,d.key)>0 then
end
for i,d in pairs(s.aforest) do
if d.key == cedit.forest or #U.index(cedit.aforest,d.key)>0 then
-- U.dump(desc.aspline,'?? win_bot:'..ij[2])
for _,d in pairs(desc.aspline[ij[1]][ij[2]].aforest) do
if d.key == cedit.forest then
if w['win'..'_inf'] then
for i,dae in pairs(w['win'..'_inf'].ddae) do
for j,k in pairs(w.df[dae]) do
for i,dae in pairs(w['win'..'_inf'].ddae) do
for j,k in pairs(w.df[dae]) do
-- U.dump(dforest[k], '?? in_dforest:'..j)
@/lua/ge/extensions/core/dynamicProps.lua
function DynamicProps:getFirstPropAvailable()
for id, value in pairs(self.props) do
if not value then
local source
for id, _ in pairs(self.props) do
source = scenetree.findObjectById(id)
@/lua/common/jbeam/sections/nodeBeam.lua
for k, v in pairs(vehicle.nodes) do
local x, y, z = jbeamUtils.getPosAfterNodeRotateOffsetMove(v, v.posX, v.posY, v.posZ)
if not vehicle.hydros then return end
for i, hydro in pairs(vehicle.hydros) do
hydro.beamType = BEAM_HYDRO
if not vehicle.ropes then return end
for i, rope in pairs(vehicle.ropes) do
rope.segments = rope.segments or 1
local tbi = tableEndC(vehicle.triangles)
for _, quad in pairs(vehicle.quads) do
local tri1 = deepcopy(quad)
@/lua/ge/extensions/gameplay/rally/notebook/path.lua
local sp = tc:getSystemPacenotes()
for key,val in pairs(sp) do
for i,variant in ipairs(val) do
local stage3 = {}
for k,v in pairs(stage2) do
table.insert(stage3, v)
local wps = {}
for i,pacenote in pairs(self.pacenotes.objects) do
for j,wp in pairs(pacenote.pacenoteWaypoints.objects) do
for i,pacenote in pairs(self.pacenotes.objects) do
for j,wp in pairs(pacenote.pacenoteWaypoints.objects) do
wps[wp.id] = wp
function C:getWaypoint(wpId)
for i, pacenote in pairs(self.pacenotes.objects) do
for i, waypoint in pairs(pacenote.pacenoteWaypoints.objects) do
for i, pacenote in pairs(self.pacenotes.objects) do
for i, waypoint in pairs(pacenote.pacenoteWaypoints.objects) do
if waypoint.id == wpId then
local lang_set = {}
for _, codriver in pairs(self.codrivers.objects) do
if not lang_set[codriver.language] then
local languages = {}
for lang, codrivers in pairs(lang_set) do
table.insert(languages, { language = lang , codrivers = codrivers })
function C:setAllRadii(newRadius, wpType)
for i, pacenote in pairs(self.pacenotes.objects) do
pacenote:setAllRadii(newRadius, wpType)
function C:allToTerrain()
for i, pacenote in pairs(self.pacenotes.objects) do
pacenote:allToTerrain()
@/lua/ge/extensions/flowgraph/nodes/types/setVariable.lua
local links = {}
for _,lnk in pairs(self.graph.links) do
if lnk.targetPin == self.pinInLocal[self.varName] then
local links = {}
for _,lnk in pairs(self.graph.links) do
if lnk.targetPin == self.pinInLocal[self.varName] then
@/lua/ge/extensions/ui/apps/minimap/minimap.lua
table.clear(occlusionPixels)
for id, transform in pairs(occlusionTransforms) do
local x, y, width, height = transform[1], transform[2], transform[3], transform[4]
for _, transform in pairs(occlusionTransforms) do
--im.Text(string.format("Pixel: %d, %d, %d, %d", pixel[1], pixel[2], pixel[3], pixel[4]))
if debugSettings.drawOcclusion then
for id, transform in pairs(occlusionTransforms) do
im.Text(string.format("Occ %s: %0.3f, %0.3f, %0.3f, %0.3f", id, transform[1], transform[2], transform[3], transform[4]))
@/lua/ge/extensions/core/multiseatCamera.lua
-- avg position
for pid, _ in pairs(plvehicles) do
local k = be:getPlayerVehicleID(pid)
-- max distance
for k, _ in pairs(plvehicles) do
local v = map.objects[be:getPlayerVehicleID(k)]
@/gameplay/missions/gridmap_v2/aiRace/001-grindergrandprix/script.lua
-- Loop through all spinners and update their timers
for id, timer in pairs(spinnerTimers) do
timer = timer + dtSim
@/lua/vehicle/fire.lua
local minDistanceTemperature = 0
for k, v in pairs(hotNodes) do
local squareDistance = obj:nodeSquaredLength(k, cid)
-- Particles --
for hotcid, node in pairs(hotNodes) do
if hotcid ~= currentNodeKey then
if v.data.beams then
for k, b in pairs(v.data.beams) do
if b.containerBeam then
local centreNodeDist = 100
for _, node in pairs(v.data.nodes) do
local nodeDist = sqrt((node.pos.x * node.pos.x) + (node.pos.y * node.pos.y) + (node.pos.z * node.pos.z))
if wheels.wheels then
for id, wd in pairs(wheels.wheels) do
wheelNodes[wd.node1] = {wheelID = id, node1 = wd.node1, node2 = wd.node2}
local possibleNodes = {}
for k, n in pairs(flammableNodes) do
if n and n.canIgnite and not wheelNodes[k] and n.intensity <= 0 then
local possibleNodes = {}
for k, n in pairs(flammableNodes) do
if n and n.canIgnite and not wheelNodes[k] and n.intensity <= 0 then
local function igniteVehicle()
for cid, _ in pairs(flammableNodes) do
if not wheelNodes[cid] then --don't ignite wheelnodes right away to delay the tire popping a bit
local function explodeVehicle()
for cid, node in pairs(flammableNodes) do
if node.containerBeam then
local function extinguishVehicle()
for cid, node in pairs(flammableNodes) do
node.temperature = tEnv
local function extinguishVehicleSlowly()
for _, node in pairs(flammableNodes) do
node.chemEnergy = 0
@/lua/vehicle/controller/tech/powertrainSensor.lua
local latestReading = {}
for _, device in pairs(powertrain.getDevices()) do
local deviceData = {inputAV = device.inputAV, gearRatio = device.gearRatio, isBroken = device.isBroken, mode = device.mode}
@/lua/ge/extensions/gameplay/drag/saveSystem.lua
if lane.waypoints then
for waypointType, waypoint in pairs(lane.waypoints) do
convertedLane.waypoints[waypointType] = {
for vehId, racer in pairs(dragData.racers) do
if racer.timers and racer.timers.time_1_4 and racer.isPlayable then
for i, racerInfo in ipairs(historyEntry.racerInfos) do
for rVehId, rRacer in pairs(dragData.racers) do
if rRacer.lane == racerInfo.laneNum then
local result = {}
for configHash, data in pairs(dialTimes) do
result[configHash] = {
local allHistory = {}
for configHash, data in pairs(dialTimes) do
if data.history then
@/lua/ge/extensions/editor/flowgraph/welcome.lua
local res, _ = self.examples:getExamplesLookup()
for r, e in pairs(res.beginner.examples) do
table.insert(self._examplesSorted, e)
for k, p in pairs(self.demoProjects) do
if fancyIconButton('welcomeContentColumn2demo1' .. k, editor.icons.folder_open, editor.icons.folder, p.name, p.description) then
@/lua/ge/extensions/flowgraph/nodes/gameplay/race/raceHighscoresLap.lua
local _, fn, ext = path.splitWithoutExt(vData.config.partConfigFilename)
for k, c in pairs(mData.configs) do
if fn == c then
@/lua/vehicle/powertrain/electricMotor.lua
for k, v in pairs(device.torqueCurve) do
if type(k) == "number" then
device.energyStorageRegenRatios = {}
for _, s in pairs(device.registeredEnergyStorages) do
local storage = energyStorage.getStorage(s)
local previousStorageCount = device.storageWithEnergyCounter
for _, s in pairs(device.registeredEnergyStorages) do
local storage = energyStorage.getStorage(s)
local hasValidReactioNodes = true
for _, v in pairs(torqueReactionNodes_nodes) do
if type(v) ~= "number" then
local points = {}
for _, v in pairs(torqueTable) do
table.insert(points, {v.rpm, v.torque})
points = {}
for _, v in pairs(regenTorqueTable) do
table.insert(points, {v.rpm, v.torque})
tempElectricalEfficiencyTable = {}
for k, v in pairs(copy) do
if type(k) == "number" then
device.electricalEfficiencyTable = {}
for k, v in pairs(tempElectricalEfficiencyTable) do
device.electricalEfficiencyTable[k * 0.01] = v
@/lua/ge/extensions/editor/shapeEditor.lua
highestDetail = -1
for k,v in pairs(shapeInfo.details) do
if v.size < 0 then goto continue_info end
comboSeqCtxTxt = ""
for k,v in pairs(shapeInfo.sequences) do
log("I","info.seq", dumps(k).."|"..dumps(v.name))
f:write(string.format("function %s::onLoad(%%this)\n{\n", filenameNoExt))
for k,v in pairs(meshConstructor.createMeshLOD) do
if v.sloppy then
local fdata = originalMaterial:getFieldsForEditor()
for k,v in pairs(fdata) do
if arrayFindValueIndex(skipFields,k) == false then
end
for k,v in pairs(fdata.Stages_beginarray.fields) do
for i = 0, 3 do
end
for k,v in pairs(meshConstructor.createMeshLOD) do
if v.dest == dest then
-- im.Columns(2)
-- for k,v in pairs(shapePrev:getMeshStat()) do
-- im.Text(k)
if data then
for k, v in pairs(data) do
if type(v) ~= 'table' then
if meshConstructor and meshConstructor.createMeshLOD and not lodBrokenMesh then
for k,v in pairs(meshConstructor.createMeshLOD) do
local src = tostring(v.src)
@/lua/ge/extensions/career/modules/delivery/general.lua
loadData.cargo = {}
for key, fac in pairs(loadData.facilities) do
fac.logisticGenerators = nil
end
for vehId, veh in pairs(vehs) do
--for key, amount in pairs(elem.totalCargoSlots) do
-- elem.usedCargoSlots[key] = 0
-- check if all cargo was sent
for key, val in pairs(vehCargoData) do
if val == -1 then return end
local ret = {}
for _, list in pairs(vehCargoData) do
for _, elem in ipairs(list) do
local maxDelay = 0
for _, delay in pairs(data) do
maxDelay = math.max(delay, maxDelay)
step.makeStepReturnTrueFunction(function()
for vehId, data in pairs(data) do
local veh = scenetree.findObjectById(vehId)
-- 1s delay, no freeze
for vehId, data in pairs(data) do
local veh = scenetree.findObjectById(vehId)
--if next(updatePerVehicle) then
for vehId, data in pairs(updatePerVehicle) do
local veh = scenetree.findObjectById(vehId)
for _, con in pairs(updatePerVehicle[vehId]) do
log("I","",string.format("Container %d => volume %0.1f | density: %0.1f",con.containerId, con.volume or 0, con.density or 1))
local delayData = {}
for vehId, data in pairs(updatePerVehicle) do
delayData[vehId] = -1
for vehId, data in pairs(updatePerVehicle) do
local veh = scenetree.findObjectById(vehId)
for key, val in pairs(delayData) do
if val == -1 then return end
local anyValue = false
for key, value in pairs(loadData.penalty) do
if value ~= 0 then
for name, ap in pairs(fac.accessPointsByName) do
local ps = ap.ps
local pos = lastPsPos
for name, ap in pairs(fac.accessPointsByName) do
if ap.isInspectSpot then
local fac = dGenerator.getFacilityById(elem.facId)
for materialType, storage in pairs(fac.materialStorages) do
if storage.isProvider then
local fine = dVehicleTasks.getFineForAbandonAllVehicleTasks()
for attKey, amount in pairs(fine) do
penalty[attKey] = (penalty[attKey] or 0) + amount
@/lua/common/utils/perf.lua
local fcts = {}
for k,v in pairs(timings_tmp) do
if calls_tmp[k] > 0 then
@/lua/ge/extensions/editor/biomeTool.lua
local elements = getElementsForBrush(brushName)
for id, elementName in pairs(elements) do
forestBrushElements[id] = elementName
local function removeItemsActionUndo(actionData)
for _, item in pairs(actionData.items) do
editor.addForestItem(var.forestData, item)
local function removeItemsActionRedo(actionData)
for _, item in pairs(actionData.items) do
editor.removeForestItem(var.forestData, item)
local function addItemsActionUndo(actionData)
for _, item in pairs(actionData.items) do
editor.removeForestItem(var.forestData, item)
local function addItemsActionRedo(actionData)
for _, item in pairs(actionData.items) do
editor.addForestItem(var.forestData, item)
local function replaceItemsActionUndo(actionData)
for i, item in pairs(actionData.newItems) do
editor.removeForestItem(var.forestData, item)
end
for i, item in pairs(actionData.oldItems) do
editor.addForestItem(var.forestData, item)
local function replaceItemsActionRedo(actionData)
for _, item in pairs(actionData.oldItems) do
editor.removeForestItem(var.forestData, item)
end
for _, item in pairs(actionData.newItems) do
editor.addForestItem(var.forestData, item)
local delItems = {}
for _, item in pairs(itemsToDel) do
table.insert(delItems, item)
---local forestData = forest:getData()
---for _, item in pairs(itemsToAdd) do
--local uids = forestData:generateAndSetItemUid(itemKeys)
local delItems = {}
for _, item in pairs(itemsToDel) do
table.insert(delItems, item)
local delItems = {}
for _, item in pairs(itemsToDel) do
table.insert(delItems, item)
local delItems = {}
for _, item in pairs(itemsToDel) do
table.insert(delItems, item)
@/lua/ge/extensions/util/export.lua
for i, beam in pairs(v.vdata.beams) do
local id1 = beam.id1
for mesh, d in pairs(meshes) do
if meshNodeMap[mesh] then
local parentage = {}
for parent, children in pairs(slotMap) do
for idx, child in ipairs(children) do
if partNode.children then
for _, child in pairs(partNode.children) do
partTreeParser(child,partNode.chosenPartName)
for part, data in pairs(slotMap) do
if parentPart[part] ~= nil and parentPart[part] ~= '' then
if data.slots ~= nil then
for subPart, d in pairs(data.slots) do
if parentPart[subPart] ~= nil and parentPart[subPart] ~= '' then
local parent = {}
for kn,vn in pairs(gltfRoot.nodes) do
if rootNodes[kn-1] then
-- end
-- for kp,rootNode in pairs(rootNodes) do
-- if rootNodes then
-- log("I", logTag, "=================================== dump child")
-- for k,v in pairs(gltfRoot.nodes) do
-- log("I", logTag, dbgNodeName(gltfRoot,k-1) .. dumps(v.children))
for kn,vn in pairs(gltfRoot.nodes) do
if not parent[kn-1] then
--log("D", logTag,"export image indexes "..dumps(materialObj.name))
for k,v in pairs(gltfCurrentMaterial) do
if k:endswith("Map") then
local partToFlexMesh = {}
for _, flexMesh in pairs(v.vdata.flexbodies or {}) do
local path = flexMesh.partPath or ""
end
for _, prop in pairs(v.vdata.props or {}) do
-- print("prop["..dumps(_)..dumps(prop.mesh))
gltfRoot.scenes[1].nodes = {}
for nodeID, root in pairs(rootNodes) do
if root then
local matNames = veh:getMaterialNames()
for i,v in pairs(gltfRoot.materials) do
gltfRoot.materials[i].name = matNames[v.extras.bngMaterialId+1]
for i, e in pairs(gltfRoot.scenes[1].nodes) do
local node = gltfRoot.nodes[e + 1]
local totalBinBufSize = getStartByteBufferView(#binaryBuffers)
for k,v in pairs(gltfRoot.bufferViews) do
if v.buffer ~= 0 then
@/lua/common/introspection.lua
local function gather_from_table(tbl, class_name, is_static)
for key, value in pairs(tbl) do
if type(key) == "string" and type(value) == "function" then
-- Iterate over global variables
for global_key, global_value in pairs(_G) do
-- Ignore the global variable named "extensions"
@/lua/ge/extensions/career/modules/vehicleDeletionService.lua
local function onUpdate()
for vehId, data in pairs(flaggedVehicles) do
local obj = getObjectByID(vehId)
local function deleteFlaggedVehicles()
for vehId, _ in pairs(flaggedVehicles) do
deleteVehicle(vehId)
@/lua/ge/extensions/editor/raceEditor/tools.lua
local function setFieldsRedo(data)
for idx, _ in pairs(data.newDataMap) do
data.self.path.pathnodes.objects[idx][data.field] = data.newDataMap[idx]
local oldDataMap = {}
for idx, _ in pairs(newDataMap) do
oldDataMap[idx] = self.path.pathnodes.objects[idx][field]
local allTransforms = {}
for _, pn in pairs(self.path.pathnodes.objects) do
local transforms = pn:getSideTransforms(self:getSideTransformParameters())
local newDataMap = {}
for _, node in pairs(self.path.pathnodes.objects) do
newDataMap[node.id] = core_terrain.getTerrainHeight(node.pos)
local newDataMap = {}
for _, node in pairs(self.path.pathnodes.objects) do
if node.hasNormal then
local newDataMap = {}
for _, node in pairs(self.path.pathnodes.objects) do
newDataMap[node.id] = nodeSize[0]
if im.Button("Remove Redundant BeamNGWaypoints") then
for _, node in pairs(self.path.pathnodes.objects) do
if scenetree.findObject(node.name) then
if im.Button("Align All Pathnodes to Grid") then
for _, node in pairs(self.path.pathnodes.objects) do
node.pos.x = round(node.pos.x)
@/lua/ge/extensions/scenario/raceDebug.lua
for _, wp in pairs(currentScenario.lapConfig) do
local n = currentScenario.nodes[wp]
local lastWpp = nil
for _, wpp in pairs(path) do
if wpp ~= lastWpp then
local i = 0
for _, wp in pairs(currentScenario.lapConfig) do
i = i + 1
local lastwpdStr = nil
for _, wp in pairs(currentScenario.debugPath) do
local wpd = currentScenario.debugNodes[wp]
@/lua/ge/extensions/flowgraph/nodes/states/stateNode.lua
local rootGraphs = {}
for _, graph in pairs(self.mgr.graphs) do
if graph.type == "graph" and graph:getParent() == nil and (not self.mgr.stateGraph or graph.id ~= self.mgr.stateGraph.id) then
if im.BeginCombo("Target Graph", label) then
for _, graph in pairs(rootGraphs) do
if im.Selectable1(graph.id .. "-"..graph.name, graph.id == id) then
local names = {}
for n, pin in pairs(self.pinOut) do
table.insert(names,n)
@/lua/ge/extensions/editor/sensorDebugger.lua
local camData = tech_cameraPreview.getCamData()
for id, cam in pairs(camData) do
if not cam.visualize[0] then
local camData = tech_cameraPreview.getCamData()
for id, cam in pairs(camData) do
if cam.visualize[0] then
end
for id, cam in pairs(camData) do
im.Text(tech_sensors.getCameraSensorName(cam.id))
@/lua/ge/extensions/gameplay/drift/stallingSystem.lua
local variety = 0
for _ in pairs(uniqueStunts) do
variety = variety + 1
@/lua/ge/extensions/util/groundModelDebug.lua
for name, gm in pairs(groundModels) do
tbl.colors[name] = {}
if tbl then
for name, color in pairs(tbl.colors) do
if groundModels[name] then
if #groundModels[name].aliases > 0 then
for _,alias in pairs(groundModels[name].aliases) do
be:setGroundModel(alias, gm.data)
local data = {}
for k,v in pairs(groundModels) do
data[k] = {}
data[k] = {}
for propertyName, propertyVal in pairs(v.cdata) do
data[k][propertyName] = propertyVal[0]
if im.SmallButton("Enable All") then
for _,k in pairs(gms) do
groundModels[k].active[0] = true
if im.SmallButton("Disable All") then
for _,k in pairs(gms) do
groundModels[k].active[0] = false
for _,k in pairs(gms) do
local v = groundModels[k]
if #v.aliases > 0 then
for _, name in pairs(v.aliases) do
groundModels[name].active[0] = groundModels[k].active[0]
-- no groundtype filtering: draw them all!
for _,k in pairs(gms) do
local gm = groundModels[k]
@/lua/ge/extensions/core/inventory.lua
found = true
for k,v in pairs(item) do
found = found and valueObj[k] == v
if onEventData then
for key,entry in pairs(onEventData) do
if key == 'remove' then
if key == 'remove' then
for subKey,data in pairs(entry) do
if subKey == 'gold' or subKey == 'silver' or subKey == 'bronze' then
if earnedMedal and subKey == earnedMedal then
for invType,value in pairs(data) do
processTable('remove', invType, value)
@/lua/ge/extensions/telemetry/core.lua
local trackersToUnload = {}
for trackerName, _ in pairs(trackingExtensions) do
local priority = trackerPriorities[trackerName] or 500
@/lua/ge/extensions/career/modules/milestones/generalMilestones/speedTraps.lua
local numOfTrapsTriggered = 0
for name, velocityMilestone in pairs(velocityMilestonesByTrapName) do
if milestones.saveData.general[velocityMilestone.id].notificationStep > 0 then
@/lua/ge/extensions/editor/slotTrafficEditor.lua
local res
for nid, _ in pairs(nodes) do
if distances[nid] < min or not res then
-- remove all nodes that are too far away
for otherNid, data in pairs(mapNodes) do
if data.pos:squaredDistance(node.pos) > square(maxConnectionRenderDistance) then
-- remove the links
for otherNid2, _ in pairs(data.links) do
if nodesToCheck[otherNid2] then
for neighbor, otherLinkData in pairs(nextNodeData.links) do
if nodesToCheck[neighbor] and otherLinkData.inNode == nextNid then
-- Add distances to the links that are close enough, but not on any shortest route from any node
for otherNid, data in pairs(mapNodes) do
if distancesOfLinks[otherNid] then
if distancesOfLinks[otherNid] then
for neighbor, linkData in pairs(data.links) do
if distancesOfLinks[neighbor] and not distancesOfLinks[otherNid][neighbor] then
local result
for nid1, nodeLinks in pairs(editor.selection.stLink) do
for nid2, _ in pairs(nodeLinks) do
for nid1, nodeLinks in pairs(editor.selection.stLink) do
for nid2, _ in pairs(nodeLinks) do
if result then return nil end
local function isLinkSelectionEmpty()
for nid1, nodeLinks in pairs(editor.selection.stLink) do
for nid2, _ in pairs(nodeLinks) do
for nid1, nodeLinks in pairs(editor.selection.stLink) do
for nid2, _ in pairs(nodeLinks) do
return false
-- Find which road this link belongs to
for roadId, road in pairs(roads) do
local controlPoints = road.controlPoints
local function changeNodeFieldActionUndo(actionData)
for nid, _ in pairs(actionData.nids) do
setNodeField(nid, actionData.fieldName, actionData.oldValues[nid])
local function changeNodeFieldActionRedo(actionData)
for nid, _ in pairs(actionData.nids) do
setNodeField(nid, actionData.fieldName, actionData.newValues[nid])
local result = {}
for nid, _ in pairs(nids) do
result[nid] = mapNodes[nid].links
nids[nid] = true
for nid1, links in pairs(getConnectedLinks(nids)) do
for nid2, link in pairs(links) do
for nid1, links in pairs(getConnectedLinks(nids)) do
for nid2, link in pairs(links) do
deleteLink(nid1, nid2)
if actionData.linkInfos then
for nid1, links in pairs(actionData.linkInfos) do
for nid2, linkInfo in pairs(links) do
for nid1, links in pairs(actionData.linkInfos) do
for nid2, linkInfo in pairs(links) do
deleteLink(nid1, nid2)
if actionData.linkInfos then
for nid1, links in pairs(actionData.linkInfos) do
for nid2, linkInfo in pairs(links) do
for nid1, links in pairs(actionData.linkInfos) do
for nid2, linkInfo in pairs(links) do
mapNodes[nid1].links[nid2] = linkInfo
-- Draw road segments connected to this node
for roadId, road in pairs(roads) do
local controlPoints = road.controlPoints
mapNodes = {}
for nid, node in pairs(rawNodes) do
mapNodes[nid] = {
-- Add links temporarily for road tracing
for nid1, node in pairs(rawNodes) do
for nid2, link in pairs(node.links) do
for nid1, node in pairs(rawNodes) do
for nid2, link in pairs(node.links) do
-- Create two-way links for easier traversal
for linkedNodeId, linkData in pairs(node.links) do
if linkedNodeId ~= prevNodeId and
if not prevNodeId then
for linkedNodeId, _ in pairs(mapNodes[currentNodeId].links) do
if not processedLinks[currentNodeId .. "-" .. linkedNodeId] and
-- Process all nodes and links to create roads
for nodeId, node in pairs(mapNodes) do
-- Find unprocessed links from this node
-- Find unprocessed links from this node
for linkedNodeId, _ in pairs(node.links) do
if not processedLinks[nodeId .. "-" .. linkedNodeId] and
-- Clear temporary links from mapNodes
for nid, node in pairs(mapNodes) do
node.links = {}
mapNodes = loadedNavgraph
for nid1, node in pairs(mapNodes) do
for nid2, link in pairs(node.links) do
for nid1, node in pairs(mapNodes) do
for nid2, link in pairs(node.links) do
mapNodes[nid2].links[nid1] = link
local roadsArray = {}
for roadId, road in pairs(roads) do
-- Apply filter if any
for roadId, road in pairs(roads) do
local controlPoints = road.controlPoints
-- First add all nodes to the quadtree
for nid, n in pairs(mapNodes) do
local nPos = n.pos
-- Then add edges from roads
for roadId, road in pairs(roads) do
local controlPoints = road.controlPoints
for otherNid, link in pairs(node.links) do
if link.inNode == nid then
if not tableIsEmpty(editor.selection.stNode) then
for nodeId, _ in pairs(editor.selection.stNode) do
nodeOldPositions[nodeId] = mapNodes[nodeId].pos
local newValues = {}
for nid, _ in pairs(editor.selection.stNode) do
newValues[nid] = vec3(mapNodes[nid].pos)
if core_forest.getForestObject() then core_forest.getForestObject():disableCollision() end
for nodeId, _ in pairs(editor.selection.stNode) do
local rayDist = castRayStatic(nodeOldPositions[nodeId] + nodeOffset + upVector, downVector, 10)
for nid, _ in pairs(mapNodes) do
editor.selection.stNode[nid] = true
local nodeInfos = {}
for nid, _ in pairs(editor.selection.stNode) do
local nodeInfo = {nid = nid, pos = vec3(mapNodes[nid].pos), radius = mapNodes[nid].radius, links = deepcopy(mapNodes[nid].links)}
local linkInfos = {}
for nid1, nodeLinks in pairs(editor.selection.stLink) do
for nid2, _ in pairs(nodeLinks) do
for nid1, nodeLinks in pairs(editor.selection.stLink) do
for nid2, _ in pairs(nodeLinks) do
if not linkInfos[nid1] then linkInfos[nid1] = {} end
local mapNodesCopy = deepcopy(mapNodes)
for nid1, node in pairs(mapNodes) do
for nid2, link in pairs(node.links) do
for nid1, node in pairs(mapNodes) do
for nid2, link in pairs(node.links) do
if link.inNode ~= nid1 then
@/lua/ge/extensions/career/modules/branches/landing.lua
--Get the names of the rewards
for _, tierData in pairs(rewards) do
for _, reward in ipairs(tierData) do
--dump("getting skills for " .. branchId)
for _, skill in pairs(career_branches.getSortedBranches()) do
--dump(branchId .. " is a skill of " .. skill.id.." / "..dumps( skill.parentId))
}
for key, value in pairs(fac.providedSystemsLookup) do
if value then
for key, value in pairs(fac.receivedSystemsLookup) do
if value then
local ret = {}
for key, value in pairs(facility.providedSystemsLookup) do
if value then
end
for key, value in pairs(facility.receivedSystemsLookup) do
if value then
for _, subBranch in pairs(career_branches.getSortedBranches()) do
if subBranch.parentId == branchId then
@/lua/common/utils.lua
local prefix = '{"'
for kk, vv in pairs(v) do
bufTmp:put(prefix, type(kk) == 'string' and escapeString(kk) or kk, '":')
local tableKeys = tableKeysSorted(v)
for _, kk in pairs(tableKeys) do
local vv = v[kk]
if not data then return nil end
for k,v in pairs(data) do
for k2,v2 in pairs(v) do
for k,v in pairs(data) do
for k2,v2 in pairs(v) do
if k2 > 1 then
local tblSize = #tbl
for k, _ in pairs(tbl) do
if type(k) ~= 'number' or k < 1 or k > tblSize then return false end
local keysidx = 0
for k in pairs(tbl) do
keysidx = keysidx + 1
local res = target or table.new(#tbl, 4)
for _, tb in pairs(tbl) do
res[tb] = 1
function tableMerge(dst, src)
for k, v in pairs(src) do
dst[k] = v
function tableMergeRecursive(t1, t2)
for k, v in pairs(t2) do
if type(v) == "table" and type(t1[k]) == "table" then
function tableMergeRecursiveArray(t1, t2)
for k, v in pairs(t2) do
if type(v) == "table" and type(t1[k]) == "table" then
local count = 0
for _ in pairs(tbl) do
count = count + 1
function tableFindKey(t, element)
for k, v in pairs(t) do
if v == element then
element = string.lower(element)
for _, value in pairs(table) do
if string.lower(value) == element then
local depth = 1
for k, v in pairs(tbl) do
if type(k) == "table" then
local copy = table.new(#orig, 0)
for k, v in pairs(orig) do
copy[k] = v
lookup_table[object] = new_table
for index, value in pairs(object) do
if type(index) == 'table' then
profilerPushEvent("readFiles readClose batch")
for filename, f in pairs(batchFiles) do
if f ~= nil then
local function tableMergeExceptFunc(dst, src)
for k, v in pairs(src) do
dst[k] = type(v) ~= "function" and v or nil
local tmp = {}
for k, v in pairs(package.loaded) do
if isPackage(k, v) and type(v) == 'table' and (v['onDeserialized'] ~= nil or v['onSerialize'] ~= nil) then
for k,v in pairs(package.loaded) do
if isPackage(k, v) and (filter == nil or k == filter) and type(v) == 'table' and (v['onDeserialized'] ~= nil or v['onDeserialize'] ~= nil) and data[k] ~= nil then
local dkeys = {}
for k in pairs(d) do table.insert(dkeys, k) end
table.sort(dkeys)
-- save the text
for _, k in pairs(dkeys) do
local v = d[k]
if type(incl) == "table" then
for kk, vv in pairs(v) do
if incl[kk] then
else
for kk, vv in pairs(v) do
bufTmp:putf(type(kk) == 'string' and "%q;" or "%s;", kk)
local prefix = "{"
for kk, vv in pairs(v) do
if kk == arrayidx then
for _, k in pairs(keys) do
local v = tbl[k]
local function _unflattenTable_rec(tbl, tableRegister, path)
for k, v in pairs(tbl) do
if type(v) == 'table' then
local i = 0
for k in pairs(t) do
i = i + 1
@/lua/ge/extensions/flowgraph/nodes/ui/startScreen.lua
function C:_executionStarted()
for _, p in pairs(self.pinOut) do
p.value = false
function C:_executionStarted()
for _, p in pairs(self.pinOut) do
p.value = false
function C:buttonPushed(action)
for nm, pn in pairs(self.pinOut) do
self.pinOut[nm].value = nm == action
self:reset()
for _,pn in pairs(self.pinOut) do
pn.value = false
@/lua/ge/extensions/freeroam/facilities.lua
local data = jsonReadFile(file)
for type, listKey in pairs(facilityTypeToListName) do
for i, f in ipairs(data[listKey] or {}) do
facilitiesByLevel[levelName] = {}
for _, listKey in pairs(facilityTypeToListName) do facilitiesByLevel[levelName][listKey] = {} end
-- put in the default values for this facility, if the facility itself did not define it
for key, value in pairs(facilityPoiDefaults[f.type]) do
e[key] = f[key]
@/lua/ge/extensions/tech/sumoExporter.lua
local children = {}
for k, v in pairs(node) do
if type(v) == 'table' then
local function doesCollectionContainSegment(collection, testSeg)
for _, trialSeg in pairs(collection) do
local matches = 0
local matches = 0
for _, v1 in pairs(trialSeg) do
for _, v2 in pairs(testSeg) do
for _, v1 in pairs(trialSeg) do
for _, v2 in pairs(testSeg) do
if v1 == v2 then
for headKey, _ in pairs(graph) do
local successors = getChildren(graph[headKey])
local successors = getChildren(graph[headKey])
for childKey, _ in pairs(successors) do
local currentPath = { headKey }
local allVisited = true
for k, _ in pairs(nextSuccessors) do
if not doesSegmentContainKey(currentPath, k) then
local found = false
for k, _ in pairs(nextSuccessors) do
if not doesSegmentContainKey(currentPath, k) then
local id = 0
for k, v in pairs(coords3d) do
keysToNodeMap[k] = k
@/lua/ge/extensions/flowgraph/nodes/vehicle/special/wheelDistance.lua
if self.data.debug and closestWheels then
for k, v in pairs(closestWheels) do
-- Line from each closest wheel to start line
@/lua/common/devUtils.lua
local res = {}
for _, entry in pairs(tbl) do
if type(entry) == 'function' and not visitedEntries[tostring(entry)] then
local snapshot = { tables = {}, tablesTmp = {}, vars = {}, extensions = {} }
for k, v in pairs(_G) do
if (type(v) == 'table' and (rawget(v, '___type') or rawget(v, '___getters'))) or type(v) == 'function' or k == '_G' or k == 'extensions' or k == 'package' then goto continue end
-- now cleanup the tables
for k, v in pairs(snapshot.tablesTmp) do
if v.module and v.module.__extensionName__ then
local function _tableFindRecursion(tbl, res, path)
for k, v in pairs(tbl) do
if type(v) == 'table' then
local dupeCount = 0
for k, v in pairs(res) do
if #v > 1 then
@/gameplay/missionTypes/dragStripRace/constructor.lua
local vehiclesUsedPerStar = saveData.vehiclesUsedPerStar or {}
for star, achieved in pairs(attempt.unlockedStars or {}) do
if achieved then
@/lua/ge/extensions/core/online.lua
local requests_pub = {}
for id, r in pairs(requests) do
requests_pub[id] = r.pub
local data2display = {}
for _, data in pairs(storedMessages) do
if data.uid and hidden_ids[data.uid] then
for _, cmd in pairs(data.cmds) do
if cmd.type == 'message' then
@/lua/ge/extensions/editor/camPathEditor.lua
local function changeMarkerFieldActionRedo(actionData)
for index, values in pairs(actionData.markerValues) do
actionData.path.markers[index][actionData.field] = values.new
local function changeMarkerFieldActionUndo(actionData)
for index, values in pairs(actionData.markerValues) do
actionData.path.markers[index][actionData.field] = values.old
@/lua/vehicle/energyStorage/n2oTank.lua
for k, v in pairs(storage.nodes) do
obj:setNodeMass(k, v + storage.storedEnergy * storage.nodeMassCoef)
--apply final weight as soon as possible
for k, v in pairs(storage.nodes) do
obj:setNodeMass(k, v + storage.storedEnergy * storage.nodeMassCoef)
if jbeamData.nodes and jbeamData.nodes._engineGroup_nodes then
for _, n in pairs(jbeamData.nodes._engineGroup_nodes) do
storage.nodes[n] = v.data.nodes[n].nodeWeight --save initial mass as the offset for the node weights
--apply final weight as soon as possible
for k, v in pairs(storage.nodes) do
obj:setNodeMass(k, v + storage.storedEnergy * storage.nodeMassCoef)
@/lua/vehicle/extensions/vehicleeditor/nodes.lua
local min = math.huge
for _,node in pairs(nodesTbl) do
totalWeight = totalWeight + obj:getNodeMass(node.cid)
@/lua/vehicle/controller/vehicleController/shiftLogic/cvtGearbox.lua
automaticHandling.availableModeLookup = {}
for _, v in pairs(automaticHandling.availableModes) do
automaticHandling.availableModeLookup[v] = true
@/lua/ge/extensions/scenario/quickRace.lua
fg = core_flowgraphManager.loadManager(sc.track.flowgraph.file)
for name, value in pairs(sc.track.flowgraph.variables or {}) do
fg.variables:changeBase(name, value)
if sc.generatedNodes then
for k, v in pairs(sc.generatedNodes) do
sc.nodes[k] = v
if sc.track.reverse then
for _, node in pairs(sc.nodes) do
if node.rot ~= nil then
@/lua/ge/extensions/gameplay/drift/drift.lua
-- Reset debug histories
for _, historyData in pairs(debugHistories) do
historyData.data = {}
random = getBlueNoise1d(random)
for _, scannerData in pairs(scanners) do
-- remove oldest data
for _, historyData in pairs(debugHistories) do
if historyData.data and historyData.data[maxHistorySize] then
im.BeginChild1("Debug Graph", im.ImVec2(im.GetContentRegionAvailWidth(), 400), true)
for _, historyData in pairs(debugHistories) do
im.PushStyleColor2(im.Col_Text, im.ImVec4(historyData.color[1], historyData.color[2], historyData.color[3], historyData.color[4]))
local i = 1
for _, historyData in pairs(debugHistories) do
chartData[i] = {}
@/lua/vehicle/controller/inputOutputDemo.lua
local storages = energyStorage.getStorages()
for _, storage in pairs(storages) do
--filter for electric batteries
@/lua/vehicle/extensions/vehicleStatsLogger.lua
local function updateStreams()
for _, moduleID in pairs(moduleIdx) do
if settings.useModule[moduleID] then
local function createCSVs()
for _, moduleID in pairs(moduleIdx) do
local header = getCSVHeader(moduleID)
local function initOutput()
for _, moduleID in pairs(moduleIdx) do
local fpath = settings.outputDir .. "\\" .. moduleID .. ".csv"
local function flushOutputStream()
for _, moduleID in pairs(moduleIdx) do
local fpath = outputStreams[moduleID].fpath
for _, moduleID in pairs(moduleIdx) do
settings.useModule[moduleID] = true
for _, moduleID in pairs(moduleIdx) do
if s.useModule[moduleID] ~= nil then
-- for moduleID, useModule in pairs(settings.useModule) do
-- log("D", logTag, moduleID..": "..tostring(useModule))
for moduleID, useModule in pairs(settings.useModule) do
s.useModule[moduleID] = useModule
@/lua/ge/extensions/flowgraph/nodes/vehicle/touchingProps.lua
if self.pinIn.propsIds.value then
for k,v in pairs(self.pinIn.propsIds.value) do
if cols[v] then
@/lua/ge/extensions/gameplay/markers/missionMarker.lua
if iconRendererObj then
for id, data in pairs(self.iconDataById or {}) do
data.color = ColorI(0,0,0,0)
if iconRendererObj then
for id, _ in pairs(self.iconDataById or {}) do
iconRendererObj:removeIconById(id)
@/lua/ge/extensions/util/terrainGenerator.lua
local blanks = 0
for k, v in pairs(self.materialsToTextureMaps) do
if not v then -- if material to texture map entry is still false
@/lua/ge/extensions/flowgraph/nodes/ui/imgui/elemental/imBegin.lua
self.done = false
for _, p in pairs(self.pinOut) do
p.value = false
@/lua/ge/extensions/flowgraph/nodes/activity/starsActive.lua
local unflattenedSettings = {}
for k, v in pairs(mission.lastUserSettings) do
table.insert(unflattenedSettings, {key = k, value = v})
for _, pin in pairs(self.pinOut) do
if pin.type == 'flow' then
else
for _, pin in pairs(self.pinOut) do
if pin.type == 'flow' then
@/gameplay/tutorials/customNodes/registerTestCarsNode.lua
self.mgr._fgTutoTestCarsStep.getCarBySortedId = function(id)
for _,car in pairs(self.mgr._fgTutoTestCarsStep.carsData) do
if car.id == id then return car end
@/lua/ge/extensions/core/input/actionFilter.lua
clearCFilter(filter)
for actionGroupName, filtered in pairs(blockedActionGroups[filter]) do
if filtered then
local function isActionBlocked(actionName)
for filter, actions in pairs(blockedActions) do
if actions[actionName] then
@/lua/ge/extensions/career/modules/uiUtils.lua
for _, br in pairs(career_branches.getSortedBranches()) do
if not br.isSkill then
@/lua/ge/extensions/flowgraph/nodes/vehicle/touchingStatic.lua
function C:reset()
for _, pin in pairs(self.pinOut) do
pin.value = false
self.pinOut.isTouching.value = false
for k, v in pairs(self.points) do
local dist = v.pos:distance(self.center)
if self.active and self.pinIn.debugMode.value then
for k, v in pairs(self.points) do
local color = v.hit and ColorF(1, 0, 0, 1) or ColorF(0, 1, 0, 0.5)
@/lua/ge/extensions/career/modules/inventory.lua
for inventoryId, transform in pairs(inventoryData.spawnedPlayerVehicles) do
inventoryId = tonumber(inventoryId)
local callbackCounter = 0
for vehId, inventoryId in pairs(vehIdToInventoryId) do
setVehicleDirty(inventoryId)
local function checkSaveFinished(currentSavePath, oldSaveDate)
for _, fin in pairs(finishedSaveTasks) do
if not fin then
for id, vehicle in pairs(vehiclesCopy) do
if dirtiedVehicles[id] or not vehicle.dirtyDate then
data.spawnedPlayerVehicles = {}
for inventoryId, vehId in pairs(inventoryIdToVehId) do
local veh = getObjectByID(vehId)
local ownedVehiclesAmount = 0
for inventoryId, vehicle in pairs(vehicles) do
if vehicle.owned and not vehicle.takesNoInventorySpace then ownedVehiclesAmount = ownedVehiclesAmount + 1 end
local vehiclesToTeleportToGarage = {}
for inventoryId, location in pairs(loadedVehiclesLocations) do
local vehInfo = vehicles[inventoryId]
function (job)
for inventoryId, location in pairs(vehiclesToTeleportToGarage) do
local veh = getObjectByID(location.vehId)
if sellAllVehicles then
for inventoryId, vehicle in pairs(vehicles) do
if vehicle.owned then
local res = {}
for inventoryId, vehId in pairs(inventoryIdToVehId) do
spawnedVehicles[inventoryId] = getObjectByID(vehId)
for _, zone in ipairs(zones) do
for inventoryId, veh in pairs(spawnedVehicles) do
if intersecting then
local inventoryIdsInGarage = getVehiclesInGarage(garage, true)
for otherInventoryId, _ in pairs(inventoryIdsInGarage) do
if otherInventoryId ~= inventoryId then
for otherInventoryId, _ in pairs(inventoryIdsInGarage) do
if otherInventoryId ~= inventoryId then
for inventoryId, vehicle in pairs(vehicles) do
data.vehicles[tostring(inventoryId)] = getVehicleUiData(inventoryId, inventoryIdsInGarage)
for inventoryId, vehInfo in pairs(vehicles) do
if vehInfo.timeToAccess then
local inventoryIdsList = {}
for inventoryId, _ in pairs(inventoryIdsInGarage) do
table.insert(inventoryIdsList, inventoryId)
if next(inventoryIdToVehId) then
for invId, vehId in pairs(inventoryIdToVehId) do
if be:getPlayerVehicleID(0) ~= vehId then -- don't display the current player's vehicle
@/lua/ge/extensions/flowgraph/nodes/ui/monologue.lua
for i = old, new+1, -1 do
for _, lnk in pairs(self.graph.links) do
if lnk.sourcePin == self.pinInLocal['message_'..i] then
@/lua/common/libs/luamqtt/mqtt/protocol5.lua
local order = {}
for name, value in pairs(args.properties) do
assert(type(name) == "string", "expecting property name to be a string: "..tostring(name))
local order = {}
for name, val in pairs(args.user_properties) do
local ntype = type(name)
@/lua/ge/extensions/editor/suspensionAudioDebug.lua
im.Columns(2, "AudioTable")
for i, v in pairs(filter) do
for bi, val in ipairs(editor_suspensionAudioDebug.beamSounds) do
@/lua/vehicle/controller/tech/cosimulationCoupling.lua
local ctr = 1
for _, wheel in pairs(wheels.wheels) do
wNodePos[ctr] = obj:getNodePosition(wheel.node1)
local function electricsName2Id(name)
for k, _ in pairs(electrics.values) do -- First check the first-level keys (which the name already is).
if k == name then
local function powertrainName2Ids(name)
for k, dev in pairs(powertrain.getDevices()) do
if string.find(name, dev.name) then
local wheelIds, wOrderCtr = wheelIds, 1
for k, _ in pairs(wheelIds) do
wheelsOrder[wOrderCtr] = k
local ctr = 1
for _, v in pairs(dTable) do
inDMap[ctr] = v
ctr = 1
for _, v in pairs(wTable) do
inWMap[ctr] = v
local propulsionTorques = inTorques[1]
for k, _ in pairs(pTorqueKeys) do -- Set wheel propulsion torque only if set to be controlled by 3rd party.
local wheel = wheelRotators[k]
local brakeTorques = inTorques[2]
for k, _ in pairs(bTorqueKeys) do -- Set wheel braking torque only if set to be controlled by 3rd party.
wheelRotators[k].desiredBrakingTorque = -brakeTorques[k]
local frictionTorques = inTorques[3]
for k, _ in pairs(fTorqueKeys) do -- Set wheel friction torque only if set to be controlled by 3rd party.
wheelRotators[k].frictionTorque = frictionTorques[k]
@/lua/vehicle/controller/drivingDynamics/actuators/activeDiffBias.lua
local avgWheelPositions = {[-1] = vec3(), [1] = vec3()}
for wheelSideIndex, wheelSide in pairs(relevantWheels) do
for _, wheel in ipairs(wheelSide.wheels) do
for wheelSideIndex, avgWheelPosition in pairs(avgWheelPositions) do
local wheelVector = avgWheelPosition - avgDiffPosition --create a vector from our "center" to the wheel
@/gameplay/missionTypes/garageToGarage/constructor.lua
if self.missionTypeData then
for key, value in pairs(self.missionTypeData) do
-- Exclude complex data structures that flowgraph can't handle
}
for _, c in pairs(v.configs) do
local passConfig = true
local removalsNested = {}
for configKey, _ in pairs(manualRemovals or {}) do
local model, config = configKey:match("^([^/]+)/(.+)$")
local selectedOptions = {}
for option, selected in pairs(filter.values) do
if selected and option ~= 'Other...' then
@/lua/ge/extensions/gameplay/statistic.lua
for cbindex in pairs(cbs) do
if not cbs[cbindex].trigger or newentry.value >= cbs[cbindex].trigger then
for e in pairs( target ) do
if target[e].trigger == trigger and target[e].func == callbackFunction then
if im.TreeNode1("Timers") then
for k,v in pairs(timers) do
im.TextUnformatted(k..": "..dumps(v))
if im.BeginTabItem("entries") then
for k,v in pairs(fileData.entries) do
if v.max then
if fileDataCareer then
for k,v in pairs(fileDataCareer.entries) do
if v.max then
if im.TreeNode1("callbacks general") then
for k,v in pairs(callbacks) do
im.TextUnformatted(k..": v="..dumps(v))
if im.TreeNode1("callbacks career") then
for k,v in pairs(callbacksCareer) do
im.TextUnformatted(k..": v="..dumps(v))
local function forceTimerUpdate()
for k in pairs(timers) do
_timerSave(k)
@/lua/ge/extensions/gameplay/rally/notebook/pacenote.lua
for _,wp in pairs(self.pacenoteWaypoints.objects) do
foundTypes[wp.waypointType] = true
function C:onSerialize()
for lang,langData in pairs(self.notes) do
-- convert from old to new file format.
function C:upgradeFromV2ToV3()
for lang,langData in pairs(self.notes) do
local freeformnote = langData.note
function C:matchesSearchPattern(searchPattern)
for lang,note in pairs(self.notes) do
local fullNote = self:noteOutputFreeform(lang)
@/lua/ge/extensions/gameplay/discover/discover_038.lua
for _, discover in pairs(freeroamExperiences) do
table.insert(D.pageInfo.sections[1].discoverIds, discover.id)
end
for _, mission in pairs(missions) do
table.insert(D.pageInfo.sections[2].discoverIds, mission.id)
@/lua/ge/extensions/editor/gen/top.lua
if rest then
for _,i in pairs(rest) do
dbase[#dbase+1] = dbasepre[i]
end
for _,i in pairs(chunk) do
dchunk[#dchunk+1] = dbasepre[i]
local af = {}
for _,c in pairs(achunk) do
af = M.zip(c, af)
-- check winding/cross-bounds
for _,p in pairs(apair) do
local ps = deepcopy(p)
local pair,mult = pairsUp(base)
for _,m in pairs(mult) do
if #m > 1 then
for _,v in pairs(ap) do
av[#av+1] = v
end
for _,v in pairs(aP) do
av[#av+1] = v
if dbg then
for i,d in pairs(adata) do
-- U.dump(d[1], '?? for_DATA:')
-- U.dump(amult, '??+++++ AMULT:')
for _,l in pairs(amult) do
if #l > 1 then return false end
for key,list in pairs(amult) do
-- lo('?? for_M:'..key..':'..#list)
if #apair == 0 then athread[#athread+1] = cthread end
for i,t in pairs(athread) do
if #t % 2 ~= 0 then
local achunk = {}
for i,t in pairs(athread) do
local cbase = {}
local cbase = {}
for _,k in pairs(t) do
cbase[#cbase+1] = base[k]
-- U.dump(cchunk, '?? for_CCHUNK:'..i)
for _,c in pairs(cchunk) do
local chunk = {}
local chunk = {}
for _,j in pairs(c) do
chunk[#chunk+1] = t[j]
local archunk = {}
for i,p in pairs(apair) do
archunk[#archunk+1] = {
for i,p in pairs(apair) do
--- get centers
-- U.dump(athread, '?? for_THREAD:')
for _,t in pairs(athread) do
local cbase = {}
local cbase = {}
for _,i in pairs(t) do
cbase[#cbase+1] = sbase[i]
-- lo('??*************** child_REM:'..#floor.top.achild, true)
for _,c in pairs(floor.top.achild) do
if c.id then
-- lo('?? fR_param:'..#achild)
for i,c in pairs(achild) do
c.id = floor.top.achild[i].id
imi = {i,j}
for _,p in pairs(apair) do
local ps = deepcopy(p)
--[[
for key,_ in pairs(noridge) do
U.dump(achunk[key], '??***************** for_chunk:'..key)
local cbase = {}
for _,i in pairs(achunk[key]) do
cbase[#cbase+1] = sbase[i]
local isin
for k,c in pairs(achunk) do
-- U.dump(c, '?? if_inchunk:'..p[1]..':'..p[2]..':'..#U.index(c,p[1]))
local b = av[#av-6+j]
-- for _,b in pairs(baseext) do
auv[#auv+1] = {u=(b-ref):dot(u), v=(b-ref):dot(v)}
local ref = base[1]
for _,b in pairs(baseext) do
auv[#auv+1] = {u=(b-ref):dot(u), v=(b-ref):dot(v)}
local ref = base[1]
for _,b in pairs(baseext) do
auv[#auv+1] = {u=(b-ref):dot(u), v=(b-ref):dot(v)}
local ajoin = {}
-- for k,p in pairs(apair) do
for k = 1,#apair-1 do
@/lua/ge/extensions/flowgraph/nodes/ui/imgui/imDialogue.lua
local strLinks = {}
for _, lnk in pairs(self.graph.links) do
if lnk.sourceNode == self then
local outPins = {}
for _, pn in pairs(self.pinOut) do
table.insert(outPins, pn)
end
for _, pn in pairs(outPins) do
self:removePin(pn)
local inPins = {}
for _, pn in pairs(self.pinInLocal) do
if tableContains(self.oldOptions, pn.name) then
end
for _, pn in pairs(inPins) do
self:removePin(pn)
@/lua/ge/extensions/flowgraph/nodes/career/onVehicleShoppingEvent.lua
self.pinOut.vehicleSpawned.value = false
for flag, act in pairs(self.flags) do
self.pinOut[flag].value = act
@/lua/vehicle/extensions/mqttGrafanaDemo.lua
for _, wd in pairs(wheels.wheels) do
local name = wd.name
@/lua/vehicle/electrics.lua
for f, v in pairs(vals) do
if M.disabledState[f] ~= nil then
--apply the smoothers as the last thing
for f, s in pairs(smoothers) do
if values[f] ~= nil then
for _, s in pairs(smoothers) do
s:reset()
local combinedSmootherSettings = {}
for _, setting in pairs(defaultSmoothersSettings) do
combinedSmootherSettings[setting.electricsName] = setting
end
for _, setting in pairs(jbeamSmootherSettings) do
combinedSmootherSettings[setting.electricsName] = setting
--iterate over all desired smoothers and create them with the correct settings
for _, smootherSetting in pairs(combinedSmootherSettings) do
smoothers[smootherSetting.electricsName] = newSmoother(smootherSetting.smootherType, smootherSetting.params)
--set all smoothers to the starting value of their respective electrics value
for electricsName, smoother in pairs(smoothers) do
if M.values[electricsName] ~= nil then
@/lua/ge/extensions/gameplay/drift/destination.lua
extractedWaypoints = {}
for _, pathNode in pairs(pathData.pathnodes.sorted) do
table.insert(extractedWaypoints, pathNode.pos)
@/lua/ge/extensions/freeroam/bigMapMarkers.lua
local newOldMarkers = {}
for clusterId, marker in pairs(oldMarkersByClusterId) do
if not marker.visible then
-- Move current markers to old markers list for gradual cleanup
for clusterId, marker in pairs(markersByClusterId) do
marker:hide()
local markersToRemove = {}
for clusterId, marker in pairs(oldMarkersByClusterId) do
marker:update(updateData)
local function hideMarkers()
for _, marker in pairs(markersByClusterId) do
marker:hide()
-- Also hide old markers
for _, marker in pairs(oldMarkersByClusterId) do
marker:hide()
print("Clearing markers")
for _, marker in pairs(markersByClusterId) do
marker:clearObjects()
-- Also clear old markers
for _, marker in pairs(oldMarkersByClusterId) do
marker:clearObjects()
@/lua/ge/extensions/util/trackBuilder/materialUtil.lua
local ret = {}
for key, value in pairs(material) do
if type(material[key]) == "table" then
local function fillDefaults(material, original)
for key, value in pairs(original) do
if material[key] == nil then
if not materials then return end
for letter, mat in pairs(materials) do
M.setSingleMaterial(letter,fillDefaults(mat,originalMaterials[letter]), skipSet)
local ret = {}
for letter, mat in pairs(currentMaterials) do
ret[letter] = removeDefaults(mat,originalMaterials[letter])
@/lua/ge/extensions/core/trailerRespawn.lua
local function getPreviousAttachedVehicleId(vehId)
for previousId, connectionInfo in pairs(trailerReg) do
if type(connectionInfo) == "table" and connectionInfo.trailerId == vehId then
for vId, coupleInfo in pairs(trailerReg) do
if coupleInfo and coupleInfo.trailerId == vehId then
for vID,c in pairs(core_vehicles.vehsCouplerOffset) do
local veh = getObjectByID(vID)
local pos = veh:getPosition()
for ci,cpos in pairs(c) do
debugDrawer:drawSphere( (pos+cpos), 0.05, ColorF(1, 0, 0, 1))
@/lua/ge/extensions/editor/api/genericInspector.lua
local count = 0
for k, v in pairs(tbl) do
if type(k) ~= "number" then return false else count = count + 1 end
-- set the sorted fields array and sort the array fields
for _, field in pairs(fields) do
if tableIsArray(field.value) then field.elementCount = #field.value end
field.sortedFields = {}
for _, fld in pairs(field.fields) do
if tableIsArray(fld.value) then fld.elementCount = #fld.value end
--TODO: use modifiers from the main editor inspector
for k, v in pairs(self.inspectorFieldModifiers) do
if v.callback then
@/lua/ge/extensions/editor/fileDialog.lua
for _, file in pairs(fileCache) do
if not (options.select_folder and file.filetype ~= 'dir') then
local cols = editor.getPreference("files.fileDialog.columns")
for columnName, visible in pairs(cols) do
for _, column in ipairs(columns) do
@/lua/ge/extensions/flowgraph/nodes/states/transitionStack.lua
if self._stack then
for name, pin in pairs(self.pinOut) do
self.pinOut[name].value = self._stack[name]
-- collect the in-pins of this node
for name, pin in pairs(node.pinInLocal) do
if name ~= 'flow' then
-- collect the out-pins of this node
for name, pin in pairs(node.pinOut) do
if name ~= 'flow' then
self._pinTemplates = {_in = {}, _out = {}}
for name, type in pairs(pins) do table.insert(self._pinTemplates._in, {name = name, type = type}) end
table.sort(self._pinTemplates._in, function(a,b) return a.name < b.name end)
@/lua/vehicle/controller/tech/idealRADARSensor.lua
local keys = {}
for key in pairs(tbl) do
table.insert(keys, key)
local vehicles, ctr = {}, 1
for k, _ in pairs(mapmgr.getObjects()) do
if k ~= objectId then
@/lua/ge/extensions/editor/dynamicDecals/inspector.lua
local i = 1
for _, v in pairs(sel) do
if i > 1 then return true end
for layerUid, layerData in pairs(editor.selection["dynamicDecalLayer"]) do
if multiSelect then
for layerType, layerTypeId in pairs(api.layerTypes) do
layerGui[layerTypeId] = function() im.TextUnformatted(string.format("No layerGui available for '%s'", layerType)) end
@/lua/common/libs/lua-luaepnf/epnf.lua
-- copy lpeg shortcuts
for k,v in pairs( L ) do
if string.match( k, "^%u%w*$" ) then
end
for k,v in pairs( node ) do
if k ~= "id" and k ~= "pos" then
@/lua/ge/extensions/editor/tech/roadArchitect/roads.lua
local startWidth = nil
for k, v in pairs(n.widths) do
if r.profile[k].type == 'road_lane' then
local laneWidth = max(0.5, min(10.0, startWidth + offset))
for k, _ in pairs(n.widths) do
if r.profile[k].type == 'road_lane' then
@/lua/vehicle/backwardsCompatibility.lua
for k, _ in pairs(uniqueWheels) do
local axleBeamsWheel = wheels[k] and (wheels[k].axleBeams or {}) or {}
engine.torque = {{"rpm", "torque"}}
for _, v in pairs(v.data.enginetorque) do
table.insert(engine.torque, {v.rpm, v.torque})
if engineData then
for _, e in pairs(engineData) do
table.insert(v.data.powertrain, e)
if diffData then
for _, e in pairs(diffData) do
table.insert(v.data.powertrain, e)
--check if we already have an esc controller
for _, v in pairs(v.data.controller) do
if v.filename == "esc" then
for _, deviceData in pairs(v.data.powertrain or {}) do
local type = deviceData.type
for _, controllerData in pairs(v.data.controller or {}) do
if controllerData.fileName == "vehicleController" then
@/lua/vehicle/controller/gauges/customModules/electricMotorData.lua
motors = powertrain.getDevicesByType("electricMotor")
for _, v in pairs(motors) do
for _, j in pairs(v.registeredEnergyStorages) do
for _, v in pairs(motors) do
for _, j in pairs(v.registeredEnergyStorages) do
table.insert(batteries, j)
@/lua/ge/extensions/editor/gen/network.lua
local aang = {}
for i,v in pairs(apos) do
aang[#aang + 1] = {i, math.atan2(v.y, v.x) % (2*math.pi)}
state = {}
for i,l in pairs(lines) do
local a = U.split(l,',')
local apair = {}
for o,s in pairs(edges.astamp) do
if (edges.infaces[s] ~= nil and math.abs(edges.infaces[s]) == 1) or #edges.astamp == 1 then
end
for _,n in pairs(anode) do
n.pos = n.pos + (pos or vec3(0))
massCenter = vec3(0,0,0)
for _,n in pairs(anode) do
massCenter = massCenter + n.pos
local dpos = pos - massCenter/#anode
for _,n in pairs(anode) do
n.pos = n.pos + dpos
local star, anear = {}, {}
for _,iuse in pairs(ause) do
anear[#anear + 1] = iuse - 1
end
for _,j in pairs(anear) do
if j > 0 and j <= #path then
local dma = 0
for i,n in pairs(anode) do
local step = U.stamp({cp, i})
local crossed, xc, yc
for o,p in pairs(ap) do
local w = wa * p.d/dma + wb * p.ang/math.pi + (1 - (wa + wb)) * p.used
end
for _,pth in pairs(apath) do
crossed = forCross(pth)
apath[#apath + 1] = path
for _,s in pairs(path) do
jointpath[#jointpath + 1] = s
local aang, angp = {}, 0
for _,i in pairs(star) do
local v = anode[i].pos - anode[s].pos
-- relative to p
for o,_ in pairs(aang) do
aang[o][2] = (aang[o][2] - angp) % (2*math.pi)
lo('>> roadAni:')
for key,list in pairs(dlist) do
-- U.dump(list, '?? ani_LIST:'..key..':'..#list)
-- U.dump(nodelist, '?? NLIST:'..#nodelist)
for k,n in pairs(nodelist) do
-- for k,n in pairs(acnode) do
for k,n in pairs(nodelist) do
-- for k,n in pairs(acnode) do
for i = cedge,nedge do
-- local s = aseg[i]
for i,s in pairs(aseg) do
-- U.dump(s, '?? for_seg:'..i)
local an = {s[3]}
for _,n in pairs(s) do
if n.tp and n.tp == 1 then
local nma = 0
for _,s in pairs(ani) do
if #s > nma then
local epos = road:getMiddleEdgePosition(i)
for k,n in pairs(acnode) do
if (n.pos - epos):length() < 0.1 then
local p = pth[o]
-- for o,p in pairs(dec) do
local set = 0
-- reset heights
for o,n in pairs(adec) do
if dbg then
-- build decal
for _,r in pairs(roads) do
local rd = path2decal(r, wHeighway)
local an = {}
for _,p in pairs(apos) do
an[#an + 1] = {pos = p, width = w}
-- get branches
for i,r in pairs(roads) do
local inpath = U.index(r.path, icirc)
-- U.dump(r.apin, '?? r:'..i)
for _,j in pairs(inpath) do
inedge[#inedge + 1] = {i, r.apin[r.path2dec[j]][1]}
local adir = {}
for _,s in pairs(inedge) do
print('?? for_s:'..s[1]..':'..s[2])
-- circles
for o,n in pairs(anode) do
local clr = color(255,255,255,255)
-- paths
for i,l in pairs(apath) do
for j,s in pairs(l) do
for i,l in pairs(apath) do
for j,s in pairs(l) do
if j > 1 then
@/lua/ge/extensions/flowgraph/nodes/career/menuClosed.lua
self.pinOut.menuClosed.value = false
for flag, act in pairs(self.flags) do
self.pinOut[flag].value = act
@/lua/ge/extensions/flowgraph/nodes/activity/activityHook.lua
local pinData = {}
for k, v in pairs(self.pinIn) do
if k ~= 'flow' and k ~= 'reset' then
@/lua/ge/extensions/editor/gen/render.lua
if true then
for _,pth in pairs(apath) do
Render.path(pth, ColorF(c[1],c[2],c[3],c[4] or 1), w, true, z)
local n = 0
for _,pth in pairs(apath) do
for i=1,#pth-1 do
local campos = core_camera.getPosition()
for _,pos in pairs(set) do
-- print('?? set:'..tostring(pos)..':'..tostring(campos)..':'..tostring(c))
c = ColorF(c[1],c[2],c[3],c[4] or 1)
for _,s in pairs(list) do
-- print('?? label:'..tostring(s[2])..':'..tostring(s[1]))
@/lua/ge/extensions/editor/drivePathEditor/playback.lua
-- Disable the AI for all vehicles in the playing table.
for _, v in pairs(playing) do
v.vehicle.veh:queueLuaCommand('ai.setState({mode = "stop"})')
-- Reset the vehicles to their starting positions.
for _, d in pairs(playing) do
splineMgr.resetVehiclePose(d.spline, d.vehicle)
local function handlePlayback()
for _, d in pairs(playing) do
local isStarted = d.isStarted
@/lua/ge/extensions/gameplay/rally/notebook/structured/libCompositor.lua
local prioritizedModifiers = {}
for mod,modData in pairs(config.modifiers) do
table.insert(prioritizedModifiers, { modName = mod, modData = modData })
for _,rawDistanceBefore in ipairs(rawDistanceBeforeValues) do
for caution,cautionText in pairs(config.caution) do
structured.fields.caution = caution
for _,cornerSeverity in ipairs(config.cornerSeverity) do
for cornerDirection,_ in pairs(config.cornerDirection) do
for _,cornerLength in pairs(config.cornerLength) do
for cornerDirection,_ in pairs(config.cornerDirection) do
for _,cornerLength in pairs(config.cornerLength) do
for _,cornerRadiusChange in pairs(config.cornerRadiusChange) do
for _,cornerLength in pairs(config.cornerLength) do
for _,cornerRadiusChange in pairs(config.cornerRadiusChange) do
structured.fields.cornerSeverity = cornerSeverity.value
-- for _,cornerSquare in ipairs({true, false}) do
for cornerDirection,_ in pairs(config.cornerDirection) do
for _,cornerLength in pairs(config.cornerLength) do
for cornerDirection,_ in pairs(config.cornerDirection) do
for _,cornerLength in pairs(config.cornerLength) do
for _,cornerRadiusChange in pairs(config.cornerRadiusChange) do
for _,cornerLength in pairs(config.cornerLength) do
for _,cornerRadiusChange in pairs(config.cornerRadiusChange) do
structured.fields.cornerSeverity = -1
for _,rawDistanceBefore in ipairs(rawDistanceBeforeValues) do
for modName,modData in pairs(config.modifiers) do
-- clear modifiers to work with a clean and consistent state.
for modName,_ in pairs(config.modifiers) do
structured.fields[modName] = false
@/lua/vehicle/controller/gauges/genericGauges.lua
electricsConfig = {}
for _, v in pairs(config) do
table.insert(electricsConfig, v)
local mergedConfig = {}
for _, v in pairs(tableFromHeaderTable(config)) do
mergedConfig[v.deviceName] = mergedConfig[v.deviceName] or {}
powertrainConfig = {}
for k, v in pairs(mergedConfig) do
local device = powertrain.getDevice(k)
local mergedConfig = {}
for _, v in pairs(tableFromHeaderTable(config)) do
mergedConfig[v.moduleName] = mergedConfig[v.moduleName] or {}
local controllerPath = "gauges/customModules/"
for k, v in pairs(mergedConfig) do
local c = controller.getController(controllerPath .. k)
--dump(configData)
for k, v in pairs(jbeamData) do
if k:sub(1, #"configuration_") == "configuration_" then
@/lua/vehicle/extensions/tech/impactgen/damageEvaluation.lua
for i, beam in pairs(v.data.beams) do
local id1 = beam.id1
for k, v in pairs(damage) do
damage[k] = {damage = damage[k] / beamCounts[k]}
for i, beam in pairs(v.data.beams) do
local id1 = beam.id1
for k, v in pairs(damage) do
damage[k] = {damage = damage[k]}
for i, beam in pairs(v.data.beams) do
local id1 = beam.id1
for k, v in pairs(damaged) do
damaged[k] = {damage = damaged[k] / beamCounts[k]}
for i, beam in pairs(v.data.beams) do
local id1 = beam.id1
for k, v in pairs(damage) do
damage[k] = {damage = damage[k] / beamCounts[k]}
for i, beam in pairs(v.data.beams) do
local id1 = beam.id1
for k, v in pairs(damage) do
damage[k] = {damage = damage[k]}
for i, beam in pairs(v.data.beams) do
local id1 = beam.id1
for k, v in pairs(damaged) do
damaged[k] = {damage = damaged[k] / beamCounts[k]}
for i, beam in pairs(v.data.beams) do
local id1 = beam.id1
for k, v in pairs(damage) do
damage[k] = {damage = damage[k] / beamCounts[k]}
for i, beam in pairs(v.data.beams) do
local id1 = beam.id1
for k, v in pairs(damage) do
damage[k] = {damage = damage[k]}
for i, beam in pairs(v.data.beams) do
local id1 = beam.id1
for k, v in pairs(damaged) do
damaged[k] = {damage = damaged[k] / beamCounts[k]}
for i, beam in pairs(v.data.beams) do
local part = beam.partPath
for k, v in pairs(beamCounts) do
if partData[k] ~= nil and partData[k].beamsBroken ~= nil then
local nodeProperties = {}
for k, v in pairs(v.data.nodes[id]) do
if type(v) == "string" or type(v) == "boolean" or type(v) == "number" then
local beamProperties = {}
for k, v in pairs(beam) do
if type(v) == "string" or type(v) == "boolean" or type(v) == "number" then
for i, beam in pairs(v.data.beams) do
local id1 = beam.id1
@/gameplay/missionTypes/crawl/customNodes/getDynamicObjectsFromPrefabNode.lua
local dF = child:getDynamicFields()
for _, value in pairs(dF or {}) do
if type(value) == "string" and value == self.pinIn.dynamicName.value then
@/lua/ge/extensions/gameplay/missions/missionScreen.lua
-- Pre-format aggregates for the UI
for key, prog in pairs(info.parentInfo.formattedProgress.formattedProgressByKey) do
local ownAggregate = {}
-- pre-format aggregates for the UI. This formatting might be the default later and then be moved to gameplay_missions_progress
for key, prog in pairs(info.formattedProgress.formattedProgressByKey) do
--dump(key)
local canPayFee = true
for key, value in pairs(entryFee) do
hasEntryFee = hasEntryFee or value > 0
if m.ignoreUserSettingsKeyForActiveStars then
for key, _ in pairs(m.ignoreUserSettingsKeyForActiveStars) do
flatSettings[key] = nil
local same = true
for k, v in pairs(defaultUserSettings) do
if type(v) == "table" and type(flatSettings[k]) == "table" then
if type(v) == "table" and type(flatSettings[k]) == "table" then
for k2, v2 in pairs(v) do
same = same and flatSettings[k][k2] == v2
end
for k, v in pairs(flatSettings) do
if type(v) == "table" and type(defaultUserSettings[k]) == "table" then
if type(v) == "table" and type(defaultUserSettings[k]) == "table" then
for k2, v2 in pairs(v) do
same = same and defaultUserSettings[k][k2] == v2
for key, info in pairs(starInfo) do
if info.visible then
-- pre-format aggregates for the UI. This formatting might be the default later and then be moved to gameplay_missions_progress
for key, prog in pairs(formattedProgress.formattedProgressByKey) do
--dump(key)
else
for label, _ in pairs(soundNames) do
local sound = scenetree.findObjectById(soundObjectIds[label])
groupsByKey["all"] = {meta = {type = "all"}, sortingKey = "date", sortingDirection = "desc"}
for _, diff in pairs(gameplay_missions_missions.getAdditionalAttributes().difficulty.valuesByKey) do
groupsByKey["difficulty_"..diff.key] = {label = "Difficulty: " ..diff.translationKey, meta = {type = "difficulty"}}
-- build group lists (new groups might have been added)
for key, group in pairs(groupsByKey) do
group.tileIdsUnsorted = {}
-- add tiles to groups
for id, tile in pairs(tilesById) do
for groupKey, _ in pairs(tile.filterData.groupTags) do
for id, tile in pairs(tilesById) do
for groupKey, _ in pairs(tile.filterData.groupTags) do
if groupsByKey[groupKey] then
career_modules_branches_leagues.clearLeagueUnlockCache()
for groupKey, group in pairs(groupsByKey) do
if group.meta.type == "league" then
-- Group by mission type outside career
for groupKey, group in pairs(groupsByKey) do
if group.meta.type == "all" then
@/lua/vehicle/powertrain/hydraulicCylinder.lua
for _, bvs in pairs(cylinder.beamVelocitySmoothers) do
bvs:reset()
end
for k, _ in pairs(cylinder.previousBeamVelocities) do
cylinder.previousBeamVelocities[k] = 0
local currentExtend = 0
for _, bt in pairs(cylinderData.beamTags) do
if beamstate.tagBeamMap[bt] then
if beamstate.tagBeamMap[bt] then
for _, cid in pairs(beamstate.tagBeamMap[bt]) do
table.insert(cylinder.beamCids, cid)
@/lua/vehicle/controller/vehicleController/vehicleController.lua
local hasPressureWheels = false
for _, wi in pairs(wheels.wheels) do
if wi.isPropulsed and not wi.isBroken then
local newBehavior = gearboxHandling.behavior
for _, v in pairs(gearboxHandling.behaviors) do
if found then
local torqueCurve = engine.torqueData.curves[engine.torqueData.finalCurveName].torque
for k, v in pairs(gearbox.gearRatios) do
local shiftUpRPM = nil
-- local energyStorageCount = 0
-- for _, s in pairs(controlLogicModule.energyStorages or {}) do
-- local energyStorage = energyStorage.getStorage(s)
local jbeamDataCopy = deepcopy(jbeamData)
for _, v in pairs(shiftRPMNames) do
if type(jbeamDataCopy[v]) ~= "table" then
gearboxHandling.behaviorLookup = {}
for _, v in pairs(gearboxHandling.behaviors) do
gearboxHandling.behaviorLookup[v] = true
local energyStorageCount = 0
for _, s in pairs(controlLogicModule.energyStorages or {}) do
local energyStorage = energyStorage.getStorage(s)
--for _, v in pairs(drivingStrategy.core.strategies) do
-- drivingStrategy[v] = require(drivingStrategyModuleDirectory .. v)
@/lua/ge/extensions/c2/panelPlugins/tileManager.lua
if mapData and mapData.graph then
for nid, pos in pairs(mapData.positions) do
local n = mapData.graph[nid]
if n then
for lid, _ in pairs(n) do
local lPos = mapData.positions[lid]
for _, col in pairs(index) do
for _, tile in pairs(col) do
for _, col in pairs(index) do
for _, tile in pairs(col) do
tile._roadMarkingSet = nil
if n then
for lid, _ in pairs(n) do
local lPos = mapData.positions[lid]
-- Iterate over all cached tiles
for key, data in pairs(activeTileCache) do
local ctx = data.metadata.tileX
@/lua/ge/extensions/flowgraph/nodes/gameplay/recoveryPrompt/setRecoveryPromptActive.lua
core_recoveryPrompt.deactivateAllButtons()
for _, o in pairs({'flipMission','recoverMission','submitMission','restartMission'}) do
if self.pinIn[o].value ~= nil then
@/lua/ge/extensions/career/modules/delivery/cargoScreen.lua
local idx = 1
for bmId, data in pairs(visibleBigMapIdsToCardIds) do
for cardId, _ in pairs(data.cardIds) do
for bmId, data in pairs(visibleBigMapIdsToCardIds) do
for cardId, _ in pairs(data.cardIds) do
local card = cardsById[cardId]
-- format each group individually
for _, group in pairs(cargoByGroupId) do
local formatted = formatCargoGroup(group, playerCargoContainers, updateFirstSeen)
local vehicleInfoList = {}
for vehId, vehicleInfo in pairs(uiData.player.vehicles) do
--table.sort(vehicleInfo.containers, function(a,b) return a.name < b.name end)
--[[
for poiId, list in pairs(visibleBigMapIdsToCardIds) do
for _, cargo in ipairs(list) do
local maxDelay = 0
for _, delay in pairs(data) do
maxDelay = math.max(delay, maxDelay)
step.makeStepReturnTrueFunction(function()
for vehId, data in pairs(data) do
local veh = scenetree.findObjectById(vehId)
-- no delay, no freeze
for vehId, data in pairs(data) do
local veh = scenetree.findObjectById(vehId)
targetsById[sourceId] = nil
for otherFacId, targetData in pairs(targetsById) do
local dist = targetData.distances[sourceId]
for tgtId1, targetData1 in pairs(targetsById) do
for tgtId2, targetData2 in pairs(targetsById) do
for tgtId1, targetData1 in pairs(targetsById) do
for tgtId2, targetData2 in pairs(targetsById) do
if tgtId1 ~= tgtId2 and tgtId1 ~= "player" and tgtId2 ~= "player" then
if elem then
for cardId, _ in pairs(elem.cardIds) do
cardIds[cardId] = true
visibleBigMapIdsToCardIds = {}
for cardId, card in pairs(cardsById) do
--print("Card Id: " .. cardId)
--print("Card Id: " .. cardId)
for bigMapId, _ in pairs(card.bigMapIds or {}) do
--print(" -> " ..bigMapId)
@/lua/vehicle/energyStorage/pressureTank.lua
for k, v in pairs(storage.nodes) do
obj:setNodeMass(k, v + storage.remainingMass * storage.nodeMassCoef)
--apply final weight as soon as possible
for k, v in pairs(storage.nodes) do
obj:setNodeMass(k, v + storage.remainingMass * storage.nodeMassCoef)
if jbeamData.nodes and jbeamData.nodes._engineGroup_nodes then
for _, n in pairs(jbeamData.nodes._engineGroup_nodes) do
storage.nodes[n] = v.data.nodes[n].nodeWeight --save initial mass as the offset for the node weights
--apply final weight as soon as possible
for k, v in pairs(storage.nodes) do
obj:setNodeMass(k, v + storage.storedEnergy * storage.nodeMassCoef)
local ptoSupplyNodeNames = jbeamData.pneumaticPTOSupplyCouplerNodeNames or {}
for _, nodeName in pairs(ptoSupplyNodeNames) do
if beamstate.nodeNameMap[nodeName] then
local ptoConsumerNodeNames = jbeamData.pneumaticPTOConsumerCouplerNodeNames or {}
for _, nodeName in pairs(ptoConsumerNodeNames) do
if beamstate.nodeNameMap[nodeName] then
@/lua/ge/extensions/campaign/photoSafari.lua
M.count = 1
for k,v in pairs(subLocationsHints) do
unlockedHints[k] = subLocationsHints[k][1]
M.count = #seen +1
for k,v in pairs(subLocationsHints) do
if not M.foundLocation[k] then
@/lua/ge/extensions/ui/liveryEditor/controls.lua
local disableAllActionMaps = function()
for key, value in pairs(ACTION_MAPS) do
popActionMap(value)
@/lua/vehicle/extensions/gameplayInterfaceModules/interactMisc.lua
local function latchesOpen()
for k, v in pairs(controller.getControllersByType("advancedCouplerControl")) do
v.detachGroup()
local function latchesClose()
for k, v in pairs(controller.getControllersByType("advancedCouplerControl")) do
v.tryAttachGroupImpulse()
@/lua/vehicle/extensions/tech/wheelForces.lua
for id, wd in pairs(wheels.wheels) do
local data = {}
for _, beamId in pairs(rimBeams) do
local rBeam = v.data.beams[beamId]
for _, beamId in pairs(sidewallBeams) do
local sBeam = v.data.beams[beamId]
for _, beamId in pairs(sidewallReinfBeams) do
local rBeam = v.data.beams[beamId]
--dump(v.data.beams)
for beamId, beam in pairs(v.data.beams) do
--we only care for non-rim beams
for _, treadNodeId in pairs(v.data.wheels[id].treadNodes) do
table.insert(data.treadNodes, treadNodeId)
@/lua/ge/extensions/flowgraph/nodes/gameplay/recoveryPrompt/onRecoveryPromptAction.lua
function C:work(args)
for _, pin in pairs(self.pinOut) do
pin.value = false
self.pinOut.flow.value = self.pinIn.flow.value
for key, val in pairs(self.flags) do
if self.pinOut[key] then
@/lua/vehicle/controller/propAnimation/hPattern.lua
minExistingGearCoordinateIndex = 0
for _, coordinate in pairs(gearCoordinateTable) do
gearCoordinates[coordinate.gearIndex] = {x = coordinate.x, y = coordinate.y}
@/lua/ge/extensions/core/vehicle/manager.lua
vehicles = {}
for k, v in pairs(data.vehicles) do
vehicles[k] = lpack.decode(v)
}
for k, v in pairs(vehicles) do
data.vehicles[k] = lpack.encode(v)
@/lua/ge/extensions/core/settings/rally.lua
if levelData then
for k,v in pairs(levelData) do
settings.setValue(k, v)
local ngrcPreset = rallyPresets.NGRC
for key, value in pairs(ngrcPreset) do
if settings.getValue(key) ~= value then
@/lua/ge/extensions/core/multiseat.lua
local leastUsedN = math.huge
for id,n in pairs(usedVehicles) do
if n < leastUsedN then
@/lua/ge/extensions/core/lapTimes.lua
slowStreamData.bestSegmentTimesFormatted = {}
for segmentIndex, time in pairs(bestSegmentTimes) do
local lap = bestSegmentLaps[segmentIndex] or 1
@/lua/ge/extensions/flowgraph/nodes/util/file/saveData.lua
if self.pinIn.file.value then
for name, pin in pairs(self.pinIn) do
if name ~= 'flow' and name ~= 'reset' and name ~= 'file' then
@/lua/ge/extensions/career/modules/inspectVehicle.lua
-- find the corresponding route of the current parking spot
for i, parkingSpotRoute in pairs(dealership.testDrive.parkingSpotRoutes) do
if parkingSpotRoute.parkingSpotName == parkingSpot.name then
@/lua/common/tech/techCommunication.lua
for k, v in pairs(tab) do
k = type(k) == 'number' and k or tostring(k)
@/lua/ge/extensions/core/vehicle/colors.lua
for i, paint in ipairs(vd.config.paints) do
for attribute, value in pairs(paint) do
if type(value) == "table" then
@/lua/ge/extensions/editor/tech/roadArchitect/terraform.lua
local quads, ctr = {}, 1
for _, road in pairs(roads) do
local rData = road.renderData
@/lua/ge/extensions/freeroam/freeroamConfigurator.lua
local buttons = {}
for _, buttonInfo in pairs(buttonsInfos) do
table.insert(buttons, buttonInfo)
@/lua/ge/extensions/editor/raceEditor/pacenotes.lua
if not self.path then return end
for _, n in pairs(self.path.pacenotes.objects) do
n._drawMode = 'normal'
for _, seg in pairs(self.path.segments.objects) do
seg._drawMode = 'faded'
--self:selectPacenote(nil)
for _, n in pairs(self.path.pacenotes.objects) do
n._drawMode = 'none'
self.index = id
for _, note in pairs(self.path.pacenotes.objects) do
note._drawMode = (id == note.id) and 'highlight' or 'normal'
else
for _, seg in pairs(self.path.segments.objects) do
seg._drawMode = 'faded'
local closestNote = nil
for idx, note in pairs(self.path.pacenotes.objects) do
local distNoteToCam = (note.pos - self.mouseInfo.camPos):length()
self:selector('Segment','segment', 'Associated Segment')
for _, seg in pairs(self.path.segments.objects) do
seg._drawMode = note.segment == -1 and 'normal' or (note.segment == seg.id and 'normal' or 'faded')
@/lua/ge/extensions/flowgraph/nodes/logic/and.lua
for i = old, new+1, -1 do
for _, lnk in pairs(self.graph.links) do
if lnk.targetPin == self.pinInLocal['flow'..'_'..i] then
@/lua/ge/extensions/editor/util/vehicleSelectUtil.lua
self.configs = {}
for k, v in pairs(modelData.configs) do
table.insert(self.configs, v)
@/lua/ge/extensions/editor/vehicleEditor/veToolbar.lua
local function createMenu(subItems)
for _, item in pairs(subItems) do
if item.group then
local function drawAlwaysVisibleToolbars()
for key, val in pairs(editor.editModes) do
if val["toolbarAlwaysVisible"] and val.onToolbar then
local function toolbarAlwaysVisibleModeExists()
for key, val in pairs(editor.editModes) do
if val["toolbarAlwaysVisible"] and val.onToolbar then
@/lua/ge/extensions/flowgraph/modules/actionModule.lua
local list = {}
for k, v in pairs(self.actionsByName) do
table.insert(list, k)
@/lua/ge/extensions/core/vehicleMirrors.lua
local mirrorCamPos = vec3()
for _, m in pairs(vehicleMirrorData) do
local id1 = vec3(veh:getNodePosition(m.id1))
-- add some more stuff
for _, m in pairs(vehicleMirrorData) do
m.userCorrection = vec3()
@/lua/ge/extensions/flowgraph/nodes/gameplay/recoveryPrompt/setRecoveryPromptEnabled.lua
function C:workOnce(args)
for _, o in pairs({'flipMission','recoverMission','submitMission','restartMission'}) do
if self.pinIn[o].value ~= nil then
@/lua/ge/extensions/trackbuilder/trackBuilder.lua
local function selectMode(name)
for k,v in pairs(paintModes) do
if k == name then
local function setAllPaintModes(active)
for name, tbl in pairs(materials.materialInfo) do
tbl.paint[0] = active
local function setupTextures()
for _, file in pairs(FS:findFiles(materialSettings.directory, "*.dds", -1, true, false)) do
local fileWithoutExtension = string.sub(file, 1, string.len(file) - 4)
for _, set in pairs(materialSettings.textureSets) do
if set.d then set.tex = editor.texObj(set.d)
local function getGroundModelKeyByValue(groundmodel)
for k, gm in pairs(materialSettings.groundModelNames) do
if gm == groundmodel then return k end
local i = 1
for name, set in pairs(materialSettings.textureSets) do
if im.ImageButton("##imageButton4", set.tex.texId, im.ImVec2(64,64), im.ImVec2Zero, im.ImVec2One, im.ImColorByRGB(0,0,0,255).Value, im.ImColorByRGB(255,255,255,255).Value) then print("Image") end
local i = 1
for name, glowMap in pairs(materialSettings.glowMaps) do
if im.ImageButton("##imageButton5", glowMap.tex.texId, im.ImVec2(64,64), im.ImVec2Zero, im.ImVec2One, im.ImColorByRGB(0,0,0,255).Value, im.ImColorByRGB(255,255,255,255).Value) then print("Image") end
local settings = {}
for name,v in pairs(menuSettings) do
if v.type == "bool" then
if not settings then return end
for name, v in pairs(settings) do
if menuSettings[name] then
local function toolbarFromMenuItems(items,sorted)
for _, v in pairs(sorted) do
if items[v].icon then
for _, name in pairs(paintModesSorted) do
if paintModes[name].active[0] == true then
if im.BeginMenu(translateLanguage("ui.trackbuilder.menus.windows","Windows")) then
for k,v in pairs(menuItemsSorted) do
if im.MenuItem2(menuItems[v].name, "", menuItems[v].isOpen) then
im.Separator()
for k,v in pairs(additionalMenuItemsSorted) do
im.MenuItem2(additionalMenuItems[v].name, "", additionalMenuItems[v].isOpen)
local function showSubWindows()
for k,v in pairs(menuItems) do
if v.wasOpen == true and v.isOpen[0] == false then
end
for k,v in pairs(additionalMenuItems) do
if v.wasOpen == true and v.isOpen[0] == false then
local change = false
for name,val in pairs(materials.materialInfo) do
if val.paint[0] then
local doPaint = false
for name,val in pairs(materials.materialInfo) do
doPaint = doPaint or val.paint[0]
local change = false
for name, borderPaint in pairs(clickInputModes) do
if borderPaint[0] == true then
local function trackBuilderEditModeToolbar()
-- for _, v in pairs(menuItemsSorted) do
-- if menuItems[v].icon then
-- im.Separator()
-- for _, v in pairs(additionalMenuItemsSorted) do
-- if additionalMenuItems[v].icon then
local found = false
for nm, pc in pairs(pieceInfo.free) do
if pc.piece == info.piece then
if pc.piece == info.piece then
for key, val in pairs(pc) do
if key ~= 'piece' then
for key, mod in pairs(modifierValues) do
if not mod.noFill then
for nm, pc in pairs(pieceInfo.free) do
if pc.piece == currentPieceName then
if pc.piece == currentPieceName then
for key, val in pairs(pc) do
if key ~= 'piece' then
if not to then return end
for name, mat in pairs(materials.materialInfo) do
mat.value[0] = indexOf(materials[mat.table].matNames,to[name])-1
--TODO: this must be done everytime level changed? since scenetree will be different
for i, matName in pairs(materials.matNames) do
table.insert( materialSettings.materials.center, scenetree.findObject(matName .. 'center') )
@/lua/ge/extensions/editor/rallyEditor/drivelineTab.lua
for nodeName, nodeData in pairs(mapData.nodes) do
if nodeData.pos then
@/lua/ge/extensions/ui/vehicleSelector/tileClustering.lua
local lowestRecentIdx = math.huge
for _configKey, config in pairs(clusteredItems.configsByKey) do
local favouriteIdx = ui_vehicleSelector_general.isFavourite(config.model_key, config.key) or 0
local configsByConfigTypeName = {}
for _, config in pairs(clusteredItems.configsByKey) do
table.insert(configsByConfigTypeName, config)
local allAuxiliary = true
for _, config in pairs(clusteredItems.configsByKey) do
if not config.isAuxiliary then
local sourcesByIconCount = {}
for _, config in pairs(clusteredItems.configsByKey) do
local sources = getSources(config, model.model, true)
local allAuxiliary = true
for _, config in pairs(clusteredItems.configsByKey) do
if not config.isAuxiliary then
local sourcesByIconCount = {}
for _, config in pairs(clusteredItems.configsByKey) do
local sources = getSources(config, model.model, true)
local clusteredItems = {}
for _, config in pairs(configs) do
local group = clusterModeFunctions[clusterMode](config) or "No Data"
@/lua/ge/extensions/editor/inspector.lua
for fldName, field in pairs(ctx.fields) do
if field.useCount == tableSize(valueInspector.selectedIds) then
local fieldVal = nil
for key, val in pairs(ctx.fields) do
-- we start at the second object, since the first one we keep as reference
-- set the sorted fields array and sort the array fields
for _, field in pairs(ctx.fields) do
if field.type == "beginArray" then
field.sortedFields = {}
for _, fld in pairs(field.fields) do table.insert(field.sortedFields, fld) end
table.sort(field.sortedFields, function(a, b) return a.id < b.id end)
if val then
for k, v in pairs(inspectorFieldModifiers) do
if v.callback then
-- otherwise we skip it, since it would not make sense when not common
for key, val in pairs(dynFieldUsage) do
if val == #valueInspector.selectedIds then
if guiInstancer.instances then
for key, inspectorInfo in pairs(guiInstancer.instances) do
local wndName = inspectorWindowNamePrefix .. key
-- first lets check if we have multiple selection types
for _, val in pairs(editor.selection) do
if not tableIsEmpty(val) then
imgui.Text("Multiple types selected:")
for className, val in pairs(editor.selection) do
imgui.Text(#val .. " " .. className .. "(s)")
-- so we provide a function for the current mode, the default is object inspector objectInspectorGui function
for typeName, typeHandler in pairs(inspectorTypeHandlers) do
-- if we have a locked inspector, use its selection
guiInstancer:deserialize("inspectorInstances", state)
for key, val in pairs(guiInstancer.instances) do
editor.registerWindow(inspectorWindowNamePrefix .. tostring(key), imgui.ImVec2(300, 500))
if objFields then
for fldName, field in pairs(objFields) do
if sharedCtx.fields[fldName] == nil then
@/lua/ge/extensions/career/modules/vehicleShopping.lua
local function removeUnusedPlayerVehicles()
for inventoryId, vehId in pairs(career_modules_inventory.getMapInventoryIdToVehId()) do
if inventoryId ~= career_modules_inventory.getCurrentVehicle() then
for partName, part in pairs(newParts) do
part.year = vehicle.year
if part.description.slotInfoUi then
for slot, _ in pairs(part.description.slotInfoUi) do
allSlotsInVehicle[slot] = true
--[[ local slotsToRemove = {}
for slot, partName in pairs(vehicle.config.parts) do
if not allSlotsInVehicle[slot] then
end
for slot, _ in pairs(slotsToRemove) do
vehicle.config.parts[slot] = nil
-- in both cases we change the slot to a unified ""
for slot, partName in pairs(vehicle.config.parts) do
if not vehicle.originalParts[slot] then
local inspectedVehicleInfo = career_modules_inspectVehicle.getSpawnedVehicleInfo()
for shopId, status in pairs(vehicleWatchlist) do
if status == "unsold" and (not inspectedVehicleInfo or inspectedVehicleInfo.shopId ~= shopId) then
@/lua/ge/extensions/util/trackBuilder/basicCenters.lua
for _,shape in pairs(shapes) do computeFaces(shape) end
M.getMeshes = getMeshes
@/lua/common/luaCore.lua
if not pcall(require, "table.clear") then
table.clear = function(tab) for k, _ in pairs(tab) do tab[k] = nil end end
end
@/lua/ge/extensions/editor/terrainMaterialsEditor.lua
local values = {}
for map, asset in pairs(bulkChange.textures) do
if map == "b" then
-- remove obsolete v1 fields from terrain materials
for id, mtl in pairs(editor_terrainEditor.getMaterialsInJson()) do
mtl.material:setDiffuseMap("")
if im.CollapsingHeader1("Terrain Materials", im.TreeNodeFlags_DefaultOpen) then
for id, mtl in pairs(editor_terrainEditor.getMaterialsInJson()) do
if im.Selectable1(mtl.internalName .. "##Terrain Materials" .. id, name == mtl.internalName, nil,
local function showTerrainMaterialsEditor(internalName)
for id, mtl in pairs(editor_terrainEditor.getMaterialsInJson()) do
if mtl.internalName == internalName then
@/lua/ge/extensions/editor/textEditor.lua
local function onEditorGui()
for index, instance in pairs(guiInstancer.instances) do
if instance.registerNameAsync then
local removeList = {}
for index, instance in pairs(guiInstancer.instances) do
for _, objId in ipairs(objIds) do
local function onDeserialize(state)
for index, instance in pairs(state) do
newTextEditorInstance(instance.objIds, instance.fieldName)
local instancesCopy = deepcopy(guiInstancer.instances)
for key, instance in pairs(instancesCopy) do
instance.textInput = nil
@/lua/common/jbeam/sections/licenseplatesSkins.lua
for partName, part in pairs(activePartsData or {}) do
if part.slotType then
@/lua/ge/extensions/scenario/demolitionDerby.lua
reset()
for vName, vData in pairs(scenario.vehicles) do
local vObj = scenetree.findObject(vName)
local playersStoped = {}
for vName, vObj in pairs(scenarioVehicles) do
if not lastPosition[vName] then lastPosition[vName] = vObj:getPosition() end
@/lua/ge/extensions/editor/resourceChecker/resourceUtil.lua
local function foreachMaterial(matTable, cb)
for file, mats in pairs(matTable) do
for key, mat in pairs(mats) do
for file, mats in pairs(matTable) do
for key, mat in pairs(mats) do
cb(file, key, mat)
local out, count = {}, 0
for file, mats in pairs(map) do
local hasAny = false
local hasAny = false
for _, issues in pairs(mats) do
if not tableIsEmpty(issues) then
out[file] = {}
for matName, issues in pairs(mats) do
if not tableIsEmpty(issues) then
local forestItem
for k,v in pairs(forestContent) do
if v.shapeFile == shape then
for layer = 0, layers - 1 do
for k,v in pairs(meta) do
if v["type"] == "filename" then
duplicatedM = {}
for _,v in pairs(duplicatelist) do
local name, mapTo = v[1], v[2]
job.progress = 75
for k,v in pairs(isOld) do
job.yield()
local duplicatelist = {}
for file, mats in pairs(matTable) do
for k, mat in pairs(mats) do
for file, mats in pairs(matTable) do
for k, mat in pairs(mats) do
if mat and mat.name then
job.sleep(0.001)
for k,_ in pairs(duplicatedM) do
countduplicate = countduplicate + 1
job.sleep(0.001)
for k,_ in pairs(outdatedFiles) do
log('I', '', 'Saved materials to '..k )
matData[fn][obj:getName()] = {}
for k,v in pairs(texfields) do
matData[fn][obj:getName()][k] = v
local texfields = {}
for k,v in pairs(obj:getFields()) do
if v["type"] == "filename" then
matData[fn][obj:getName()] = {}
for k,v in pairs(texfields) do
matData[fn][obj:getName()][k] = v
local cases = {".color.png", ".normal.png", ".data.png", ".color.dds", ".normal.dds", ".data.dds", ".dds", ".png", ".bmp", ".jpg", ".jpeg", ".tga"}
for e,t in pairs(matData) do
fileIsMissing[e] = {}
incorrectPathCooker[e] = {}
for k,v in pairs(t) do
if job.progress < 75 then job.progress = job.progress + 0.001 end
incorrectPathCooker[e][k] = {}
for m,d in pairs(v) do
job.yield()
if d and d ~= "" then
for _,b in pairs(cases) do
if d:find(b) then
local sorted = {}
for k,v in pairs(materialFiles) do
if string.find(v, '/terrains/') and string.find(v, '/terrain/') then
matData[fn][obj:getName()] = {}
for k,v in pairs(texfields) do
matData[fn][obj:getName()][k] = v
end
for e,t in pairs(matData) do
pow2[e] = {}
cooker[e] = {}
for k,v in pairs(t) do
if job.progress < 75 then
cooker[e][k] = {}
for m,d in pairs(v) do
if abort(job) then return end
job.sleep(0.001)
for _,v in pairs(objmatTable) do
if job.progress < 90 then job.progress = job.progress + 0.01 end
if (luaType(v[1]) == "table") then
for _,j in pairs(v[1]) do
if not mapping[j] then
local shapesprepare = {}
for k,_ in pairs(shapeList) do
if abort(job) then return end
table.sort(shapesprepare, function(a,b) return tonumber(a[3]) > tonumber(b[3]) end)
for _,v in pairs(shapesprepare) do
local sizeS = string.format("%.2f", v[2] / 1048576)
local shapesprepare = {}
for k,_ in pairs(shapeList) do
if abort(job) then return end
table.sort(shapesprepare, function(a,b) return tonumber(a[3]) > tonumber(b[3]) end)
for _,v in pairs(shapesprepare) do
local sizeS = string.format("%.2f", v[2] / 1048576)
local shapes = {}
for k,_ in pairs(shapeList) do
if abort(job) then return end
job.sleep(0.001)
for _,v in pairs(meshNames) do
if abort(job) then return end
job.sleep(0.001)
for k,_ in pairs(shapeList) do
if abort(job) then return end
local meshNames2 = scenetree.findClassObjects('TSStatic')
for _,v in pairs(meshNames2) do
job.yield()
job.sleep(0.001)
for _,v in pairs(objmatTable) do
job.yield()
if (luaType(v) == "table") then
for _,vv in pairs(v) do
mats[vv] = true
local meshNames3 = scenetree.findClassObjects('TerrainBlock')
for _,v in pairs(meshNames3) do
job.yield()
job.sleep(0.001)
for _,v in pairs(terrainMats) do
job.yield()
job.yield()
for _,vv in pairs(v) do
mats[vv:getInternalName()] = true
local meshNames4 = scenetree.findClassObjects('GroundPlane')
for _,v in pairs(meshNames4) do
job.yield()
local meshNames5 = scenetree.findClassObjects('GroundCover')
for _,v in pairs(meshNames5) do
job.yield()
local meshNames6 = scenetree.findClassObjects('DecalRoad')
for _,v in pairs(meshNames6) do
job.yield()
local meshNames7 = scenetree.findClassObjects('MeshRoad')
for _,v in pairs(meshNames7) do
job.yield()
local meshNames8 = scenetree.findClassObjects('DecalData')
for _,v in pairs(meshNames8) do
job.yield()
log('I', '', 'parsing all materials')
for path, mats in pairs(matTable) do
job.yield()
job.yield()
for k,v in pairs(mats) do
local mat = v
local tmpMats = {}
for k,_ in pairs(mats) do
job.yield()
mats = tmpMats
for k,v in pairs(materialFilesdata) do
job.yield()
job.sleep(0.001)
for k,_ in pairs(unused) do
job.yield()
local toRemove = {}
for k,_ in pairs(unused) do
job.yield()
local prefabInstances = scenetree.findClassObjects('Prefab')
for _,v in pairs(prefabInstances) do
job.yield()
job.sleep(0.001)
for _,v in pairs(meshNames) do
if abort(job) then return end
job.sleep(0.001)
for k,_ in pairs(shapeList) do
if abort(job) then return end
local meshNames2 = scenetree.findClassObjects('TSStatic')
for _,v in pairs(meshNames2) do
job.yield()
job.sleep(0.001)
for _,v in pairs(objmatTable) do
job.yield()
if (luaType(v) == "table") then
for _,vv in pairs(v) do
mats[vv] = true
local meshNames3 = scenetree.findClassObjects('TerrainBlock')
for _,v in pairs(meshNames3) do
job.yield()
job.sleep(0.001)
for _,v in pairs(terrainMats) do
job.yield()
job.yield()
for _,vv in pairs(v) do
mats[vv:getInternalName()] = true
local meshNames4 = scenetree.findClassObjects('GroundPlane')
for _,v in pairs(meshNames4) do
job.yield()
local meshNames5 = scenetree.findClassObjects('GroundCover')
for _,v in pairs(meshNames5) do
job.yield()
local meshNames6 = scenetree.findClassObjects('DecalRoad')
for _,v in pairs(meshNames6) do
job.yield()
local meshNames7 = scenetree.findClassObjects('MeshRoad')
for _,v in pairs(meshNames7) do
job.yield()
local meshNames8 = scenetree.findClassObjects('DecalData')
for _,v in pairs(meshNames8) do
job.yield()
if abort(job) then return end
for k,_ in pairs(mats) do
job.yield()
if texfields then
for _,h in pairs(texfields) do
local file = h
local countMat = 0
for _,h in pairs(allMatsUsages) do
if h == k then countMat = countMat + 1 end
job.sleep(0.001)
for k,v in pairs(mats) do
job.yield()
end
for k,v in pairs(mats) do
job.yield()
table.sort(shapes, function(a,b) return tonumber(a[2]) > tonumber(b[2]) end)
for k,v in pairs(shapes) do
shapes[k] = v[1]
sizeTotal = string.format("%.2f", sizeTotal/1048576)
for k,v in pairs(matsInObjects) do
if (luaType(v) == "table") then
if (luaType(v) == "table") then
for _,p in pairs(v) do
if not usages[p] then usages[p] = {} end
local prefabInstances = scenetree.findClassObjects('Prefab')
for _,v in pairs(prefabInstances) do
job.yield()
end
for _, fn in pairs(prefabs) do
if abort(job) then return end
job.yield()
for _,v in pairs(forestObject:getData():getItems()) do
if not staticInstances[v:getData():getShapeFile()] then
local meshNames = scenetree.findClassObjects('TSStatic')
for _,v in pairs(meshNames) do
job.yield()
end
for k,v in pairs(staticInstances) do
if abort(job) then return end
end
for k,v in pairs(staticInstances) do
job.yield()
if v and v.ColPolygons > 0 then
for _,c in pairs(v.collision) do
if c == "Collision Mesh" then colMeshInst = colMeshInst + 1 end
if v and v.VisPolygons > 0 then
for _,c in pairs(v.collision) do
if (c == "Visible Mesh" or c == "Visible Mesh Final") then visMeshInst = visMeshInst + 1 end
table.sort(shapes, function(a,b) return tonumber(a[2]) > tonumber(b[2]) end)
for k,v in pairs(shapes) do
shapes[k] = v[1]
local meshNames = scenetree.findClassObjects('TSStatic')
for _,v in pairs(meshNames) do
if abort(job) then return end
local forestModels = {}
for _,v in pairs(meshNames2) do
job.yield()
local forestFiles = FS:findFiles("/levels/"..levelname.."/forest/", "*forest4.json", -1, true, false)
for _,v in pairs(forestFiles) do
job.yield()
local meshNames3 = scenetree.findClassObjects('GroundCover')
for _,v in pairs(meshNames3) do
job.yield()
job.sleep(0.001)
for k,v in pairs(forestModels) do
job.yield()
job.sleep(0.001)
for k,_ in pairs(models) do
job.yield()
local tempMdl = {}
for k,_ in pairs(models) do
job.yield()
local meshFiles = FS:findFiles("/levels/"..levelname.."/", "*.dae\t*.dts\t*.cdae", -1, true, false)
for _,v in pairs(meshFiles) do
job.yield()
job.progress = 75
for _,v in pairs(forestModels) do
forestShapes[string.lower(v)] = true
job.sleep(0.001)
for k,_ in pairs(unused) do
job.yield()
local toRemove = {}
for k,_ in pairs(unused) do
job.yield()
local meshNames = scenetree.findClassObjects('Material')
for _,v in pairs(meshNames) do
job.yield()
if texfields then
for _,vv in pairs(texfields) do
textures[vv] = true
local meshNames2 = scenetree.findClassObjects('TerrainMaterial')
for _,v in pairs(meshNames2) do
if abort(job) then return end
else
for k,f in pairs(m:getFields()) do
job.yield()
local meshNames3 = scenetree.findClassObjects('WaterPlane')
for _,v in pairs(meshNames3) do
job.yield()
else
for k,f in pairs(m:getFields()) do
job.yield()
local meshNames4 = scenetree.findClassObjects('WaterBlock')
for _,v in pairs(meshNames4) do
job.yield()
else
for k,f in pairs(m:getFields()) do
job.yield()
local meshNames5 = scenetree.findClassObjects('River')
for _,v in pairs(meshNames5) do
job.yield()
else
for k,f in pairs(m:getFields()) do
job.yield()
local meshNames6 = scenetree.findClassObjects('CloudLayer')
for _,v in pairs(meshNames6) do
job.yield()
local meshNames7 = scenetree.findClassObjects('ScatterSky')
for _,v in pairs(meshNames7) do
job.yield()
else
for k,f in pairs(m:getFields()) do
job.yield()
local meshNames8 = scenetree.findClassObjects('CubemapData')
for _,v in pairs(meshNames8) do
job.yield()
else
for k,f in pairs(m:getFields()) do
job.yield()
if meshNames9 then
for k,v in pairs(meshNames9) do
job.yield()
if k == "previews" then
for _,t in pairs(v) do
textures[t] = true
if k == "spawnPoints" then
for _,t in pairs(v) do
for i,m in pairs(t) do
for _,t in pairs(v) do
for i,m in pairs(t) do
if i == "preview" then
local texTemp = {}
for k,_ in pairs(textures) do
job.yield()
local blacklist = {"buslines", "quickrace", "scenarios", "scenarios", "lights", "export", "import", "minimap"}
for _,v in pairs(texFiles) do
job.yield()
job.sleep(0.001)
for k,_ in pairs(unused) do
job.yield()
local toRemove = {}
for k,_ in pairs(unused) do
job.yield()
if not tableIsEmpty(selected) then
for k,_ in pairs(selected) do
local entry = k:gsub(' ','')
if not tableIsEmpty(materialsToRemove) then
for k,v in pairs(materialsToRemove) do
if string.find(v, levelname) then
if not tableIsEmpty(selected) then
for k,_ in pairs(selected) do
table.insert(shapesToRemove, k)
if not tableIsEmpty(shapesToRemove) then
for _,v in pairs(shapesToRemove) do
local file
if not tableIsEmpty(selected) then
for k,_ in pairs(selected) do
table.insert(texturesToRemove, k)
if not tableIsEmpty(texturesToRemove) then
for _,v in pairs(texturesToRemove) do
log('I', '', 'Removing unused texture '..v )
job.sleep(0.001)
for file,mats in pairs(dummyMat) do
if FS:fileExists(file) then
local materialFile = jsonReadFile(file) or {}
for key,_ in pairs(mats) do
if materialFile[key] then materialFile[key] = nil end
local prefabInstances = scenetree.findClassObjects('Prefab')
for _,v in pairs(prefabInstances) do
if abort(job) then return end
local uniqueModels = {}
for k,_ in pairs(prefabModels) do uniqueModels[k] = true end
for k,_ in pairs(staticFiles) do uniqueModels[k] = true end
for k,_ in pairs(prefabModels) do uniqueModels[k] = true end
for k,_ in pairs(staticFiles) do uniqueModels[k] = true end
local seen = {}
for k,_ in pairs(uniqueModels) do
if abort(job) then return end
if type(names) == "table" then
for _,n in pairs(names) do matsUsed[n] = true end
end
if o and o.getMaterials then
for _,tm in pairs(o:getMaterials()) do
matsUsed[tm:getInternalName()] = true
local seenTex = {}
for matName,_ in pairs(matsUsed) do
if abort(job) then return end
if texfields then
for _,file in pairs(texfields) do
local f = file
@/gameplay/tutorials/customNodes/getLocationsNode.lua
local flag = false
for _,i in pairs(tablee) do
if id == i then flag = true end
@/lua/ge/extensions/editor/flowgraph/main.lua
end
for k, node in pairs(graph.nodes) do
local status, err, res = xpcall(node.draw, debug.traceback, node, builder, style, drawType)
local hiddenLinks = {}
for _, link in pairs(graph.links) do
if link.hidden then
end
for _,gr in pairs(self.mgr.graphs) do table.insert(allGraphs, gr) end
-- graph tabs
local nIds, boxes = {}, {}
for _, g in pairs(self.mgr.graphs) do
for nid, _ in pairs(g.nodes) do
for _, g in pairs(self.mgr.graphs) do
for nid, _ in pairs(g.nodes) do
local box = math.ceil(nid/100)
-- DBEUG: draw all graphs:
--for _, g in pairs(self.mgr.graphs) do self:drawGraph(g, builder, style) end
-- draw current graph only:
local lnks = {}
for _, gr in pairs(self.mgr.graphs) do
drawnThisFrame = false
self:drawGraph(gr, builder, style)
for k, node in pairs(gr.nodes) do
for pinName, pin in pairs(node.pinInLocal) do
for k, node in pairs(gr.nodes) do
for pinName, pin in pairs(node.pinInLocal) do
if pin.type ~= "flow" then
else
for fName, flowPin in pairs(node._mInFlow[pinName] or {}) do
table.insert(lnks,{pin.id, flowPin.id, true})
if globIn and globOut then table.insert(lnks,{globIn,globOut,true}) end
for i,lnk in pairs(lnks) do
ui_flowgraph_editor.Link(9999999+i, lnk[1],lnk[2], lnk[3] and virtualFlowPinLinkCol or virtualPinLinkCol,15, false, "...")
--for _, node in pairs(gr.nodes) do
-- node:overDraw()
if self.fgEditor.delayedHistorySnapshot == nil and ui_flowgraph_editor.IsActive() then
for _, node in pairs(graph.nodes) do
node:updateNodePosition()
-- get unique names with their types
for _, node in pairs(self.mgr.graph.nodes) do
for _, p in pairs(node.pinList) do
for _, node in pairs(self.mgr.graph.nodes) do
for _, p in pairs(node.pinList) do
if p.quickAccess and p.direction ~= pin.direction then
self.quickConnectSortedNames = {}
for name,_ in pairs(self.quickConnectPins) do
table.insert(self.quickConnectSortedNames, name)
local ffiName = ffi.string(self.quickAccessTextfield)
for _, node in pairs(self.mgr.graph.nodes) do
for _, p in pairs(node.pinList) do
for _, node in pairs(self.mgr.graph.nodes) do
for _, p in pairs(node.pinList) do
if p.direction == pin.direction and p.quickAccess and p.accessName == ffiName then
local lnkRemove = nil
for _, lnk in pairs(self.mgr.graph.links) do
if lnk.sourcePin == pin and lnk.targetPin == other or lnk.sourcePin == other and lnk.targetPin == pin then
local toDelete = nil
for _, lnk in pairs(self.mgr.graph.links) do
if lnk.targetPin.id == pin.id then
local toDelete = nil
for _, lnk in pairs(self.mgr.graph.links) do
if lnk.targetPin == other then
@/lua/ge/extensions/flowgraph/nodes/gameplay/rally/rallySuperCountdown.lua
-- Set impulse flags and reset them
for pName, val in pairs(self.flags) do
self.pinOut[pName].value = val
@/lua/ge/extensions/flowgraph/nodes/gameplay/recoveryPrompt/setRecoveryPromptLimit.lua
local counts = {}
for name, pin in pairs(self.pinInLocal) do
if self.pinIn[name].value ~= nil and pin.type == 'number' then
@/lua/ge/extensions/ui/apps.lua
if origLayout.removedApps then
for appName, appVersion in pairs(origLayout.removedApps) do
local userAppIndex = getAppIndexByName(userLayout, appName)
local function onFilesChanged(files)
for _,v in pairs(files) do
local filename = v.filename
end
for k,v in pairs(layouts[layout]) do
if v.directive == appDirective then
@/lua/ge/extensions/flowgraph/nodes/vehicle/beamstate/breakgroup.lua
if groups then
for _,g in pairs(groups) do
veh:queueLuaCommand("beamstate.breakBreakGroup('" .. g .. "')")
@/lua/vehicle/controller/drivingDynamics/actuators/adaptiveDampers.lua
dampBeams = {}
for _, b in pairs(v.data.beams) do
if b.name then
if b.name then
for _, name in pairs(dampBeamNames) do
if b.name == name then
beamModes = {}
for _, mode in pairs(modeData) do
beamModes[mode.name] = {
@/lua/ge/extensions/career/modules/missionWrapper.lua
gameplay_missions_progress.setSavePath(currentSavePath .. "/career/missions/")
for id, dirtyDate in pairs(allMissionData) do
if dirtyDate > oldSaveDate then
@/lua/vehicle/powertrain/supercharger.lua
if jbeamData.boostController then
for k, v in pairs(jbeamData.boostController) do
if type(k) == "number" then
for k, _ in pairs(assignedEngine.torqueCurve) do
if type(k) == "number" and k < assignedEngine.maxRPM then
@/lua/ge/extensions/gameplay/backgroundActivities/g2g.lua
}
for _, c in pairs(v.configs) do
local passConfig = true
@/lua/ge/extensions/flowgraph/nodes/ui/imgui/elemental/imNumbers.lua
function C:_executionStarted()
for _, p in pairs(self.pinOut) do
p.value = nil
@/lua/ge/extensions/flowgraph/nodes/thread/sendMessage.lua
local added = false
for name, pin in pairs(self.pinIn) do
if not pin.fixed then
@/lua/vehicle/extensions/vehiclePerformanceData.lua
local avgWheelPos = vec3(0, 0, 0)
for _, wd in pairs(wheels.wheels) do
wheelCount = wheelCount + 1
local propulsedWheelLocations = {fr = 0, fl = 0, rr = 0, rl = 0}
for _, wd in pairs(wheels.wheels) do
if wd.isPropulsed then
local transmissions = powertrain.getDevicesByCategory("gearbox")
for _, v in pairs(transmissions) do
transmissionTypes[v.type] = true
local fuelTypes = {}
for _, v in pairs(energyStorages) do
if v.type == "fuelTank" then
local inductionTypes = {}
for _, v in pairs(engines) do
inductionTypes.naturalAspiration = true
--iterate active recordings and execute the update method
for recordingType, _ in pairs(activeRecordingTypes) do
recordingUpdateMethods[recordingType](dt)
-- local torqueData = {}
-- for _, v in pairs(engines) do
-- local tData = v:getTorqueData()
-- local engineCurves = td.curves[td.finalCurveName]
-- for rpm, torque in pairs(engineCurves.torque) do
-- torqueCurve[rpm] = (torqueCurve[rpm] or 0) + torque
-- end
-- for rpm, power in pairs(engineCurves.power) do
-- powerCurve[rpm] = (powerCurve[rpm] or 0) + power
-- end
-- for _, torque in pairs(torqueCurve) do
-- maxTorque = max(maxTorque, torque)
-- end
-- for _, power in pairs(powerCurve) do
-- maxPower = max(maxPower, power)
@/lua/ge/extensions/flowgraph/modules/prefabModule.lua
for k, v in pairs(objectsByType) do
if not ignoredClasses[k] then
moreData = moreData or {}
for k, v in pairs(moreData) do data[k] = v end
if data then
for vid, val in pairs(data.originalVehicleTransforms or {}) do
local veh = scenetree.findObjectById(vid)
local vehicleTransforms = {}
for k, _ in pairs(self.prefabs[id].originalVehicleTransforms) do
local veh = scenetree.findObjectById(k)
obj:delete()
for k, v in pairs(vehicleTransforms) do
--dump("Extracting object: " .. i)
@/lua/ge/extensions/career/modules/tuning.lua
local total = 0
for varName, value in pairs(changedVars) do
local varData = tuningData[varName]
local shoppingCartUI = {items = {}}
for name, info in pairs(shoppingCart.items) do
table.insert(shoppingCartUI.items, {varName = info.name, level = 1, title = info.title, price = info.price, type = info.type})
table.insert(shoppingCartUI.items, {varName = info.name, level = 1, title = info.title, price = info.price, type = info.type})
for name, info in pairs(info.items or {}) do
table.insert(shoppingCartUI.items, {varName = info.name, level = 2, title = info.title, price = info.price, type = info.type})
table.insert(shoppingCartUI.items, {varName = info.name, level = 2, title = info.title, price = info.price, type = info.type})
for name, info in pairs(info.items or {}) do
table.insert(shoppingCartUI.items, {varName = info.name, level = 3, title = info.title, price = info.price, type = info.type})
local res = {}
for varName1, value1 in pairs(vars1) do
if vars2[varName1] ~= value1 then
-- fill the vehicleVarsBefore with the missing default values
for varName, varTuningData in pairs(tuningData) do
if not vehicleVarsBefore[varName] then
@/lua/vehicle/controller/hydraulics/hydraulicsCombustionEngineControl.lua
if type(relevantElectricsNames) == "table" then
for _, electricsName in pairs(relevantElectricsNames) do
table.insert(relevantElectrics, electricsName)
@/lua/ge/extensions/career/modules/delivery/parcelManager.lua
local same = true
for k, v in pairs(a) do
same = same and a[k] == b[k]
-- check loaner cut for cargo
for organizationId, _ in pairs(cargo.loanerOrganisations or {}) do
local organization = freeroam_organizations.getOrganization(organizationId)
for _, bd in ipairs(breakdown) do
for key, amount in pairs(bd.rewards) do
adjustedRewards[key] = (adjustedRewards[key] or 0) + amount
-- format each group individually
for gId, group in pairs(cargoByGroupId) do
-- this function is copied over from cargoscreen... TODO: cleanup
@/lua/vehicle/extensions/inputAnalyzer.lua
local function checkInput(dt)
for k, v in pairs(iV) do
lastInputs[k] = inputs[k]
local keyPressed = false
for k, v in pairs(inputs) do
if v and v ~= lastInputs[k] then
if keyPressed then
for k, v in pairs(inputs) do
if v and v ~= lastInputs[k] then
@/lua/ge/extensions/flowgraph/nodes/gameplay/decalLine.lua
function C:work()
for k, pin in pairs(self.pinInLocal) do
if pin.type == 'color' then
@/lua/ge/extensions/editor/api/history.lua
local t1Len = 0
for k, v in pairs(t1) do
t1Len = t1Len + 1
local t2Len = 0
for k in pairs(t2) do
t2Len = t2Len + 1
@/lua/ge/extensions/ui/gridSelectorUtils/filterModule.lua
-- Check if any option for this property is locked
for _, _ in pairs(lockedFiltersByProp[propName]) do
return true
-- Fallback to iterating through keys if no options structure in filterList
for key, _ in pairs(filterOptions) do
if key ~= 'min' and key ~= 'max' then
-- Preserve locked filters when updating
for propName, lockedOptions in pairs(lockedFiltersByProp) do
if newFilters[propName] then
-- For set filters, preserve locked options
for option, lockedValue in pairs(lockedOptions) do
if newFilters[propName][option] ~= nil then
if filterByProp[propName] then
for option, value in pairs(filterByProp[propName]) do
lockedFiltersByProp[propName][option] = value
local hasLockedOptions = false
for _, _ in pairs(lockedFiltersByProp[propName]) do
hasLockedOptions = true
if options then
for option, enabled in pairs(options) do
if filterByProp[propName][option] ~= nil then
@/lua/common/jbeam/expressionParser.lua
}
for k, v in pairs(math) do
c[k] = v
@/lua/ge/extensions/flowgraph/nodes/ui/missionEndScreen.lua
function C:_executionStarted()
for _, p in pairs(self.pinOut) do
p.value = false
local strLinks = {}
for _, lnk in pairs(self.graph.links) do
if lnk.sourceNode == self and tableContains(self.oldOptions, lnk.sourcePin.name) then
local outPins = {}
for _, pn in pairs(self.pinOut) do
if tableContains(self.oldOptions, pn.name) then
end
for _, pn in pairs(outPins) do
self:removePin(pn)
local inPins = {}
for _, pn in pairs(self.pinInLocal) do
local contained = false
end
for _, pn in pairs(inPins) do
self:removePin(pn)
function C:buttonPushed(action)
for nm, pn in pairs(self.pinOut) do
if nm == action then
self:closeDialogue()
for _,pn in pairs(self.pinOut) do
pn.value = false
@/lua/ge/extensions/flowgraph/nodes/ui/threeElementSelect.lua
function C:_executionStarted()
for _, p in pairs(self.pinOut) do
p.value = false
function C:_executionStarted()
for _, p in pairs(self.pinOut) do
p.value = false
function C:buttonPushed(action)
for nm, pn in pairs(self.pinOut) do
self.pinOut[nm].value = nm == action
self:reset()
for _,pn in pairs(self.pinOut) do
pn.value = false
@/lua/ge/extensions/flowgraph/nodes/gameplay/dragRace/getDragWinners.lua
if self.pinOut.playerPos:isUsed() then
for k, v in pairs(self.data) do
if v.isPlayable then
@/lua/vehicle/controller/drivingDynamics/supervisors/tractionControl.lua
local function reset()
for _, wheelGroup in pairs(tractionControlledWheelGroups) do
wheelGroup.slipRange = 0
wheelGroup.slipRange = 0
for _, wheel in pairs(wheelGroup.wheels) do
wheel.slip = 0
@/lua/ge/extensions/flowgraph/nodes/gameplay/race/fileRace.lua
for i = old, new+1, -1 do
for _, lnk in pairs(self.graph.links) do
if lnk.sourcePin == self.pinInLocal['vehId_'..i] then
@/lua/ge/extensions/editor/assemblySpline/import.lua
local totalWeight, total = 0, numGroupComponents
for _, count in pairs(pathCounts) do -- Not round robin, must be random - calculate average weight.
totalWeight = totalWeight + (count / total)
local meshesInPolygon = {}
for _, meshName in pairs(scenetree.findClassObjects("TSStatic")) do
local obj = scenetree.findObject(meshName)
@/lua/ge/extensions/ui/gameplaySelector/tileSorting.lua
M.SORT_MODE_TO_UI = {}
for uiValue, sortMode in pairs(M.UI_TO_SORT_MODE) do
M.SORT_MODE_TO_UI[sortMode] = uiValue
@/lua/ge/extensions/gameplay/markers/bigmapMarker.lua
if iconRendererObj then
for id, _ in pairs(self.iconDataById or {}) do
iconRendererObj:removeIconById(id)
@/lua/vehicle/powertrain.lua
local i = 1
for _, device in pairs(powertrainDevices) do
serializeInfoRes[i] = serializeInfoRes[i] or {}
deviceData.children = {}
for _, v in pairs(device.children) do
table.insert(deviceData.children, v.name or "unknown")
if streams.willSend("powertrainDeviceData") then
for _, v in pairs(powertrainDevices) do
deviceStream[v.name] = deviceStream[v.name] or {outputTorque = {}, outputAV = {}, isBroken = false, uiSimpleModeControl = v.uiSimpleModeControl}
local di = 1
for i, _ in pairs(v.outputPorts) do
deviceStream[v.name].outputTorque[di] = v[outputTorqueStr[i]]
local devices = {}
for _, d in pairs(powertrainDevices) do
if d.parent.isFake then
local inverseMap = {}
for _, d1 in pairs(d.children) do
inverseMap[d1.inputIndex] = d1.name
end
for i, _ in pairs(d.outputPorts) do
table.insert(device.children, inverseMap[i])
if playerInfo.firstPlayerSeated then
for _, device in pairs(powertrainDevices) do
if device.sendTorqueData then
local function updateSimpleControlButtons()
for _, device in pairs(powertrainDevices) do
if device.updateSimpleControlButtons then
if t.requiredExternalInertiaOutputs then
for _, index in pairs(t.requiredExternalInertiaOutputs) do
local hasMatchingChild = false
local hasMatchingChild = false
for _, child in pairs(t.children or {}) do
if child.inputIndex == index then
if t.children then
for _, v in pairs(t.children) do
if not t.outputPorts[v.inputIndex] then
deviceJbeamData = {}
for _, jbeamData in pairs(deepcopy(v.data.powertrain)) do
tableMergeRecursive(jbeamData, v.data[jbeamData.name] or {})
if type(jbeamData.visualPositionRelativeChildren) == "table" and tableSize(jbeamData.visualPositionRelativeChildren) > 0 then
for _, childRelativePosition in pairs(jbeamData.visualPositionRelativeChildren) do
device.visualPositionRelativeChildren = device.visualPositionRelativeChildren or {}
for _, device in pairs(deviceLookup) do
if not device.parent then
for _, device in pairs(powertrainDevices) do
device.parent = device.parent or {isFake = true, outputTorque0 = 0, outputTorque1 = 0, outputTorque2 = 0, deviceCategories = {}}
-- for _,device in pairs(powertrainDevices) do
-- print(device.name)
--dump(beamBrokenEvents)
-- for k,v in pairs(powertrainDevices) do
-- print(v.name)
for _, v in pairs(v.data.beams) do
if v.name and v.name ~= "" and beamTriggers[v.name] then
canResetDevices = true
for _, device in pairs(powertrainDevices) do
local hasReset = device.reset ~= nil
if not tableIsEmpty(previousDeviceModes) then
for k, v in pairs(previousDeviceModes) do
powertrainDevices[k]:setMode(v)
torsionReactorIndexes = {}
for _, rotator in pairs(wheels.wheelRotators) do
if rotator.torsionReactor then
for _, device in pairs(powertrainDevices) do
if device.initSounds then
for _, device in pairs(powertrainDevices) do
for _, groupData in ipairs(device.deformGroups) do
torqueReactionCoefs2 = {}
for _, rotator in pairs(wheels.wheelRotators) do
if rotator.torsionReactor then
for _, device in pairs(powertrainDevices) do
if device.resetSounds then
local newMode = device.mode
for _, v in pairs(device.availableModes) do
if found then
local function toggleDefaultDiffs()
for _, v in pairs(powertrainDevices) do
if v.type == "differential" and v.defaultToggle then
local result = {}
for _, v in pairs(powertrainDevices) do
if v.type == deviceType then
local result = {}
for _, v in pairs(powertrainDevices) do
if v.deviceCategories[category] then
local poweredWheels = {}
for _, wheel in pairs(wheels.wheels) do
local propulsionDevice = powertrain.getPropulsionDeviceForWheel(wheel.name)
for _, wheel in pairs(wheels.wheels) do
local propulsionDevice = powertrain.getPropulsionDeviceForWheel(wheel.name)
local propulsionDevices = {}
for propulsionDevice, _ in pairs(duplicatedPropulsionDevices) do
table.insert(propulsionDevices, powertrain.getDevice(propulsionDevice))
@/lua/ge/extensions/tech/pythonExport.lua
local pythonData = LuaToPython[sensorType](sensor, vehicle)
for _, kv in pairs(PythonDefaults[sensorType]) do
local property, defaultValue = next(kv, nil)
buffer:put("', beamng")
for _, kv in pairs(nonDefaultData) do
local length = #buffer - lineStart
@/lua/vehicle/extensions/chassisData.lua
local wheelCount = 0
for _, wheel in pairs(wheels.wheels) do
local wheelNodePos = vec3(v.data.nodes[wheel.node1].pos) --find the wheel position
for _, wheel in pairs(wheels.wheels) do
local wheelNodePos = vec3(v.data.nodes[wheel.node1].pos) --find the wheel position
local RL2 = 0
for _, n in pairs(v.data.nodes) do
if n.cid == frontRightWheel.node1 then
@/lua/ge/extensions/flowgraph/nodes/string/format.lua
for i = old, new+1, -1 do
for _, lnk in pairs(self.graph.links) do
if lnk.sourcePin == self.pinInLocal['value_'..i] then
@/lua/ge/extensions/editor/tech/roadArchitect/groups.lua
local roadArray, ctr = {}, 1
for _, v in pairs(roads) do
roadArray[ctr] = v
@/lua/ge/extensions/editor/decalSpline/populate.lua
if decalsBySpline then
for material, v in pairs(decalsBySpline) do
local numDecalsByShape = #v
-- Now check if any templates are no longer needed, and remove them.
for material, numInstances in pairs(instanceCounters) do
if numInstances < 1 then
@/lua/ge/extensions/flowgraph/nodes/logic/booleanExpression.lua
--dumpz(self.graph.links,2)
for _, l in pairs(self.graph.links) do
if l.targetNode.id == self.id then
self.keyworkdWhiteListLookup = {}
for _, v in pairs(keywordWhiteList) do
self.keyworkdWhiteListLookup[v] = true
@/lua/ge/extensions/gameplay/parking.lua
for id, data in pairs(trackedVehData) do
local valid, pData = trackParking(id)
@/lua/ge/extensions/career/modules/loanerVehicles.lua
}
for id, offer in pairs(markedForSpawningLoaners) do
-- spawn vehicle and trigger initialization
local result = {}
for inventoryId, vehInfo in pairs(career_modules_inventory.getVehicles()) do
if vehInfo.owningOrganization then
local function onUpdate(dtReal, dtSim, dtRaw)
for inventoryId, vehId in pairs(career_modules_inventory.getMapInventoryIdToVehId()) do
local vehInfo = career_modules_inventory.getVehicles()[inventoryId]
for inventoryId, loanedVehInfo in pairs(loanedVehiclesInfo) do
local vehInfo = career_modules_inventory.getVehicles()[inventoryId]
local counter = 0
for inventoryId, vehicleInfo in pairs(career_modules_inventory.getVehicles()) do
if vehicleInfo.owningOrganization == organizationId then
local numberNonTrailers, numberTrailers = 0, 0
for id, offer in pairs(markedForSpawningLoaners) do
local configInfo = core_vehicles.getConfig(offer.model, offer.config)
@/lua/vehicle/extensions/dynamicVehicleData.lua
for k, v in pairs(newData) do
--print(k .. ": " .. v)
--dump(data)
for _, v in pairs(whiteList) do
data[v] = nil
local torqueData = {}
for _, v in pairs(engines) do
local tData = v:getTorqueData()
local engineCurves = td.curves[td.finalCurveName]
for rpm, torque in pairs(engineCurves.torque) do
torqueCurve[rpm] = (torqueCurve[rpm] or 0) + torque
end
for rpm, power in pairs(engineCurves.power) do
powerCurve[rpm] = (powerCurve[rpm] or 0) + power
end
for rpm, torque in pairs(torqueCurve) do
if torque > maxTorque then
end
for rpm, power in pairs(powerCurve) do
if power > maxPower then
local motors = powertrain.getDevicesByCategory("engine")
for _, v in pairs(motors) do
if v.type == "combustionEngine" then
local engines = powertrain.getDevicesByType("combustionEngine")
for _, v in pairs(engines) do
if v.turbocharger.isExisting then
local energyStorages = energyStorage.getStorages()
for _, v in pairs(energyStorages) do
if v.type == "fuelTank" then
local transmissions = powertrain.getDevicesByCategory("gearbox")
for _, v in pairs(transmissions) do
if v.type == "automaticGearbox" then
end
-- for _, wd in pairs(adjustedWheels) do
-- print(wd.name)
local avgWheelPos = vec3(0, 0, 0)
for _, wd in pairs(adjustedWheels) do
wheelCount = wheelCount + 1
local propulsedWheelLocations = {fr = 0, fl = 0, rr = 0, rl = 0}
for _, wd in pairs(adjustedWheels) do
if wd.isPropulsed then
local centerDiff
for _, v in pairs(orderedDevices) do
if centerDiff then
end
for _, w in pairs(actualDiffs) do
if w.name == v.name then
for _, diff in pairs(powertrain.getDevicesByType("differential")) do
if diff.mode ~= "locked" then
for _, shaft in pairs(powertrain.getDevicesByType("shaft")) do
if shaft.mode ~= "connected" then
for _, rangebox in pairs(powertrain.getDevicesByType("rangeBox")) do
if rangebox.mode ~= "high" then
for _, diff in pairs(powertrain.getDevicesByType("differential")) do
if diff.mode ~= "locked" then
for _, shaft in pairs(powertrain.getDevicesByType("shaft")) do
if shaft.mode ~= "connected" then
for _, rangebox in pairs(powertrain.getDevicesByType("rangeBox")) do
if rangebox.mode ~= "high" then
for _, diff in pairs(powertrain.getDevicesByType("differential")) do
if diff.mode ~= "locked" then
for _, shaft in pairs(powertrain.getDevicesByType("shaft")) do
if shaft.mode ~= "connected" then
for _, rangebox in pairs(powertrain.getDevicesByType("rangeBox")) do
if rangebox.mode ~= "low" then
@/lua/ge/extensions/util/precompileShaders.lua
local allLevels = core_levels.getList()
for _, value in pairs(allLevels) do
if levelsToLoad[string.lower(value.levelName)] == true then
@/gameplay/missionTypes/evade/customNodes/getClosestTrafficNode.lua
self.pos:setFromTable(self.pinIn.position.value)
for k, v in pairs(gameplay_traffic.getTrafficData()) do
if not role or role == v.role.name then
@/lua/ge/extensions/flowgraph/nodes/util/file/loadData.lua
if self.pinIn.file.value then
for name, pin in pairs(self.pinOut) do
if name ~= 'flow'then
@/lua/ge/extensions/gameplay/util/damageAssessment.lua
for _, location in pairs(damageLocationNames) do
textualDamageLocations.damagedLocations[location.name] =
-- for _, location in pairs(damageLocationNames) do
-- if textualDamageLocations.damagedLocations[location.name] then
local highestScore = 0
for locationName, locationData in pairs(textualDamageLocations.damagedLocations) do
if locationData.damageLocationScore > highestScore then
else
for cellId, cellDamageInfo in pairs(data.oldSectionsDamageRaw) do
data.oldSectionsDamageRaw[cellId] = cellDamageInfo[damageType]
data.newSectionsDamageInfoRaw = {}
for cellId, cellDamageInfo in pairs(getSectionsDamageInfoRaw(data.vehId)) do
data.newSectionsDamageInfoRaw[cellId] = cellDamageInfo[damageType]
else
for cellId, cellDamageInfo in pairs(data.newSectionsDamageInfoRaw) do
data.newSectionsDamageInfoRaw[cellId] = cellDamageInfo[damageType]
@/lua/common/libs/LuaIRC/init.lua
if hooks then
for id,f in pairs(hooks) do
if f(...) then
if (type(t)=="table") then
for pos,val in pairs(t) do
if (type(val)=="table") then
@/lua/ge/extensions/career/modules/delivery/cargoCards.lua
-- build grouping data on cards
for id, card in pairs(cardsById) do
local groupTags = {}
-- build group lists (new groups might have been added)
for key, group in pairs(groupsByKey) do
group.cardIdsUnsorted = {}
-- add card ids to groups
for id, card in pairs(cardsById) do
for groupKey, _ in pairs(card.groupTags) do
for id, card in pairs(cardsById) do
for groupKey, _ in pairs(card.groupTags) do
table.insert(groupsByKey[groupKey].cardIdsUnsorted, id)
table.insert(groupsByKey[groupKey].cardIdsUnsorted, id)
for filterKey, _ in pairs(card.filterTags) do
groupsByKey[groupKey].filterTags[filterKey] = true
end
for filterKey, _ in pairs(card.filterTags) do
if not usePlayerCards then
local destinationGroups = {}
for key, group in pairs(groupsByKey) do
if key ~= "destination_noDestination" and key:startswith('destination_') then
local taskGroups = {}
for key, group in pairs(groupsByKey) do
if key:startswith('task_') then
local idx = 1
for _, card in pairs(cardsById) do
card.sortValues = {}
-- give the groups in the groupsets the sorting values.
for _, groupSet in pairs(groupSets) do
for _, group in ipairs(groupSet.groups) do
local itemCount = 0
for _, card in pairs(cardsById) do
if card.isPlayerCard and
@/lua/vehicle/extensions/tech/mesh.lua
local function onVehicleDestroyed(vid)
for sensorId, _ in pairs(meshes) do
if vid == objectId then
local function updateGFX(dtSim)
for sensorId, _ in pairs(meshes) do
updateMesh(dtSim, sensorId, false, nil)
@/lua/ge/extensions/editor/dynamicDecals/debugSection.lua
for materialName, materialData in pairs(data) do
if materialData.mapTo == material then
@/lua/ge/extensions/flowgraph/utils.lua
local sortedString = {}
for name, val in pairs(mergeFunctionsAll) do
mergeFunctionsAny[name] = val
end
for name, val in pairs(mergeFunctionsNumber) do
mergeFunctionsAny['num_'.. name] = val
end
for name, val in pairs(mergeFunctionsBool) do
mergeFunctionsAny['bool_'.. name] = val
end
for name, val in pairs(mergeFunctionsVec) do
mergeFunctionsAny['vec_'.. name] = val
end
for name, val in pairs(mergeFunctionsString) do
mergeFunctionsAny['any_'.. name] = val
@/lua/ge/extensions/campaign/campaignsLoader.lua
local files = FS:findFiles('/campaigns/', '*.json', 1, true, false)
for k,filename in pairs(files) do
local fileData = jsonReadFile(filename) or {}
local campaignList = {}
for _,campaignfile in pairs(campaignInfofiles) do
local entry = loadCampaign(campaignfile)
local campaigns = getList()
for _,campaign in pairs(campaigns) do
if campaign.meta.subsections then
if campaign.meta.subsections then
for subsectionKey,subsection in pairs(campaign.meta.subsections) do
for locationKey,location in pairs(subsection.locations) do
for subsectionKey,subsection in pairs(campaign.meta.subsections) do
for locationKey,location in pairs(subsection.locations) do
if isLocationForScenario(campaign, subsectionKey, locationKey) then
local campaignScenarios = getCampaignScenarios()
for _,path in pairs(campaignScenarios) do
if scenarioFullPath == path then
for k,subsection in pairs(newCampaign.meta.subsections) do
subsection.locations = subsection.locations or {}
subsection.locations = subsection.locations or {}
for locationKey, locationData in pairs(subsection.locations) do
locationData.info = locationData.info or {}
locationData.onEvent = locationData.onEvent or {}
for eventKey, eventData in pairs(locationData.onEvent) do
if eventData.disableEndUI then
local statusTable = processedCampaign.state.locationStatus
for subsectionKey,subsection in pairs(processedCampaign.meta.subsections) do
subsection.key = subsectionKey
subsection.key = subsectionKey
for locationKey,location in pairs(subsection.locations) do
statusTable[subsectionKey..'.'..locationKey] = {attempts = 0, state = 'ready', medal=''}
for k,filename in pairs(files) do
local fileData = jsonReadFile(filename) or {}
local saveInfo = getCampaignSaveInfo()
for k,entry in pairs(saveInfo) do
if entry.title == title then
local savedData = jsonReadFile(saveFilename)
for name,data in pairs(savedData) do
if name ~= 'campaign_campaigns' then
@/gameplay/missionTypes/evade/constructor.lua
unlockedStars.completeTraffic = false
for id, v in pairs(gameplay_traffic.getTrafficData()) do
if be:getObjectActive(id) and v.roleName == 'standard' then
@/lua/vehicle/controller/airplaneSurfaces.lua
for k, v in pairs(trimming) do
if abs(v - lastTrimValues[k]) > 0.005 then
@/lua/ge/extensions/editor/gen/exp_meshexplorer.lua
local alib = {}
for _,p in pairs(apth) do
unrequire(p)
ageopin = {}
for i,part in pairs(ajpart) do
if (part.sel or part.key == cpart) and daedata.dgeo then
-- if part.sel and daedata.dgeo then
for _,k in pairs(part.amesh) do
-- lo('?? to_SEL:'..k)
elseif part.key == unsel then
for _,k in pairs(part.amesh) do
local ind = U.index(ageopin, daedata.dgeo[name2ind[k] ].key)[1]
-- dump(beamdata.abeampick,'?? for_BEAMS_p:')
for i,b in pairs(beamdata.abeampick) do
cstr = cstr + (b.strength == 'FLT_MAX' and 20000 or b.strength)
end
for k,v in pairs(dparam) do
env.ui['in_'..k] = v
end
for k,v in pairs(dparam) do
env.ui['in_'..k] = v
ajpart = {}
for k,v in pairs(djpart) do
ajpart[#ajpart+1] = v
for i,d in pairs(daedata.ageo) do
if d.key == key and d.abeam then
local set = {}
for i,b in pairs(beamdata.abeam) do
local a,b =
beamdata.agroup = {}
for k,v in pairs(beamdata.opart.dgroup) do
-- beamdata.dgroup[v.key] = k
for i,p in pairs(ajpart) do
if p.name == 'pickup_hood' then
W.onVal('group_in',gkey)
for i,g in pairs(beamdata.agroup) do
if g.key == gkey then
--[[
for j,d in pairs(data.configs) do
if d.model_key == 'pickup' then
local data = ui_vehicleSelector_general.getUiData()
for j,d in pairs(data.configs) do
if d.model_key == 'pickup' then
local dgeo = {}
for i,m in pairs(am) do
dgeo[#dgeo+1] = {name=m.name,m=m,mat={nm='WarningMaterial', body=nil, c=c}}
daedata.ageo = {}
for k,d in pairs(dgeo) do
daedata.ageo[#daedata.ageo+1] =
local mi,ma = vec3(math.huge,math.huge,math.huge),-vec3(math.huge,math.huge,math.huge)
for i,v in pairs(pvd.vdata.nodes) do
if v.pos.x < mi.x then
-- local s = 0
for k,bbag in pairs(dbeam) do
-- s = s + #b
local dmi,pmi = math.huge
for j,m in pairs(am) do
if m.name == 'pickup_hood' then
end),c={0,1,0},w=0.005}
for _,b in pairs(bbag) do
local a = pvd.vdata.nodes[b.av[1]]
local a = pvd.vdata.nodes[b.av[1]]
for _,v in pairs(m.verts) do
-- dump(a, '?? for_v:'..tostring(v))
--[[
for k,v in pairs(dbeam) do
for _,d in pairs(daedata.ageo) do
for k,v in pairs(dbeam) do
for _,d in pairs(daedata.ageo) do
if string.find(d.name,k) == 1 then
end)
for i,m in pairs(am) do
-- lo('?? for_PART:'..i..':'..m.name)
-- dump(U.out.agraph[1].list,'?? apath:'..tostring(apath[1][1])..'/'..#apath)
-- for i,b in pairs(pvd.vdata.beams) do
-- if not dbeam[b.partOrigin] then dbeam[b.partOrigin] = {} end
local dicon = {}
for i,mod in pairs(amodel) do
local hit
local hit
for j,d in pairs(data.configs) do
if d.model_key == mod then
for _, config in pairs(data.configs) do
if not data.displayData.showAuxContent and config.isAuxiliary then
if true then
for modelName, _ in pairs(core_vehicles.getModelsData()) do
lo('?? for_model:'..modelName..':'..tostring(core_vehicles.getModel(modelName).model))
local vid
for i,id in pairs(aveh) do
if false and i == 1 then
beamdata.m = am[1]
for k,v in pairs(dbeam) do
-- dump(v,'??==================== vehDATA_dbeam:'..tableSize(dbeam),nil)
end
for k,v in pairs(dbeam) do
for _,d in pairs(daedata.ageo) do
for k,v in pairs(dbeam) do
for _,d in pairs(daedata.ageo) do
if string.find(d.name,k) == 1 then
local matFiles = FS:findFiles('/art/shapes/', '*'..'materials.json', -1, true, false)
for k,f in pairs(matFiles) do
local list = extensions.editor_resourceChecker_resourceUtil.getSimObjects(f)
-- lo('?? matFile:'..#list..':'..f)
for i,m in pairs(list) do
-- lo('?? for_MAT:'..tostring(m.name))
-- models list
for modelName, _ in pairs(core_vehicles.getModelsData()) do
amodel[#amodel+1] = modelName
-- local list = {}
for k,v in pairs(matFiles) do
-- lo('?? for_mat_FILE:'..tostring(v))
}
for _,nm in pairs(wrCommon) do
local mo = scenetree.findObject(nm)
fsnode.astep = {'/'}
for i,s in pairs(astep) do
fsnode.astep[#fsnode.astep+1] = '/'..s
local out,outf = {},{}
for i,f in pairs(adir) do
f = U.split(f, '/', true)
-- lo('?? pre_FAV:'..#afav)
for i,p in pairs(afav) do
-- lo('?? if_fav:'..p..':'..fsnode.path)
if string.find(p, fsnode.path) == 1 then
for j,d in pairs(out) do
-- lo('?? if_FAV:'..(fsnode.path..d.s))
-- lo('?? f_list:'..#list)
for i,f in pairs(list) do
-- lo('?? fof:'..i..':'..tostring(f))
-- dump(daedata.dgeo, '?? DGEO:'..val..':'..n..':'..tableSize(daedata.dgeo),nil,2)
for k,d in pairs(daedata.dgeo) do
m = m + 1
daedata.djoint[k] = jnt
for i,iv in pairs(jnt) do
astick[#astick+1] = daedata.dgeo[val].m.verts[iv]+pos
local n = 0
for _,k in pairs(cval['geo_drag'].akey) do
n = n + 1
local am = {}
for k,v in pairs(daedata.dgeo) do
am[#am+1] = v.m
lo('>> meshClear:'..#amesh)
for i,d in pairs(amesh) do
-- if amesh[1] then
local cfr,cto = vec3(0,0.9,0.2),vec3(0,0,1)
for i,b in pairs(abeam) do
w,c,alpha =
local function groupExtract(val, abeamsel, keepbeams)
for i,d in pairs(beamdata.agroup) do
if not val or d.key == val then
--[[
for _,a in pairs(d.list) do
for _,b in pairs(beamdata.abeam) do
for _,a in pairs(d.list) do
for _,b in pairs(beamdata.abeam) do
if b.stamp == a.stamp then
]]
for _,b in pairs(beamdata.abeam) do
local hit
for _,a in pairs(d.list) do
if b.stamp == a.stamp and val then
if abeam then
for i,s in pairs(abeam) do
abeampick[#abeampick+1] = s
local npick = 0
for i,b in pairs(abeam) do
if not dfrom[b.prn] then dfrom[b.prn] = {} end
local groupn,beamn = 0,0
for i,s in pairs(aline) do
if string.find(s, '"'..beamdata.cpart.name..'":') then
--[[
for k,d in pairs(djpart['pickup_body'].abeam) do
local stamp = U.stamp({
ajpart = {}
for k,v in pairs(djpart) do
ajpart[#ajpart+1] = v
-- models list
-- for modelName, _ in pairs(core_vehicles.getModelsData()) do
-- amodel[#amodel+1] = modelName
ajpart = {}
for k,v in pairs(djpart) do
ajpart[#ajpart+1] = v
-- cleanup params
for k,p in pairs(dextparam) do
lo('?? for_PARAM:'..k..':'..tostring(p == nil)..':'..tostring(tostring(p) == '')..'>'..tostring(p)..'<')
dump(oval,'?? values_OVAL:')
-- for k,v in pairs(oval) do
-- dextparam[k] = v
local file = io.open(beamdata.cpart.file,'w')
for i,s in pairs(aline) do
file:write(s, '\n')
-- partUp(beamdata.cpart)
for i,g in pairs(beamdata.agroup) do
if g.key == 1 then
ajpart = {}
for k,v in pairs(djpart) do
ajpart[#ajpart+1] = v
ajpart = {}
for k,v in pairs(djpart) do
ajpart[#ajpart+1] = v
local npick = 0
for i,b in pairs(beamdata.abeampick) do
if b.prn ~= keyto then
local groupn,beamn = 0,0
for i,s in pairs(aline) do
if string.find(s, '"'..beamdata.cpart.name..'":') then
local groupn,beamn = 0,0
for i,s in pairs(aline) do
if string.find(s, '"'..beamdata.cpart.name..'":') then
lo('?? to_TARGET:'..i..':'..groupn..':'..#linemove)
for j,s in pairs(linemove) do
table.insert(aline, i, s)
'w')
for i,s in pairs(aline) do
file:write(s, '\n')
partUp(beamdata.cpart)
for i,g in pairs(beamdata.agroup) do
if g.key == keyto then
ajpart = {}
for k,v in pairs(djpart) do
ajpart[#ajpart+1] = v
-- dump(aveh, '?? aVEH:')
for i,id in pairs(aveh) do
scenetree.findObjectById(id):delete()
ajpart = {}
for k,v in pairs(djpart) do
ajpart[#ajpart+1] = v
if cg then
for j,g in pairs(beamdata.agroup) do
if g.key == cg then
]]
-- for i,d in pairs(beamdata.agpick)
-- val.sel = not val.sel
local cbeam = {}
for i,b in pairs(beamdata.cgroup) do
if val == b.stamp then
local part
for i,p in pairs(ajpart) do
if val == p.key then
--[[
for i,part in pairs(ajpart) do
if part.sel and daedata.dgeo then
if part.sel and daedata.dgeo then
for _,k in pairs(part.amesh) do
-- lo('?? if_IND:'..tostring(name2ind[k]))
elseif part.key == unsel then
for _,k in pairs(part.amesh) do
local ind = U.index(ageopin, daedata.dgeo[name2ind[k] ].key)[1]
ageopin = {}
for i,p in pairs(ajpart) do
p.sel = false
{m=m,aiv={},aif=fbag})
for i,p in pairs(apiece) do
dump(geo.fbag[p],'?? piece:'..p)
dump(geo.fbag[p],'?? piece:'..p)
for _,fi in pairs(geo.fbag[p]) do
dump(fi, '?? fbag_SRC:'..p)
local pos = amesh[env.ui['lod_up']].body:getPosition()
for i,d in pairs(apiece) do
-- dump(geo.abag[d], '?? bag:')
-- dump(geo.abag[d], '?? bag:')
for _,ind in pairs(geo.abag[d]) do
local v = cval['piece_rot'].verts[ind]+pos
local apath = {}
for i,d in pairs(apiece) do
local fbag = geo.fbag[d]
local fbag = geo.fbag[d]
for i,fi in pairs(fbag) do
apath[#apath+1] = {
local aline = {}
for i,geotgt in pairs(daedata.dgeo) do
if i ~= env.ui['geo_up'] then
aline = {aline[#aline]}
for i,line in pairs(aline) do
local c = (line.ab[1]+line.ab[2])/2
local pos = amesh[env.ui['lod_up']].body:getPosition()
for i,fi in pairs(fbag) do
apath[#apath+1] = {
if val == env.ui[key] or not editor.keyModifiers.ctrl then return end
for i,m in pairs(amesh) do
-- lo('?? if_HIT:'..val..':'..i..':'..m.name..':'..daedata.alod[val].name)
local dicon = {}
for i,mod in pairs(amodel) do
local hit
local hit
for j,d in pairs(data.configs) do
if d.model_key == mod then
dump(aveh, '?? aVEH:')
for i,id in pairs(aveh) do
scenetree.findObjectById(id):delete()
local list = {}
for i,f in pairs(fbag[val].list) do
list[#list+1] = {m.verts[m.faces[f].v+1]+pos,m.verts[m.faces[f+1].v+1]+pos,m.verts[m.faces[f+2].v+1]+pos} -- [#av-0],av[#av-2],av[#av-1],av[#av-0]}
local am = amesh[1].data
for i,cm in pairs(am) do
if cm.key == cgeo then
local pos = amesh[1].body:getPosition()
for i,f in pairs(flist) do
av[#av+1] = m.verts[m.faces[f].v+1]+pos
local am = {}
for k,d in pairs(daedata.dgeo) do
if k == cgeo then
if val > 0 then
for i,k in pairs(geonode.apart) do
-- am[#am+1] = daedata.dgeo[k].m
if val>0 then
for _,k in pairs(geonode.apart) do
am[#am+1] = daedata.dgeo[k].m
if not cval['DragPos'] then
for k,d in pairs(daedata.dgeo) do
if k == cgeo then
lo('?? for_POS:'..tostring(d.pos))
for i,p in pairs(cval['DragPos'].m.verts) do
cval['DragPos'].m.verts[i] = p - d.pos
local am = {}
for k,d in pairs(daedata.dgeo) do
if k == cgeo then
if k == cgeo then
for i,p in pairs(cval['DragPos'].m.verts) do
d.pos = vec3(val,0,0)
local am = {}
for i,m in pairs(mesh.data) do
local ds = sma*(i-(nm - 1)/2-1)
--[[
for k,g in pairs(daedata.dgeo) do
lo('?? for_geo:'..k)
-- local nm = daedata.dgeo[key].name
for i,d in pairs(ajpart) do
if d.sel then
local p1,p2
for i,d in pairs(daedata.ageo) do
if d.key == ageopin[1] then
-- local apath = {}
for i,b in pairs(abeam) do
-- lo('?? pp:'..i..':'..tostring(anode[b.av[1]].partOrigin)..':'..tostring(anode[b.av[2]].partOrigin))
lo('?? for_PART:')
for i,b in pairs(abeam) do
if anode[b.av[1]].partOrigin == p1 or anode[b.av[2]].partOrigin == p1 then
local cfr,cto = vec3(0,0.5,0.5),vec3(0,0,1)
for i,b in pairs(list) do
w,c,alpha =
local nm = daedata.dgeo[key].name
for i,d in pairs(ajpart) do
-- if d.sel then
]]
for j,k in pairs(d.amesh) do
if k == nm then
local list = {}
for i,b in pairs(abeam) do
-- lo('?? foS:'..i..':'..b.stamp..'/'..'rb8r_rb8rr'..'<')
if abeam then
for i,b in pairs(abeam) do
w,c,alpha =
for i,d in pairs(daedata.ageo) do
-- i ~= d.key since sorting
local mid,mad = math.huge,-math.huge
for i,b in pairs(d.abeam) do
if b.strength < math.huge and b.strength < mis then
lo('?? if_BEAMS:'..#d.abeam)
for i,b in pairs(d.abeam) do
-- w = b.strength == math.huge and 1 or (b.strength-beamdata.mis)/(beamdata.mas-beamdata.mis)
for i,b in pairs(abeam) do
w = 2
local item
for i,d in pairs(daedata.ageo) do
if d.key == val then
local mi,ma=vec3(math.huge,math.huge,math.huge),vec3(-math.huge,-math.huge,-math.huge)
for i,v in pairs(daedata.dgeo[val].m.verts) do
if v.x < mi.x then
if false then
for k,d in pairs(daedata.dgeo) do
-- k='Mesh_160-mesh'
if jnt then
for i,iv in pairs(jnt) do
astick[#astick+1] = daedata.dgeo[val].m.verts[iv]+pos
local bv = {}
for s,f in pairs(d.m.faces) do
bv[#bv+1] = d.m.verts[f.v+1]+pos
]]
for i,m in pairs(am) do
if m.key == cgeo then
local pm = {}
for i,flist in pairs(fbag) do
pm[#pm+1] = deepcopy(am[idel])
-- dump(pm[#pm].faces, '?? list:'..i)
for j,f in pairs(flist.list) do
-- lo('?? fo_F:'..tostring(f))
om:createMesh({})
for i,m in pairs(am) do
if m.key ~= cgeo then
ageopin = {}
for k,v in pairs(daedata.alod[val].list) do
-- dump(v.mat, '?? for_MAT2:'..v.mat.body)
--[[
for k,d in pairs(dgeo) do
daedata.ageo[#daedata.ageo+1] =
--[[
for k,d in pairs(djpart['pickup_body'].abeam) do
local stamp = U.stamp({
ajpart = {}
for k,v in pairs(djpart) do
ajpart[#ajpart+1] = v
local po = {}
for _,b in pairs(pvd.vdata.beams) do
-- lo('?? for_beam:'..i..':'..tostring(b.partOrigin))
end)
for k,g in pairs(alod) do
-- alod[#alod+1] = {key=k,name=g.name or 'NONE',area=g.area,nface=g.nface}
local am = {}
for i,d in pairs(g.list) do
d.m.material = d.mat.nm
daedata.ageo = {}
for k,d in pairs(dgeo) do
daedata.ageo[#daedata.ageo+1] =
dump(pvd.vdata.nodes[1], '?? NODES_1:')
for k,v in pairs(dbeam) do
for _,d in pairs(daedata.ageo) do
for k,v in pairs(dbeam) do
for _,d in pairs(daedata.ageo) do
if string.find(d.name,k) == 1 then
local po = {}
for _,b in pairs(pvd.vdata.beams) do
-- lo('?? for_beam:'..i..':'..tostring(b.partOrigin))
local mi,ma = vec3(math.huge,math.huge,math.huge),-vec3(math.huge,math.huge,math.huge)
for i,v in pairs(beamdata.anode) do
if v.pos.x < mi.x then
am = {}
for k,d in pairs(dgeo) do
am[#am+1] = d.m
daedata.ageo = {}
for k,d in pairs(dgeo) do
daedata.ageo[#daedata.ageo+1] =
local dbeam = M.forBeams(extensions.core_vehicle_manager.getPlayerVehicleData().vdata)
for k,v in pairs(dbeam) do
for _,d in pairs(daedata.ageo) do
for k,v in pairs(dbeam) do
for _,d in pairs(daedata.ageo) do
if string.find(d.name,k) == 1 then
dump(aveh, '?? aVEH:')
for i,id in pairs(aveh) do
scenetree.findObjectById(id).hidden = false
dump(aveh, '?? aVEH:')
for i,id in pairs(aveh) do
scenetree.findObjectById(id).hidden = true
if true then
for k,d in pairs(dgeo) do
daedata.ageo[#daedata.ageo+1] = {key=k,name=d.name or 'NONE',area=d.area}
local am = {}
for k,d in pairs(dgeo) do
am[#am+1] = d.m
if M.valid(am) then
for i,m in pairs(amesh) do
local obj = scenetree.findObjectById(m.id)
if v.exp then
for _,d in pairs(v.amesh) do
im.TableNextColumn()
-- im.SetCursorPosX(curx)
for k,v in pairs(geonode.astep) do
if daedata.dgeo[v] then
im.PushStyleColor2(im.Col_Text, im.ImVec4(0.6,1,0.9,0.9))
for i,b in pairs(v.list) do
im.TableNextColumn()
-------------------------
for k,v in pairs(geonode.apart) do
im.Text(daedata.dgeo[v] and tostring(daedata.dgeo[v].name) or 'NONE')
forParam()
-- for k,v in pairs(dparam) do
for j,k in pairs({'strength','deform','spring','damp'}) do
-- for k,v in pairs(dparam) do
for j,k in pairs({'strength','deform','spring','damp'}) do
UI.sliderC(k,'in_'..k, {dparam[k]/2,
if fbag then
for i,b in pairs(fbag) do
im.TableNextColumn()
--[[
for i,af in pairs(fbag) do
im.Text(''..#af)
if env.ui['geo_up'] then
for i,d in pairs(daedata.dgeo[env.ui['geo_up'] ].abag) do
im.Text('Piece '..i..' /'..#d..'/')
im.Columns(#bag4surf, "geoSurf", true)
for i,list in pairs(bag4surf) do
im.Text(toroman[i])
if im.BeginListBox(id, im.ImVec2(-1,-1)) then
for j,af in pairs(list) do
im.PushItemWidth(200)
-- lo('??***** PIN:'..tostring(inhover)..':'..#ageopin)
for c,d in pairs(daedata.dgeo) do
if (inhover and editor.keyModifiers.ctrl) or #ageopin>0 then
-- JOINTS
for c,d in pairs(daedata.dgeo) do
if djoint[c] then -- and inhover and inpanel~=1 then
if geonode.astep then
for _,k in pairs(geonode.astep) do
if _ == #geonode.astep then
-- lo('?? toPIN:'..tableSize(djoint))
for c,d in pairs(daedata.dgeo) do
if djoint[c] and c~=inhover then
if geonode.astep then
for _,k in pairs(geonode.astep) do
if _ == #geonode.astep then
-- lo('?? toPIN:'..tableSize(djoint))
for c,d in pairs(daedata.dgeo) do
if djoint[c] and c~=inhover then
if geonode.astep then
for _,k in pairs(geonode.astep) do
if _ == #geonode.astep then
im.SetColumnWidth(1, panelW-80)
for j,d in pairs(fsnode.afile) do
if j == fsnode.cfile then
-- im.SetColumnWidth(2, 26)
for j,s in pairs(fsnode.astep) do
-- for i=1,#fsnode.astep do
local set = {}
for i,b in pairs(beamdata.abeam) do
local a,b =
beamdata.agroup = {}
for k,v in pairs(beamdata.opart.dgroup) do
beamdata.agroup[#beamdata.agroup+1] = v
local n = 0
for _,k in pairs(cval['geo_drag'].akey) do
n = n + 1
local am = {}
for k,v in pairs(daedata.dgeo) do
am[#am+1] = v.m
ajpart = {}
for k,v in pairs(djpart) do
ajpart[#ajpart+1] = v
local partname
for i,d in pairs(ajpart) do
for j,k in pairs(d.amesh) do
for i,d in pairs(ajpart) do
for j,k in pairs(d.amesh) do
if k == nm then
local partname
for i,p in pairs(ajpart) do
if p.key == env.ui['jpart_pick'] then
end
for k,v in pairs(danim) do
if v.cb then
meshTarget = nil
for c,d in pairs(daedata.dgeo) do
d.mat.c[4] = _conf.alpha
local cm = vec3(0,0,0)
for _,v in pairs(daedata.dgeo[key].m.verts) do
cm = cm + v
-- local pos = amesh[1].body:getPosition()
for i,d in pairs(daedata.ageo) do
-- i ~= d.key since sorting
local mid,mad = math.huge,-math.huge
for i,b in pairs(d.abeam) do
if b.strength < math.huge and b.strength < mis then
U.out.agraph = {}
for i,b in pairs(d.abeam) do
-- w = b.strength == math.huge and 1 or (b.strength-beamdata.mis)/(beamdata.mas-beamdata.mis)
lo('?? to_BR:'..#d.abeam)
for i,b in pairs(d.abeam) do
w = b.strength == math.huge and 1 or (b.strength-beamdata.mis)/(beamdata.mas-beamdata.mis)
U.out.agraph = {}
for i,b in pairs(d.abeam) do
U.out.agraph[#U.out.agraph+1] = {
--[[
for i,list in pairs(bag4surf) do
im.Text(toroman[i])
im.PushFont3("cairo_regular_medium")
for i,list in pairs(bag4surf) do
-- im.Text(tostring(cgeo))
-- im.NextColumn()
for i,list in pairs(bag4surf) do
im.Text('AAA')
if im.BeginListBox(id, im.ImVec2(-1,-1)) then
for j,af in pairs(list) do
im.Text(j)
im.Columns(#bag4surf, "geoSurf", true)
for i,list in pairs(bag4surf) do
im.SameLine()
lo('??***** PIN:'..tostring(inhover)..':'..#ageopin)
for c,d in pairs(daedata.dgeo) do
if (inhover and editor.keyModifiers.ctrl) or #ageopin>0 then
-- lo('?? toPIN:'..tableSize(djoint))
for c,d in pairs(daedata.dgeo) do
if djoint[c] and c~=inhover then
inhover = false
for k,v in pairs(daedata.dgeo) do
color = im.ImVec4(0.8, 0.8, 0.8, 1) --U.index(ageopin,k)[1] and im.ImVec4(0.9, 0.2, 0.9, 1) or im.ImVec4(0.8, 0.8, 0.8, 1)
@/lua/ge/extensions/gameplay/discover.lua
local pages = {}
for id, pageInfo in pairs(pageInfosById) do
local page = deepcopy(pageInfo)
local devices = {}
for k, v in pairs(core_input_bindings.bindings) do
if v.contents.devicetype and v.contents.imagePack then
@/lua/ge/extensions/ui/appSelector/general.lua
if apps then
for _, app in pairs(apps) do
if app.types then
local commonFilters = {}
for _, propName in pairs(filtersWhiteList) do
if filterByProp[propName] then
local options = {}
for option, _ in pairs(filterByProp[propName]) do
table.insert(options, option)
local items = {}
for _, app in pairs(apps) do
if filterInstance.passesFilters(app) then
local remainingCategories = {}
for category, _ in pairs(categoryGroups) do
table.insert(remainingCategories, category)
local allButtons = buttonInstance.getAllButtonInfos()
for buttonId, buttonInfo in pairs(allButtons) do
if buttonInfo.meta and buttonInfo.meta.label == translateHelper.translate("ui.apps.selector.addToLayout") then
@/lua/ge/extensions/flowgraph/nodes/ui/imgui/elemental/imSeparator.lua
function C:_executionStarted()
for _, p in pairs(self.pinOut) do
p.value = false
@/lua/ge/extensions/flowgraph/nodes/input/blacklistAction.lua
allCategories = {}
for name, info in pairs(allActions) do
allCategories[info.cat] = allCategories[info.cat] or {}
-- self.search:setSameScoreResolvingFunction(sortFun)
for name, info in pairs(allActions) do
self.search:queryElement({
self.list = {}
for k, v in pairs(listKeys) do
if v then
@/lua/ge/extensions/flowgraph/nodes/activity/activityAttempt.lua
local added = false
for name, pin in pairs(self.pinIn) do
if not pin.fixed then
@/lua/ge/extensions/flowgraph/graph.lua
local children = {}
for _, gr in pairs(self.mgr.graphs) do
if gr.parentId == self.id then
-- collect all nodes and additionally put all integrated nodes into a second list.
for _, node in pairs(self.nodes) do
if node.nodeType == 'macro/integrated' then
-- gather all links which are not connected to neither an integrated node nor an IO node.
for _, link in pairs(self.links) do
if not (link.sourceNode.nodeType == 'macro/integrated' or link.sourceNode.nodeType == 'macro/io'
for id, link in pairs(iNode.graph.links) do
if link.targetNode == iNode then
-- get links in target graph that connect from either i/o node
for id, link in pairs(iNode.targetGraph.links) do
if link.sourceNode == iNode.inputNode then
local allLinks = {}
for node, list in pairs(interInfo) do
if node.nodeType == "macro/integrated" then
if node.nodeType == "macro/integrated" then
for pinName, lnkList in pairs(list.inLinks) do
for _, link in ipairs(lnkList) do
elseif node.nodeType == "macro/io" and node.ioType == "out" then
for pinName, lnkList in pairs(list) do
for _, link in ipairs(lnkList) do
if self.mgr.gcprobe_enabled then
for id, node in pairs(allNodes) do
if gcprobe_grouping == 'type' then
local nodeInFlows = {}
for _, link in pairs(allLinks) do
local tPin = link.targetPin
for id, node in pairs(allNodes) do
table.clear(node._flowColors)
if not node.ignoreAsRoot then
for _, pin in pairs(node.pinOut) do
if pin.type == 'flow' then
-- build dependency map
for _, pin in pairs(node.pinIn) do
local parentNode = pin.node
for _, mPin in pairs(node._mInFlow) do
for _, pin in ipairs(mPin) do
local hasOutFlow = false
for _, pin in pairs(node.pinOut) do
if pin.type == 'flow' then
prevOutCount = #outList
for id, node in pairs(inNodes) do
local depsOk = true
local dnode = ndeps[i]
for color, _ in pairs(dnode._flowColors) do
node._flowColors[color] = 1
local sourceColor = node._flowColors
for _, p in pairs(node.pinOut) do
if outNodeIdx[p] then
if outNodeIdx[p] then
for targetNode, _ in pairs(outNodeIdx[p]) do
for color, _ in pairs(targetNode._flowColors) do
for targetNode, _ in pairs(outNodeIdx[p]) do
for color, _ in pairs(targetNode._flowColors) do
if sourceColor[color] == nil then
local n = outList[i]
for pname, mPin in pairs(n._mInFlow) do
if #mPin > 1 then
{ __index = {value = function()
for _,v in pairs(mPin) do
print(mPin.value)
for color, _ in pairs(n._flowColors) do
if rootWork[color] == nil then
if next(n.pinIn) ~= nil then
for _, mPin in pairs(n._mInFlow) do
for _, pin in ipairs(mPin) do
local hasFlowPin = false
for _, pin in pairs(n.pinInLocal) do
if pin.type == 'flow' then
table.clear(self.hookList)
for color, orderList in pairs(rootWork) do
if string.sub(color.name, 1, 2) == 'on' then
for _, p in pairs(color.pinOut) do
if p.type == 'flow' then
table.clear(tmp1)
for _, p in pairs(cInDeps[node]) do
local pnum = cInDepsDict[p]
table.insert(fun, '\n -- multi-inflow pins')
for pname, dOutPin in pairs(node._mInFlowPins) do
table.clear(tmp)
table.clear(tmp)
for _, p in pairs(node._mInFlow[pname]) do
local pnum = cInDepsDict[p]
table.clear(tmp)
for p, _ in pairs(cOutDeps[node]) do
if p.value == nil then
if gcprobe_grouping == 'individual' then
table.insert(fun, '\n for k, v in pairs(currentGarbage) do\n gcprobeTable.entries[k].total = (gcprobeTable.entries[k].total or 0) + v\n gcprobeTable.entries[k].count = (gcprobeTable.entries[k].count or 0) + 1\n gcprobeTable.entries[k].history[self.mgr.frameCount+1] = v\n gcprobeTable.entries[k].totalHistory[self.mgr.frameCount+1] = gcprobeTable.entries[k].total end ')
table.insert(fun, '\n gcprobeTable.total = gcprobeTable.total + garbageTotal\n gcprobeTable.history[self.mgr.frameCount+1] = garbageTotal\n gcprobeTable.totalHistory[self.mgr.frameCount+1] = gcprobeTable.total')
end
--for id, node in pairs(self.nodes) do
-- if node.nodeType == "macro/integrated" then
--end
for _, node in pairs(self.nodes) do
node:_destroy()
-- delete any links to it
for linkId, link in pairs(self.links) do
if link.sourceNode == node or link.targetNode == node then
-- delete any links to it
for linkId, link in pairs(self.links) do
if link.sourceNode == node or link.targetNode == node then
for nid, node in pairs(self.nodes) do
nodes[nid] = node:__onSerialize()
local orderedLinks = {}
for _, link in pairs(self.links) do
if pinOrder[link.targetPin] then
--[[
for childId, child in pairs(data.children) do
local cid = tonumber(childId) + self.mgr:getGraphNodeOffset()
function C:linkExists(startPin, endPin)
for k, link in pairs(self.links) do
if link.sourcePin.id == startPin.id and link.targetPin.id == endPin.id then
function C:hasLink(pin)
for k, link in pairs(self.links) do
if pin.type ~= 'flow' and pin.type ~= 'state' and link.targetPin.id == pin.id then
end
for typeA, _ in pairs(sourceTypes) do
if targetTypes['any'] then
function C:_executionStarted()
for _, node in pairs(self.nodes) do
if node._executionStarted then
function C:_onClear()
for _, node in pairs(self.nodes) do
node:_onClear()
function C:_executionStopped()
for _, node in pairs(self.nodes) do
if node._executionStopped then
--print("Root ID " .. root.id)
for _, m in pairs(self.mgr.macros) do
if m.id == root.macroID then
function C:getRecursiveHooksAndDependencies(hooks, deps)
for _, node in pairs(self.nodes) do
table.insert(hooks, node)
end
for _, g in pairs(self:getChildren()) do
g:getRecursiveHooksAndDependencies(hooks, deps)
function C:findNodeRecursive(id)
for _, node in pairs(self.nodes) do
if node.id == id then
local ret = nil
for _, child in pairs(self:getChildren()) do
if not ret then
function C:forceRecursiveNodeUpdatePosition()
for _, gr in pairs(self:getChildren()) do
gr:forceRecursiveNodeUpdatePosition()
end
for _, nd in pairs(self.nodes) do
nd:updateNodePosition()
local state = nil
for _, gr in pairs(self.mgr.graphs) do
if gr.isStateGraph and state == nil then
if gr.isStateGraph and state == nil then
for _, node in pairs(gr.nodes) do
if node:representsGraph() and node:representsGraph().id == self.id then
local children = self:getChildren()
for _, node in pairs(self.nodes) do
if node:representsGraph() and not node:representsGraph().isStateGraph then
local children = parent:getChildren()
for _, node in pairs(parent.nodes) do
if node:representsGraph() and not node:representsGraph().isStateGraph then
local children = {}
for _, gr in pairs(self.mgr.graphs) do
if gr:getParentWithStates() == nil then
local state = nil
for _, gr in pairs(self.mgr.graphs) do
--print(gr.isStateGraph)
if gr.isStateGraph and state == nil then
for _, node in pairs(gr.nodes) do
if node:representsGraph() and node:representsGraph().id == last.id then
@/lua/ge/extensions/flowgraph/modules/uiModule.lua
-- Find highest predefined order
for _, config in pairs(pageConfig) do
if config.order > nextOrder then
if element.pages then
for pageName, enabled in pairs(element.pages) do
if not career_career.isActive() and pageConfig[pageName].hideInCareer then
local unflattenedSettings = {}
for k, v in pairs(mission.lastUserSettings) do
table.insert(unflattenedSettings, {key = k, value = v})
local perfStatsRows = {}
for _, statData in pairs(driftStats.perfStats) do
table.insert(perfStatsRows, {
local totalTiersScore = 0
for _, statData in pairs(driftStats.tiersStats) do
totalTiersScore = totalTiersScore + statData.totalScore
local totalDriftEventsScore = 0
for _, eventData in pairs(driftStats.driftEvents) do
totalDriftEventsScore = totalDriftEventsScore + eventData.totalScoreEarned
@/lua/ge/extensions/ui/liveryEditor/layers.lua
if M.layerMap then
for k, layer in pairs(M.layerMap) do
if not layer.hidden then
M.getLayerByOrder = function(order, parentUid)
for k, layerMapItem in pairs(M.layerMap) do
if (not parentUid or parentUid == layerMapItem.parentUid) and layerMapItem.order == order then
@/lua/ge/extensions/core/vehicle/partmgmt.lua
if node.children then
for _, childNode in pairs(node.children) do
recGetPart(childNode, outPartsHighlighted, outPartsHighlightedIdxs, outPartNameToIdx)
-- enrich the data a bit for the UI
for partName, uiPartInfo in pairs(availableParts) do
local richPartInfo = {}
if not node then return end
for slotId, child in pairs(node.children or {}) do
legacySlotMap[child.path] = {
-- now simplify it
for path, slotData in pairs(legacySlotMap) do
if not legacySlotMapSimple[slotData.slotId] then
-- now discard the complex data
for key, slotData in pairs(legacySlotMapSimple) do
if slotData ~= "COLLISION" then
if not node then return end
for slotId, child in pairs(node.children or {}) do
legacySlotMap[child.path] = {
-- now simplify it
for path, slotData in pairs(legacySlotMap) do
if not legacySlotMapSimple[slotData.slotId] then
-- now discard the complex data
for key, slotData in pairs(legacySlotMapSimple) do
if slotData ~= "COLLISION" then
if node.children then
for _, childNode in pairs(node.children) do
if setPaintDesignSlotRec(childNode) then
for _, file in pairs(files) do
local basename = string.sub(file, string.len(playerVehicle.vehicleDirectory) + 1, -1)
if vdata.flexbodies then
for _, flexbody in pairs(vdata.flexbodies) do
if flexbody.mesh and flexbody.mesh ~= "" and flexbody.meshLoaded then
if vdata.props then
for _, prop in pairs(vdata.props) do
if prop.mesh and prop.mesh ~= "" and prop.mesh ~= "SPOTLIGHT" and prop.mesh ~= "POINTLIGHT" then
if node.children then
for _, childNode in pairs(node.children) do
highlightNode(childNode)
if node.children then
for _, childNode in pairs(node.children) do
recHighlightNode(childNode, highlight)
@/lua/vehicle/electricsCustomValueParser.lua
--include all math functions and constants
for k, v in pairs(math) do
customElectricsEnv[k] = v
keyworkdWhiteListLookup = {}
for _, v in pairs(keywordWhiteList) do
keyworkdWhiteListLookup[v] = true
--TODO invesitgate if we maybe only want to update the values that are actually used within the custom value functions
for electricsName, electricsValue in pairs(electrics.values) do
customElectricsEnv.electrics[electricsName] = electricsValue
local function updateElectrics(dt)
for electricsName, customValue in pairs(customElectricsEnv.electrics) do
electrics.values[electricsName] = customValue
--dump(customDefaultValues)
for electricsName, value in pairs(customDefaultValues) do
electrics.values[electricsName] = value
@/lua/ge/extensions/flowgraph/nodes/gameplay/rally/countdown.lua
-- set out pins according to flags and reset flags
for pName, val in pairs(self.flags) do
self.pinOut[pName].value = val
@/lua/ge/extensions/scenario/quickRaceLoader.lua
-- filter paths to only return filename without extension
for k,v in pairs(files) do
files[k] = string.gsub(files[k], "(.*/)(.*)/(.*)", "%2")
else
for _,v in pairs(newLevel.vehicles) do
if (v.playerUsable == true or v.playerUsable == '1') or (v.driver and v.driver.player == true) then
local newPreviews = {}
for _, img in pairs(levelInfo.levelInfo.previews) do
table.insert(newPreviews, levelInfo.directory..'/' .. img)
local tmp = FS:findFiles("/levels/"..levelName.."/",levelName..'_preview*.png', 0, true, false)
for _, p in pairs(tmp) do
table.insert(levelInfo.previews, p)
tmp = FS:findFiles("/levels/"..levelName.."/",levelName..'_preview*.jpg', 0, true, false)
for _, p in pairs(tmp) do
table.insert(levelInfo.previews, p)
file.previews = {}
for _, p in pairs(tmp) do
table.insert(file.previews, p)
file.reversePreviews = {}
for _, p in pairs(tmp) do
table.insert(file.reversePreviews, p)
-- add automatic prefabs only if they exist
for list, suf in pairs(autoPrefabs) do
for _, ext in ipairs(prefabExt) do
@/lua/ge/extensions/flowgraph/nodes/events/customizedTriggerBox.lua
if noData then
for _, p in pairs(self.pinOut) do p.value = nil end
end
@/lua/vehicle/extensions/gameplayInterfaceModules/interactEnergyStorage.lua
local result = {}
for name, storage in pairs(storages) do
table.insert(result, {
@/lua/ge/extensions/flowgraph/nodes/logic/select.lua
for i = old, new+1, -1 do
for _, lnk in pairs(self.graph.links) do
if lnk.sourcePin == self.pinInLocal['select_'..i] then
@/lua/ge/extensions/editor/flowgraph/properties.lua
local allowList = {}
for k, v in pairs(types) do if v then table.insert(allowList, k) end end
table.sort(allowList)
if im.BeginCombo("##pinType" .. pin.id, pin.type) then
for typename, type in pairs(ui_flowgraph_editor.getTypes()) do
if item.allowedManualPinTypes == nil or item.allowedManualPinTypes[typename] then
-- Check if the link should be deleted now
for k, link in pairs(item.graph.links) do
if link.targetPin == pin then
if im.BeginCombo("##pinType" .. pin.id, hcPin.hardCodeType) then
for _, typename in pairs(allowedTypes) do
self.mgr:DrawTypeIcon(typename, true, 1)
if im.BeginCombo("##pinType" .. pin.id, pin.type) then
for typename, type in pairs(ui_flowgraph_editor.getTypes()) do
if item.allowedManualPinTypes == nil or item.allowedManualPinTypes[typename] then
-- Check if the link should be deleted now
for k, link in pairs(item.graph.links) do
if link.sourcePin == pin then
local colWidth = 10
for pid, pin in pairs(item.pinList) do
if pin.direction == 'in' then
for pid, pin in pairs(item.pinList) do
if pin.direction == 'in' then
if im.BeginCombo("##pinType" .. pin.id, hcPin.hardCodeType) then
for _, typename in pairs(allowedTypes) do
self.mgr:DrawTypeIcon(typename, true, 1)
local colWidth = 10
for pid, pin in pairs(item.pinList) do
if pin.direction == 'out' then
im.SetColumnWidth(0, colWidth)
for pid, pin in pairs(item.pinList) do
if pin.direction == 'out' then
-- if im.Begin('Properties', self.windowOpen) then
for n,_ in pairs(self.mgr.selectedNodes) do
local node = self.mgr.graph.nodes[n]
function C:showAvailableMacroTags()
for i,k in pairs(self.mgr.macroTags) do
local textinput = im.ArrayChar(256, tostring(k or ''))
@/lua/ge/extensions/gameplay/missions/startTrigger.lua
local cluster = {}
for level, locations in pairs(locationsByLevel) do
local qt = quadtree.newQuadtree()
@/lua/common/jbeam/scaling.lua
local stack = {}
for keyEntry, entry in pairs(vehicle) do
if type(entry) == "table" and tableIsDict(entry) and not jbeamUtils.ignoreSections[keyEntry] then
local data = stack[stackidx]
for key, v in pairs(data) do
local typev = type(v)
@/lua/ge/extensions/editor/materialEditor.lua
local fields = mat:getFields() or {}
for k, v in pairs(fields) do
if v.type == "filename" then
for k, f in pairs(fields) do
if f.type == "filename" then
local rows = {}
for mesh, count in pairs(usageByMesh) do
table.insert(rows, { mesh = mesh, count = count })
local forestRows = {}
for mesh, count in pairs(forestUsageByShape) do
table.insert(forestRows, { mesh = mesh, count = count })
table.sort(sortedTags, sortFunc)
for tagName, materials in pairs(tags) do
table.sort(materials, sortFunc)
for mat, _ in pairs(tbl) do
if mat ~= "" then
for mat, _ in pairs(tbl) do
table.insert(materialObjectNames, mat)
for k, v in pairs(materialObjectNames) do
if im.ImGuiTextFilter_PassFilter(matFilter, v) and v then
local i = 0
for k, val in pairs(sortedMaterialObjectNamesAtTop) do
local mat = scenetree.findObject(val)
end
for k, val in pairs(sortedMaterialObjectNames) do
local mat = scenetree.findObject(val)
local function saveAllDirtyMaterials()
for matName, _ in pairs(v.dirtyMaterials) do
local mat = scenetree.findObject(matName)
local field = currentMaterial:getField(property, layer)
for k, v in pairs(items) do
if v == field then
else
for k, v in pairs(items) do
if v == translucentBlendOp then
local files = {}
for k,v in pairs(currentMaterial:getFields()) do
if v.type == "filename" then
local tooltipMsg = "Save all dirty materials:\n"
for k,v in pairs(v.dirtyMaterials) do
tooltipMsg = tooltipMsg .. "* " .. k .. "\n"
local function onFilesChanged(files)
for _,v in pairs(files) do
local path = v.filename
@/lua/vehicle/powertrain/linearActuator.lua
device.actuatorBeams = {}
for _, tag in pairs(beamTags) do
local beamCids = beamstate.tagBeamMap[tag]
if beamCids then
for _, beamCid in pairs(beamCids) do
table.insert(device.actuatorBeams, beamCid)
@/ui/ui-vue/mockdata/inputBindings.js
"title": "ui.inputActions.vehicle.toggleDiffMode.title",
"onDown": "if #controller.getControllersByType('4wd') > 0 then for _,v in pairs(controller.getControllersByType('4wd')) do v.toggleDiffs() return end else powertrain.toggleDefaultDiffs() end",
"order": 30.1,
"title": "ui.inputActions.vehicle.toggle4WDStatus.title",
"onDown": "for _,v in pairs(controller.getControllersByType('4wd')) do v.toggle4WD() end",
"order": 30.2,
"title": "ui.inputActions.vehicle.toggleRangeStatus.title",
"onDown": "for _,v in pairs(controller.getControllersByType('4wd')) do v.toggleRange() end",
"order": 30.3,
"title": "ui.inputActions.vehicle.toggleLineLock.title",
"onDown": "for _,v in pairs(controller.getControllersByType('lineLock')) do v.toggleLineLock() end",
"order": 32,
"title": "ui.inputActions.vehicle.overrideNitrousOxide.title",
"onUp": "for _,v in pairs(controller.getControllersByType('nitrousOxideInjection')) do v.setOverride(false) end",
"onDown": "for _,v in pairs(controller.getControllersByType('nitrousOxideInjection')) do v.setOverride(true) end",
"onUp": "for _,v in pairs(controller.getControllersByType('nitrousOxideInjection')) do v.setOverride(false) end",
"onDown": "for _,v in pairs(controller.getControllersByType('nitrousOxideInjection')) do v.setOverride(true) end",
"order": 33,
"title": "ui.inputActions.vehicle.toggleLightbarMode.title",
"onDown": "for _,v in pairs(controller.getControllersByType('lightbar')) do v.toggleMode() end",
"order": 37,
"title": "ui.inputActions.vehicle.toggleNitrousOxide.title",
"onDown": "for _,v in pairs(controller.getControllersByType('nitrousOxideInjection')) do v.toggleActive() end",
"order": 34,
"title": "ui.inputActions.vehicle.toggleTransbrake.title",
"onDown": "for _,v in pairs(controller.getControllersByType('transbrake')) do v.toggleTransbrake() end",
"order": 31,
@/lua/ge/extensions/core/vehicles.lua
local pcfiles = FS:findFiles("/vehicles/" .. vehicleName .. "/", "*.pc", 0, true, false)
for _, fn in pairs(pcfiles) do
local dir, filename, ext = path.split(fn)
local function _fillAggregates(data, destination)
for key, value in pairs(data) do
if tableContains(range, key) then
if type(value) == 'table' then
for value, active in pairs(value or {}) do
if active then
local function _mergeAggregates(data, destination)
for key, value in pairs(data) do
if tableContains(range, key) or tableContains(convertToRange, key) then
end
for value, active in pairs(value or {}) do
if active then
else
for key2, _ in pairs(value) do
destination[key][key2] = true
local shouldBeDict = { "Region" }
for key, _ in pairs(displayInfo.units) do table.insert(shouldBeNumber, key) end
for key, _ in pairs(displayInfo.predefinedUnits) do table.insert(shouldBeNumber, key) end
for key, _ in pairs(displayInfo.units) do table.insert(shouldBeNumber, key) end
for key, _ in pairs(displayInfo.predefinedUnits) do table.insert(shouldBeNumber, key) end
local shouldBeStringLookup = tableValuesAsLookupDict(shouldBeString)
local newData = deepcopy(data)
for key, value in pairs(data) do
if shouldBeStringLookup[key] and type(value) ~= "string" then
newData[key] = tableValuesAsLookupDict(newData[key])
for k, v in pairs(newData[key]) do
newData[key][k] = true
if fileData then
for partName, part in pairs(fileData) do
if part.slotType == 'main' then
local paints = {}
for name, data in pairs(info.colors or {}) do
if type(data) == 'string' then
for configFilename, configName in pairs(vehFiles.configs) do
local contentSource = getSourceAttr(configFilename)
local validatedPaints = {}
for name, data in pairs(readData.paints or {}) do
if type(data) ~= 'table' then
local validatedPaints = {}
for name, data in pairs(data.paints or {}) do
if type(data) ~= 'table' then
missingInfoConfigs = data.configs
for mConfigName, mConfig in pairs(missingInfoConfigs) do
mConfig.is_default_config = false
local aggHelper = {}
for _, config in pairs(cache[key].configs) do
_mergeAggregates(config.aggregates, aggHelper)
if list then
for _, value in pairs(list) do
for propName, propVal in pairs(value.aggregates) do
for _, value in pairs(list) do
for propName, propVal in pairs(value.aggregates) do
if tableContains(finalRanges, propName) then
end
for key,_ in pairs(propVal) do
if type(key) == 'table' then
if type(key) == 'table' then
for _, key2 in pairs(key) do
filter[propName][key2 .. ''] = true
local models = {}
for modelName, _ in pairs(getModelsData()) do
local model = getModel(modelName)
local configList = {}
for modelName, _ in pairs(getModelsData()) do
local model = getModel(modelName)
if model.configs and not tableIsEmpty(model.configs) then
for _, config in pairs(model.configs) do
if array then
if not model.configs then return end
for _, config in pairs(model.configs) do
if configKey == config.key then
local modelList, configList = {}, {}
for modelName, _ in pairs(getModelsData()) do
if p then p:add("model begin") end
if p then p:add("model insert") end
for _, config in pairs(model.configs or {}) do
table.insert(configList, config)
configList = {}
for id, vehicle in pairs(vehicles) do
-- configList
local vehicles = {}
for i,m in pairs(models) do
local vehicle = getModel(m.key)
for childVehId, initChildVehData in pairs(initVehData.children or {}) do
buildInitVehCollectionCacheRec(initVehData, initChildVehData, vehData, vehData.children[childVehId])
for childVehId, childVehData in pairs(vehData.children or {}) do
buildVehCollectionCacheRec(vehData, childVehData)
local function removeVehicleCollection(collection)
for vehId, vehData in pairs(collection.vehsData) do
M.vehIdToVehCollection[vehId] = nil
collection.vehsData[vehData.vehId] = vehData
for childVehId, childVehData in pairs(vehData.children or {}) do
addVehicleToNewCollectionRec(collection, childVehData)
-- Add the remaining vehicles to new collections
for childVehId, childVehData in pairs(vehData.children or {}) do
local newCollection = initVehicleCollection()
M.vehIdToVehCollection[vehId] = nil
for childVehId, childVehData in pairs(vehData.children or {}) do
removeVehicleFromCollectionRec(collection, childVehData)
for childVehId, childVehData in pairs(vehData.children or {}) do
local childVeh = getObjectByID(childVehId)
local function getNodeByCid(vehicleData, nodeCid)
for nodeId, node in pairs(vehicleData.vdata.nodes) do
if node.cid == nodeCid then
if not vdata or not vdata.nodes then return end
for nodeId, node in pairs(vdata.nodes) do
if node.name == nodeName then
local couplerOffset = {}
for _, c in pairs(couplerCache) do
if c.couplerTag == couplerTag or c.tag == couplerTag or couplerTag == "" or not couplerTag then
-- get all vehicles to reuse from the other vehicle collection
for vehId, _ in pairs(otherVehCollection.vehsData) do
table.insert(state.vehsToReuse, vehId)
-- -- Remove the vehicles from the other collections
-- for otherMainVehId, otherCollection in pairs(M.vehCollections) do
-- for vehId, vehData in pairs(collection.vehsData) do
-- for otherMainVehId, otherCollection in pairs(M.vehCollections) do
-- for vehId, vehData in pairs(collection.vehsData) do
-- if otherCollection.vehsData[vehId] then
-- for mainVehId, vehCollection in pairs(M.vehCollections) do
-- buildVehCollectionCache(vehCollection)
for k,fn in pairs(designData.gen.patternData) do
if type(fn) == "table" then
end
for _,curFormat in pairs(formats) do
designData={}; designData.data=design.data.format[curFormat]
for _, n in pairs(vdata.nodes) do
if n.couplerTag or n.tag then
local players = M.vehiclePlayersMap[vid]
for player, _ in pairs(players) do
M.playerVehicleMap[player] = nil
-- Place the children vehicles relative to us
for childVehId, childVehData in pairs(vehData.children or {}) do
local childVeh = getObjectByID(childVehId)
-- local parentVehData = parentCollection.vehsData[parentVehicleId]
-- for vehId, vehData in pairs(parentVehData.children or {}) do
-- if vehData.offsetData and vehData.offsetData.type == "coupledNodes" then
-- for childVehId, childVehData in pairs(vehData.children or {}) do
-- if childVehData.offsetData and childVehData.offsetData.type == "coupledNodes" then
-- Don't serialize the vehsData list in the vehicle collections
for mainVehId, initVehCollection in pairs(M.initVehCollections) do
for vehId, vehData in pairs(initVehCollection.vehsData) do
for mainVehId, initVehCollection in pairs(M.initVehCollections) do
for vehId, vehData in pairs(initVehCollection.vehsData) do
vehData.parent = nil
end
for mainVehId, collection in pairs(M.vehCollections) do
for vehId, vehData in pairs(collection.vehsData) do
for mainVehId, collection in pairs(M.vehCollections) do
for vehId, vehData in pairs(collection.vehsData) do
vehData.parent = nil
for mainVehId, initVehCollection in pairs(M.initVehCollections) do
buildVehCollectionCache(initVehCollection)
end
for mainVehId, collection in pairs(M.vehCollections) do
buildVehCollectionCache(collection)
-- im.Text(' -' .. vehData.vehId)
-- for childVehId, childVehData in pairs(vehData.children or {}) do
-- drawVehicleCollectionRec(childVehData)
-- if im.Begin("Vehicle Collections Debug") then
-- for mainVehId, collection in pairs(M.vehCollections) do
-- im.Text('Main Veh ID: ' .. mainVehId)
@/lua/ge/extensions/editor/missionEditor.lua
local passed = true
for key, fun in pairs(filterFunctions) do
passed = passed and ( filterFunctions[key](mission, filter[key]))
table.sort(result.sortedKeys)
for key, list in pairs(result.missions) do
table.sort(list, idSort)
else
for key, list in pairs(mission.careerSetup.starRewards) do
local newRewards = {}
-- if the value didn't exist in the preferences, use the default bool by skipping the item
for k, v in pairs(_showWindows) do
if v ~= nil then
@/lua/ge/extensions/editor/raceEditor/segments.lua
if not self.path then return end
for _, seg in pairs(self.path.segments.objects) do
seg._drawMode = 'normal'
--self:selectSegment(nil)
for _, seg in pairs(self.path.segments.objects) do
seg._drawMode = 'faded'
self.capsuleIndex = nil
for _, seg in pairs(self.path.segments.objects) do
seg._drawMode = (index == seg.id) and 'highlight' or 'normal'
for _, n in pairs(self.path.pacenotes.objects) do
if index and index ~= -1 and n.segment == index then
@/lua/ge/extensions/flowgraph/nodes/vehicle/ai/simpleFollowDecalroad.lua
local lastP
for _, p in pairs(self.path.path) do
debugDrawer:drawSphere(vec3(p), 0.1, ColorF(1,0,1,1))
@/lua/vehicle/sounds.lua
-- sound bank
for _, snd in pairs(soundBank.sounds) do
if snd.active then
--apply modifiers if applicable
for _, s in pairs(snd.volumeModifiers) do
sndVol = sndVol * getSoundModifier(s)
for _, s in pairs(snd.pitchModifiers) do
sndPitch = sndPitch * getSoundModifier(s)
for wi, wd in pairs(wheels.wheels) do
local wheelSound = wheelsSounds[wi]
local soundBank = {}
for _, sbfn in pairs(sbeamFiles) do
local tmp = readDictJSONTable(sbfn)
if tmp then
for _, v in pairs(tmp.sounds) do
v.minVolume = v.minVolume * sbeamVolumeFactor
soundBank.modifiersNamed = {}
for _, sbm in pairs(soundBank.modifiers) do
soundBank.modifiersNamed[sbm.name] = sbm
if #powertrain.engineData > 0 then
for _, v in pairs(powertrain.engineData) do
maxrpm = max(maxrpm, v.maxSoundRPM or 1)
local nodeNameIdx = {}
for _, node in pairs(v.data.nodes) do
if node.name then
--check and postprocess them
for skey, s in pairs(soundBank.sounds) do
-- set default values
for _, snd in pairs(soundBank.sounds) do
for k2, v2 in pairs(snd) do
for _, snd in pairs(soundBank.sounds) do
for k2, v2 in pairs(snd) do
if v2 == "MAXRPM" then
local soundGroup = v.data.engine and v.data.engine.soundGroup
for _, vl in pairs(soundBank.sounds) do
vl.active = (vl.group == "default" or vl.group == soundGroup)
if v.data.beams then
for _, bm in pairs(v.data.beams) do
if bm.soundFile ~= nil then
for matId, event in pairs(scrapeMap) do
if type(event) == "string" then --this can be nil (if nothing exists for a given material) or a boolean/false (if disabled via jbeam)
for wi, wd in pairs(wheels.wheels) do
addWheelSounds(wi, wd)
if soundscapes then
for name, soundscape in pairs(soundscapes) do
bdebug.setNodeDebugText("Soundscape", type(soundscape.node) == "number" and soundscape.node or M.refNode, name .. ": " .. soundscape.src)
--resend all static tire properties upon reset because the GE param cache is cleared upon vehicle reset
for wi, wh in pairs(wheelsSounds or {}) do
local wd = wheels.wheels[wi]
for wi, wh in pairs(wheelsSounds or {}) do
if wh.rigidRoll then
if soundConfig then
for name, data in pairs(soundConfig) do
local blendFileName = data.blendFile:match("^.+/(.+)$")
@/lua/ge/extensions/editor/toolUtilities/util.lua
local sum = 0.0
for _, v in pairs(t) do
sum = sum + v
@/lua/ge/extensions/editor/assemblySpline/molecule.lua
-- Convert valid join groups to mesh attachment data.
for joinName, joinGroup in pairs(joinGroups) do
local points = joinGroup.points
if not isPlaced[i] then
for j, _ in pairs(isPlaced) do -- Iterate over all placed meshes.
local placedMesh = rigids[j]
@/lua/ge/extensions/flowgraph/nodes/career/onTestDriveChanged.lua
self.pinOut.started.value = false
for flag, act in pairs(self.flags) do
self.pinOut[flag].value = act
@/lua/common/libs/xlsxlib/xlsxlib.lua
local maxRow, maxCol = 0, 0
for r, row in pairs(sheetData) do
if r > maxRow then maxRow = r end
if r > maxRow then maxRow = r end
for c in pairs(row) do
if c > maxCol then maxCol = c end
local keys = {}
for k in pairs(t) do
table.insert(keys, k)
local workbookRel = nil
for _, rel in pairs(packageRels) do
if rel.type == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" then
local sharedStringsFile = nil
for _, rel in pairs(workbookRels) do
if rel.type == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings" then
-- Try to find the sheet ignoring case
for name, path in pairs(xlsx.sheets) do
if name:lower() == sheetName:lower() then
@/lua/vehicle/controller/pneumatics.lua
local maxPressureDiff = 0
for _, v in pairs(groupData.beams) do
local oldTarget = v.targetPressure
local function setBeamGroupsPressureRaw(groupNames, pressure)
for _, g in pairs(groupNames) do
local groupData = beamGroups[g]
local maxPressureDiff = 0
for _, v in pairs(groupData.beams) do
local oldTarget = v.targetPressure
local function setBeamGroupsPressureLevel(groupNames, pressureName)
for _, g in pairs(groupNames) do
setBeamGroupPressureLevel(g, pressureName)
local function toggleBeamGroupsMinMax(groupNames)
for _, g in pairs(groupNames) do
local groupData = beamGroups[g]
local isMax = true
for _, v in pairs(groupData.beams) do
isMax = isMax and abs(v.targetPressure - v.maxPressure) < 0.1
local function setBeamGroupsMomentaryIncrease(groupNames, enabled)
for _, g in pairs(groupNames) do
local groupData = beamGroups[g]
local function setBeamGroupsMomentaryDecrease(groupNames, enabled)
for _, g in pairs(groupNames) do
local groupData = beamGroups[g]
local isAtLevel = true
for _, v in pairs(groupData.beams) do
isAtLevel = isAtLevel and v.currentPressure == v[levelName]
local function updateGFX(dt)
for _, g in pairs(beamGroups) do
local isFinishedChangingPressure = true -- used to check if we should stop the sound based on pressure change
local avgVelocity = 0
for _, v in pairs(g.beams) do
if g.momentaryIncrease then
local function reset()
for _, g in pairs(beamGroups) do
for _, v in pairs(g.beams) do
for _, g in pairs(beamGroups) do
for _, v in pairs(g.beams) do
v.targetPressure = v.defaultPressure
if jbeamData.pressureLevels then
for _, v in pairs(tableFromHeaderTable(jbeamData.pressureLevels)) do
pressureLevels[v.name] = v.pressure
local pressuredBeamNames = {}
for _, v in pairs(pressureBeamData) do
local name = v.beamName
beamGroups = {}
for _, pressureData in pairs(pressureBeamData) do
local name = pressureData.beamName
for k, v2 in pairs(pressureData) do
local pressureStart = k:find("Pressure")
for k, v in pairs(beamPressureLevels) do
beamData[k] = v
for _, v in pairs(pressureBeamSoundData) do
local groupData = beamGroups[v.groupName]
local function resetSounds()
for _, g in pairs(beamGroups) do
if g.soundLoopUp then
@/lua/ge/extensions/editor/rendererComponents.lua
level = level + 1
for _, s in pairs(settingNode) do
local newPath = path .. '/' .. tostring(s.name)
s.valMap = {}
for ck, cv in pairs(s.values) do
s.valMap[cv] = ck
if im.BeginCombo((s.title or s.name) .. '##' .. tostring(newPath), s.valMap[s.cVal]) then
for ck, cv in pairs(s.values) do
local selected = s.values
local tabNames = {}
for _, s in pairs(settings) do
local tabTitle = s.name or ""
if im.BeginTabBar("settings") then
for _, tabName in pairs(tabNames) do
local entry = settings[tabName]
@/lua/ge/extensions/editor/roadSpline/import.lua
if entry.fields then
for k, v in pairs(entry.fields) do
obj:setField(k, 0, v)
local decalRoadsInPolygon, ctr = {}, 1
for _, name in pairs(scenetree.findClassObjects("DecalRoad")) do
local obj = scenetree.findObject(name)
@/lua/ge/extensions/gameplay/markers/walkingMarker.lua
end
for key, poisInCluster in pairs(poisByObjectNames) do
local wm = poisInCluster[1].markerInfo.walkingMarker
@/lua/ge/extensions/gameplay/traffic.lua
local activeCount = 0
for id, veh in pairs(traffic) do
if veh.isAi and be:getObjectActive(id) then
local function refreshVehicles() -- resets core traffic vehicle data
for _, veh in pairs(traffic) do
veh:onRefresh()
for k, v in pairs(data) do
if k == 'aiMode' or k == 'aiDebug' or k == 'aiAware' then
updateTrafficPool()
for id, veh in pairs(traffic) do
veh._teleport = true
local outboundCount = 0
for id, veh in pairs(traffic) do
if veh.state == 'active' then
tempVec.z = tempVec.z - 1
for id, veh in pairs(traffic) do
if be:getObjectActive(id) then
local trafficData = {}
for _, veh in pairs(traffic) do
table.insert(trafficData, veh:onSerialize())
if data.state == 'on' then
for _, veh in pairs(data.traffic) do
insertTraffic(veh.id, not veh.isAi)
@/lua/vehicle/controller/vehicleController/shiftLogic/cvtGearbox2.lua
automaticHandling.availableModeLookup = {}
for _, v in pairs(automaticHandling.availableModes) do
automaticHandling.availableModeLookup[v] = true
@/lua/ge/extensions/flowgraph/baseStateNode.lua
--setmetatable(o, C)
for k, v in pairs(C) do
--print('k = ' .. tostring(k) .. ' = '.. tostring(v) )
local baseInit = o.init
for k, v in pairs(derivedClass) do
--print('k = ' .. tostring(k) .. ' = '.. tostring(v) )
@/lua/vehicle/controller/drivingDynamics/actuators/adaptiveTorsionBars.lua
torsionBars = {}
for _, b in pairs(v.data.torsionbars) do
if b.name then
if b.name then
for _, name in pairs(torsionBarNames) do
if b.name == name then
torsionBarModes = {}
for _, mode in pairs(modeData) do
torsionBarModes[mode.name] = {
@/lua/ge/extensions/flowgraph/nodes/vehicle/gForce.lua
for k, _ in pairs(values) do
values[k] = core_vehicleBridge.getCachedVehicleData(vehId, k)
@/lua/vehicle/extensions/tech/LINBus/LINBusPeak.lua
local msg = msgBuffer[i]
for _, callback in pairs(linMessageCallbacks) do
callback(msg)
M.errorCodeLookup = {}
for key, value in pairs(M.errorCodes) do
M.errorCodeLookup[value] = key
@/lua/ge/extensions/gameplay/drag/display.lua
-- Check if at least one light object exists
for _, light in pairs(laneTree.stageLights) do
if light and light.obj then
end
for _, light in pairs(laneTree.countDownLights) do
if light and light.obj then
for _, laneTree in ipairs(dragData.strip.treeLights) do
for _,group in pairs(laneTree) do
if type(group) == "table" then
if type(group) == "table" then
for _,light in pairs(group) do
if type(light) == "table" and light.obj and simObjectExists(light.obj) then
if not dragData then return end
for _, digitTypeData in pairs(dragData.strip.displayDigits) do
for _,laneTypeData in ipairs(digitTypeData) do
for vehId, racer in pairs(dragData.racers) do
if racer.isPlayable then
for vehId, racer in pairs(dragData.racers) do
-- Send times to UI continuously if display signs are not available and racer is in race phase
for _, laneTree in ipairs(dragData.strip.treeLights) do
for _, group in pairs(laneTree) do
if type(group) == "table" then
if type(group) == "table" then
for _, light in pairs(group) do
if type(light) == "table" and light.obj and simObjectExists(light.obj) then
end
for _, digitTypeData in pairs(dragData.strip.displayDigits) do
for _, laneTypeData in ipairs(digitTypeData) do
for _, laneTree in ipairs(dragData.strip.treeLights) do
for _, group in pairs(laneTree) do
if type(group) == "table" then
if type(group) == "table" then
for _, light in pairs(group) do
if type(light) == "table" and light.obj and simObjectExists(light.obj) then
end
for _, digitTypeData in pairs(dragData.strip.displayDigits) do
for _, laneTypeData in ipairs(digitTypeData) do
for _, laneTree in ipairs(dragData.strip.treeLights) do
for _, group in pairs(laneTree) do
if type(group) == "table" then
if type(group) == "table" then
for _, light in pairs(group) do
if type(light) == "table" and light.obj and simObjectExists(light.obj) then
end
for _, digitTypeData in pairs(dragData.strip.displayDigits) do
for _, laneTypeData in ipairs(digitTypeData) do
for _, laneTree in ipairs(dragData.strip.treeLights) do
for _, group in pairs(laneTree) do
if type(group) == "table" then
if type(group) == "table" then
for _, light in pairs(group) do
if type(light) == "table" and light.obj and simObjectExists(light.obj) then
end
for _, digitTypeData in pairs(dragData.strip.displayDigits) do
for _, laneTypeData in ipairs(digitTypeData) do
@/lua/common/libs/ezSVG/EzSVG.lua
local num = 0
for _, _ in pairs(tbl) do num = num + 1 end
return num
local function mergeTable(dst, src)
for k, v in pairs(src) do
if not dst[k] then dst[k] = src[k] end
local function overwriteTable(dst, src)
for k, v in pairs(src) do
dst[k] = src[k]
local ret = {}
for k, v in pairs(tbl) do
local nk = string.gsub(k, "_", "-")
local function processPropertyValues(tbl, run)
for k,v in pairs(tbl) do
if serializableValue(k, v) then
if not run.preflight then
for k,v in pairs(tbl) do
if serializableValue(k, v) then
for k,v in pairs(tbl["__style"]) do
if serializableValue(k, v) then
for k, v in pairs(tbl["__functions"]) do
if serializableValue(k, v) then
local func = ""
for i, vv in pairs(v) do
if i == 1 then func = string.format("%s%s(", func, vv)
local stringTable = {}
for k, v in pairs(tbl) do
if serializableValue(k, v) then
else
for _, v in pairs(EzSVG.styles) do
v[key] = value
EzSVG.styles = {}
for _, v in pairs(EzSVG.knownTags) do
EzSVG.styles[v] = {}
local style = {}
for k, v in pairs(EzSVG.styles) do
style[k] = {}
style[k] = {}
for kk, vv in pairs(v) do
style[k][kk] = vv
tag = value -- promote
for k, v in pairs(key) do
setDefaultStyles(k, v, tag)
local seperator = ""
for k, v in pairs(tbl["__d"]) do
if serializableValue(k, v) then
local i = 0
for _, v in pairs(tbl["__points"]) do
if i ~= 0 then
-- Put referenced objects not in the tree to
for _, v in pairs(preflightRun["referencedObjects"]) do
if v["lastRunID"] ~= preflightRun["id"] then
@/lua/common/libs/luasec/https.lua
local mt = getmetatable(conn.sock).__index
for name, method in pairs(mt) do
if type(method) == "function" then
-- Default settings
for k, v in pairs(cfg) do
params[k] = params[k] or v
@/lua/vehicle/extensions/aeroDebug.lua
for _, wd in pairs(wheels.wheels) do
local pos1 = obj:getNodePosition(wd.node1) + obj:getPosition()
aeroData.wheelNameStrings = {}
for _, wd in pairs(wheels.wheels) do
table.insert(aeroData.wheelNameStrings, wd.name)
@/lua/vehicle/controller/tirePressureControl.lua
for groupName, wheelGroup in pairs(wheelGroups) do
local groupPressure = 0
local groupPressure = 0
for _, wheelData in pairs(wheelGroup.wheelData) do
wheelData.isWheelBrokenOff = wheels.wheels[wheelData.wheelId].isBroken
for _, wheelData in pairs(wheelGroup.wheelData) do
local pressureDiff = preSyncGroupPressure - wheelData.currentPressure
local pressureChangeInflateDeflate = activeGroupPressureChange * dt
for groupName, isActive in pairs(activeGroups) do
local wheelGroup = wheelGroups[groupName]
if isActive then
for _, wheelData in pairs(wheelGroup.wheelData) do
local pressureDiff = activeGroupAvgPressure - wheelData.currentPressure
for groupName, wheelGroup in pairs(wheelGroups) do
table.insert(
local function reset(jbeamData)
for groupName, wheelGroup in pairs(wheelGroups) do
activeGroups[groupName] = false
activeGroups[groupName] = false
for _, wheelData in pairs(wheelGroup.wheelData) do
wheelData.currentPressure = 0
local wheelGroupData = tableFromHeaderTable(jbeamData.wheelGroups or {})
for _, wheelGroup in pairs(wheelGroupData) do
local groupName = wheelGroup.groupName
local wheelData = {}
for _, wheelName in pairs(wheelNames) do
local wheelId = wheels.wheelIDs[wheelName]
@/lua/ge/extensions/career/modules/vehiclePerformance.lua
local vehicles = career_modules_inventory.getVehicles()
for id, vehicle in pairs(vehicles) do
if id ~= inventoryId then
@/lua/vehicle/extensions/tech/CANBus/ButtonBox.lua
local function emitInputs()
for buttonName, buttonValue in pairs(hardwareState.buttons) do
if lastHardwareState.buttons[buttonName] ~= buttonValue then
for axisName, axisValue in pairs(hardwareState.axes) do
if lastHardwareState.axes[axisName] ~= axisValue then
@/lua/ge/extensions/editor/vehicleEditor/staticEditor/vePartPropertyView.lua
fields = {}
for k, v in pairs(vEditor.propertyTableEditTarget or {}) do
if k ~= '__astNodeIdx' and type(v) ~= 'table' and k ~= '__schemaProcessed' then
@/lua/ge/extensions/flowgraph/nodes/career/careerVehicleSelect.lua
function C:_executionStarted()
for _, p in pairs(self.pinOut) do
p.value = false
function C:_executionStarted()
for _, p in pairs(self.pinOut) do
p.value = false
function C:buttonPushed(action)
for nm, pn in pairs(self.pinOut) do
self.pinOut[nm].value = nm == action
self:reset()
for _,pn in pairs(self.pinOut) do
pn.value = false
@/lua/ge/extensions/editor/gen/exp_solidflex.lua
local alib = {}
for _,p in pairs(apth) do
unrequire(p)
aed = {}
for i,d in pairs(aax) do
dedge[#dedge+1] = U.stamp({d[1][2],d[2][2]})
for i=1,#aa do
-- for i,a in pairs(ac) do
-- U.dump(avp,'??----------- NEXT:'..i..':'..aind[i])
for i=1,(cvneigh and #dedge or #dedge-2) do
-- for i,s in pairs(dedge) do
local ab = U.split(dedge[i], '_')
end
-- for i,d in pairs(aax) do
-- elist[#elist+1] = {d[1][1],d[2][1]}
-- dedge = {U.stamp({1,2})}
for i,d in pairs(aax) do
dedge[#dedge+1] = U.stamp({d[1][2],d[2][2]})
local ai2 = U.split(dedge[i],'_')
for _,ind in pairs(ai2) do
if de[ind] then
if not cvover then
for i,d in pairs(segpick) do
if d.on then
dedge = {}
for i,d in pairs(aax) do
dedge[#dedge+1] = U.stamp({d[1][2],d[2][2]})
local amil,amir,vmil,vmir = math.huge,math.huge
for i,v in pairs(m.verts) do
local ang = U.vang(U.proj2D(v-campos),U.proj2D(tocur-campos),true)
-- check side hit
for i,d in pairs(segpick) do
d.on = nil
local hit
for i,v in pairs(m.verts) do
local ang = U.vang(v-campos,tocur-campos)
if not cvover then
for i,d in pairs(segpick) do
if d.on then
dedge = {}
for i,d in pairs(aax) do
dedge[#dedge+1] = U.stamp({d[1][2],d[2][2]})
--------------------------
for i,d in pairs(danim) do
if d.cb then
local ami1,ami2,vmi1,vmi2
for i,v in pairs(m.verts) do
local ang = U.vang(v-campos,tocur-campos)
@/lua/ge/extensions/editor/terrainEditor.lua
local name = initialName .. (counter or "")
for k, mtl in pairs(materialsInJson) do
if mtl.internalName == name then
for uniqueID, jsonMtl in pairs(jsonMaterials) do
if jsonMtl.class ~= "TerrainMaterialTextureSet" then
local function selectPaintMaterialByName(internalName)
for _, mtl in pairs(paintMaterialProxies) do
if mtl.internalName == internalName then
-- attach all terrain blocks
for tbName, tbData in pairs(terrainBlockProxies) do
local tb = scenetree.findObjectById(tbData.id)
-- check if the TerrainBlock with the given name already exist
for tbName, tbData in pairs(terrainBlockProxies) do
if string.lower(tbName) == string.lower(terrBlockName) then
local success = false
for tbName, tbData in pairs(terrainBlockProxies) do
local tb = scenetree.findObjectById(tbData.id)
else
for name, tbData in pairs(terrainBlockProxies) do
if tbData then tbData.selected = false end
if im.BeginCombo("##availableMaterials", "") then
for id, mat in pairs(materialsInJson) do
if not hasPaintMaterial(mat.internalName) then
end
for id, notification in pairs(notifications) do
im.TextColored(im.ImVec4(1.0, 0.73, 0.04, 1.0), notification)
if im.CollapsingHeader1("Select Terrain(s)", im.TreeNodeFlags_DefaultOpen) then
for tbName, tbData in pairs(terrainBlockProxies) do
im.Spacing()
profilerPushEvent("terrainEditor terrainToolsEditModeUpdate")
for tbName, tbData in pairs(terrainBlockProxies) do
local tb = scenetree.findObjectById(tbData.id)
M.deleteMaterialInJson = function (name)
for id, value in pairs(materialsInJson) do
if value.internalName == name then
M.getTerrainBlockMaterialIndex = function (name)
for id, value in pairs(paintMaterialProxies) do
if value.internalName == name then
@/lua/common/jit/p.lua
local t, n = {}, 0
for k in pairs(count1) do
n = n + 1
local ms = 0
for k, v in pairs(count1) do
local pct = floor(v*100/samples + 0.5)
@/lua/ge/extensions/core/groundMarkerArrows.lua
-- Look through proxies to find an unused arrow
for id, proxy in pairs(arrowProxies) do
if proxy.state == "unused" then
-- Delete all arrow objects through their proxies
for id, proxy in pairs(arrowProxies) do
local arrow = scenetree.findObjectById(id)
-- Reset all proxies to unused state
for id, proxy in pairs(arrowProxies) do
proxy.state = "unused"
if nodeToNodeAngle <= 25 then
for wpId, edgeInfo in pairs(map.getGraphpath().graph[path[i].wp]) do
if path[i-1].wp ~= wpId then
for id, proxy in pairs(arrowProxies) do
if not usedWpIds[proxy.wp] then
-- Update all arrow objects based on their proxies
for id, proxy in pairs(arrowProxies) do
if proxy.state == "unused" then
--[[
for wpId, wpLog in pairs(lastWpLog) do
simpleDebugText3d(string.format("Wp %s: nodeToNodeAngle=%0.3f, %s, %s, links: %d, %0.1f", wpId, wpLog.nodeToNodeAngle or -1, wpLog.routeHasSmallestAngle and "smallest Angle" or "", wpLog.wp, wpLog.linkCount or -1, wpLog.distToVehicle or -1), wpLog.pos)
for id, proxy in pairs(arrowProxies) do
if proxy.state ~= "unused" then
for id, proxy in pairs(arrowProxies) do
if proxy.state == "unused" then
-- Show wpToArrowId mappings
for wp, arrowId in pairs(wpToArrowId) do
im.TableNextColumn()
@/lua/ge/extensions/editor/aiTests.lua
for k, v in pairs(params) do
vehicles[id][k] = v[1][0]
if not id or not vehicles[id] then return end
for k, v in pairs(params) do
v[1][0] = vehicles[id][k]
local pos, rot = firstVeh:getPosition(), firstVeh:getRotation()
for k, v in pairs(vehicles) do
getObjectByID(k):setPosRot(pos.x, pos.y, pos.z, rot.x, rot.y, rot.z, rot.w)
for k, v in pairs(vehicles) do
local obj = getObjectByID(k)
local aiParams = {}
for key, _ in pairs(params) do
aiParams[key] = v[key]
if im.Button("Stop##aiParams") then
for k, v in pairs(vehicles) do
getObjectByID(k):queueLuaCommand("ai.setMode('stop')")
if im.Button("Reset##aiParams") then
for k, v in pairs(vehicles) do
getObjectByID(k):setPosRot(v.pos.x, v.pos.y, v.pos.z, v.rot.x, v.rot.y, v.rot.z, v.rot.w)
if im.Button("Reload##aiParams") then
for k, v in pairs(vehicles) do
getObjectByID(k):reload()
@/lua/common/settings.lua
local result = {}
for originalSetting,v in pairs(settings) do
local setting = upgradeSetting(originalSetting)
M.internalValues = upgradeSettings(internalValues)
for k,v in pairs(M.internalValues) do
local definition = M.defaults[k]
steamdeckValues = upgradeSettings(steamdeckValues)
for k,v in pairs(steamdeckValues) do
local definition = M.defaults[k]
M.defaultValues = {}
for k,v in pairs(M.defaults) do
M.defaultValues[k] = v[2]
if CppSettings then
for k,value in pairs(values) do
if CppSettings[k] ~= nil then
@/lua/vehicle/controller/couplings/fifthwheel.lua
table.clear(kingpinTimeoutsToDelete)
for obj2Id, _ in pairs(kingpinRequestTimeouts) do
kingpinRequestTimeouts[obj2Id] = kingpinRequestTimeouts[obj2Id] - dt
local minDistanceNodeCid
for objId, nodeData in pairs(kingpinCache) do
for nodeCid, data in pairs(nodeData) do
for objId, nodeData in pairs(kingpinCache) do
for nodeCid, data in pairs(nodeData) do
if data.distance < minDistance then
@/lua/vehicle/controller/gauges/customModules/tireData.lua
moduleData.temperatures = moduleData.temperatures or {}
for _, wd in pairs(wheels.wheels) do
moduleData.temperatures[wd.name] = "#ffffff"
moduleData.pressures = moduleData.pressures or {}
for _, wd in pairs(wheels.wheels) do
local hasPressure = wd.pressureGroup and v.data.pressureGroups and v.data.pressureGroups[wd.pressureGroup]
@/lua/vehicle/extensions/tech/CANBus/ProjectBavariaShifter.lua
parkButtonLookup = {}
for key, value in pairs(leverStates) do
leverStateLookup[value] = key
end
for key, value in pairs(parkButtonStates) do
parkButtonLookup[value] = key
@/lua/common/testFramework/TestManager.lua
local testNames = {}
for name, func in pairs(tests) do
if type(func) == "function" and name:match("^test") then
@/lua/console/test.lua
log('I', "lua.test", "* loading jbeam files:")
for k,v in pairs(jbeamFiles) do
local content = readFile(v)
@/lua/ge/extensions/flowgraph/nodes/scene/sevensegmentDisplay.lua
function C:clearObjects()
for _, obj in pairs(self.objects) do
if obj then
@/lua/ge/extensions/career/branches.lua
local children = {}
for id, branch in pairs(remaining) do
if branch.parentId == parentId then
-- Now that all branches are loaded, handle color inheritance
for _, branch in pairs(branchesById) do
branch.color = branch.color or getInheritedColor(branch, 'color')
if mission.careerSetup.showInCareer then
for branchKey, _ in pairs(mission.unlocks.branchTags) do
if branchKey == skill.id then
local saveData = { }
for id, branch in pairs(getBranches()) do
saveData[id] = {}
local data = (savePath and not outdated and jsonReadFile(savePath .. "/career/"..saveFile)) or {}
for id, branch in pairs(getBranches()) do
for k, v in pairs(data[id] or {}) do
for id, branch in pairs(getBranches()) do
for k, v in pairs(data[id] or {}) do
--branch[k] = v
local function checkUnlocks()
for id, branch in pairs(getBranches()) do
branch.unlocked = true
for id, branch in pairs(getBranches()) do
-- for levels
-- for levels
for lvl, lvlData in pairs(branch.levels or {}) do
local unlockFlags = lvlData.unlockFlags or {}
local newAttributeNamesToOldNames = {}
for oldName, newName in pairs(oldAttributeNamesToNewNames) do
newAttributeNamesToOldNames[newName] = oldName
@/lua/vehicle/controller/tech/roadsSensor.lua
local cands, c2Ctr = {}, 1
for k, _ in pairs(graph[p_frontKey]) do
cands[c2Ctr] = k
local cands1, c1Ctr = {}, 1
for k, _ in pairs(graph[p1Key]) do
cands1[c1Ctr] = k
local cands2, c2Ctr = {}, 1
for k, _ in pairs(graph[p2Key]) do
cands2[c2Ctr] = k
graph, coords, widths = mapData.graph, mapData.positions, mapData.radius
for k, v in pairs(coords) do
normals[k] = mapmgr.surfaceNormalBelow(v)
local wp, ctr = {}, 1
for _, wheel in pairs(wheels.wheels) do
wp[ctr] = obj:getNodePosition(wheel.node1)
@/lua/ge/extensions/core/levels.lua
for _, d in pairs(level_dirs) do
-- check if its a valid folder really
for _, l in pairs(found_levels) do
-- so, enrich the data of the levels for the user interface below
local newPreviews = {}
for _, img in pairs(info["previews"]) do
table.insert(newPreviews, l.dir..'/' .. img)
if type(info.spawnPoints) == 'table' then
for _, point in pairs(info.spawnPoints) do
if not point.previews then point.previews = {} end
local newPreviews = {}
for _, img in pairs(point.previews) do
table.insert(newPreviews, l.dir..'/' .. img)
local jsonLevels = {}
for _, level in pairs(levels) do
if string.find(level.fullfilename, ".json") then
local newLevels = {}
for _, level in pairs(levels) do
-- check if there is a json version of this, thus hide the old .mis file format
local function onFilesChanged(files)
for _,v in pairs(files) do
local filename = v.filename
@/lua/ge/extensions/util/saveDynamicData.lua
local blacklistLookup = {}
for _, v in pairs(vehicleBlacklist) do
blacklistLookup[v] = true
local filteredConfigs = {}
for k, v in pairs(configs) do
if (not vehicleToTest or v.model_key == vehicleToTest) and ((not pcFileToTest or pcFileToTest == "") or v.key == pcFileToTest) and not blacklistLookup[v.model_key] then
local progressCount = 1
for _, v in pairs(filteredConfigs) do
local vehName = v.model_key
log("I", logTag, "Vehicles that are skipped:")
for _, value in pairs(vehicleBlacklist) do
log("I", logTag, value)
@/lua/ge/extensions/editor/cosimulationSignalEditor.lua
end
for name, c in pairs(fromGroup) do
for j = 1, numSignals do
@/lua/ge/extensions/util/dependencyTree.lua
if n.childs then
for _, c in pairs(n.childs) do
for ck, _ in pairs(recurseFindAttribute(c, className, attributeName)) do
for _, c in pairs(n.childs) do
for ck, _ in pairs(recurseFindAttribute(c, className, attributeName)) do
res[ck] = 1
local dir, filename, ext = path.split(sourceFile)
for k, fn in pairs(fileList) do
local dir2, filename2, ext2 = path.split(fn)
if not fileList then return end
for k, fn in pairs(fileList) do
local dir, filename, ext = path.split(fn)
for k, _ in pairs(rootNode.instances) do
add(entity.deps, 'simobject', k)
if n.childs then
for _, c in pairs(n.childs) do
processSimObject(c, sourceFile)
local filenames = findFiles('*.level.json\t*.material.json\t*.datablock.json')
for _, filename in pairs(filenames) do
processSimObject(jsonReadFile(filename), filename)
for _, shapeInfoFn in pairs(shapeInfoFiles) do
local rootNode = jsonReadFile(shapeInfoFn)
local entity = { deps = { material = {}}, provides = { shape = shapeInfoFn:sub(1, -13) }}
for _, m in pairs(rootNode.materials) do
table.insert(entity.deps.material, m)
@/lua/ge/extensions/flowgraph/nodes/ui/setUILayout.lua
local layout = {}
for tmp, _ in pairs(layout_options) do
table.insert(layout, {value = tmp})
local menu = {}
for tmp, _ in pairs(layout_options) do
table.insert(menu, {value = tmp})
@/lua/vehicle/energyStorage.lua
for _, jbeamData in pairs(deepcopy(v.data.energyStorage or {})) do
tableMergeRecursive(jbeamData, v.data[jbeamData.name] or {})
for _, device in pairs(powertrain.getDevices()) do
if device.energyStorage then
end
for _, s in pairs(device.energyStorage) do
local storage = energyStorages[s]
for _, storage in pairs(energyStorages) do
table.insert(orderedStorages, storage)
local beamTriggers = {}
for _, storage in pairs(energyStorages) do
if storage.breakTriggerBeam then
for _, v in pairs(v.data.beams or {}) do
if v.name and v.name ~= "" and beamTriggers[v.name] then
local function reset()
for _, v in pairs(orderedStorages) do
if v.reset then
for _, device in pairs(powertrain.getDevices()) do
if device.energyStorage then
end
for _, s in pairs(device.energyStorage) do
local storage = energyStorages[s]
-- end
-- for name, storageData in pairs(data) do
-- if name and energyStorages[name] then
local data = {}
for _, storage in pairs(energyStorages) do
if storage.serialize then
@/lua/ge/extensions/flowgraph/nodes/activity/attemptStars.lua
attempt.unlockedStars = attempt.unlockedStars or {}
for name, pin in pairs(self.pinInLocal) do
if not pin.fixed and pin.type ~= 'flow' then
@/lua/common/jbeam/sections/meshs.lua
if vehicleObj and vehicle.triangles then
for _, triangle in pairs(vehicle.triangles) do
-- skip denormalized tris
local prop_count = 0
for propKey, prop in pairs(vehicle.props) do
if disableSteeringProp and prop.func == 'steering' then
if vehicle.flexbodies ~= nil and vehicleObj then
for flexKey, flexbody in pairs(vehicle.flexbodies) do
local flexnodeCount = #flexbody['_group_nodes']
profilerPushEvent('flexmesh_rotate')
for _, v in pairs(vehicle.flexbodies) do
local x, y, z, rx, ry, rz = jbeamUtils.getFlexbodyPosRotAfterNodeRotateOffsetMove(v, v.pos and v.pos.x or 0, v.pos and v.pos.y or 0, v.pos and v.pos.z or 0, v.rot and v.rot.x or 0, v.rot and v.rot.y or 0, v.rot and v.rot.z or 0)
if vehicle.props ~= nil then
for _, prop in pairs(vehicle.props) do
if prop.mesh ~= "SPOTLIGHT" and prop.mesh ~= "POINTLIGHT" then
if vehicle.flexbodies ~= nil then
for _, flexbody in pairs(vehicle.flexbodies) do
vehicleObj:requestMesh(flexbody.mesh)
@/lua/ge/extensions/career/modules/insurance/repairScreen.lua
if insuranceModule.doesInsuranceExist(insuranceId) then
for _, choiceData in pairs(data.repairOptions.insuranceRepairData.repairTimeOptions.choices) do
if choiceData.id == defaultRepairTimeChoiceData.currentValueId then
for _, choiceData in pairs(data.repairOptions.noInsuranceRepairData.repairTimeOptions.choices) do
local totalPrice = choiceData.premiumInfluence + data.vehicleData.damageCost
@/lua/ge/extensions/gameplay/race/race.lua
local pathLen = #self.aiDetailedPath
for id, data in pairs(self.states) do
if data.complete then
local t = math.huge
for k, v in pairs(inside) do
if v ~= nil then
if state.skippedLap then -- sets the segment to the final one
for segId, currentSegment in pairs(self.path.config.graph) do
if currentSegment.lastInLap then
for id, state in pairs(self.states) do
if state.timeDifferenceToFirst ~= nil then
@/lua/ge/extensions/editor/dynamicDecals/settings.lua
materialsMapMaterialIdxToMaterialName = {}
for materialId, materialName in pairs(mNames) do
materialsMapMaterialNameToMaterialIdx[materialName] = materialId
for name, id in pairs(materialsMapMaterialNameToMaterialIdx) do
if im.ImGuiTextFilter_PassFilter(materialsFilter, name) then
local i = 0
for name, enabled in pairs(sMeshes) do
if im.ImGuiTextFilter_PassFilter(meshesFilter, name) then
local textureResolution = api.getTextureResolution()
for k,v in pairs(api.textureResolutions) do
if textureResolution.x == v.value then
@/lua/ge/extensions/gameplay/missions/proceduralMissionGenerators/timeTrialMissions.lua
}
for key, _ in pairs(autoPrefabs) do
for i, p in ipairs(mission.missionTypeData[key] or {}) do
-- add automatic prefabs only if they exist
for list, suf in pairs(autoPrefabs) do
for _, ext in ipairs(prefabExt) do
@/lua/ge/extensions/core/input/bindings.lua
local testedKeys = {}
for k1, v1 in pairs(t1) do
local v2 = t2[k1]
end
for k2, v2 in pairs(t2) do
if not testedKeys[k2] then
local result = deepcopy(binding)
for k, v in pairs(defaultBinding) do
if deepcompare(result[k],v) then
local count = 0
for i,binding in pairs(bindings) do
if binding.unused then
end
for k,v in pairs(fileData or {}) do
if k == "bindings" then
if list == nil then return result end
for _,v in pairs(list) do
if v.action == nil then log("W", "bindings", "Binding is missing the 'action' field: " ..dumpbinding(v)) end
local result = { bindings = {}, removed = {}, version = 1 }
for k,v in pairs(old) do
if k ~= "bindings" and k ~= "removed" then result[k] = v end
local markedForRemoval = {}
for k,v in pairs(dictOld) do
if dictNew[k] == nil then
-- process removed bindings
for k,v in pairs(markedForRemoval) do
log('D', 'bindings', "Removed binding (added to list): "..dumps(v.control).." : "..dumps(v.action))
-- process modified/new bindings
for k,v in pairs(dictNew) do
if dumps(dictOld[k]) ~= dumps(v) then
local function applyResponseCurve(contents, path, curveInverted)
for i,binding in pairs(contents.bindings) do
if binding.ffb and binding.ffb.responseCorrected then
if not allowDuplicates then
for k,v in pairs(dictDiffReplaced) do
for kk,vv in pairs(dictBase) do
for k,v in pairs(dictDiffReplaced) do
for kk,vv in pairs(dictBase) do
if vv.control == v.control then
-- merge removed bindings
for k,v in pairs(dictDiffRemoved) do
if dictBase[k] == nil then
-- merge new/modified bindings
for k,v in pairs(dictDiffReplaced) do
dictBase[k] = v
local bindings = {}
for _,v in pairs(dictBase) do table.insert(bindings, cleanBindingDefaults(v)) end
-- now check for removed devices
for device,_ in pairs(oldDevices) do
if newDevicesSet[device] == nil then
local enabledActionsMap = {}
for _, t in pairs(vd.vdata.actionsEnabled) do
enabledActionsMap[t.name] = true
-- fill/rewrite metadata (all except bindings themselves: guid, devtype...)
for k,v in pairs(vehicleContents) do
if k ~= "bindings" then contents[k] = v end
local currentActions = {}
for actionName,action in pairs(core_input_actions.getActiveActions()) do
if action.vehicle == nil or action.vehicle == vehicleName then
actionToControl = nil
for i,s in pairs(ActionMap:getList())do
for j,v in ipairs(s) do
local vd = extensions.core_vehicle_manager.getVehicleData(veh:getId())
for _, actionList in pairs(vd and vd.vdata and vd.vdata.triggerEventLinksDict or {}) do
for _, linkList in pairs(actionList) do
for _, actionList in pairs(vd and vd.vdata and vd.vdata.triggerEventLinksDict or {}) do
for _, linkList in pairs(actionList) do
for _, lnk in pairs(linkList) do
for _, linkList in pairs(actionList) do
for _, lnk in pairs(linkList) do
if lnk.namespace == 'common' then
lnk.inputAction = core_input_actions.upgradeAction(lnk.inputAction)
for actionName, action in pairs(activeActions) do
if actionName == lnk.inputAction then
for _,data in pairs(M.bindings) do
sendBindingsToGE(data.devname, data.contents.bindings, M.assignedPlayers[data.devname])
-- remove the "unused" flag from the bindings for comparing and writing to disk
for k,v in pairs(defaultData.bindings) do v.unused = nil end
for k,v in pairs(data.bindings) do v.unused = nil end
for k,v in pairs(defaultData.bindings) do v.unused = nil end
for k,v in pairs(data.bindings) do v.unused = nil end
-- convert from vehicle__actionname to actionname. this name-mangling is needed to prevent collisions with other vehicles' action names
for _,b in pairs(diffData.bindings or {}) do b.action = core_input_actions.uniqueNameToName(b.action, vehicleName) end
for _,b in pairs(diffData.removed or {}) do b.action = core_input_actions.uniqueNameToName(b.action, vehicleName) end
for _,b in pairs(diffData.bindings or {}) do b.action = core_input_actions.uniqueNameToName(b.action, vehicleName) end
for _,b in pairs(diffData.removed or {}) do b.action = core_input_actions.uniqueNameToName(b.action, vehicleName) end
-- normal bindings
for devname,info in pairs(M.devices) do
if resetAllDevices or devname == desiredDevName then
-- vehicle specific bindings
for devname,info in pairs(M.devices) do
if resetAllDevices or devname == desiredDevName then
setMenuActionEnabled(enabled, nil, "MenuActionMap")
for menuActionMapName,_ in pairs(core_input_actions.menuActionMapNames) do
setMenuActionEnabled(enabled, nil, menuActionMapName)
@/lua/ge/extensions/core/vehicleTriggers.lua
if vData and vData.vdata and type(vData.vdata.triggers) == 'table' then
for _, trg in pairs(vData.vdata.triggers or {}) do
for actionStr, lnkTable in pairs(vData.vdata.triggerEventLinksDict[trg.cid] or {}) do
if lnkTable and #lnkTable > 0 then
if lnkTable and #lnkTable > 0 then
for lnkIdx, lnk in pairs(lnkTable) do
if vData and vData.vdata and type(vData.vdata.events) == 'table' then
for _, evt in pairs(vData.vdata.events or {}) do
im.TableNextRow()
if vData and vData.vdata and type(vData.vdata.triggerEventLinksDict) == 'table' then
for triggerId, lnkDict in pairs(vData.vdata.triggerEventLinksDict or {}) do
im.TableNextRow()
for actionStr, lnkTable in pairs(lnkDict) do
for _, lnk in pairs(lnkTable) do
for actionStr, lnkTable in pairs(lnkDict) do
for _, lnk in pairs(lnkTable) do
if lnk.triggerInput then
-- TODO: this is overly simplistic and serves as a prototype :)
for _, lnk in pairs(vdata.triggerEventLinksDict[triggerId][actionStr]) do
local actionsExecuted = executeLink(vdata, lnk, actionValue, vehicleId)
@/lua/common/jbeam/utils.lua
for nodeKey, data in pairs(jbeamData) do
if type(nodeKey) == 'string' and type(data) == 'table' and type(data.x) == 'number' and type(data.y) == 'number' and type(data.z) == 'number'
@/lua/common/jbeam/sectionMerger.lua
-- add the source keys to target
for k, v in pairs(vehicle[sectionNameSource]) do
if vehicle[sectionNameTarget][k] then
@/lua/ge/extensions/flowgraph/nodes/scene/getPointOnDecalroad.lua
self.roadObj = nil
for _, p in pairs(self.pinOut) do
p.value = nil
@/lua/ge/extensions/flowgraph/nodes/math/math.lua
--include all math functions and constants
for k, v in pairs(math) do
env[k] = v
--dumpz(self.graph.links,2)
for _, l in pairs(self.graph.links) do
if l.targetNode.id == self.id then
self.keyworkdWhiteListLookup = {}
for _, v in pairs(keywordWhiteList) do
self.keyworkdWhiteListLookup[v] = true
@/lua/ge/extensions/core/vehicle/mirror.lua
if #offset then
for k,v in pairs(offset) do
M.setAngleOffset(k,v.angleOffset.x,v.angleOffset.z, veh)
local mytable = {}
for k,v in pairs(vdata.vdata.mirrors ) do
if v.mesh then
local mid = -1
for i in pairs(vdata.vdata.mirrors) do
if vdata.vdata.mirrors[i].mesh == mirrorName then
imguiSliderData = {}
for k,v in pairs(imguiMirrordata) do
imguiSliderData[k] = {im.FloatPtr(v.angleOffset.x or 0), im.FloatPtr(v.angleOffset.z or 0)}
if im.Button("save") then
for k,v in pairs(imguiMirrordata) do
setAngleOffset(k,imguiSliderData[k][1][0], imguiSliderData[k][2][0], nil, true)
local focusedAny = false
for k,v in pairs(imguiMirrordata) do
im.TextUnformatted(dumps(k))
local viewFrustum = Engine.sceneGetCameraFrustum()
for i in pairs(vdata.vdata.mirrors) do
if vdata.vdata.mirrors[i].mesh == mirror_name then
@/lua/ge/extensions/gameplay/rally/notebook/structured/textCompositor.lua
for name,variants in pairs(systemPacenotes) do
sysNotes[name] = {}
local compacted = {}
for distStr,n in pairs(out) do
compacted[n] = distStr
local keys = {}
for k in pairs(compacted) do table.insert(keys, k) end
table.sort(keys)
local systemCount = 0
for name,variants in pairs(self:getSystemPacenotes()) do
systemCount = systemCount + #variants
@/lua/ge/extensions/campaign/campaigns.lua
if campaign and campaign.meta.subsections then
for subsectionKey,subsection in pairs(campaign.meta.subsections) do
for k,_ in pairs(subsection.locations) do
for subsectionKey,subsection in pairs(campaign.meta.subsections) do
for k,_ in pairs(subsection.locations) do
if k == locationKey then
local locations = campaign.meta.subsections[subsectionKey].locations
for key,location in pairs(locations) do
if location.entryMarker == markerName or location.exitLocation == markerName then
@/lua/ge/extensions/editor/sitesEditor/locations.lua
local closestNode = nil
for idx, node in pairs(objects) do
local distNodeToCam = (node.pos - mouseInfo.camPos):length()
@/lua/ge/extensions/core/settings/graphic.lua
local modes = o.GraphicDisplayDriver.getModes()
for _,v in pairs(modes.keys) do
if current == v then
-- log('I','','Overall quality to be applied is '..value..' : '..dumps(levelData))
for k,v in pairs(levelData) do
o[k].set(v)
local temp = {}
for index, group in pairs(overallQualityPresets) do
for key, presetValue in pairs(group) do
for index, group in pairs(overallQualityPresets) do
for key, presetValue in pairs(group) do
temp[key] = true
presetKeys = {}
for k,v in pairs(temp) do
table.insert(presetKeys, k)
local matchedGroupIndex = nil
for index, group in pairs(overallQualityPresets) do
-- log('I','',' Checking group: '..tostring(index))
for k,v in pairs(data) do
if graphicsOptions[k] and type(graphicsOptions[k].init) == 'function' then
data.GraphicFullscreen = true
for k, v in pairs(data) do
settings.setValue(k, v)
@/lua/ge/extensions/core/input/virtualInput.lua
local function getDeviceInfo(vidpid)
for deviceInstance, info in pairs(M.devices) do
if info[2] == vidpid then
@/lua/vehicle/controller/sbrGauges.lua
local energyLeft = 0
for k, _ in pairs(batteriesUsed) do
local storage = energyStorage.getStorage(k)
local motors = powertrain.getDevicesByType("electricMotor")
for _, v in pairs(motors) do
for _, j in pairs(v.registeredEnergyStorages) do
for _, v in pairs(motors) do
for _, j in pairs(v.registeredEnergyStorages) do
batteriesUsed[j] = true
for k, _ in pairs(batteriesUsed) do
local storage = energyStorage.getStorage(k)
@/lua/ge/extensions/ui/vehicleSelector/vehicleOperations.lua
local validConfigs = {}
for _, config in pairs(data.configs) do
if not ui_vehicleSelector_general.passesFilters({model = config.model_key, config = config.key}) then
@/lua/ge/extensions/editor/api/core.lua
for _, v in pairs(filesAndFolders) do
local newFilename = v
for _, v in pairs(filesAndFolders) do
local newFilename = v
dirtyToolsSaveInfo = {}
for name, _ in pairs(editor.dirtyTools) do
dirtyToolsSaveInfo[name] = true
imgui.BeginChild1("Windows", imgui.ImVec2(-1, imgui.GetContentRegionAvail().y - 30), imgui.WindowFlags_ChildWindow)
for name, _ in pairs(editor.dirtyTools) do
if imgui.Checkbox(name, imgui.BoolPtr(dirtyToolsSaveInfo[name])) then
if imgui.Button("Save All") then
for k, _ in pairs(dirtyToolsSaveInfo) do
if editor.dirtyTools[k] then
if imgui.Button("Save Selected") then
for k, v in pairs(dirtyToolsSaveInfo) do
if v == true then
local function getCurrentEditModeName()
for key, val in pairs(editor.editModes) do
if val == editor.editMode then return key end
@/lua/vehicle/energyStorage/fuelTank.lua
for k, v in pairs(storage.fuelNodes) do
obj:setNodeMass(k, v + storage.storedEnergy * storage.fuelNodeMassCoef)
--apply final weight as soon as possible
for k, v in pairs(storage.fuelNodes) do
obj:setNodeMass(k, v + storage.storedEnergy * storage.fuelNodeMassCoef)
if jbeamData.fuel and jbeamData.fuel._engineGroup_nodes then
for _, n in pairs(jbeamData.fuel._engineGroup_nodes) do
storage.fuelNodes[n] = v.data.nodes[n].nodeWeight --save initial mass as the offset for the fuel node weights
--apply final weight as soon as possible
for k, v in pairs(storage.fuelNodes) do
obj:setNodeMass(k, v + storage.storedEnergy * storage.fuelNodeMassCoef)
@/lua/common/libs/luasocket/socket/smtp.lua
local lower = {}
for i,v in base.pairs(headers or lower) do
lower[string.lower(i)] = v
local h = "\r\n"
for f,v in base.pairs(tosend) do
h = (canonic[f] or f) .. ': ' .. v .. "\r\n" .. h
@/lua/ge/extensions/freeroam/organizations.lua
local data = jsonReadFile(file)
for orgId, orgData in pairs(data) do
orgData.id = orgId
local result = {}
for orgId, organization in pairs(getOrganizations()) do
table.insert(result, getUIDataForOrg(orgId))
@/lua/ge/extensions/editor/assetManagementTool.lua
for hash, asset in pairs(assetsByHash) do
if string.sub(asset.targetPath, 1, size) == newPathNotSetString then
for key, val in pairs(assetsByHash) do
table.insert(assetsByIndex, val)
for hash, asset in pairs(assetsByHash) do
-- copy first asset in list to new location (ignore others in the list for this hash since they're the same)
for hash, asset in pairs(allAssetsWithHashes) do
-- if its more than one, then we have duplicates
local function setTargetPathForSelection(targetPath)
for hash, _ in pairs(selectedHashes) do
if assetsByHash[hash] then
for key, val in pairs(assetsByHash) do
for _, path in ipairs(val.paths) do
if imgui.Button("Yes") then
for hash, _ in pairs(selectedHashes) do
local asset = assetsByHash[hash]
@/lua/ge/extensions/editor/levelValidator.lua
local count = 0
for _ in pairs(ignoredObjects) do
count = count + 1
local sortedFields = {}
for field, _ in pairs(data) do
table.insert(sortedFields, field)
-- Check which sceneObjectNodes are planted
for i, node in pairs(sceneObjectNodes) do
if node.planted then
for i, node in pairs(forestItemNodes) do
if node.planted then
for id, node in pairs(sceneObjectNodes) do
if not node.planted then
job.yield()
for _, node in pairs(forestItemNodes) do
if not node.planted then
local foundDuplicate = false
for id2, hash2 in pairs(objectHashes) do
if hash == hash2 then
local filterFunctions = {}
for logLevel, _ in pairs(logLevelFilters) do
table.insert(filterFunctions, filterLogLevel(logLevel))
}
for type, idx in pairs(types) do
aggregatedElements.elementsByType[idx] = { elements = {}, count = 0, type = type }
@/lua/ge/extensions/core/ropeVisualTest.lua
local anyRopeHasDebugNodes = false
for _, settings in pairs(ropeDebugSettings) do
if settings.debugNodes then
for ropeId, _ in pairs(perfStats.ropeSimTimes) do
if not activeRopeIds[ropeId] then
else
for _, settings in pairs(ropeDebugSettings) do
if settings.debugNodes then
@/lua/ge/extensions/ui/uiMods.lua
local vueModsChanged = false
for _,v in pairs(files) do
if not modModulesChanged and string.startswith(v.filename, "/ui/modModules/") then
@/lua/ge/extensions/flowgraph/nodes/gameplay/traffic/signals/controller.lua
for i = old, new + 1, -1 do
for _, lnk in pairs(self.graph.links) do
if lnk.sourcePin == self.pinOut['stateName_'..i] or lnk.sourcePin == self.pinOut['stateDuration_'..i] then
@/lua/vehicle/particlefilter.lua
if mmap ~= nil then
for _, r in pairs(mmap) do
if r.compareFunc(p) then
@/lua/ge/extensions/flowgraph/nodes/ui/onBigmapPoiSelected.lua
self.pinOut.denavigated.value = false
for flag, act in pairs(self.flags) do
self.pinOut[flag].value = act
@/lua/common/jbeam/materials.lua
for flexKey, flexbody in pairs(vehicle.flexbodies) do
flexmeshMats[flexbody.mesh] = vehicleObj:getMeshsMaterialsTbl(flexbody.mesh)
--if(not meshes or #meshes == 0 or (#meshes == 1 and meshes[1] == '')) then log('E', "material.init", "[glowmap] No meshes containing material " .. orgMat) end
for meshi, mesh in pairs(meshes) do
local gmat = deepcopy(gm)
elseif type(gm.simpleFunction) == "table" then
for fk, fc in pairs(gm.simpleFunction) do
local s = "(" .. fk .. "*" .. fc .. ")"
elseif gm.advancedFunction and gm.advancedFunction.triggers and gm.advancedFunction.cmd then
for _, fc in pairs(gm.advancedFunction.triggers) do
mv[fc] = 0
-- debug helper: list all materials on a mesh:
--for flexKey, flexbody in pairs(vehicle.flexbodies) do
-- log('D', "material.init", "flexbody mesh '"..flexbody.mesh.."' contains the following materials: " .. dumps(vehicleObj:getMeshsMaterialsTbl(flexbody.mesh)))
for flexKey, flexbody in pairs(vehicle.flexbodies) do
if flexbody.deformGroup and flexbody.deformGroup ~= "" then
for mati, matName in pairs(flexmeshMats[flexbody.mesh]) do
if matName == "" then
for i, b in pairs(vehicle.beams) do
if b.deformGroup then
local deformGroups = type(b.deformGroup) == "table" and b.deformGroup or {b.deformGroup}
for _, g in pairs(deformGroups) do
if switchTmp[g] ~= nil then
if switchTmp[g] ~= nil then
for sk, sv in pairs(switchTmp[g]) do
if b.deformSwitches == nil then
--log('I', "material.init", "available deformGroups:")
--for k, va in pairs(assignStats) do
-- log('I', "material.init", " * " .. k .. " on " .. va .. " beams")
triggerList = {}
for _, s in pairs(triggers) do
matSet[s.msc] = s
for tk, _ in pairs(triggerSet) do
table.insert(triggerList, tk)
for _, s in pairs(matSet) do
if s.on then
for _, va in pairs(switches) do
switchMaterial(vehicleObj, va, nil, matState)
local triggersCopy = deepcopy(triggers)
for _, t in pairs(triggersCopy) do
t.evalFunction = nil
@/lua/ge/extensions/editor/missionEditor/progressMulti.lua
for _,l in pairs(currentAggregatesByKey.labels) do
im.TableSetupColumn(l)
im.TableNextColumn()
for _, missionData in pairs(currentAggregatesByKey.rows) do
for _, c in pairs(missionData) do
for _, missionData in pairs(currentAggregatesByKey.rows) do
for _, c in pairs(missionData) do
im.Text(c.text)
@/lua/ge/extensions/ui/gameplaySelector/tileGenerators/campaignTiles.lua
if campaign.meta and campaign.meta.subsections then
for _, subsection in pairs(campaign.meta.subsections) do
if subsection.locations then
if subsection.locations then
for _ in pairs(subsection.locations) do
scenarioCount = scenarioCount + 1
@/lua/ge/extensions/gameplay/taxi.lua
local taxisToDiscard = {}
for vehId, state in pairs(blinkerStates) do
local veh = getObjectByID(vehId)
local function extractTaxiIds()
for vehId, _ in pairs(map.objects) do
if isTaxi(vehId) then
local missingVehIds = {}
for vehId, _ in pairs(taxiIdsList) do
if not ignoreTaxiIdsList[vehId] then
@/lua/ge/extensions/gameplay/traffic/trafficUtils.lua
local valid = true
for k, v in pairs(filters) do -- optional filters by traffic vehicle properties
if veh[k] ~= nil and veh[k] ~= v then
@/lua/common/event.lua
function Event.call(self, ...)
for f, _ in pairs(self.__subscribers) do f(...) end
end
@/lua/ge/extensions/editor/vehicleEditor/staticEditor/veJBeamTableVis.lua
-- and have number arrays in all subbtables except first?
for k, v in pairs(data) do
if type(v) == "table" then
@/lua/ge/extensions/flowgraph/nodes/gameplay/sites/location.lua
local strLinks = {}
for _, lnk in pairs(self.graph.links) do
if lnk.sourceNode == self and tableContains(self.oldOptions, lnk.sourcePin.name) then
local outPins = {}
for _, pn in pairs(self.pinOut) do
if tableContains(self.oldOptions or {}, pn.name) then
end
for _, pn in pairs(outPins) do
self:removePin(pn)
@/lua/ge/extensions/core/input/actions.lua
local result = {}
for actionName,v in pairs(actions) do
if vehicleName and v.namespace ~= "common" then
local result = {}
for _,path in pairs(FS:findFiles(directory, pattern, 0, false, false)) do
if active == tech_license.isAllowedActionsPath(path) then
end
for k,action in pairs(vehicleActions or {}) do
action.source = path
-- add actions from vehicle action files
for uniqueActionName,action in pairs(readFromActionsFile(vehicleName, active)) do
if result[uniqueActionName] and result[uniqueActionName].source ~= action.source then log("E", "", "Detected duplication of action: "..dumps(uniqueActionName)..", vid: "..dumps(vid)..", source A: "..dumps(result[uniqueActionName].source)..", source B: "..dumps(action.source)) end
local vd = extensions.core_vehicle_manager.getVehicleData(vehicle:getID())
for uniqueActionName,action in pairs(actionsToUniqueActions(vd and vd.vdata and vd.vdata.inputActions or {}, vehicleName)) do
if result[uniqueActionName] and result[uniqueActionName].source ~= action.source then log("E", "", "Detected duplication of action: "..dumps(uniqueActionName)..", vid: "..dumps(vid)..", source A: "..dumps(result[uniqueActionName].source)..", source B: "..dumps(action.source)) end
if vd and vd.vdata and vd.vdata.actionsEnabled then
for _, action in pairs(vd.vdata.actionsEnabled or {}) do
for resultActionName, resultAction in pairs(result) do
for _, action in pairs(vd.vdata.actionsEnabled or {}) do
for resultActionName, resultAction in pairs(result) do
if resultAction.vehicle and resultActionName == playerVehicleName .. "__" .. action.name then
-- If the vehicle has no actionsEnabled table, mark all vehicle-specific actions as usable
for resultActionName, resultAction in pairs(result) do
resultAction.usable = true
for resultActionName, resultAction in pairs(result) do
if resultAction.usable then
-- add actions from normal action files
for uniqueActionName,action in pairs(getNormalActions(active)) do
if result[uniqueActionName] and result[uniqueActionName].source ~= action.source then log("E", "", "Detected duplication of action: "..dumps(uniqueActionName)..", vid: "..dumps(vid)..", source A: "..dumps(result[uniqueActionName].source)..", source B: "..dumps(action.source)) end
table.clear(M.menuActionMapNames)
for actionName, action in pairs(result) do
local success, actionMap = M.actionToCommands(actionName, action)
@/lua/ge/extensions/editor/api/dynamicDecals.lua
M.blendModesMap = {}
for k, v in pairs(M.blendModes) do M.blendModesMap[v.name] = v.value end
M.textureResolutions = {
M.layerTypesMap = {}
for k, v in pairs(M.layerTypes) do M.layerTypesMap[v] = k end
M.layerBakingStatusCode = {
M.typesMap = {}
for k, v in pairs(M.types) do M.typesMap[v] = k end
M.widgetTypes = {
M.propertiesMap = {}
for _, cat in pairs(M.properties) do
for _, prop in ipairs(cat) do
local meshNames = {}
for name, enabled in pairs(sMeshes) do
if enabled then
local mNames = M.getShapeMaterialNames()
for k, materialName in pairs(mNames) do
if materials[materialName] then
local mNames = M.getShapeMaterialNames()
for k, materialName in pairs(mNames) do
if materialName == vehicleName then
local materials = {}
for materialId, materialName in pairs(mNames) do
materials[materialId] = materialName
local layerData = {}
for _, layer in pairs(layerStack) do
table.insert(layerData, serializeLayer(layer))
@/lua/ge/extensions/editor/rallyEditor/measurementsTab.lua
for id, measurement in pairs(self.measurements) do
local serializedPoints = {}
local maxId = 0
for idStr, measurement in pairs(data.measurements or {}) do
local deserializedPoints = {}
-- Recalculate distances for all measurements
for id, measurement in pairs(self.measurements) do
self:calculateMeasurementDistance(id)
for _, measurement in pairs(self.measurements) do
if #measurement.points > 0 then
local maxId = 0
for id, _ in pairs(self.measurements) do
if id > maxId then
-- Search across all measurements
for measurementId, measurement in pairs(self.measurements) do
if measurement.points and #measurement.points > 0 then
for measurementId, measurement in pairs(self.measurements) do
local isSelected = measurement.id == self.selectedMeasurementId
@/lua/ge/extensions/editor/bulkRename.lua
for id, entry in pairs(previewNames) do
table.insert(ids, id)
local function findCollisionWithNewName(ownerId, newName)
for id, entry in pairs(previewNames) do
-- we skip the id we check with the others
for id, entry in pairs(previewNames) do
local objId
-- Populate rows
for id, entry in pairs(previewNames) do
imgui.TableNextRow()
@/lua/vehicle/extensions/api.lua
local data = {}
for vk,vs in pairs(data_ref) do
data[vk] = {}
-- for nodeid, beamnid
for _,vv in pairs(vs) do
data[vk][vv.cid] = {}
data[vk][vv.cid] = {}
for vk,vi in pairs(vv) do
if whitelist[vk] then
local tris = {}
for k, s in pairs(v.data.beams) do
if not s.wheelID then
end
for k, s in pairs(v.data.nodes) do
if not s.wheelTreadBeamDeform then
end
for k, s in pairs(v.data.triangles) do
if s.cid then
@/ui/ui-vue/dist/index.js
`,overlayDiv.textContent=count$1.toString(),overlayElement.appendChild(overlayDiv),overlayDivs.set(element,overlayDiv)}catch{}}function updateOverlayText(){if(!overlayActive||overlayDivs.size===0)return;let appsStats=getUIAppsStats(),counts=appsStats.sortedList.map(item=>item.count),maxCount=Math.max(...counts,1),minCount=Math.min(...counts,0);for(let{element,count:count$1}of appsStats.sortedList){let overlayDiv=overlayDivs.get(element);overlayDiv&&(overlayDiv.textContent=count$1.toString(),overlayDiv.style.opacity=getOverlayOpacity(count$1,minCount,maxCount))}}function destroyOverlay(){overlayUpdateTimer&&=(clearInterval(overlayUpdateTimer),null),overlayDivs.forEach(overlayDiv=>overlayDiv.remove()),overlayDivs.clear(),overlayElement&&=(overlayElement.remove(),null),overlayActive=!1}function toggleOverlay(){return overlayActive?(destroyOverlay(),!1):(overlayActive=!0,createOverlay(),updateOverlayDivs(),overlayUpdateTimer=setInterval(updateOverlayText,500),!0)}function refreshOverlay(){overlayActive&&updateOverlayDivs()}var isBrowser=typeof document<`u`;function isRouteComponent(component){return typeof component==`object`||`displayName`in component||`props`in component||`__vccOpts`in component}function isESModule(obj){return obj.__esModule||obj[Symbol.toStringTag]===`Module`||obj.default&&isRouteComponent(obj.default)}var assign=Object.assign;function applyToParams(fn,params){let newParams={};for(let key in params){let value=params[key];newParams[key]=isArray(value)?value.map(fn):fn(value)}return newParams}var noop$1=()=>{},isArray=Array.isArray;function mergeOptions(defaults,partialOptions){let options={};for(let key in defaults)options[key]=key in partialOptions?partialOptions[key]:defaults[key];return options}var HASH_RE=/#/g,AMPERSAND_RE=/&/g,SLASH_RE=/\//g,EQUAL_RE=/=/g,IM_RE=/\?/g,PLUS_RE=/\+/g,ENC_BRACKET_OPEN_RE=/%5B/g,ENC_BRACKET_CLOSE_RE=/%5D/g,ENC_CARET_RE=/%5E/g,ENC_BACKTICK_RE=/%60/g,ENC_CURLY_OPEN_RE=/%7B/g,ENC_PIPE_RE=/%7C/g,ENC_CURLY_CLOSE_RE=/%7D/g,ENC_SPACE_RE=/%20/g;function commonEncode(text){return text==null?``:encodeURI(``+text).replace(ENC_PIPE_RE,`|`).replace(ENC_BRACKET_OPEN_RE,`[`).replace(ENC_BRACKET_CLOSE_RE,`]`)}function encodeHash(text){return commonEncode(text).replace(ENC_CURLY_OPEN_RE,`{`).replace(ENC_CURLY_CLOSE_RE,`}`).replace(ENC_CARET_RE,`^`)}function encodeQueryValue(text){return commonEncode(text).replace(PLUS_RE,`%2B`).replace(ENC_SPACE_RE,`+`).replace(HASH_RE,`%23`).replace(AMPERSAND_RE,`%26`).replace(ENC_BACKTICK_RE,"`").replace(ENC_CURLY_OPEN_RE,`{`).replace(ENC_CURLY_CLOSE_RE,`}`).replace(ENC_CARET_RE,`^`)}function encodeQueryKey(text){return encodeQueryValue(text).replace(EQUAL_RE,`%3D`)}function encodePath(text){return commonEncode(text).replace(HASH_RE,`%23`).replace(IM_RE,`%3F`)}function encodeParam(text){return encodePath(text).replace(SLASH_RE,`%2F`)}function decode(text){if(text==null)return null;try{return decodeURIComponent(``+text)}catch{}return``+text}var TRAILING_SLASH_RE=/\/$/,removeTrailingSlash=path=>path.replace(TRAILING_SLASH_RE,``);function parseURL(parseQuery$1,location$1,currentLocation=`/`){let path,query={},searchString=``,hash=``,hashPos=location$1.indexOf(`#`),searchPos=location$1.indexOf(`?`);return searchPos=hashPos>=0&&searchPos>hashPos?-1:searchPos,searchPos>=0&&(path=location$1.slice(0,searchPos),searchString=location$1.slice(searchPos,hashPos>0?hashPos:location$1.length),query=parseQuery$1(searchString.slice(1))),hashPos>=0&&(path||=location$1.slice(0,hashPos),hash=location$1.slice(hashPos,location$1.length)),path=resolveRelativePath(path??location$1,currentLocation),{fullPath:path+searchString+hash,path,query,hash:decode(hash)}}function stringifyURL(stringifyQuery$1,location$1){let query=location$1.query?stringifyQuery$1(location$1.query):``;return location$1.path+(query&&`?`)+query+(location$1.hash||``)}function stripBase(pathname,base){return!base||!pathname.toLowerCase().startsWith(base.toLowerCase())?pathname:pathname.slice(base.length)||`/`}function isSameRouteLocation(stringifyQuery$1,a$1,b){let aLastIndex=a$1.matched.length-1,bLastIndex=b.matched.length-1;return aLastIndex>-1&&aLastIndex===bLastIndex&&isSameRouteRecord(a$1.matched[aLastIndex],b.matched[bLastIndex])&&isSameRouteLocationParams(a$1.params,b.params)&&stringifyQuery$1(a$1.query)===stringifyQuery$1(b.query)&&a$1.hash===b.hash}function isSameRouteRecord(a$1,b){return(a$1.aliasOf||a$1)===(b.aliasOf||b)}function isSameRouteLocationParams(a$1,b){if(Object.keys(a$1).length!==Object.keys(b).length)return!1;for(let key in a$1)if(!isSameRouteLocationParamsValue(a$1[key],b[key]))return!1;return!0}function isSameRouteLocationParamsValue(a$1,b){return isArray(a$1)?isEquivalentArray(a$1,b):isArray(b)?isEquivalentArray(b,a$1):a$1===b}function isEquivalentArray(a$1,b){return isArray(b)?a$1.length===b.length&&a$1.every((value,i)=>value===b[i]):a$1.length===1&&a$1[0]===b}function resolveRelativePath(to,from){if(to.startsWith(`/`))return to;if(!to)return from;let fromSegments=from.split(`/`),toSegments=to.split(`/`),lastToSegment=toSegments[toSegments.length-1];(lastToSegment===`..`||lastToSegment===`.`)&&toSegments.push(``);let position=fromSegments.length-1,toPosition,segment;for(toPosition=0;toPosition1&&position--;else break;return fromSegments.slice(0,position).join(`/`)+`/`+toSegments.slice(toPosition).join(`/`)}var START_LOCATION_NORMALIZED={path:`/`,name:void 0,params:{},query:{},hash:``,fullPath:`/`,matched:[],meta:{},redirectedFrom:void 0},NavigationType=function(NavigationType$1){return NavigationType$1.pop=`pop`,NavigationType$1.push=`push`,NavigationType$1}({}),NavigationDirection=function(NavigationDirection$1){return NavigationDirection$1.back=`back`,NavigationDirection$1.forward=`forward`,NavigationDirection$1.unknown=``,NavigationDirection$1}({});function normalizeBase(base){if(!base)if(isBrowser){let baseEl=document.querySelector(`base`);base=baseEl&&baseEl.getAttribute(`href`)||`/`,base=base.replace(/^\w+:\/\/[^\/]+/,``)}else base=`/`;return base[0]!==`/`&&base[0]!==`#`&&(base=`/`+base),removeTrailingSlash(base)}var BEFORE_HASH_RE=/^[^#]+#/;function createHref(base,location$1){return base.replace(BEFORE_HASH_RE,`#`)+location$1}function getElementPosition(el,offset$2){let docRect=document.documentElement.getBoundingClientRect(),elRect=el.getBoundingClientRect();return{behavior:offset$2.behavior,left:elRect.left-docRect.left-(offset$2.left||0),top:elRect.top-docRect.top-(offset$2.top||0)}}var computeScrollPosition=()=>({left:window.scrollX,top:window.scrollY});function scrollToPosition(position){let scrollToOptions;if(`el`in position){let positionEl=position.el,isIdSelector=typeof positionEl==`string`&&positionEl.startsWith(`#`),el=typeof positionEl==`string`?isIdSelector?document.getElementById(positionEl.slice(1)):document.querySelector(positionEl):positionEl;if(!el)return;scrollToOptions=getElementPosition(el,position)}else scrollToOptions=position;`scrollBehavior`in document.documentElement.style?window.scrollTo(scrollToOptions):window.scrollTo(scrollToOptions.left==null?window.scrollX:scrollToOptions.left,scrollToOptions.top==null?window.scrollY:scrollToOptions.top)}function getScrollKey(path,delta){return(history.state?history.state.position-delta:-1)+path}var scrollPositions=new Map;function saveScrollPosition(key,scrollPosition){scrollPositions.set(key,scrollPosition)}function getSavedScrollPosition(key){let scroll$1=scrollPositions.get(key);return scrollPositions.delete(key),scroll$1}function isRouteLocation(route){return typeof route==`string`||route&&typeof route==`object`}function isRouteName(name){return typeof name==`string`||typeof name==`symbol`}var ErrorTypes=function(ErrorTypes$1){return ErrorTypes$1[ErrorTypes$1.MATCHER_NOT_FOUND=1]=`MATCHER_NOT_FOUND`,ErrorTypes$1[ErrorTypes$1.NAVIGATION_GUARD_REDIRECT=2]=`NAVIGATION_GUARD_REDIRECT`,ErrorTypes$1[ErrorTypes$1.NAVIGATION_ABORTED=4]=`NAVIGATION_ABORTED`,ErrorTypes$1[ErrorTypes$1.NAVIGATION_CANCELLED=8]=`NAVIGATION_CANCELLED`,ErrorTypes$1[ErrorTypes$1.NAVIGATION_DUPLICATED=16]=`NAVIGATION_DUPLICATED`,ErrorTypes$1}({}),NavigationFailureSymbol=Symbol(``);ErrorTypes.MATCHER_NOT_FOUND,ErrorTypes.NAVIGATION_GUARD_REDIRECT,ErrorTypes.NAVIGATION_ABORTED,ErrorTypes.NAVIGATION_CANCELLED,ErrorTypes.NAVIGATION_DUPLICATED;function createRouterError(type,params){return assign(Error(),{type,[NavigationFailureSymbol]:!0},params)}function isNavigationFailure(error,type){return error instanceof Error&&NavigationFailureSymbol in error&&(type==null||!!(error.type&type))}function parseQuery(search$1){let query={};if(search$1===``||search$1===`?`)return query;let searchParams=(search$1[0]===`?`?search$1.slice(1):search$1).split(`&`);for(let i=0;iv&&encodeQueryValue(v)):[value&&encodeQueryValue(value)]).forEach(value$1=>{value$1!==void 0&&(search$1+=(search$1.length?`&`:``)+key,value$1!=null&&(search$1+=`=`+value$1))})}return search$1}function normalizeQuery(query){let normalizedQuery={};for(let key in query){let value=query[key];value!==void 0&&(normalizedQuery[key]=isArray(value)?value.map(v=>v==null?null:``+v):value==null?value:``+value)}return normalizedQuery}var matchedRouteKey=Symbol(``),viewDepthKey=Symbol(``),routerKey=Symbol(``),routeLocationKey=Symbol(``),routerViewLocationKey=Symbol(``);function useCallbacks(){let handlers$1=[];function add$2(handler$1){return handlers$1.push(handler$1),()=>{let i=handlers$1.indexOf(handler$1);i>-1&&handlers$1.splice(i,1)}}function reset$1(){handlers$1=[]}return{add:add$2,list:()=>handlers$1.slice(),reset:reset$1}}function guardToPromiseFn(guard,to,from,record,name,runWithContext=fn=>fn()){let enterCallbackArray=record&&(record.enterCallbacks[name]=record.enterCallbacks[name]||[]);return()=>new Promise((resolve$1,reject)=>{let next=valid=>{valid===!1?reject(createRouterError(ErrorTypes.NAVIGATION_ABORTED,{from,to})):valid instanceof Error?reject(valid):isRouteLocation(valid)?reject(createRouterError(ErrorTypes.NAVIGATION_GUARD_REDIRECT,{from:to,to:valid})):(enterCallbackArray&&record.enterCallbacks[name]===enterCallbackArray&&typeof valid==`function`&&enterCallbackArray.push(valid),resolve$1())},guardReturn=runWithContext(()=>guard.call(record&&record.instances[name],to,from,next)),guardCall=Promise.resolve(guardReturn);guard.length<3&&(guardCall=guardCall.then(next)),guardCall.catch(err=>reject(err))})}function extractComponentsGuards(matched,guardType,to,from,runWithContext=fn=>fn()){let guards=[];for(let record of matched)for(let name in record.components){let rawComponent=record.components[name];if(!(guardType!==`beforeRouteEnter`&&!record.instances[name]))if(isRouteComponent(rawComponent)){let guard=(rawComponent.__vccOpts||rawComponent)[guardType];guard&&guards.push(guardToPromiseFn(guard,to,from,record,name,runWithContext))}else{let componentPromise=rawComponent();guards.push(()=>componentPromise.then(resolved=>{if(!resolved)throw Error(`Couldn't resolve component "${name}" at "${record.path}"`);let resolvedComponent=isESModule(resolved)?resolved.default:resolved;record.mods[name]=resolved,record.components[name]=resolvedComponent;let guard=(resolvedComponent.__vccOpts||resolvedComponent)[guardType];return guard&&guardToPromiseFn(guard,to,from,record,name,runWithContext)()}))}}return guards}function extractChangingRecords(to,from){let leavingRecords=[],updatingRecords=[],enteringRecords=[],len=Math.max(from.matched.length,to.matched.length);for(let i=0;iisSameRouteRecord(record,recordFrom))?updatingRecords.push(recordFrom):leavingRecords.push(recordFrom));let recordTo=to.matched[i];recordTo&&(from.matched.find(record=>isSameRouteRecord(record,recordTo))||enteringRecords.push(recordTo))}return[leavingRecords,updatingRecords,enteringRecords]}var createBaseLocation=()=>location.protocol+`//`+location.host;function createCurrentLocation(base,location$1){let{pathname,search:search$1,hash}=location$1,hashPos=base.indexOf(`#`);if(hashPos>-1){let slicePos=hash.includes(base.slice(hashPos))?base.slice(hashPos).length:1,pathFromHash=hash.slice(slicePos);return pathFromHash[0]!==`/`&&(pathFromHash=`/`+pathFromHash),stripBase(pathFromHash,``)}return stripBase(pathname,base)+search$1+hash}function useHistoryListeners(base,historyState,currentLocation,replace){let listeners=[],teardowns=[],pauseState=null,popStateHandler=({state})=>{let to=createCurrentLocation(base,location),from=currentLocation.value,fromState=historyState.value,delta=0;if(state){if(currentLocation.value=to,historyState.value=state,pauseState&&pauseState===from){pauseState=null;return}delta=fromState?state.position-fromState.position:0}else replace(to);listeners.forEach(listener=>{listener(currentLocation.value,from,{delta,type:NavigationType.pop,direction:delta?delta>0?NavigationDirection.forward:NavigationDirection.back:NavigationDirection.unknown})})};function pauseListeners(){pauseState=currentLocation.value}function listen(callback){listeners.push(callback);let teardown=()=>{let index=listeners.indexOf(callback);index>-1&&listeners.splice(index,1)};return teardowns.push(teardown),teardown}function beforeUnloadListener(){if(document.visibilityState===`hidden`){let{history:history$1}=window;if(!history$1.state)return;history$1.replaceState(assign({},history$1.state,{scroll:computeScrollPosition()}),``)}}function destroy$1(){for(let teardown of teardowns)teardown();teardowns=[],window.removeEventListener(`popstate`,popStateHandler),window.removeEventListener(`pagehide`,beforeUnloadListener),document.removeEventListener(`visibilitychange`,beforeUnloadListener)}return window.addEventListener(`popstate`,popStateHandler),window.addEventListener(`pagehide`,beforeUnloadListener),document.addEventListener(`visibilitychange`,beforeUnloadListener),{pauseListeners,listen,destroy:destroy$1}}function buildState(back,current,forward,replaced=!1,computeScroll=!1){return{back,current,forward,replaced,position:window.history.length,scroll:computeScroll?computeScrollPosition():null}}function useHistoryStateNavigation(base){let{history:history$1,location:location$1}=window,currentLocation={value:createCurrentLocation(base,location$1)},historyState={value:history$1.state};historyState.value||changeLocation(currentLocation.value,{back:null,current:currentLocation.value,forward:null,position:history$1.length-1,replaced:!0,scroll:null},!0);function changeLocation(to,state,replace$1){let hashIndex=base.indexOf(`#`),url=hashIndex>-1?(location$1.host&&document.querySelector(`base`)?base:base.slice(hashIndex))+to:createBaseLocation()+base+to;try{history$1[replace$1?`replaceState`:`pushState`](state,``,url),historyState.value=state}catch(err){console.error(err),location$1[replace$1?`replace`:`assign`](url)}}function replace(to,data){changeLocation(to,assign({},history$1.state,buildState(historyState.value.back,to,historyState.value.forward,!0),data,{position:historyState.value.position}),!0),currentLocation.value=to}function push(to,data){let currentState=assign({},historyState.value,history$1.state,{forward:to,scroll:computeScrollPosition()});changeLocation(currentState.current,currentState,!0),changeLocation(to,assign({},buildState(currentLocation.value,to,null),{position:currentState.position+1},data),!1),currentLocation.value=to}return{location:currentLocation,state:historyState,push,replace}}function createWebHistory(base){base=normalizeBase(base);let historyNavigation=useHistoryStateNavigation(base),historyListeners=useHistoryListeners(base,historyNavigation.state,historyNavigation.location,historyNavigation.replace);function go(delta,triggerListeners=!0){triggerListeners||historyListeners.pauseListeners(),history.go(delta)}let routerHistory=assign({location:``,base,go,createHref:createHref.bind(null,base)},historyNavigation,historyListeners);return Object.defineProperty(routerHistory,`location`,{enumerable:!0,get:()=>historyNavigation.location.value}),Object.defineProperty(routerHistory,`state`,{enumerable:!0,get:()=>historyNavigation.state.value}),routerHistory}function createWebHashHistory(base){return base=location.host?base||location.pathname+location.search:``,base.includes(`#`)||(base+=`#`),createWebHistory(base)}var TokenType=function(TokenType$1){return TokenType$1[TokenType$1.Static=0]=`Static`,TokenType$1[TokenType$1.Param=1]=`Param`,TokenType$1[TokenType$1.Group=2]=`Group`,TokenType$1}({}),TokenizerState=function(TokenizerState$1){return TokenizerState$1[TokenizerState$1.Static=0]=`Static`,TokenizerState$1[TokenizerState$1.Param=1]=`Param`,TokenizerState$1[TokenizerState$1.ParamRegExp=2]=`ParamRegExp`,TokenizerState$1[TokenizerState$1.ParamRegExpEnd=3]=`ParamRegExpEnd`,TokenizerState$1[TokenizerState$1.EscapeNext=4]=`EscapeNext`,TokenizerState$1}(TokenizerState||{}),ROOT_TOKEN={type:TokenType.Static,value:``},VALID_PARAM_RE=/[a-zA-Z0-9_]/;function tokenizePath(path){if(!path)return[[]];if(path===`/`)return[[ROOT_TOKEN]];if(!path.startsWith(`/`))throw Error(`Invalid path "${path}"`);function crash(message){throw Error(`ERR (${state})/"${buffer$1}": ${message}`)}let state=TokenizerState.Static,previousState=state,tokens=[],segment;function finalizeSegment(){segment&&tokens.push(segment),segment=[]}let i=0,char,buffer$1=``,customRe=``;function consumeBuffer(){buffer$1&&=(state===TokenizerState.Static?segment.push({type:TokenType.Static,value:buffer$1}):state===TokenizerState.Param||state===TokenizerState.ParamRegExp||state===TokenizerState.ParamRegExpEnd?(segment.length>1&&(char===`*`||char===`+`)&&crash(`A repeatable param (${buffer$1}) must be alone in its segment. eg: '/:ids+.`),segment.push({type:TokenType.Param,value:buffer$1,regexp:customRe,repeatable:char===`*`||char===`+`,optional:char===`*`||char===`?`})):crash(`Invalid state to consume buffer`),``)}function addCharToBuffer(){buffer$1+=char}for(;ib.length?b.length===1&&b[0]===PathScore.Static+PathScore.Segment?1:-1:0}function comparePathParserScore(a$1,b){let i=0,aScore=a$1.score,bScore=b.score;for(;i0&&last[last.length-1]<0}var PATH_PARSER_OPTIONS_DEFAULTS={strict:!1,end:!0,sensitive:!1};function createRouteRecordMatcher(record,parent,options){let matcher=assign(tokensToParser(tokenizePath(record.path),options),{record,parent,children:[],alias:[]});return parent&&!matcher.record.aliasOf==!parent.record.aliasOf&&parent.children.push(matcher),matcher}function createRouterMatcher(routes,globalOptions){let matchers=[],matcherMap=new Map;globalOptions=mergeOptions(PATH_PARSER_OPTIONS_DEFAULTS,globalOptions);function getRecordMatcher(name){return matcherMap.get(name)}function addRoute(record,parent,originalRecord){let isRootAdd=!originalRecord,mainNormalizedRecord=normalizeRouteRecord(record);mainNormalizedRecord.aliasOf=originalRecord&&originalRecord.record;let options=mergeOptions(globalOptions,record),normalizedRecords=[mainNormalizedRecord];if(`alias`in record){let aliases=typeof record.alias==`string`?[record.alias]:record.alias;for(let alias of aliases)normalizedRecords.push(normalizeRouteRecord(assign({},mainNormalizedRecord,{components:originalRecord?originalRecord.record.components:mainNormalizedRecord.components,path:alias,aliasOf:originalRecord?originalRecord.record:mainNormalizedRecord})))}let matcher,originalMatcher;for(let normalizedRecord of normalizedRecords){let{path}=normalizedRecord;if(parent&&path[0]!==`/`){let parentPath=parent.record.path,connectingSlash=parentPath[parentPath.length-1]===`/`?``:`/`;normalizedRecord.path=parent.record.path+(path&&connectingSlash+path)}if(matcher=createRouteRecordMatcher(normalizedRecord,parent,options),originalRecord?originalRecord.alias.push(matcher):(originalMatcher||=matcher,originalMatcher!==matcher&&originalMatcher.alias.push(matcher),isRootAdd&&record.name&&!isAliasRecord(matcher)&&removeRoute(record.name)),isMatchable(matcher)&&insertMatcher(matcher),mainNormalizedRecord.children){let children=mainNormalizedRecord.children;for(let i=0;i{removeRoute(originalMatcher)}:noop$1}function removeRoute(matcherRef){if(isRouteName(matcherRef)){let matcher=matcherMap.get(matcherRef);matcher&&(matcherMap.delete(matcherRef),matchers.splice(matchers.indexOf(matcher),1),matcher.children.forEach(removeRoute),matcher.alias.forEach(removeRoute))}else{let index=matchers.indexOf(matcherRef);index>-1&&(matchers.splice(index,1),matcherRef.record.name&&matcherMap.delete(matcherRef.record.name),matcherRef.children.forEach(removeRoute),matcherRef.alias.forEach(removeRoute))}}function getRoutes(){return matchers}function insertMatcher(matcher){let index=findInsertionIndex(matcher,matchers);matchers.splice(index,0,matcher),matcher.record.name&&!isAliasRecord(matcher)&&matcherMap.set(matcher.record.name,matcher)}function resolve$1(location$1,currentLocation){let matcher,params={},path,name;if(`name`in location$1&&location$1.name){if(matcher=matcherMap.get(location$1.name),!matcher)throw createRouterError(ErrorTypes.MATCHER_NOT_FOUND,{location:location$1});name=matcher.record.name,params=assign(pickParams(currentLocation.params,matcher.keys.filter(k=>!k.optional).concat(matcher.parent?matcher.parent.keys.filter(k=>k.optional):[]).map(k=>k.name)),location$1.params&&pickParams(location$1.params,matcher.keys.map(k=>k.name))),path=matcher.stringify(params)}else if(location$1.path!=null)path=location$1.path,matcher=matchers.find(m=>m.re.test(path)),matcher&&(params=matcher.parse(path),name=matcher.record.name);else{if(matcher=currentLocation.name?matcherMap.get(currentLocation.name):matchers.find(m=>m.re.test(currentLocation.path)),!matcher)throw createRouterError(ErrorTypes.MATCHER_NOT_FOUND,{location:location$1,currentLocation});name=matcher.record.name,params=assign({},currentLocation.params,location$1.params),path=matcher.stringify(params)}let matched=[],parentMatcher=matcher;for(;parentMatcher;)matched.unshift(parentMatcher.record),parentMatcher=parentMatcher.parent;return{name,path,params,matched,meta:mergeMetaFields(matched)}}routes.forEach(route=>addRoute(route));function clearRoutes(){matchers.length=0,matcherMap.clear()}return{addRoute,resolve:resolve$1,removeRoute,clearRoutes,getRoutes,getRecordMatcher}}function pickParams(params,keys){let newParams={};for(let key of keys)key in params&&(newParams[key]=params[key]);return newParams}function normalizeRouteRecord(record){let normalized={path:record.path,redirect:record.redirect,name:record.name,meta:record.meta||{},aliasOf:record.aliasOf,beforeEnter:record.beforeEnter,props:normalizeRecordProps(record),children:record.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:`components`in record?record.components||null:record.component&&{default:record.component}};return Object.defineProperty(normalized,`mods`,{value:{}}),normalized}function normalizeRecordProps(record){let propsObject={},props=record.props||!1;if(`component`in record)propsObject.default=props;else for(let name in record.components)propsObject[name]=typeof props==`object`?props[name]:props;return propsObject}function isAliasRecord(record){for(;record;){if(record.record.aliasOf)return!0;record=record.parent}return!1}function mergeMetaFields(matched){return matched.reduce((meta,record)=>assign(meta,record.meta),{})}function findInsertionIndex(matcher,matchers){let lower=0,upper=matchers.length;for(;lower!==upper;){let mid=lower+upper>>1;comparePathParserScore(matcher,matchers[mid])<0?upper=mid:lower=mid+1}let insertionAncestor=getInsertionAncestor(matcher);return insertionAncestor&&(upper=matchers.lastIndexOf(insertionAncestor,upper-1)),upper}function getInsertionAncestor(matcher){let ancestor=matcher;for(;ancestor=ancestor.parent;)if(isMatchable(ancestor)&&comparePathParserScore(matcher,ancestor)===0)return ancestor}function isMatchable({record}){return!!(record.name||record.components&&Object.keys(record.components).length||record.redirect)}function useLink(props){let router$1=inject(routerKey),currentRoute=inject(routeLocationKey),route=computed(()=>{let to=unref(props.to);return router$1.resolve(to)}),activeRecordIndex=computed(()=>{let{matched}=route.value,{length}=matched,routeMatched=matched[length-1],currentMatched=currentRoute.matched;if(!routeMatched||!currentMatched.length)return-1;let index=currentMatched.findIndex(isSameRouteRecord.bind(null,routeMatched));if(index>-1)return index;let parentRecordPath=getOriginalPath(matched[length-2]);return length>1&&getOriginalPath(routeMatched)===parentRecordPath&¤tMatched[currentMatched.length-1].path!==parentRecordPath?currentMatched.findIndex(isSameRouteRecord.bind(null,matched[length-2])):index}),isActive=computed(()=>activeRecordIndex.value>-1&&includesParams(currentRoute.params,route.value.params)),isExactActive=computed(()=>activeRecordIndex.value>-1&&activeRecordIndex.value===currentRoute.matched.length-1&&isSameRouteLocationParams(currentRoute.params,route.value.params));function navigate$1(e={}){if(guardEvent(e)){let p$1=router$1[unref(props.replace)?`replace`:`push`](unref(props.to)).catch(noop$1);return props.viewTransition&&typeof document<`u`&&`startViewTransition`in document&&document.startViewTransition(()=>p$1),p$1}return Promise.resolve()}return{route,href:computed(()=>route.value.href),isActive,isExactActive,navigate:navigate$1}}function preferSingleVNode(vnodes){return vnodes.length===1?vnodes[0]:vnodes}var RouterLink=defineComponent({name:`RouterLink`,compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:`page`},viewTransition:Boolean},useLink,setup(props,{slots}){let link=reactive(useLink(props)),{options}=inject(routerKey),elClass=computed(()=>({[getLinkClass(props.activeClass,options.linkActiveClass,`router-link-active`)]:link.isActive,[getLinkClass(props.exactActiveClass,options.linkExactActiveClass,`router-link-exact-active`)]:link.isExactActive}));return()=>{let children=slots.default&&preferSingleVNode(slots.default(link));return props.custom?children:h(`a`,{"aria-current":link.isExactActive?props.ariaCurrentValue:null,href:link.href,onClick:link.navigate,class:elClass.value},children)}}});function guardEvent(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){let target=e.currentTarget.getAttribute(`target`);if(/\b_blank\b/i.test(target))return}return e.preventDefault&&e.preventDefault(),!0}}function includesParams(outer,inner){for(let key in inner){let innerValue=inner[key],outerValue=outer[key];if(typeof innerValue==`string`){if(innerValue!==outerValue)return!1}else if(!isArray(outerValue)||outerValue.length!==innerValue.length||innerValue.some((value,i)=>value!==outerValue[i]))return!1}return!0}function getOriginalPath(record){return record?record.aliasOf?record.aliasOf.path:record.path:``}var getLinkClass=(propClass,globalClass,defaultClass)=>propClass??globalClass??defaultClass,RouterViewImpl=defineComponent({name:`RouterView`,inheritAttrs:!1,props:{name:{type:String,default:`default`},route:Object},compatConfig:{MODE:3},setup(props,{attrs,slots}){let injectedRoute=inject(routerViewLocationKey),routeToDisplay=computed(()=>props.route||injectedRoute.value),injectedDepth=inject(viewDepthKey,0),depth=computed(()=>{let initialDepth=unref(injectedDepth),{matched}=routeToDisplay.value,matchedRoute;for(;(matchedRoute=matched[initialDepth])&&!matchedRoute.components;)initialDepth++;return initialDepth}),matchedRouteRef=computed(()=>routeToDisplay.value.matched[depth.value]);provide(viewDepthKey,computed(()=>depth.value+1)),provide(matchedRouteKey,matchedRouteRef),provide(routerViewLocationKey,routeToDisplay);let viewRef=ref();return watch(()=>[viewRef.value,matchedRouteRef.value,props.name],([instance$1,to,name],[oldInstance,from,oldName])=>{to&&(to.instances[name]=instance$1,from&&from!==to&&instance$1&&instance$1===oldInstance&&(to.leaveGuards.size||(to.leaveGuards=from.leaveGuards),to.updateGuards.size||(to.updateGuards=from.updateGuards))),instance$1&&to&&(!from||!isSameRouteRecord(to,from)||!oldInstance)&&(to.enterCallbacks[name]||[]).forEach(callback=>callback(instance$1))},{flush:`post`}),()=>{let route=routeToDisplay.value,currentName=props.name,matchedRoute=matchedRouteRef.value,ViewComponent=matchedRoute&&matchedRoute.components[currentName];if(!ViewComponent)return normalizeSlot(slots.default,{Component:ViewComponent,route});let routePropsOption=matchedRoute.props[currentName],component=h(ViewComponent,assign({},routePropsOption?routePropsOption===!0?route.params:typeof routePropsOption==`function`?routePropsOption(route):routePropsOption:null,attrs,{onVnodeUnmounted:vnode=>{vnode.component.isUnmounted&&(matchedRoute.instances[currentName]=null)},ref:viewRef}));return normalizeSlot(slots.default,{Component:component,route})||component}}});function normalizeSlot(slot,data){if(!slot)return null;let slotContent=slot(data);return slotContent.length===1?slotContent[0]:slotContent}var RouterView=RouterViewImpl;function createRouter(options){let matcher=createRouterMatcher(options.routes,options),parseQuery$1=options.parseQuery||parseQuery,stringifyQuery$1=options.stringifyQuery||stringifyQuery,routerHistory=options.history,beforeGuards=useCallbacks(),beforeResolveGuards=useCallbacks(),afterGuards=useCallbacks(),currentRoute=shallowRef(START_LOCATION_NORMALIZED),pendingLocation=START_LOCATION_NORMALIZED;isBrowser&&options.scrollBehavior&&`scrollRestoration`in history&&(history.scrollRestoration=`manual`);let normalizeParams=applyToParams.bind(null,paramValue=>``+paramValue),encodeParams=applyToParams.bind(null,encodeParam),decodeParams=applyToParams.bind(null,decode);function addRoute(parentOrRoute,route){let parent,record;return isRouteName(parentOrRoute)?(parent=matcher.getRecordMatcher(parentOrRoute),record=route):record=parentOrRoute,matcher.addRoute(record,parent)}function removeRoute(name){let recordMatcher=matcher.getRecordMatcher(name);recordMatcher&&matcher.removeRoute(recordMatcher)}function getRoutes(){return matcher.getRoutes().map(routeMatcher=>routeMatcher.record)}function hasRoute(name){return!!matcher.getRecordMatcher(name)}function resolve$1(rawLocation,currentLocation){if(currentLocation=assign({},currentLocation||currentRoute.value),typeof rawLocation==`string`){let locationNormalized=parseURL(parseQuery$1,rawLocation,currentLocation.path),matchedRoute$1=matcher.resolve({path:locationNormalized.path},currentLocation),href$1=routerHistory.createHref(locationNormalized.fullPath);return assign(locationNormalized,matchedRoute$1,{params:decodeParams(matchedRoute$1.params),hash:decode(locationNormalized.hash),redirectedFrom:void 0,href:href$1})}let matcherLocation;if(rawLocation.path!=null)matcherLocation=assign({},rawLocation,{path:parseURL(parseQuery$1,rawLocation.path,currentLocation.path).path});else{let targetParams=assign({},rawLocation.params);for(let key in targetParams)targetParams[key]??delete targetParams[key];matcherLocation=assign({},rawLocation,{params:encodeParams(targetParams)}),currentLocation.params=encodeParams(currentLocation.params)}let matchedRoute=matcher.resolve(matcherLocation,currentLocation),hash=rawLocation.hash||``;matchedRoute.params=normalizeParams(decodeParams(matchedRoute.params));let fullPath=stringifyURL(stringifyQuery$1,assign({},rawLocation,{hash:encodeHash(hash),path:matchedRoute.path})),href=routerHistory.createHref(fullPath);return assign({fullPath,hash,query:stringifyQuery$1===stringifyQuery?normalizeQuery(rawLocation.query):rawLocation.query||{}},matchedRoute,{redirectedFrom:void 0,href})}function locationAsObject(to){return typeof to==`string`?parseURL(parseQuery$1,to,currentRoute.value.path):assign({},to)}function checkCanceledNavigation(to,from){if(pendingLocation!==to)return createRouterError(ErrorTypes.NAVIGATION_CANCELLED,{from,to})}function push(to){return pushWithRedirect(to)}function replace(to){return push(assign(locationAsObject(to),{replace:!0}))}function handleRedirectRecord(to,from){let lastMatched=to.matched[to.matched.length-1];if(lastMatched&&lastMatched.redirect){let{redirect}=lastMatched,newTargetLocation=typeof redirect==`function`?redirect(to,from):redirect;return typeof newTargetLocation==`string`&&(newTargetLocation=newTargetLocation.includes(`?`)||newTargetLocation.includes(`#`)?newTargetLocation=locationAsObject(newTargetLocation):{path:newTargetLocation},newTargetLocation.params={}),assign({query:to.query,hash:to.hash,params:newTargetLocation.path==null?to.params:{}},newTargetLocation)}}function pushWithRedirect(to,redirectedFrom){let targetLocation=pendingLocation=resolve$1(to),from=currentRoute.value,data=to.state,force=to.force,replace$1=to.replace===!0,shouldRedirect=handleRedirectRecord(targetLocation,from);if(shouldRedirect)return pushWithRedirect(assign(locationAsObject(shouldRedirect),{state:typeof shouldRedirect==`object`?assign({},data,shouldRedirect.state):data,force,replace:replace$1}),redirectedFrom||targetLocation);let toLocation=targetLocation;toLocation.redirectedFrom=redirectedFrom;let failure;return!force&&isSameRouteLocation(stringifyQuery$1,from,targetLocation)&&(failure=createRouterError(ErrorTypes.NAVIGATION_DUPLICATED,{to:toLocation,from}),handleScroll(from,from,!0,!1)),(failure?Promise.resolve(failure):navigate$1(toLocation,from)).catch(error=>isNavigationFailure(error)?isNavigationFailure(error,ErrorTypes.NAVIGATION_GUARD_REDIRECT)?error:markAsReady(error):triggerError(error,toLocation,from)).then(failure$1=>{if(failure$1){if(isNavigationFailure(failure$1,ErrorTypes.NAVIGATION_GUARD_REDIRECT))return pushWithRedirect(assign({replace:replace$1},locationAsObject(failure$1.to),{state:typeof failure$1.to==`object`?assign({},data,failure$1.to.state):data,force}),redirectedFrom||toLocation)}else failure$1=finalizeNavigation(toLocation,from,!0,replace$1,data);return triggerAfterEach(toLocation,from,failure$1),failure$1})}function checkCanceledNavigationAndReject(to,from){let error=checkCanceledNavigation(to,from);return error?Promise.reject(error):Promise.resolve()}function runWithContext(fn){let app$1=installedApps.values().next().value;return app$1&&typeof app$1.runWithContext==`function`?app$1.runWithContext(fn):fn()}function navigate$1(to,from){let guards,[leavingRecords,updatingRecords,enteringRecords]=extractChangingRecords(to,from);guards=extractComponentsGuards(leavingRecords.reverse(),`beforeRouteLeave`,to,from);for(let record of leavingRecords)record.leaveGuards.forEach(guard=>{guards.push(guardToPromiseFn(guard,to,from))});let canceledNavigationCheck=checkCanceledNavigationAndReject.bind(null,to,from);return guards.push(canceledNavigationCheck),runGuardQueue(guards).then(()=>{guards=[];for(let guard of beforeGuards.list())guards.push(guardToPromiseFn(guard,to,from));return guards.push(canceledNavigationCheck),runGuardQueue(guards)}).then(()=>{guards=extractComponentsGuards(updatingRecords,`beforeRouteUpdate`,to,from);for(let record of updatingRecords)record.updateGuards.forEach(guard=>{guards.push(guardToPromiseFn(guard,to,from))});return guards.push(canceledNavigationCheck),runGuardQueue(guards)}).then(()=>{guards=[];for(let record of enteringRecords)if(record.beforeEnter)if(isArray(record.beforeEnter))for(let beforeEnter of record.beforeEnter)guards.push(guardToPromiseFn(beforeEnter,to,from));else guards.push(guardToPromiseFn(record.beforeEnter,to,from));return guards.push(canceledNavigationCheck),runGuardQueue(guards)}).then(()=>(to.matched.forEach(record=>record.enterCallbacks={}),guards=extractComponentsGuards(enteringRecords,`beforeRouteEnter`,to,from,runWithContext),guards.push(canceledNavigationCheck),runGuardQueue(guards))).then(()=>{guards=[];for(let guard of beforeResolveGuards.list())guards.push(guardToPromiseFn(guard,to,from));return guards.push(canceledNavigationCheck),runGuardQueue(guards)}).catch(err=>isNavigationFailure(err,ErrorTypes.NAVIGATION_CANCELLED)?err:Promise.reject(err))}function triggerAfterEach(to,from,failure){afterGuards.list().forEach(guard=>runWithContext(()=>guard(to,from,failure)))}function finalizeNavigation(toLocation,from,isPush,replace$1,data){let error=checkCanceledNavigation(toLocation,from);if(error)return error;let isFirstNavigation=from===START_LOCATION_NORMALIZED,state=isBrowser?history.state:{};isPush&&(replace$1||isFirstNavigation?routerHistory.replace(toLocation.fullPath,assign({scroll:isFirstNavigation&&state&&state.scroll},data)):routerHistory.push(toLocation.fullPath,data)),currentRoute.value=toLocation,handleScroll(toLocation,from,isPush,isFirstNavigation),markAsReady()}let removeHistoryListener;function setupListeners(){removeHistoryListener||=routerHistory.listen((to,_from,info)=>{if(!router$1.listening)return;let toLocation=resolve$1(to),shouldRedirect=handleRedirectRecord(toLocation,router$1.currentRoute.value);if(shouldRedirect){pushWithRedirect(assign(shouldRedirect,{replace:!0,force:!0}),toLocation).catch(noop$1);return}pendingLocation=toLocation;let from=currentRoute.value;isBrowser&&saveScrollPosition(getScrollKey(from.fullPath,info.delta),computeScrollPosition()),navigate$1(toLocation,from).catch(error=>isNavigationFailure(error,ErrorTypes.NAVIGATION_ABORTED|ErrorTypes.NAVIGATION_CANCELLED)?error:isNavigationFailure(error,ErrorTypes.NAVIGATION_GUARD_REDIRECT)?(pushWithRedirect(assign(locationAsObject(error.to),{force:!0}),toLocation).then(failure=>{isNavigationFailure(failure,ErrorTypes.NAVIGATION_ABORTED|ErrorTypes.NAVIGATION_DUPLICATED)&&!info.delta&&info.type===NavigationType.pop&&routerHistory.go(-1,!1)}).catch(noop$1),Promise.reject()):(info.delta&&routerHistory.go(-info.delta,!1),triggerError(error,toLocation,from))).then(failure=>{failure||=finalizeNavigation(toLocation,from,!1),failure&&(info.delta&&!isNavigationFailure(failure,ErrorTypes.NAVIGATION_CANCELLED)?routerHistory.go(-info.delta,!1):info.type===NavigationType.pop&&isNavigationFailure(failure,ErrorTypes.NAVIGATION_ABORTED|ErrorTypes.NAVIGATION_DUPLICATED)&&routerHistory.go(-1,!1)),triggerAfterEach(toLocation,from,failure)}).catch(noop$1)})}let readyHandlers=useCallbacks(),errorListeners=useCallbacks(),ready;function triggerError(error,to,from){markAsReady(error);let list=errorListeners.list();return list.length?list.forEach(handler$1=>handler$1(error,to,from)):console.error(error),Promise.reject(error)}function isReady(){return ready&¤tRoute.value!==START_LOCATION_NORMALIZED?Promise.resolve():new Promise((resolve$1$1,reject)=>{readyHandlers.add([resolve$1$1,reject])})}function markAsReady(err){return ready||(ready=!err,setupListeners(),readyHandlers.list().forEach(([resolve$1$1,reject])=>err?reject(err):resolve$1$1()),readyHandlers.reset()),err}function handleScroll(to,from,isPush,isFirstNavigation){let{scrollBehavior}=options;if(!isBrowser||!scrollBehavior)return Promise.resolve();let scrollPosition=!isPush&&getSavedScrollPosition(getScrollKey(to.fullPath,0))||(isFirstNavigation||!isPush)&&history.state&&history.state.scroll||null;return nextTick().then(()=>scrollBehavior(to,from,scrollPosition)).then(position=>position&&scrollToPosition(position)).catch(err=>triggerError(err,to,from))}let go=delta=>routerHistory.go(delta),started,installedApps=new Set,router$1={currentRoute,listening:!0,addRoute,removeRoute,clearRoutes:matcher.clearRoutes,hasRoute,getRoutes,resolve:resolve$1,options,push,replace,go,back:()=>go(-1),forward:()=>go(1),beforeEach:beforeGuards.add,beforeResolve:beforeResolveGuards.add,afterEach:afterGuards.add,onError:errorListeners.add,isReady,install(app$1){app$1.component(`RouterLink`,RouterLink),app$1.component(`RouterView`,RouterView),app$1.config.globalProperties.$router=router$1,Object.defineProperty(app$1.config.globalProperties,`$route`,{enumerable:!0,get:()=>unref(currentRoute)}),isBrowser&&!started&¤tRoute.value===START_LOCATION_NORMALIZED&&(started=!0,push(routerHistory.location).catch(err=>{}));let reactiveRoute={};for(let key in START_LOCATION_NORMALIZED)Object.defineProperty(reactiveRoute,key,{get:()=>currentRoute.value[key],enumerable:!0});app$1.provide(routerKey,router$1),app$1.provide(routeLocationKey,shallowReactive(reactiveRoute)),app$1.provide(routerViewLocationKey,currentRoute);let unmountApp=app$1.unmount;installedApps.add(app$1),app$1.unmount=function(){installedApps.delete(app$1),installedApps.size<1&&(pendingLocation=START_LOCATION_NORMALIZED,removeHistoryListener&&removeHistoryListener(),removeHistoryListener=null,currentRoute.value=START_LOCATION_NORMALIZED,started=!1,ready=!1),unmountApp()}}};function runGuardQueue(guards){return guards.reduce((promise,guard)=>promise.then(()=>runWithContext(guard)),Promise.resolve())}return router$1}function useRouter(){return inject(routerKey)}function useRoute(_name){return inject(routeLocationKey)}function spawnUiApp(appName,appId,params,apps){let props=params?params.props:null,appKey=`${appName}${appId}`;apps.push({name:appName,appId,appKey,comp:appName,props,teleport:`#${appName+appId}`})}function destroyUiApp(appName,apps){let index=apps.findIndex(x=>x.name===appName);index>-1&&apps.splice(index,1)}function registerApps(app$1,componentsMap){Object.keys(componentsMap).forEach(key=>app$1.component(key,componentsMap[key]))}var _sfc_main$325={};function _sfc_render$5(_ctx,_cache){return null}var layoutEmpty_default=__plugin_vue_export_helper_default(_sfc_main$325,[[`render`,_sfc_render$5]]);const LAYOUT_ALIGNMENTS={left:`flex-start`,right:`flex-end`,center:`center`};var _sfc_main$324={},_hoisted_1$287={class:`layout-wrapper layout-safezones`},_hoisted_2$235={class:`layout-content`};function _sfc_render$4(_ctx,_cache,$props,$setup,$data,$options){return openBlock(),createElementBlock(`div`,_hoisted_1$287,[createBaseVNode(`div`,_hoisted_2$235,[renderSlot(_ctx.$slots,`default`,{},()=>[_cache[0]||=createTextVNode(`Content here`,-1)])])])}var layoutSingle_default=__plugin_vue_export_helper_default(_sfc_main$324,[[`render`,_sfc_render$4]]);const useEvents=(onDispose=onBeforeUnmount)=>{let bridge$4=useBridge(),events$3={_on:{},_once:{},on(name,func){name in events$3._on||(events$3._on[name]=[]),events$3._on[name].indexOf(func)===-1&&(bridge$4.events.on(name,func),events$3._on[name].push(func))},once(name,func){name in events$3._once||(events$3._once[name]=[]),events$3._once[name].indexOf(func)===-1&&(bridge$4.events.once(name,()=>{let idx=events$3._once[name].indexOf(func);idx>-1&&events$3._once[name].splice(idx,1)}),bridge$4.events.once(name,func),events$3._once[name].push(func))},off(name=void 0,func=void 0){if(!name){for(let name$1 in events$3._on){for(let func$1 of events$3._on[name$1])bridge$4.events.off(name$1,func$1);delete events$3._on[name$1]}return}if(name in events$3._on)if(func){let idx=events$3._on[name].indexOf(func);idx>-1&&(bridge$4.events.off(name,func),events$3._on[name].splice(idx,1)),events$3._on[name].length===0&&delete events$3._on[name]}else{for(let func$1 of events$3._on[name])bridge$4.events.off(name,func$1);delete events$3._on[name]}},emit(name,...values){bridge$4.events.emit(name,...values)}};return onDispose(()=>{for(let type of[`_on`,`_once`])for(let name in events$3[type]){for(let func of events$3[type][name])bridge$4.events.off(name,func);delete events$3[type][name]}}),events$3},useStreams=(names,callback,onDispose=onBeforeUnmount)=>{let bridge$4=useBridge(),enabled=!1,streams={on(){enabled||(enabled=!0,bridge$4.streams.add(names),bridge$4.events.on(`onStreamsUpdate`,callback))},off(){enabled&&(enabled=!1,bridge$4.streams.remove(names),bridge$4.events.off(`onStreamsUpdate`,callback))}};return streams.on(),onDispose(streams.off),streams};var hints_default=`ui.hints.quickSteerResponse,ui.hints.raceBrakesEffectiveness,ui.hints.quickCameraMovement,ui.hints.grabVehicleParts,ui.hints.funStabilityControl,ui.hints.recoverVehicle,ui.hints.oldCarsBurn,ui.hints.smokingWheels,ui.hints.carsBurnFuel,ui.hints.delicateCars,ui.hints.stabilityControlPresent,ui.hints.absWasOptional,ui.hints.installRollCage,ui.hints.spatialNavigation,ui.hints.repairHood,ui.hints.slowMotionPhysics,ui.hints.removeRearSeats,ui.hints.tuning,ui.hints.customLicensePlate,ui.hints.driveAtNight,ui.hints.moonGravity,ui.hints.unlockExtraFunctionality,ui.hints.playMultiseat,ui.hints.increaseGroundClearance,ui.hints.tiresBurstOnBumps,ui.hints.blueSmokeIsPistonDamage,ui.hints.keepTheEngineUpright,ui.hints.thermalDebugApp,ui.hints.rollPitchApps,ui.hints.cruiseControlApp,ui.hints.driveTheCanon,ui.hints.vehicleSkins,ui.hints.toggleMods,ui.hints.importveFramerate,ui.hints.photoModeMenu,ui.hints.publishScreenshots,ui.hints.towTrailer,ui.hints.brakesAndSteeringVary,ui.hints.countersteerEarly,ui.hints.startSlow,ui.hints.parkingbrakeForTurning,ui.hints.carefulWithOldSportsCars,ui.hints.corneringWithKeyboard,ui.hints.adaptToBadRoads,ui.hints.notAllCarsCanRace,ui.hints.changeBrakePads,ui.hints.useTurnSignals,ui.hints.showStandalonePcs,ui.hints.tweakFOV,ui.hints.driveWithMouse,ui.hints.liftOffOversteer,ui.hints.snapOversteer,ui.hints.slideBackWithParkingBrake,ui.hints.customizeSpecializedBindings,ui.hints.toggleFogLights,ui.hints.toggleLightBars,ui.hints.TrackIRSupported,ui.hints.chooseShiftingMode,ui.hints.saveRestoreVehicleHome,ui.hints.switchVehicle,ui.hints.coolantVaporizes,ui.hints.dontRunIntoTheCar`.split(`,`),_hoisted_1$286={key:0,class:`progress-box`},_hoisted_2$234={class:`progress-icon-group`},_hoisted_3$208={class:`progress-bar-container`},_hoisted_4$178={class:`progress-status`},_hoisted_5$153={class:`progress-history`},_hoisted_6$132={class:`custom-left-container`},_hoisted_7$118={key:0,class:`custom-text-panel`},_hoisted_8$99={key:1,class:`text`},_hoisted_9$89={key:1,class:`custom-indeterminate-panel`},_hoisted_10$77={class:`custom-right-container`},_hoisted_11$69={key:2,class:`tips-bar`},_hoisted_12$57={class:`tips-bar-title`},_hoisted_13$49={class:`tips-bar-tip`},_hoisted_14$44={key:0,class:`loading-cache`},_hoisted_15$42=[`src`],imagesAmount=18,activeRepeatTime=1e4,fadeInDefault=1e3,fadeOutDefault=2e3,_sfc_main$323={__name:`LoadingScreen`,setup(__props){useCssVars(_ctx=>({v79c091d8:fadeInTimeVar.value,v07559aed:fadeOutTimeVar.value}));let events$3=useEvents(),{lua}=useBridge(),navBlocker=useUINavBlocker(),lastImageNum=-1,repeatTimer=null,customTimer=null,iconsList=[{id:`terrain`,icon:icons.terrain},{id:`environment`,icon:icons.water},{id:`forest`,icon:icons.trafficCone},{id:`meshes`,icon:icons.garage01},{id:`roads`,icon:icons.road},{id:`beamng`,icon:icons.beamNG}],state=reactive({active:!1,visible:!1,fading:!1,shown:!1,autoActivate:!0,highSeas:!1,mode:`progress`,image:null,iconState:{},currentEntries:[],historyEntriesDisplay:[],customContent:null,fadeInTime:fadeInDefault,fadeOutTime:fadeOutDefault,customPause:-1});function resetState(){state.mode=`progress`,state.customContent=null,state.iconState={},state.currentEntries=[],state.historyEntriesDisplay=[],state.fadeInTime=fadeInDefault,state.fadeOutTime=fadeOutDefault,state.customPause=-1}let tip=ref(``),setTip=(txt=void 0,_retrying=!1)=>{let idx=~~(Math.random()*hints_default.length);tip.value=txt||hints_default[idx],(!tip.value||tip.value===`undefined`)&&(logger_default.debug(`Loading Screen tip is undefined!\nARG: ${JSON.stringify(txt)} TIP: ${JSON.stringify(tip.value)} IDX: ${idx}/${hints_default.length}`),_retrying?tip.value=``:setTip(void 0,!0))},fadeInTimeVar=computed(()=>state.fadeInTime+`ms`),fadeOutTimeVar=computed(()=>state.fadeOutTime+`ms`),progressValue=computed(()=>state.currentEntries[0]?.progress||0),currentStatus=computed(()=>state.currentEntries[0]?.message||``);events$3.on(`LoadingScreen`,data=>{if(window.beamng?.ingame){if((!data||typeof data!=`object`)&&(data={}),state.autoActivate=!1,state.active=!!data.active,data.custom&&(state.mode=`custom`,state.fadeInTime=data.custom.fadeIn>0?data.custom.fadeIn*1e3:state.fadeInTime||0,state.fadeOutTime=data.custom.fadeOut>0?data.custom.fadeOut*1e3:state.fadeOutTime||0),state.active)data.custom?(state.customPause=data.custom.pause?data.custom.pause*1e3:-1,state.customContent=data.custom.data,state.customContent?.image&&(state.image=state.customContent.image)):(resetState(),window.bngVue.gotoAngularState(`blank`)),setTip(state.customContent?.tips);else if(state.mode===`progress`&&`gotoMainMenu`in data){let args=[];data.gotoMainMenu?args.push(`menu.mainmenu`):args.push(`menu`,[`loading`]),window.globalAngularRootScope?.$broadcast(`ChangeState`,...args),window.vueEventBus?.emit(`onChangeState`,...args)}}}),events$3.on(`UpdateLoadingProgressV2`,data=>{if(!window.beamng?.ingame||!state.autoActivate&&!state.active)return;let{currentEntries,historyEntries}=data;(!currentEntries||!Array.isArray(currentEntries))&&(currentEntries=[]),(!historyEntries||!Array.isArray(historyEntries))&&(historyEntries=[]),state.currentEntries=currentEntries,state.historyEntriesDisplay=historyEntries.slice(Math.max(historyEntries.length-3,1)),state.iconState={};for(let{name,progress}of currentEntries)state.iconState[name.toLowerCase()]=progress;for(let{name}of historyEntries)state.iconState[name.toLowerCase()]=100;state.autoActivate&&(state.active=currentEntries.length>0||historyEntries.length>0)});let onFadeIn=()=>{state.fading=!1,state.mode===`progress`?(lua.core_gamestate.loadingScreenActive(),repeatTimer=setTimeout(()=>{lua.core_gamestate.loadingScreenActive()},activeRepeatTime)):state.mode===`custom`&&(lua.extensions.ui_fadeScreen.onScreenFadeStateDelayed(1),state.customPause!==-1&&(customTimer=setTimeout(()=>{lua.extensions.ui_fadeScreen.onScreenFadeStateDelayed(2)},state.customPause*1e3)))},onFadeOut=()=>{state.fading=!1,state.shown=!1,state.mode===`custom`&&lua.extensions.ui_fadeScreen.onScreenFadeStateDelayed(3),resetState(),loadNextImage()};watch(()=>state.active,(newActive,oldActive)=>{window.beamng?.ingame&&(newActive&&!oldActive?activateLoading():!newActive&&oldActive&&deactivateLoading())});let activateLoading=()=>{state.active&&(deactivateLoading.cancel(),navBlocker.allowOnly([]),nextTick(()=>{state.visible=!0,state.fading=!0,state.shown=!0}))},deactivateLoading=debounce(()=>{state.active||(clearTimers(),navBlocker.clear(),nextTick(()=>{state.visible=!1,state.fading=!0}))},100),getRandomImageNum=()=>{let rnd=~~(Math.random()*imagesAmount)+1;return rnd===lastImageNum?getRandomImageNum():(lastImageNum=rnd,rnd)},getNextImageUrl=()=>{let url;return url=state.highSeas?`images/mainmenu/unofficial_version.jpg`:`images/loading/drive/${getRandomImageNum()}.jpg`,getAssetURL(url)},loadNextImage=async()=>{let url=getNextImageUrl();state.image!==url&&(await loadImage$1(url),state.image=url)},loadImage$1=url=>new Promise((resolve$1,reject)=>{let img=new Image;img.onload=()=>resolve$1(url),img.onerror=()=>reject(url),img.src=url}),clearTimers=()=>{repeatTimer&&=(clearTimeout(repeatTimer),null),customTimer&&=(clearTimeout(customTimer),null)},initLoadingScreen=()=>bngApi.engineLua(`sailingTheHighSeas`,async ahoy=>{state.highSeas=ahoy===!0,await loadNextImage(),setTip(),lua.core_gamestate.loadingScreenActive(),window.loadingTest=active=>{events$3.emit(`LoadingScreen`,{active})}});return onMounted(()=>{linkLoadingScreenState(state),initLoadingScreen()}),onUnmounted(()=>clearTimers()),(_ctx,_cache)=>(openBlock(),createElementBlock(Fragment,null,[createVNode(Transition,{name:`loading-fade`,onAfterEnter:onFadeIn,onAfterLeave:onFadeOut},{default:withCtx(()=>[state.visible?(openBlock(),createElementBlock(`dialog`,{key:0,open:``,class:normalizeClass([`loading-screen`,`loading-screen-${state.mode}`])},[createBaseVNode(`div`,{class:`loading-background`,style:normalizeStyle({backgroundImage:state.image?`url('${state.image}')`:`none`})},null,4),state.mode===`progress`?(openBlock(),createElementBlock(`div`,_hoisted_1$286,[createBaseVNode(`div`,_hoisted_2$234,[(openBlock(),createElementBlock(Fragment,null,renderList(iconsList,iconInfo=>createBaseVNode(`div`,{key:iconInfo.id,class:`progress-icon-box`,style:normalizeStyle({backgroundPosition:`0 ${state.iconState[iconInfo.id]||0}%`})},[createVNode(unref(bngIcon_default),{type:iconInfo.icon,color:`#fff`,class:`progress-icon`},null,8,[`type`])],4)),64))]),createBaseVNode(`div`,_hoisted_3$208,[createVNode(unref(bngProgressBar_default),{class:`progress-bar`,gradient:``,"show-value-label":!1,min:0,max:100,value:progressValue.value},null,8,[`value`])]),createBaseVNode(`div`,_hoisted_4$178,toDisplayString(currentStatus.value||_ctx.$tt(`ui.common.loading`)),1),createBaseVNode(`div`,_hoisted_5$153,[(openBlock(!0),createElementBlock(Fragment,null,renderList(state.historyEntriesDisplay,(item,idx)=>(openBlock(),createElementBlock(`div`,{key:idx},toDisplayString(item.message),1))),128))])])):createCommentVNode(``,!0),state.mode===`custom`?(openBlock(),createElementBlock(`div`,{key:1,class:normalizeClass([`custom-box`,{"custom-with-tips":state.customContent?.tips}])},[createBaseVNode(`div`,_hoisted_6$132,[state.customContent&&(state.customContent.title||state.customContent.text)?(openBlock(),createElementBlock(`div`,_hoisted_7$118,[state.customContent.title?(openBlock(),createBlock(unref(bngScreenHeading_default),{key:0,preheadings:[_ctx.$tt(state.customContent.subtitle)]},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$tt(state.customContent.title)),1)]),_:1},8,[`preheadings`])):createCommentVNode(``,!0),state.customContent.text?(openBlock(),createElementBlock(`p`,_hoisted_8$99,[createVNode(unref(dynamicComponent_default),{"translate-id":state.customContent.text,bbcode:``,"translate-context":``},null,8,[`translate-id`])])):createCommentVNode(``,!0)])):(openBlock(),createElementBlock(`div`,_hoisted_9$89,[createVNode(unref(bngScreenHeading_default),null,{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$tt(`ui.common.loading.short`)),1)]),_:1}),createVNode(unref(bngProgressBar_default),{class:`progress-bar`,gradient:``,"show-value-label":!1,min:0,max:100,indeterminate:``})]))]),createBaseVNode(`div`,_hoisted_10$77,[state.customContent&&state.customContent.image?(openBlock(),createElementBlock(`div`,{key:0,class:`custom-image-panel`,style:normalizeStyle({backgroundImage:`url('${state.customContent.image}')`})},null,4)):createCommentVNode(``,!0)])],2)):createCommentVNode(``,!0),state.mode===`progress`||state.customContent?.tips?(openBlock(),createElementBlock(`div`,_hoisted_11$69,[createBaseVNode(`div`,_hoisted_12$57,toDisplayString(_ctx.$tt(`ui.loadingScreen.tips`))+`:`,1),createBaseVNode(`div`,_hoisted_13$49,[createVNode(unref(dynamicComponent_default),{"translate-id":tip.value,bbcode:``},null,8,[`translate-id`])])])):createCommentVNode(``,!0)],2)):createCommentVNode(``,!0)]),_:1}),state.image?(openBlock(),createElementBlock(`div`,_hoisted_14$44,[createBaseVNode(`img`,{src:state.image,alt:``},null,8,_hoisted_15$42)])):createCommentVNode(``,!0)],64))}},LoadingScreen_default=__plugin_vue_export_helper_default(_sfc_main$323,[[`__scopeId`,`data-v-2f135df0`]]),_hoisted_1$285={class:`pause-button-wrapper`},_sfc_main$322={__name:`pauseButton`,props:{teleportTo:[String,Object]},setup(__props){let route=useRoute(),events$3=useEvents(),gameContext=useGameContextStore(),isGamePaused=ref(!1),physicsMaybePaused=ref(!1),replayActive=ref(!1),replayPaused=ref(!1);events$3.on(`physicsStateChanged`,state=>{physicsMaybePaused.value=!state}),events$3.on(`replayStateChanged`,core_replay=>{replayActive.value=core_replay.state===`playback`,replayPaused.value=replayActive.value&&core_replay.paused}),events$3.on(`simTimeAuthority.pauseStateChanged`,data=>{isGamePaused.value=data.paused});let isInMenu=computed(()=>route.name?.startsWith(`menu`)&&!gameContext.activities?.length&&sysInfo_default.gameState.value!==void 0&&sysInfo_default.gameState.value!==`loading`),isPhysicsPaused=computed(()=>physicsMaybePaused.value),isReplayPaused=computed(()=>replayActive.value&&replayPaused.value),showPauseButton=computed(()=>isInMenu.value||isPhysicsPaused.value||isReplayPaused.value),isPaused=computed(()=>isGamePaused.value||isPhysicsPaused.value||isReplayPaused.value),buttonState=computed(()=>isInMenu.value&&isPaused.value?`menu-paused`:isInMenu.value?`menu`:isPaused.value?`paused`:`default`),togglePause=()=>{Lua_default.simTimeAuthority.togglePause()};return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$285,[(openBlock(),createBlock(Teleport,{disabled:!__props.teleportTo,to:__props.teleportTo},[withDirectives((openBlock(),createBlock(unref(bngButton_default),{class:normalizeClass([`pause-button`,buttonState.value]),accent:unref(ACCENTS).custom,"no-sound":``,onClick:togglePause,"bng-no-nav":``},{default:withCtx(()=>[createVNode(unref(bngBinding_default),{class:`pause-button-binding-bg`,action:`pause`}),createVNode(unref(bngIcon_default),{class:`pause-button-icon`,type:isPaused.value?unref(icons).pause:unref(icons).play},null,8,[`type`])]),_:1},8,[`class`,`accent`])),[[vShow,showPauseButton.value],[unref(BngTooltip_default),_ctx.$tt(`ui.inputActions.general.pause.title`),void 0,{bottom:!0}]])],8,[`disabled`,`to`]))]))}},pauseButton_default=__plugin_vue_export_helper_default(_sfc_main$322,[[`__scopeId`,`data-v-ea9a26b4`]]),UIAppStorage,setupDone;const useUIApps=()=>(setupDone||setup(),service);var setup=()=>{UIAppStorage||=window.UIAppStorage,setupDone=!!UIAppStorage},setLayout=layoutName=>{layoutName==`blank`?_broadcast(`appContainer:clear`):_broadcast(`appContainer:loadLayoutByType`,layoutName)},setVisible=state=>{_broadcast(`ShowApps`,!!state)},service={setLayout,setVisible,get currentLayout(){return UIAppStorage.currentLayout}},_broadcast=(...params)=>{window.globalAngularRootScope&&window.globalAngularRootScope.$broadcast(...params)},_sfc_main$321={};function _sfc_render$3(_ctx,_cache){return openBlock(),createElementBlock(`span`)}var NotFound_default=__plugin_vue_export_helper_default(_sfc_main$321,[[`render`,_sfc_render$3]]);function useGridSelector(backendName=`gridSelector`,defaultPath={keys:[`missions`]},defaultDetailsMode=`detail`){let currentPath=ref(defaultPath),previousPath=ref(null),groups=ref([]),filterList=ref([]),filterByProp=ref([]),commonFilters=ref([]),lockedFiltersByProp=ref([]),activeFilters=ref([]),onlyCommonFilters=ref(!0),detailsMode=ref(defaultDetailsMode),selectedItem=ref(null),selectedItemDetails=ref(null),prevSelectedItem=ref(null),previewItem=ref(null),previewItemDetails=ref(null),managementDetails=ref(null),autoFocusKey=ref(null),showScreenHeader=ref(!0),screenHeaderTitle=ref(`Grid Selector`),screenHeaderPath=ref([{text:`Menu`,gotoAngularState:`menu`}]),{events:events$3}=useBridge(),backFromDetailsCallback=null,refreshAllHandler=backendName$1=>{backendName$1===backendName$1&&(logger_default.debug(`gridSelectorRefreshAll`),loadTiles(),loadFilters(),loadManagementDetails())},refreshCurrentItemDetailsHandler=backendName$1=>{backendName$1===backendName$1&&(logger_default.debug(`gridSelectorRefreshCurrentItemDetails`),setSelectedItem(selectedItem.value))};events$3.on(`gridSelectorRefreshAll`,refreshAllHandler),events$3.on(`gridSelectorRefreshCurrentItemDetails`,refreshCurrentItemDetailsHandler);let log=(...args)=>{},displayData=ref([]),searchText$1=ref(``);async function getSearchText(){try{let data=await Lua_default.ui_gridSelector.getSearchText(backendName);return searchText$1.value=data||``,data||``}catch(error){return logger_default.error(`Failed to get search text:`,error),``}}async function setSearchText(value){try{await Lua_default.ui_gridSelector.setSearchText(backendName,value),searchText$1.value=value||``,await loadTiles(),await loadFilters(),await updateScreenHeaderData()}catch(error){logger_default.error(`Failed to set search text:`,error)}}let isInitializing=ref(!1),safeArray=arr=>Array.isArray(arr)?arr:[];async function setCurrentPath(path){currentPath.value=path,await loadTiles()}async function loadTiles(){currentPath.value;try{let data=await Lua_default.ui_gridSelector.getTiles(backendName,currentPath.value,previousPath.value!==currentPath.value);if(Lua_default.ui_gridSelector.profilerFinish(backendName,`received lua data on UI`),groups.value=safeArray(data),groups.value,!selectedItem.value&&(detailsMode.value===`advanced`||detailsMode.value===`detail`)&&previousPath.value!==currentPath.value)for(let group of groups.value)for(let tile of group.tiles)tile.isDefaultSelected&&(autoFocusKey.value=tile.key,tile.name,tile.forceAutoFocus&&backFromDetailsCallback());previousPath.value=currentPath.value,Lua_default.ui_gridSelector.profilerFinish(backendName,`loaded tiles into reactive state`)}catch(error){logger_default.error(`Failed to load tiles:`,error)}}async function loadFilters(){try{let data=await Lua_default.ui_gridSelector.getFilters(backendName);filterList.value=safeArray(data.filterList),filterByProp.value=data.filterByProp,commonFilters.value=safeArray(data.commonFilters)||[],lockedFiltersByProp.value=data.lockedFiltersByProp||[],activeFilters.value=safeArray(data.activeFilters),onlyCommonFilters.value=data.onlyCommonFilters,filterList.value,filterByProp.value,activeFilters.value,onlyCommonFilters.value}catch(error){logger_default.error(`Failed to load filters:`,error)}}async function loadManagementDetails(){try{managementDetails.value=await Lua_default.ui_gridSelector.getManagementDetails(backendName),managementDetails.value}catch(error){logger_default.error(`Failed to load management details:`,error)}}async function toggleFilter(propName,option){try{await Lua_default.ui_gridSelector.toggleFilter(backendName,propName,option),await loadFilters(),await loadTiles(),await updateScreenHeaderData()}catch(error){logger_default.error(`Failed to toggle filter:`,error)}}async function updateRangeFilter(propName,min$1,max$1){try{await Lua_default.ui_gridSelector.updateRangeFilter(backendName,propName,min$1,max$1),await loadFilters(),await loadTiles(),await updateScreenHeaderData()}catch(error){logger_default.error(`Failed to update range filter:`,error)}}async function resetRangeFilter(propName){console.log(`Resetting range filter:`,propName);try{await Lua_default.ui_gridSelector.resetRangeFilter(backendName,propName),await loadFilters(),await loadTiles(),await updateScreenHeaderData()}catch(error){logger_default.error(`Failed to reset range filter:`,error)}}async function resetSetFilter(propName){try{await Lua_default.ui_gridSelector.resetSetFilter(backendName,propName),await loadFilters(),await loadTiles(),await updateScreenHeaderData()}catch(error){logger_default.error(`Failed to reset set filter:`,error)}}async function loadDisplayData(){try{displayData.value=safeArray(await Lua_default.ui_gridSelector.getDisplayDataOptions(backendName));let searchOption=displayData.value.find(option=>option.key===`searchText`);searchOption&&(searchText$1.value=searchOption.value||``),displayData.value}catch(error){logger_default.error(`Failed to load display data:`,error)}}async function updateDisplayData(key,value){try{await Lua_default.ui_gridSelector.setDisplayDataOption(backendName,key,value),await loadDisplayData(),await loadTiles(),await updateScreenHeaderData()}catch(error){logger_default.error(`Failed to update display data:`,error)}}async function resetDisplayDataToDefaults(){try{await Lua_default.ui_gridSelector.resetDisplayDataToDefaults(backendName),await loadDisplayData(),await loadTiles(),await updateScreenHeaderData()}catch(error){logger_default.error(`Failed to reset display data to defaults:`,error)}}function setDetailsMode(mode){detailsMode.value=mode}async function setSelectedItem(item){if(!item||!item.showDetails){autoFocusKey.value=null,selectedItem.value=null,selectedItemDetails.value=null,await loadManagementDetails();return}try{item.showDetails;let details=await Lua_default.ui_gridSelector.getDetails(backendName,item.showDetails);autoFocusKey.value=item.key,selectedItem.value=item,selectedItemDetails.value=details,details?.paintData&&details?.paints&&selectedItemDetails.value?.paints&&(selectedItemDetails.value.paints.multiPaintSetups=safeArray(selectedItemDetails.value.paints.multiPaintSetups),selectedItemDetails.value.paints.factoryPaints=safeArray(selectedItemDetails.value.paints.factoryPaints)),setDetailsMode(`detail`)}catch(error){logger_default.error(`Failed to get item details:`,error),autoFocusKey.value=null,selectedItem.value=item,selectedItemDetails.value=null}}async function clearSelectedItem(){selectedItem.value=null,selectedItemDetails.value=null,await loadManagementDetails()}async function setPreviewItem(item){if(!item||!item.showDetails){previewItem.value=null,previewItemDetails.value=null;return}try{let details=await Lua_default.ui_gridSelector.getDetails(backendName,item.showDetails);previewItem.value=item,previewItemDetails.value=details,setDetailsMode(`detail`)}catch{previewItem.value=item,previewItemDetails.value=null}}function clearPreviewItem(){previewItem.value=null,previewItemDetails.value=null}let activeItem=computed(()=>selectedItem.value||previewItem.value),activeItemDetails=computed(()=>selectedItem.value?selectedItemDetails.value:previewItemDetails.value);async function executeButton(buttonId,additionalData){try{if(additionalData?.waitForLoadingScreen)window.vueEventBus?.emit(`LoadingScreen`,{active:!0}),await startLoading(async()=>{await waitForLoadingScreenFadeIn();let data=await Lua_default.ui_gridSelector.executeButton(backendName,buttonId,additionalData);data&&data.gotoPath&&setCurrentPath(data.gotoPath)});else{let data=await Lua_default.ui_gridSelector.executeButton(backendName,buttonId,additionalData);data&&data.gotoPath&&setCurrentPath(data.gotoPath)}}catch(error){logger_default.error(`Failed to execute button:`,error)}}let executeButtonHandler=(backendName$1,buttonId,additionalData)=>{backendName$1===backendName$1&&executeButton(buttonId,additionalData)};events$3.on(`gridSelectorExecuteButton`,executeButtonHandler);async function toggleFavourite(item){await Lua_default.ui_gridSelector.toggleFavourite(backendName,item.showDetails);let details=await Lua_default.ui_gridSelector.getDetails(backendName,item.showDetails);selectedItem.value=item,selectedItemDetails.value=details,await loadTiles()}function clearSearch(){setSearchText(``)}function updateSearch(newSearchText){setSearchText(newSearchText||``)}function commitSearch(){setSearchText(searchText$1.value||``)}function isFilterLocked(propName,option=null){return lockedFiltersByProp.value[propName]?option?lockedFiltersByProp.value[propName][option]!==void 0:Object.keys(lockedFiltersByProp.value[propName]).length>0:!1}async function updateScreenHeaderData(){try{let headerData=await Lua_default.ui_gridSelector.getScreenHeaderTitleAndPath(backendName,currentPath.value);screenHeaderTitle.value=headerData.title||`Grid Selector`,screenHeaderPath.value=headerData.pathSegments}catch(error){logger_default.error(`Failed to update screen header title:`,error),screenHeaderTitle.value=`Grid Selector`,screenHeaderPath.value=[{text:`Menu`,gotoAngularState:`menu`}]}}function isFilterOptionLocked(propName,option){return isFilterLocked(propName,option)}function isRangeFilterLocked(propName){return isFilterLocked(propName)}watch(currentPath,()=>{clearSelectedItem(),clearPreviewItem(),updateScreenHeaderData()}),watch([filterByProp,activeFilters],()=>{clearSelectedItem(),clearPreviewItem(),updateScreenHeaderData()}),watch(displayData,()=>{updateScreenHeaderData()},{deep:!0});function notifyUIReady(tag){Lua_default.ui_gridSelector.profilerFinish(backendName,tag)}function setOnBackFromDetailsCallback(callback){backFromDetailsCallback=callback}async function initialize(){if(!isInitializing.value)try{isInitializing.value=!0,await Promise.all([loadFilters(),loadDisplayData(),loadManagementDetails(),getSearchText()])}catch(error){logger_default.error(`Failed to initialize GridSelector composable:`,error)}finally{isInitializing.value=!1}}return onUnmounted(()=>{logger_default.debug(`GridSelector composable unmounting`),events$3.off(`gridSelectorRefreshAll`,refreshAllHandler),events$3.off(`gridSelectorRefreshCurrentItemDetails`,refreshCurrentItemDetailsHandler),events$3.off(`gridSelectorExecuteButton`,executeButtonHandler)}),{groups,filterList,filterByProp,lockedFiltersByProp,commonFilters,activeFilters,onlyCommonFilters,displayData,currentPath,detailsMode,selectedItem,selectedItemDetails,prevSelectedItem,previewItem,previewItemDetails,activeItem,activeItemDetails,managementDetails,isInitializing,searchText:searchText$1,getSearchText,setSearchText,autoFocusKey,showScreenHeader,screenHeaderTitle,screenHeaderPath,initialize,setCurrentPath,loadTiles,loadFilters,loadManagementDetails,toggleFilter,updateRangeFilter,resetRangeFilter,resetSetFilter,loadDisplayData,updateDisplayData,resetDisplayDataToDefaults,setDetailsMode,setSelectedItem,clearSelectedItem,setPreviewItem,clearPreviewItem,executeButton,notifyUIReady,isFilterLocked,isFilterOptionLocked,isRangeFilterLocked,toggleFavourite,clearSearch,updateSearch,commitSearch,updateScreenHeaderData,exploreFolder:function(path){Lua_default.ui_gridSelector.exploreFolder(backendName,path)},goToMod:function(modId){Lua_default.ui_gridSelector.goToMod(backendName,modId)},setOnBackFromDetailsCallback}}var _hoisted_1$284=[`bng-scoped-nav-autofocus`],_hoisted_2$233={class:`image-container`},_hoisted_3$207={key:0,class:`sub-element-count-badge`},_hoisted_4$177={class:`item-label`},_hoisted_5$152={class:`item-name`},_hoisted_6$131={class:`icons-container`},_hoisted_7$117=[`src`],_hoisted_8$98={key:0,class:`sub-element-count-badge`},_hoisted_9$88={key:1},sizes={tiny:{width:7.5,margin:.5,fontSize:.8},small:{width:9.5,margin:.5,fontSize:1},medium:{width:12,margin:.5,fontSize:1},large:{width:16,margin:.5,fontSize:1},huge:{width:20,margin:.5,fontSize:1.5},list:{width:22,height:3,margin:.5,fontSize:.9}},thumbAspectRatio=16/9.5,captionHeightEm=2,getSizeCalc=displaySize=>ctx=>{let size$3=sizes[displaySize]||sizes.medium;if(displaySize===`list`)return{width:size$3.width,height:size$3.height,margin:size$3.margin};let height$1=size$3.width/thumbAspectRatio+size$3.fontSize*captionHeightEm-size$3.margin*2;return{width:size$3.width,height:height$1,margin:size$3.margin}},__default__$6={getSizeCalc},_sfc_main$320=Object.assign(__default__$6,{__name:`Tile`,props:{tile:{type:Object,required:!0},isFavourite:Boolean,isConfig:Boolean,displaySize:String,tileImagesTopAligned:{type:Boolean,default:!1}},emits:[`focus`,`blur`,`click`,`dblclick`],setup(__props,{expose:__expose,emit:__emit}){let{showIfController}=storeToRefs(controls_default()),props=__props,gridSelectionState=inject(`gridSelectionState`,null),state=computed(()=>{let res={selected:!1,dimmed:!1,isAutoFocused:!1};return gridSelectionState&&gridSelectionState.value&&(res.selected=gridSelectionState.value.inDetails&&gridSelectionState.value.activeItemKey===props.tile.key,res.dimmed=showIfController.value&&gridSelectionState.value.inDetails&&gridSelectionState.value.activeItemKey!==props.tile.key,res.isAutoFocused=gridSelectionState.value.autoFocusKey===props.tile.key),res}),emit$1=__emit,elTile=ref(null);__expose({getElement:()=>elTile.value});let isListItem=computed(()=>props.displaySize===`list`);function onClick(){emit$1(`click`)}function onFocus(){emit$1(`focus`)}function onBlur(){emit$1(`blur`)}return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,{class:normalizeClass([`tile-wrapper`,`tile-size-${__props.displaySize}`]),style:normalizeStyle({"--tile-font-size":sizes[__props.displaySize].fontSize+`em`})},[_cache[0]||=createBaseVNode(`div`,{class:`tile-bg`},null,-1),withDirectives((openBlock(),createElementBlock(`div`,{ref_key:`elTile`,ref:elTile,"bng-scoped-nav-autofocus":state.value.isAutoFocused,class:normalizeClass({tile:!0,selected:state.value.selected,dimmed:state.value.dimmed,auxiliary:__props.tile.isAuxiliary,"is-career-only":__props.tile.isCareerOnly}),onClick:withModifiers(onClick,[`stop`]),onFocus,onBlur,"bng-nav-item":``},[createBaseVNode(`div`,_hoisted_2$233,[createVNode(unref(bngImage_default),{class:normalizeClass([`item-image`,{"top-aligned":__props.tileImagesTopAligned}]),src:__props.tile.preview},null,8,[`class`,`src`]),isListItem.value?createCommentVNode(``,!0):(openBlock(),createElementBlock(Fragment,{key:0},[!__props.isConfig&&__props.tile.subElementCount>=1?(openBlock(),createElementBlock(`div`,_hoisted_3$207,toDisplayString(__props.tile.subElementCount),1)):createCommentVNode(``,!0),__props.isFavourite||__props.tile.showFavouriteIconPercent>=1?(openBlock(),createBlock(unref(bngIcon_default),{key:1,class:`favorite-indicator`,type:`star`})):createCommentVNode(``,!0)],64))]),createBaseVNode(`div`,_hoisted_4$177,[createBaseVNode(`span`,_hoisted_5$152,toDisplayString(__props.tile.name),1),createBaseVNode(`div`,_hoisted_6$131,[__props.tile.sourceIcons?(openBlock(!0),createElementBlock(Fragment,{key:0},renderList(__props.tile.sourceIcons,sourceIcon=>(openBlock(),createElementBlock(Fragment,{key:sourceIcon},[sourceIcon.icon?(openBlock(),createBlock(unref(bngIcon_default),{key:0,type:sourceIcon.icon,class:`source-icon`,color:`var(--bng-cool-gray-100)`},null,8,[`type`])):createCommentVNode(``,!0),sourceIcon.svg?(openBlock(),createElementBlock(`img`,{key:1,class:`svg-icon`,src:sourceIcon.svg,alt:``},null,8,_hoisted_7$117)):createCommentVNode(``,!0)],64))),128)):createCommentVNode(``,!0),isListItem.value&&__props.tile.showFavouriteIconPercent>0?(openBlock(),createBlock(unref(bngIcon_default),{key:1,class:`favorite-indicator`,type:__props.tile.showFavouriteIconPercent>=1?`star`:`starSecondary`},null,8,[`type`])):createCommentVNode(``,!0)]),isListItem.value&&!__props.isConfig&&__props.tile.subElementCount>=1?(openBlock(),createElementBlock(`span`,_hoisted_8$98,toDisplayString(__props.tile.subElementCount),1)):isListItem.value?(openBlock(),createElementBlock(`span`,_hoisted_9$88)):createCommentVNode(``,!0)])],42,_hoisted_1$284)),[[unref(BngOnUiNav_default),void 0,`ok`,{focusRequired:!0,asMouse:!0,bubble:!0}],[unref(BngSoundClass_default),`bng_click_hover_generic`],[unref(BngDoubleClick_default),__props.tile.doubleClickDetails?()=>emit$1(`dblclick`):null,__props.tile.doubleClickMode]])],6))}}),Tile_default=__plugin_vue_export_helper_default(_sfc_main$320,[[`__scopeId`,`data-v-51fd3377`]]),_hoisted_1$283={class:`group-header`,"bng-list-title":``},_sfc_main$319={__name:`GroupHeader`,props:{label:{type:String,required:!0}},setup(__props){return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$283,[createVNode(bngCardHeading_default,{class:`header-label`},{default:withCtx(()=>[createTextVNode(toDisplayString(__props.label),1)]),_:1}),_cache[0]||=createBaseVNode(`div`,{class:`header-line`},null,-1)]))}},GroupHeader_default=__plugin_vue_export_helper_default(_sfc_main$319,[[`__scopeId`,`data-v-28596ef8`]]),_sfc_main$318={__name:`Grid`,props:{autoFocusKey:{type:String,default:null},activeItem:{type:Object,default:null},groups:{type:Array,required:!0},isConfig:{type:Boolean,default:!1},displaySize:{type:String,default:`medium`,validator:value=>[`tiny`,`small`,`medium`,`large`,`huge`,`list`].includes(value)},inDetails:{type:Boolean,default:!1},backendName:{type:String,default:`gridSelector`},tileImagesTopAligned:{type:Boolean,default:!1},doubleClickOverride:{type:Function,default:null}},emits:[`select-item`,`deselect-item`,`focus-item`],setup(__props,{emit:__emit}){let{showIfController}=storeToRefs(controls_default()),props=__props,emit$1=__emit,gridListRef=ref(),containerWidth=ref(0),baseFontSize=ref(16),tileSizeCalc=ctx=>Tile_default.getSizeCalc(props.displaySize)(ctx),maxTilesPerRow=computed(()=>{if(!containerWidth.value)return 1/0;let size$3=Tile_default.getSizeCalc(props.displaySize)({}),tileWidthPx=(size$3.width+size$3.margin)*baseFontSize.value;return(Math.floor(containerWidth.value/tileWidthPx)||1)*(props.displaySize===`list`?2:1)}),limitedGroups=computed(()=>props.groups.map(group=>({...group,tiles:group.isRecentGroup?group.tiles.slice(0,maxTilesPerRow.value):group.tiles}))),updateContainerWidth=()=>{gridListRef.value?.$el&&(containerWidth.value=gridListRef.value.$el.clientWidth,baseFontSize.value=parseFloat(getComputedStyle(document.documentElement).fontSize)||16)},resizeObserver;onMounted(()=>{updateContainerWidth(),gridListRef.value?.$el&&(resizeObserver=new ResizeObserver(debounce(updateContainerWidth,100)),resizeObserver.observe(gridListRef.value.$el))}),onUnmounted(()=>{resizeObserver&&resizeObserver.disconnect()}),provide(`gridSelectionState`,computed(()=>({inDetails:props.inDetails,activeItemKey:props.activeItem?.key||null,autoFocusKey:props.autoFocusKey})));let focusItem=tile=>{props.inDetails||(showIfController.value&&preselectItem(tile),emit$1(`focus-item`,tile))},selectItem=tile=>{preselectItem.cancel(),emit$1(`select-item`,tile)},preselectItem=debounce(tile=>emit$1(`select-item`,tile,!1),200),handleDoubleClick=async item=>{if(console.log(`handleDoubleClick`,item),item.doubleClickDetails)try{props.doubleClickOverride?props.doubleClickOverride(item):await Lua_default.ui_gridSelector.executeDoubleClick(props.backendName,item.doubleClickDetails)}catch(error){console.error(`Failed to execute double click:`,error)}};return(_ctx,_cache)=>(openBlock(),createBlock(unref(bngList_default),{ref_key:`gridListRef`,ref:gridListRef,class:`grid-list`,layout:unref(LIST_LAYOUTS).TILES,"no-background":``,big:``,immediate:``,"keep-alive":500,"title-width":20,"title-height":1.5,"title-margin":.5,"tile-size-calc":tileSizeCalc},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(limitedGroups.value,group=>(openBlock(),createElementBlock(Fragment,{key:group.label},[group.label?(openBlock(),createBlock(GroupHeader_default,{key:0,label:group.label,"bng-list-title":``},null,8,[`label`])):createCommentVNode(``,!0),(openBlock(!0),createElementBlock(Fragment,null,renderList(group.tiles,tile=>(openBlock(),createBlock(Tile_default,{key:tile.key,tile,"is-config":__props.isConfig,"display-size":__props.displaySize,"is-favourite":group.label===`Favourites`,"tile-images-top-aligned":__props.tileImagesTopAligned,onFocus:$event=>focusItem(tile),onClick:$event=>selectItem(tile),onDblclick:$event=>handleDoubleClick(tile)},null,8,[`tile`,`is-config`,`display-size`,`is-favourite`,`tile-images-top-aligned`,`onFocus`,`onClick`,`onDblclick`]))),128))],64))),128))]),_:1},8,[`layout`]))}},Grid_default$1=__plugin_vue_export_helper_default(_sfc_main$318,[[`__scopeId`,`data-v-efa73a51`]]),_hoisted_1$282={class:`display-controls-container`},_hoisted_2$232={class:`control-group-label`},_hoisted_3$206={key:0,class:`reset-button-container`},_sfc_main$317={__name:`DisplayControls`,props:{displayData:{type:Array,required:!0},detailsMode:{type:String,required:!0},updateDisplayData:{type:Function,required:!0},resetDisplayDataToDefaults:{type:Function,required:!0},setDetailsMode:{type:Function,required:!0}},emits:[`focus-item`],setup(__props,{emit:__emit}){let props=__props,emit$1=__emit,booleanToStringByKey=computed(()=>{let valuesByKey={};for(let option of props.displayData)if(option.type===`checkbox`){valuesByKey[option.key]={};for(let checkboxOption of option.options)valuesByKey[option.key][checkboxOption.value]=checkboxOption.label||(checkboxOption.value?`Yes`:`No`)}return valuesByKey}),controls$1=computed(()=>props.displayData.filter(x=>x.showInModes?.[props.detailsMode]).map(x=>({...x,checkboxLabel:x.type===`checkbox`?booleanToStringByKey.value[x.key]?.[x.value]:void 0}))),onOptionChanged=(key,newValue)=>{props.updateDisplayData(key,newValue),emit$1(`focus-item`,key)},resetToDefaults=()=>{props.resetDisplayDataToDefaults()};return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$282,[createBaseVNode(`div`,{class:normalizeClass([`display-controls`,{"display-controls-list":__props.detailsMode===`displayControls`||__props.detailsMode===`default`}])},[(openBlock(!0),createElementBlock(Fragment,null,renderList(controls$1.value,option=>(openBlock(),createElementBlock(`div`,{key:option.key,class:normalizeClass([`control-group`,{"force-full-width":__props.detailsMode===`default`}])},[createBaseVNode(`div`,_hoisted_2$232,toDisplayString(option.label),1),createVNode(bngTooltip_default,{text:option.description||`No description available`,position:`top`},{default:withCtx(()=>[option.type===`dropdown`?(openBlock(),createBlock(unref(bngSmartSelect_default),{key:0,modelValue:option.value,items:option.options||[],"onUpdate:modelValue":newValue=>onOptionChanged(option.key,newValue),threshold:8},null,8,[`modelValue`,`items`,`onUpdate:modelValue`])):option.type===`checkbox`?(openBlock(),createBlock(unref(bngSwitch_default),{key:1,class:normalizeClass([`full-width-checkbox`,{active:option.value}]),modelValue:option.value,"onUpdate:modelValue":newValue=>onOptionChanged(option.key,newValue),labelBefore:``,alwaysTransparent:``},{default:withCtx(()=>[createTextVNode(toDisplayString(option.checkboxLabel),1)]),_:2},1032,[`class`,`modelValue`,`onUpdate:modelValue`])):option.type===`number`?(openBlock(),createBlock(unref(bngInputNew_default),{key:2,modelValue:option.value,min:option.min,max:option.max,showExternalButton:!1,type:`number`,"onUpdate:modelValue":newValue=>onOptionChanged(option.key,newValue)},null,8,[`modelValue`,`min`,`max`,`onUpdate:modelValue`])):createCommentVNode(``,!0)]),_:2},1032,[`text`])],2))),128))],2),__props.detailsMode===`displayControls`?(openBlock(),createElementBlock(`div`,_hoisted_3$206,[createVNode(unref(bngButton_default),{onClick:resetToDefaults,accent:`attention`,iconLeft:`trashBin1`,class:`reset-button`},{default:withCtx(()=>[..._cache[0]||=[createTextVNode(` Reset to Defaults `,-1)]]),_:1})])):createCommentVNode(``,!0)]))}},DisplayControls_default=__plugin_vue_export_helper_default(_sfc_main$317,[[`__scopeId`,`data-v-863e411a`]]),_sfc_main$316={__name:`SearchBar`,props:{searchText:{type:String,required:!0},setSearchText:{type:Function,required:!0},placeholder:{type:String,default:`Search...`},fullWidth:{type:Boolean,default:!1},showClearAllButton:{type:Boolean,default:!1}},emits:[`focus-item`,`clear-all`],setup(__props,{emit:__emit}){let props=__props,emit$1=__emit,clearSearch=()=>{props.setSearchText(``),emit$1(`focus-item`,`search`)},commitSearch=()=>{},onSearchChanged=value=>{props.setSearchText(value),emit$1(`focus-item`,`search`)};return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,{class:normalizeClass([`search-container`,{"full-width":__props.fullWidth}])},[createVNode(unref(bngInput_default),{class:`search-input`,modelValue:__props.searchText,placeholder:__props.placeholder,onValueChanged:onSearchChanged,onKeydown:withKeys(commitSearch,[`enter`]),onBlur:commitSearch,onFocus:_cache[0]||=$event=>emit$1(`focus-item`,`search`)},null,8,[`modelValue`,`placeholder`]),createBaseVNode(`div`,{class:normalizeClass([`search-icon-container`,{active:__props.searchText}]),onClick:clearSearch},[createVNode(unref(bngIcon_default),{type:unref(icons).search,class:`search-icon show-unhovered`},null,8,[`type`]),createVNode(unref(bngIcon_default),{type:unref(icons).trashBin2,class:`search-icon show-hovered`},null,8,[`type`])],2)],2))}},SearchBar_default=__plugin_vue_export_helper_default(_sfc_main$316,[[`__scopeId`,`data-v-67aff9c0`]]),_hoisted_1$281={class:`filters`},_hoisted_2$231={key:0,class:`search-section`},_hoisted_3$205={key:1,class:`filter-options-grid`},_hoisted_4$176={class:`option-label`},_hoisted_5$151={class:`option-icon`},_hoisted_6$130={key:2,class:`filters-container`},_hoisted_7$116={class:`filter-container`,navigable:``,tabindex:`0`},_hoisted_8$97={class:`filter-content`},_hoisted_9$87={key:0,class:`filter-options`},_hoisted_10$76={class:`filter-options-grid`},_hoisted_11$68={class:`option-label`},_hoisted_12$56={class:`option-icon`},_hoisted_13$48={key:1,class:`filter-options`},_hoisted_14$43={class:`range-bar-container`},_hoisted_15$41={class:`range-bar`},_hoisted_16$39={class:`range-inputs`},_hoisted_17$32={class:`range-input-group`},_hoisted_18$29={class:`range-input-group`},_sfc_main$315={__name:`DetailedFilters`,props:{filterList:{type:Array,required:!0},filterByProp:{type:Object,required:!0},searchText:{type:String,default:``},commonFilters:{type:Array,default:()=>[]},detailsMode:{type:String,required:!0},onlyCommonFilters:{type:Boolean,default:!0},isFilterLocked:{type:Function,required:!0},isFilterOptionLocked:{type:Function,required:!0},isRangeFilterLocked:{type:Function,required:!0},toggleFilter:{type:Function,required:!0},updateRangeFilter:{type:Function,required:!0},resetRangeFilter:{type:Function,required:!0},setSearchText:{type:Function,required:!0},setDetailsMode:{type:Function,required:!0}},emits:[`focus-item`],setup(__props,{emit:__emit}){let props=__props,emit$1=__emit,expandedAccordions=ref({}),pendingRangeUpdates=ref({}),debouncedUpdateFunctions=ref({}),getDebouncedUpdate=propName=>(debouncedUpdateFunctions.value[propName]||(debouncedUpdateFunctions.value[propName]=debounce(()=>{if(pendingRangeUpdates.value[propName]){let{min:min$1,max:max$1}=pendingRangeUpdates.value[propName];props.updateRangeFilter(propName,min$1,max$1),delete pendingRangeUpdates.value[propName]}},300)),debouncedUpdateFunctions.value[propName]);onUnmounted(()=>{Object.values(debouncedUpdateFunctions.value).forEach(debouncedFn=>{debouncedFn&&debouncedFn.cancel&&debouncedFn.cancel()}),debouncedUpdateFunctions.value={},pendingRangeUpdates.value={}});let formatFilterName=key=>key,getFilterOptionClass=(propName,option)=>{let filter=props.filterList.find(f=>f.propName===propName);if(!filter||!filter.options)return``;let allEnabled=filter.options.every(opt=>props.filterByProp[propName]?.[opt]===!0),currentOptionEnabled=props.filterByProp[propName]?.[option]===!0;return allEnabled?`filter-neutral`:currentOptionEnabled?`filter-active`:`filter-inactive`},hasActiveFilters=propName=>{if(!props.filterList)return!1;let filter=props.filterList.find(f=>f.propName===propName);if(!filter)return!1;if(filter.type===`range`){let filterData=props.filterByProp[propName];if(!filterData)return!1;let currentMin=filterData.min,currentMax=filterData.max,defaultMin=filter.min,defaultMax=filter.max;return currentMin>defaultMin||currentMaxprops.filterByProp[propName]?.[option]===!1)},toggleFilter=(propName,option,event)=>{if(props.isFilterOptionLocked(propName,option)){console.log(`Cannot toggle locked filter:`,propName,option);return}event&&(event.preventDefault(),event.stopPropagation()),emit$1(`focus-item`,`filters`),props.toggleFilter(propName,option)},onRangeFilterChanged=(propName,newValue,field)=>{if(props.isRangeFilterLocked(propName)){console.log(`Cannot update locked range filter:`,propName);return}let filter=props.filterList.find(f=>f.propName===propName);if(!filter||filter.type!==`range`)return;let filterData=props.filterByProp[propName];if(!filterData)return;let currentPending=pendingRangeUpdates.value[propName],min$1=currentPending?currentPending.min:filterData.min,max$1=currentPending?currentPending.max:filterData.max;field===`min`?min$1=newValue:field===`max`&&(max$1=newValue),min$1=Math.max(filter.min,Math.min(filter.max,min$1)),max$1=Math.max(filter.min,Math.min(filter.max,max$1)),min$1>max$1&&([min$1,max$1]=[max$1,min$1]),pendingRangeUpdates.value[propName]={min:min$1,max:max$1},getDebouncedUpdate(propName)(),emit$1(`focus-item`,propName)},isFilterActive=filter=>hasActiveFilters(filter.propName),getRangeBarStyle=propName=>{let filter=props.filterList.find(f=>f.propName===propName);if(!filter||filter.type!==`range`)return{};let filterData=props.filterByProp[propName];if(!filterData)return{};let currentMin=filterData.min,currentMax=filterData.max,totalRange=filter.max-filter.min,leftPosition=(currentMin-filter.min)/totalRange*100,width$1=(currentMax-currentMin)/totalRange*100;return{left:`${leftPosition}%`,width:`${width$1}%`,backgroundColor:`var(--bng-orange-500)`}};return onMounted(()=>{props.filterList&&props.filterList.forEach(filter=>{hasActiveFilters(filter.propName)&&(expandedAccordions.value[filter.propName]=!0)})}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$281,[__props.detailsMode===`filter`?(openBlock(),createElementBlock(`div`,_hoisted_2$231,[createVNode(SearchBar_default,{searchText:__props.searchText,setSearchText:__props.setSearchText,placeholder:`Search items...`,"full-width":!0,onFocusItem:_cache[0]||=$event=>emit$1(`focus-item`,$event)},null,8,[`searchText`,`setSearchText`])])):createCommentVNode(``,!0),__props.detailsMode===`filter`?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_3$205,[(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.commonFilters,(filter,index)=>(openBlock(),createBlock(unref(bngPill_default),{key:index,class:normalizeClass([[getFilterOptionClass(filter[0],filter[1]),{"filter-locked":props.isFilterOptionLocked(filter[0],filter[1])}],`filter-option-chip`]),style:normalizeStyle({cursor:props.isFilterOptionLocked(filter[0],filter[1])?`not-allowed`:`pointer`}),"bng-nav-item":``,onClick:$event=>toggleFilter(filter[0],filter[1])},{default:withCtx(()=>[createBaseVNode(`span`,_hoisted_4$176,toDisplayString(filter[1]),1),createBaseVNode(`span`,_hoisted_5$151,[__props.filterByProp&&__props.filterByProp[filter[0]]&&__props.filterByProp[filter[0]][filter[1]]?(openBlock(),createBlock(unref(bngIcon_default),{key:0,type:unref(icons).checkmark},null,8,[`type`])):(openBlock(),createBlock(unref(bngIcon_default),{key:1,type:unref(icons).xmark},null,8,[`type`])),props.isFilterOptionLocked(filter[0],filter[1])?(openBlock(),createBlock(unref(bngIcon_default),{key:2,type:unref(icons).lockClosed,class:`lock-icon`},null,8,[`type`])):createCommentVNode(``,!0)])]),_:2},1032,[`class`,`style`,`onClick`]))),128))])),__props.detailsMode===`filter`?(openBlock(),createElementBlock(`div`,_hoisted_6$130,[createVNode(unref(accordion_default),{class:`filters-accordion`},{default:withCtx(()=>[(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.filterList,filter=>(openBlock(),createElementBlock(`div`,{key:filter.propName,class:`filter-wrapper`},[createVNode(unref(accordionItem_default),{navigable:``,static:!filter.options||filter.options.length===0,"arrow-big":``,"expand-hint-inline":``,expanded:expandedAccordions.value[filter.propName],class:normalizeClass({"has-active-filters":isFilterActive(filter)}),onFocus:$event=>emit$1(`focus-item`,filter.propName)},{caption:withCtx(()=>[createBaseVNode(`div`,_hoisted_7$116,[createBaseVNode(`div`,_hoisted_8$97,toDisplayString(formatFilterName(filter.propName)),1)])]),default:withCtx(()=>[filter.type===`set`&&filter.options?(openBlock(),createElementBlock(`div`,_hoisted_9$87,[createBaseVNode(`div`,_hoisted_10$76,[(openBlock(!0),createElementBlock(Fragment,null,renderList(filter.options,(option,index)=>(openBlock(),createBlock(unref(bngPill_default),{key:index,class:normalizeClass([[getFilterOptionClass(filter.propName,option),{"filter-locked":props.isFilterOptionLocked(filter.propName,option)}],`filter-option-chip`]),style:normalizeStyle({cursor:props.isFilterOptionLocked(filter.propName,option)?`not-allowed`:`pointer`}),onClick:$event=>toggleFilter(filter.propName,option)},{default:withCtx(()=>[createBaseVNode(`span`,_hoisted_11$68,toDisplayString(option),1),createBaseVNode(`span`,_hoisted_12$56,[__props.filterByProp[filter.propName][option]?(openBlock(),createBlock(unref(bngIcon_default),{key:0,type:unref(icons).checkmark},null,8,[`type`])):(openBlock(),createBlock(unref(bngIcon_default),{key:1,type:unref(icons).abandon},null,8,[`type`])),props.isFilterOptionLocked(filter.propName,option)?(openBlock(),createBlock(unref(bngIcon_default),{key:2,type:unref(icons).lockClosed,class:`lock-icon`},null,8,[`type`])):createCommentVNode(``,!0)])]),_:2},1032,[`class`,`style`,`onClick`]))),128))])])):createCommentVNode(``,!0),filter.type===`range`?(openBlock(),createElementBlock(`div`,_hoisted_13$48,[createBaseVNode(`div`,_hoisted_14$43,[createBaseVNode(`div`,_hoisted_15$41,[createBaseVNode(`div`,{class:`range-selection`,style:normalizeStyle(getRangeBarStyle(filter.propName))},null,4)])]),createBaseVNode(`div`,_hoisted_16$39,[createBaseVNode(`div`,_hoisted_17$32,[_cache[1]||=createBaseVNode(`label`,{class:`range-label`},`Min:`,-1),(openBlock(),createBlock(unref(bngInput_default),{key:filter.propName+`min`,modelValue:__props.filterByProp[filter.propName].min,type:`number`,min:filter.min,max:filter.max,step:filter.step||1,disabled:props.isRangeFilterLocked(filter.propName),onValueChanged:val=>onRangeFilterChanged(filter.propName,val,`min`)},null,8,[`modelValue`,`min`,`max`,`step`,`disabled`,`onValueChanged`]))]),createBaseVNode(`div`,_hoisted_18$29,[_cache[2]||=createBaseVNode(`label`,{class:`range-label`},`Max:`,-1),(openBlock(),createBlock(unref(bngInput_default),{key:filter.propName+`max`,modelValue:__props.filterByProp[filter.propName].max,type:`number`,min:filter.min,max:filter.max,step:filter.step||1,disabled:props.isRangeFilterLocked(filter.propName),onValueChanged:val=>onRangeFilterChanged(filter.propName,val,`max`)},null,8,[`modelValue`,`min`,`max`,`step`,`disabled`,`onValueChanged`]))])])])):createCommentVNode(``,!0)]),_:2},1032,[`static`,`expanded`,`class`,`onFocus`])]))),128))]),_:1})])):createCommentVNode(``,!0)]))}},DetailedFilters_default=__plugin_vue_export_helper_default(_sfc_main$315,[[`__scopeId`,`data-v-a4758924`]]),_hoisted_1$280={key:1},_hoisted_2$230={key:1},_hoisted_3$204={key:1},_hoisted_4$175={key:1},_sfc_main$314={__name:`HeaderButtons`,props:{canSwitchDetails:{type:Boolean,default:!1},hiddenTabs:{type:Array,default:()=>[]},detailsMode:{type:String,required:!0},slim:{type:Boolean,default:!1}},emits:[`switch-details-mode`],setup(__props){return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,{class:normalizeClass([`header-buttons`,{slim:__props.slim}])},[withDirectives(createVNode(unref(bngBinding_default),{class:`header-buttons-binding`,"ui-event":`context`,controller:``,"track-ignore":``},null,512),[[vShow,__props.canSwitchDetails]]),__props.hiddenTabs.includes(`detail`)?createCommentVNode(``,!0):withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:0,class:normalizeClass([`header-button`,{selected:__props.detailsMode===`detail`}]),accent:unref(ACCENTS).text,onClick:_cache[0]||=$event=>_ctx.$emit(`switch-details-mode`,`detail`)},{default:withCtx(()=>[__props.slim?(openBlock(),createBlock(unref(bngIcon_default),{key:0,type:unref(icons).info},null,8,[`type`])):(openBlock(),createElementBlock(`span`,_hoisted_1$280,`Details`))]),_:1},8,[`class`,`accent`])),[[unref(BngTooltip_default),`Details`,`top`]]),__props.hiddenTabs.includes(`advanced`)?createCommentVNode(``,!0):withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:1,class:normalizeClass([`header-button`,{selected:__props.detailsMode===`advanced`}]),accent:unref(ACCENTS).text,onClick:_cache[1]||=$event=>_ctx.$emit(`switch-details-mode`,`advanced`)},{default:withCtx(()=>[__props.slim?(openBlock(),createBlock(unref(bngIcon_default),{key:0,type:unref(icons).laneProperties},null,8,[`type`])):(openBlock(),createElementBlock(`span`,_hoisted_2$230,`Advanced`))]),_:1},8,[`class`,`accent`])),[[unref(BngTooltip_default),`Advanced`,`top`]]),__props.hiddenTabs.includes(`filter`)?createCommentVNode(``,!0):withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:2,class:normalizeClass([`header-button`,{selected:__props.detailsMode===`filter`}]),accent:unref(ACCENTS).text,onClick:_cache[2]||=$event=>_ctx.$emit(`switch-details-mode`,`filter`)},{default:withCtx(()=>[__props.slim?(openBlock(),createBlock(unref(bngIcon_default),{key:0,type:unref(icons).filter},null,8,[`type`])):(openBlock(),createElementBlock(`span`,_hoisted_3$204,`Filters`))]),_:1},8,[`class`,`accent`])),[[unref(BngTooltip_default),`Filters`,`top`]]),__props.hiddenTabs.includes(`displayControls`)?createCommentVNode(``,!0):withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:3,class:normalizeClass([`header-button`,{selected:__props.detailsMode===`displayControls`}]),accent:unref(ACCENTS).text,onClick:_cache[3]||=$event=>_ctx.$emit(`switch-details-mode`,`displayControls`)},{default:withCtx(()=>[__props.slim?(openBlock(),createBlock(unref(bngIcon_default),{key:0,type:unref(icons).adjust},null,8,[`type`])):(openBlock(),createElementBlock(`span`,_hoisted_4$175,`Display`))]),_:1},8,[`class`,`accent`])),[[unref(BngTooltip_default),`Display`,`top`]])],2))}},HeaderButtons_default=__plugin_vue_export_helper_default(_sfc_main$314,[[`__scopeId`,`data-v-157cdc63`]]),_sfc_main$313={__name:`Slideshow`,props:{images:Array,transition:Boolean,delay:{type:Number,default:1e4},parent:Object,shuffle:Boolean},setup(__props,{expose:__expose}){useCssVars(_ctx=>({v095d52f4:imgPrev.value,v095f8174:imgNext.value}));let props=__props,anim=ref(!1),imgPrev=ref(``),imgNext=ref(``),imgIndex=ref(-1),sequence=[],sequenceIndex=-1,tmrMain,tmrAnim,wImages,wParent;__expose({imgIndex,nextImage,carousel:{showNext:nextImage}}),onUnmounted(stopTimers);function stopTimers(){tmrMain&&=(clearTimeout(tmrMain),null),tmrAnim&&=(clearTimeout(tmrAnim),null)}watch(()=>props.parent,parent=>{wImages&&=(wImages(),null),wParent&&=(wParent(),null),parent?wParent=watch([()=>props.images,()=>parent.imgIndex],([images,index])=>{images&&(imgIndex.value=index,images.length>0&&nextTick(nextImage))},{immediate:!0}):wImages=watch([()=>props.images,()=>props.shuffle],([images,shuffle])=>{images&&(imgIndex.value=-1,images.length>0&&(shuffle&&(sequenceIndex=-1,sequence=Array.from(images).map((_,i)=>i).sort(()=>Math.random()-.5)),nextTick(nextImage)))},{immediate:!0})},{immediate:!0});function nextImage(){stopTimers(),props.parent||(props.shuffle&&sequence.length>0?(sequenceIndex=++sequenceIndex%props.images.length,imgIndex.value=sequence[sequenceIndex]):imgIndex.value=++imgIndex.value%props.images.length);let img=`url("${getAssetURL(props.images[imgIndex.value])}")`;props.transition?(imgNext.value=img,anim.value=!0,tmrAnim=setTimeout(()=>{tmrAnim=null,anim.value=!1,imgPrev.value=imgNext.value,imgNext.value=``},1e3)):imgPrev.value=img,!props.parent&&props.images.length>1&&(tmrMain=setTimeout(nextImage,props.delay))}return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,{class:normalizeClass({anim:anim.value})},null,2))}},Slideshow_default=__plugin_vue_export_helper_default(_sfc_main$313,[[`__scopeId`,`data-v-f788946d`]]),_hoisted_1$279={key:0,class:`blur-wrap`},_sfc_main$312={__name:`BlurBackground`,setup(__props){let parentCarousel=inject(`mainBackground`),backgroundsBlur=inject(`mainBackgroundBlur`),bgRequired=sysInfo_default.mainMenuBackgroundRequired;return(_ctx,_cache)=>unref(bgRequired)?(openBlock(),createElementBlock(`div`,_hoisted_1$279,[createVNode(Slideshow_default,{class:`blur-carousel`,images:unref(backgroundsBlur),parent:unref(parentCarousel),transition:``},null,8,[`images`,`parent`])])):createCommentVNode(``,!0)}},BlurBackground_default=__plugin_vue_export_helper_default(_sfc_main$312,[[`__scopeId`,`data-v-cc1c4815`]]),_hoisted_1$278={class:`header-container`},_hoisted_2$229={key:1},_hoisted_3$203={class:`content-container`},_hoisted_4$174={class:`header-back-button`},_hoisted_5$150={key:0,class:`header-title-container`},_hoisted_6$129={class:`header-back-button`},_hoisted_7$115={class:`header-back-button`},_hoisted_8$96={key:0,class:`scrollable-content`},_hoisted_9$86={class:`details-mode-buttons`},_hoisted_10$75={key:1,class:`scrollable-content`},_hoisted_11$67={key:0,class:`details-content`},_hoisted_12$55={key:1,class:`scrollable-content`},_sfc_main$311={__name:`GridSelector`,props:{backendName:{type:String,default:`gridSelector`},routePath:{type:String,default:`/grid-selector`},defaultPath:{type:Object,default:()=>({keys:[`allModels`]})},defaultDetailsMode:{type:String,default:`detail`},hiddenTabs:{type:Array,default:()=>[]},tileImagesTopAligned:{type:Boolean,default:!1},doubleClickOverride:{type:Function,default:null},noBreadcrumbs:{type:Boolean,default:!1},overrideBackFromGrid:{type:Function,default:null},inlineHeaderContainer:{type:Boolean,default:!0},selectCallback:{type:Function,default:null},bubbleEvents:{type:Array,default:()=>[]}},setup(__props,{expose:__expose}){let props=__props,{showIfController}=storeToRefs(controls_default()),store$1=useGridSelector(props.backendName,props.defaultPath,props.defaultDetailsMode),{groups,displayData,detailsMode,selectedItem,showScreenHeader,screenHeaderTitle,screenHeaderPath,activeItemDetails,activeItem,activeFilters}=store$1,route=useRoute(),router$1=useRouter(),detailsModeTitles={detail:`Details`,advanced:`Advanced`,filter:`Filters`,displayControls:`Display`},detailsModeBackTo={filter:`advanced`,displayControls:`advanced`};watch(()=>[props.backendName,props.defaultPath,props.defaultDetailsMode],([newBackendName,newDefaultPath,newDefaultDetailsMode],[oldBackendName,oldDefaultPath,oldDefaultDetailsMode])=>{newBackendName!==oldBackendName&&newDefaultPath&&newDefaultPath.keys&&store$1.setCurrentPath(newDefaultPath),newDefaultDetailsMode!==oldDefaultDetailsMode&&store$1.setDetailsMode(newDefaultDetailsMode)},{deep:!0});let scopedNavState=reactive({isGridActive:!1,isDetailsActive:!1}),setBack=inject(`setBack`),showTopbarTabBindings=inject(`showTopbarTabBindings`),showTopbarBackBinding=inject(`showTopbarBackBinding`),showBreadcrumbsBack=ref(!1),canUseTopbar=ref(!0);watch(()=>scopedNavState.isDetailsActive,val=>{canUseTopbar.value=!val,showTopbarTabBindings(canUseTopbar.value)}),watch(screenHeaderPath,val=>{showBreadcrumbsBack.value=val&&val.length>2,showTopbarBackBinding(!showBreadcrumbsBack.value)});let switchSeq=computed(()=>[`detail`,`advanced`,`displayControls`].filter(tab=>!props.hiddenTabs.includes(tab))),getNextSwitchSeq=mode=>{mode||=detailsMode.value,mode===`filter`&&(mode=`advanced`);let seq=switchSeq.value;if(seq.length===0)return`detail`;let currentIndex=seq.indexOf(mode);return currentIndex===-1?seq[0]:seq[(currentIndex+1)%seq.length]},canSeeDetails=ref(!0),hasSelectedItem=computed(()=>!!store$1.selectedItem.value),canSwitchDetails=computed(()=>activeSectionScope.value!==`default`||detailsMode.value===`advanced`);function switchDetailsMode(mode){console.log(`switchDetailsMode`,mode),typeof mode!=`string`&&(mode=getNextSwitchSeq(mode)),mode===`detail`&&!canSeeDetails.value&&(mode=getNextSwitchSeq(mode)),console.log(`switchDetailsMode`,mode),store$1.setDetailsMode(mode),switchScope(`details`)}function onToggleSectionScope(){activeSectionScope.value===`grid`?switchScope(`details`):switchDetailsMode()}let activeSectionScope=ref(`grid`);function switchScope(name,force=!1){name||=activeSectionScope.value===`grid`?`details`:`grid`,name===`details`?(scopedNavState.isGridActive=!1,force&&(scopedNavState.isDetailsActive=!1),nextTick(()=>{activeSectionScope.value=name,scopedNavState.isDetailsActive=!0})):(scopedNavState.isDetailsActive=!1,force&&(scopedNavState.isGridActive=!1),nextTick(()=>{activeSectionScope.value=name,scopedNavState.isGridActive=!0}))}let onGridActivate=()=>{scopedNavState.isGridActive=!0},onGridDeactivate=event=>{scopedNavState.isGridActive=!1},onDetailsActivate=()=>{scopedNavState.isDetailsActive=!0},onDetailsDeactivate=event=>{scopedNavState.isDetailsActive=!1},setDetailsScope=info=>{switchScope(`details`)},canBubbleGridEvent=event=>!!(event.detail.name===`rotate_v_cam`||event.detail.name===`menu`||canUseTopbar.value&&(event.detail.name===`tab_l`||event.detail.name===`tab_r`)||props.bubbleEvents.includes(event.detail.name)),canBubbleDetailsEvent=event=>!!(event.detail.name===`rotate_v_cam`||props.bubbleEvents.includes(event.detail.name)),canDeactivateGrid=()=>screenHeaderPath.value.length<=1,onBackFromDetails=()=>{if(detailsMode.value===`displayControls`||detailsMode.value===`filter`){toggleDetailsMode(`advanced`);return}switchScope(`grid`)},onToggleFavorite=()=>{store$1.toggleFavourite(activeItem.value)},gridContentRef=ref(null),scrollPositions$1=ref(new Map),scrollTimeout=null,displaySize=computed(()=>{let option=displayData.value.find(option$1=>option$1.key===`displaySize`);return option?option.value:`medium`});store$1.initialize(),store$1.setOnBackFromDetailsCallback(()=>{onBackFromDetails()}),props.defaultPath.keys;let currentPathSegments=computed(()=>{let pathMatch=route.params.pathMatch;if(!pathMatch)return props.defaultPath?.keys||(Array.isArray(props.defaultPath)?props.defaultPath:[]);let segments=Array.isArray(pathMatch)?pathMatch.map(segment=>decodeURIComponent(segment)):[decodeURIComponent(pathMatch)];if(route.params.itemDetails){let itemDetails=Array.isArray(route.params.itemDetails)?route.params.itemDetails.map(segment=>decodeURIComponent(segment)):[decodeURIComponent(route.params.itemDetails)];segments.push(...itemDetails)}return segments}),saveScrollPosition$1=()=>{if(!gridContentRef.value)return;let pathKey=currentPathSegments.value.join(`/`),scrollTop=gridContentRef.value.scrollTop;scrollPositions$1.value.set(pathKey,scrollTop)},debouncedSaveScrollPosition=()=>{scrollTimeout&&clearTimeout(scrollTimeout),scrollTimeout=setTimeout(()=>{saveScrollPosition$1()},100)},restoreScrollPosition=()=>{if(!gridContentRef.value)return;let pathKey=currentPathSegments.value.join(`/`),savedPosition=scrollPositions$1.value.get(pathKey);savedPosition!==void 0&&nextTick(()=>{gridContentRef.value.scrollTop=savedPosition})};watch(groups,async newGroups=>{newGroups&&(await nextTick(),await nextTick(),store$1.notifyUIReady(),restoreScrollPosition())},{immediate:!0}),watch([currentPathSegments],async([segments],[oldSegments])=>{if(oldSegments&&gridContentRef.value){let oldPathKey=oldSegments.join(`/`),currentScrollTop=gridContentRef.value.scrollTop;scrollPositions$1.value.set(oldPathKey,currentScrollTop)}let path={keys:segments};await store$1.setCurrentPath(path)},{immediate:!0}),watch(gridContentRef,newElement=>{if(newElement){let handleScroll=()=>{debouncedSaveScrollPosition()};newElement.addEventListener(`scroll`,handleScroll),newElement._scrollHandler=handleScroll}},{immediate:!0}),onBeforeMount(()=>{Lua_default.simTimeAuthority.pushPauseRequest(`gridSelector`)}),onMounted(()=>{setBack(props.backendName,onBackFromGrid),nextTick(()=>{scopedNavState.isGridActive=!0})}),onUnmounted(()=>{setBack(props.backendName),gridContentRef.value&&gridContentRef.value._scrollHandler&&gridContentRef.value.removeEventListener(`scroll`,gridContentRef.value._scrollHandler),scrollTimeout&&clearTimeout(scrollTimeout),Lua_default.ui_gridSelector.closedFromUI(props.backendName),Lua_default.simTimeAuthority.popPauseRequest(`gridSelector`)});let onItemFocus=item=>{item&&item.showDetails&&store$1.setPreviewItem(item)},onItemSelect=async(item,doNavigation=!0)=>{if(item.gotoPath&&Array.isArray(item.gotoPath))store$1.prevSelectedItem.value=item.key,doNavigation&&routeNav(item),store$1.clearSelectedItem(),doNavigation&&switchScope(`grid`),props.selectCallback&&await props.selectCallback(item,doNavigation);else if(item.showDetails){item.key,selectedItem.value?.key;let consumed=!1;props.selectCallback&&(consumed=await props.selectCallback(item,doNavigation)),consumed||(await store$1.setSelectedItem(item),doNavigation&&switchScope(`details`))}},onGridWrapperClick=event=>{store$1.clearSelectedItem(),switchScope(`grid`,!0)},onDetailsWrapperClick=event=>{switchScope(`details`,!0)},onItemDeselect=()=>{store$1.clearSelectedItem()},toggleDetailsMode=mode=>{store$1.setDetailsMode(mode)};function routeNav(item){if(item.gotoAngularState)return;let encodedPath=item.gotoPath.map(segment=>encodeURIComponent(segment)).join(`/`);router$1.push(`${props.routePath}/${encodedPath}`)}let onBackFromGrid=()=>{if(console.log(`onBackFromGrid`,screenHeaderPath.value),props.overrideBackFromGrid&&screenHeaderPath.value.length<=2)return props.overrideBackFromGrid();if(screenHeaderPath.value.length>1){let item=screenHeaderPath.value[screenHeaderPath.value.length-2];return store$1.prevSelectedItem.value&&(store$1.autoFocusKey.value=store$1.prevSelectedItem.value),gotoHeaderItem(item),!1}return!0},onBreadBack=()=>nextTick(onBackFromGrid),clearSearch=()=>{store$1.setSearchText(``)},clearFilters=()=>{console.log(`clearFilters`,activeFilters.value);for(let filter of activeFilters.value)console.log(`clearFilter`,filter),filter&&filter.type===`range`?store$1.resetRangeFilter(filter.propName):store$1.resetSetFilter(filter.propName)},setCurrentPath=path=>{store$1.setCurrentPath(path)},gotoHeaderItem=item=>{console.log(`gotoHeaderItem`,item),item.gotoAngularState?window.bngVue.gotoAngularState(item.gotoAngularState):item.gotoPath&&(item.clearSearch&&clearSearch(),item.clearFilters&&clearFilters(),setCurrentPath({keys:item.gotoPath}),routeNav(item),switchScope(`grid`))};return __expose({screenHeaderPath,clearSearch,clearFilters,setCurrentPath}),(_ctx,_cache)=>withDirectives((openBlock(),createBlock(unref(layoutSingle_default),{class:`grid-selector`},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_1$278,[__props.noBreadcrumbs?(openBlock(),createElementBlock(`div`,_hoisted_2$229)):(openBlock(),createBlock(unref(bngBreadcrumbs_default),{key:0,class:`header-breadcrumbs`,items:unref(screenHeaderPath),limit:`5`,simple:``,"disable-last-item":``,"show-back-button":showBreadcrumbsBack.value,onClick:gotoHeaderItem,onBack:onBreadBack},null,8,[`items`,`show-back-button`])),__props.inlineHeaderContainer?createCommentVNode(``,!0):(openBlock(),createBlock(HeaderButtons_default,{key:2,"can-switch-details":canSwitchDetails.value,"hidden-tabs":props.hiddenTabs,"details-mode":unref(detailsMode),onSwitchDetailsMode:switchDetailsMode},null,8,[`can-switch-details`,`hidden-tabs`,`details-mode`]))]),createBaseVNode(`div`,_hoisted_3$203,[createBaseVNode(`div`,{class:normalizeClass([`grid-wrapper`,{active:activeSectionScope.value===`grid`}])},[createVNode(BlurBackground_default),unref(showScreenHeader)?(openBlock(),createElementBlock(`div`,{key:0,class:normalizeClass([`header-row`,{active:activeSectionScope.value===`grid`&&unref(showIfController),"no-controller":!unref(showIfController)}])},[createVNode(unref(bngScreenHeadingV2_default),{type:`2`,class:`header-title-v2`},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(screenHeaderTitle)),1)]),_:1}),withDirectives(createBaseVNode(`div`,_hoisted_4$174,[createVNode(unref(bngBinding_default),{"ui-event":`back`,controller:``}),createVNode(unref(bngIcon_default),{type:unref(icons).undo},null,8,[`type`])],512),[[vShow,activeSectionScope.value===`grid`&&unref(showIfController)&¤tPathSegments.value.length>1]])],2)):createCommentVNode(``,!0),withDirectives((openBlock(),createElementBlock(`div`,{class:`grid-content`,ref_key:`gridContentRef`,ref:gridContentRef,"bng-nav-scroll":``,"bng-no-nav":`true`,tabindex:`-1`,onActivate:onGridActivate,onDeactivate:onGridDeactivate,onClick:onGridWrapperClick},[createVNode(Grid_default$1,{"in-details":activeSectionScope.value===`details`&&unref(detailsMode)===`detail`,"display-size":displaySize.value,"backend-name":props.backendName,"auto-focus-key":unref(store$1).autoFocusKey.value,"active-item":unref(store$1).activeItem.value,groups:unref(groups),"tile-images-top-aligned":__props.tileImagesTopAligned,onFocusItem:onItemFocus,onSelectItem:onItemSelect,onDeselectItem:onItemDeselect,"double-click-override":__props.doubleClickOverride},null,8,[`in-details`,`display-size`,`backend-name`,`auto-focus-key`,`active-item`,`groups`,`tile-images-top-aligned`,`double-click-override`])],32)),[[unref(BngScopedNav_default),{activated:scopedNavState.isGridActive,canBubbleEvent:canBubbleGridEvent,canDeactivate:canDeactivateGrid,preferAutoFocus:!0,autoFocusDelay:400}],[unref(BngOnUiNav_default),onToggleSectionScope,`context`],[unref(BngUiNavLabel_default),`Filters and more`,`context`],[unref(BngOnUiNav_default),onBackFromGrid,`back`],[unref(BngUiNavScroll_default)]])],2),withDirectives((openBlock(),createElementBlock(`div`,{class:normalizeClass([`details-wrapper wide`,{active:activeSectionScope.value===`details`,"no-controller":!unref(showIfController)}]),tabindex:`-1`,"bng-no-nav":`true`,onActivate:onDetailsActivate,onDeactivate:onDetailsDeactivate,onClick:onDetailsWrapperClick},[createVNode(BlurBackground_default),createBaseVNode(`div`,{class:normalizeClass([`header-row`,{active:activeSectionScope.value===`details`&&unref(showIfController),"no-controller":!unref(showIfController)}]),"bng-no-child-nav":`true`},[createVNode(HeaderButtons_default,{slim:``,"can-switch-details":canSwitchDetails.value,"hidden-tabs":props.hiddenTabs,"details-mode":unref(detailsMode),onSwitchDetailsMode:switchDetailsMode},null,8,[`can-switch-details`,`hidden-tabs`,`details-mode`]),__props.inlineHeaderContainer?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_5$150,[createVNode(unref(bngCardHeading_default),{type:`ribbon`,class:`header-title`},{default:withCtx(()=>[createTextVNode(toDisplayString(detailsModeTitles[unref(detailsMode)]),1)]),_:1}),detailsModeBackTo[unref(detailsMode)]?(openBlock(),createBlock(unref(bngButton_default),{key:0,"bng-no-nav":`true`,onClick:_cache[0]||=$event=>toggleDetailsMode(detailsModeBackTo[unref(detailsMode)]),accent:unref(ACCENTS).outlined,iconRight:`undo`},{default:withCtx(()=>[createVNode(unref(bngBinding_default),{"ui-event":`back`,controller:``})]),_:1},8,[`accent`])):createCommentVNode(``,!0),withDirectives(createBaseVNode(`div`,_hoisted_6$129,[createVNode(unref(bngIcon_default),{type:unref(icons).adjust},null,8,[`type`]),createVNode(unref(bngBinding_default),{"ui-event":`context`,controller:``})],512),[[vShow,activeSectionScope.value===`grid`||!unref(showIfController)]]),withDirectives(createBaseVNode(`div`,_hoisted_7$115,[createVNode(unref(bngBinding_default),{"ui-event":`back`,controller:``}),createVNode(unref(bngIcon_default),{type:unref(icons).undo},null,8,[`type`])],512),[[vShow,activeSectionScope.value===`details`&&unref(showIfController)]])]))],2),unref(detailsMode)===`advanced`?(openBlock(),createElementBlock(`div`,_hoisted_8$96,[createVNode(SearchBar_default,{searchText:unref(store$1).searchText.value,setSearchText:unref(store$1).setSearchText},null,8,[`searchText`,`setSearchText`]),createVNode(DetailedFilters_default,{filterList:unref(store$1).filterList.value,filterByProp:unref(store$1).filterByProp.value,searchText:unref(store$1).searchText.value,commonFilters:unref(store$1).commonFilters.value,detailsMode:unref(store$1).detailsMode.value,onlyCommonFilters:unref(store$1).onlyCommonFilters.value,isFilterLocked:unref(store$1).isFilterLocked,isFilterOptionLocked:unref(store$1).isFilterOptionLocked,isRangeFilterLocked:unref(store$1).isRangeFilterLocked,toggleFilter:unref(store$1).toggleFilter,updateRangeFilter:unref(store$1).updateRangeFilter,resetRangeFilter:unref(store$1).resetRangeFilter,setSearchText:unref(store$1).setSearchText,setDetailsMode:unref(store$1).setDetailsMode},null,8,[`filterList`,`filterByProp`,`searchText`,`commonFilters`,`detailsMode`,`onlyCommonFilters`,`isFilterLocked`,`isFilterOptionLocked`,`isRangeFilterLocked`,`toggleFilter`,`updateRangeFilter`,`resetRangeFilter`,`setSearchText`,`setDetailsMode`]),createVNode(DisplayControls_default,{displayData:unref(store$1).displayData.value,detailsMode:unref(store$1).detailsMode.value,updateDisplayData:unref(store$1).updateDisplayData,resetDisplayDataToDefaults:unref(store$1).resetDisplayDataToDefaults,setDetailsMode:unref(store$1).setDetailsMode},null,8,[`displayData`,`detailsMode`,`updateDisplayData`,`resetDisplayDataToDefaults`,`setDetailsMode`]),createBaseVNode(`div`,_hoisted_9$86,[createVNode(unref(bngButton_default),{onClick:_cache[1]||=$event=>toggleDetailsMode(`filter`),accent:unref(ACCENTS).secondary,iconLeft:`filter`},{default:withCtx(()=>[..._cache[3]||=[createTextVNode(` More filters... `,-1)]]),_:1},8,[`accent`]),createVNode(unref(bngButton_default),{onClick:_cache[2]||=$event=>toggleDetailsMode(`displayControls`),accent:unref(ACCENTS).secondary,iconLeft:`adjust`},{default:withCtx(()=>[..._cache[4]||=[createTextVNode(` Display Options `,-1)]]),_:1},8,[`accent`])]),createVNode(unref(bngCardHeading_default),{type:`line`,class:`heading`},{default:withCtx(()=>[..._cache[5]||=[createTextVNode(`Management`,-1)]]),_:1}),renderSlot(_ctx.$slots,`management-details`,{managementDetails:unref(store$1).managementDetails.value,executeButton:unref(store$1).executeButton},void 0,!0)])):unref(detailsMode)===`filter`?(openBlock(),createElementBlock(`div`,_hoisted_10$75,[createVNode(DetailedFilters_default,{filterList:unref(store$1).filterList.value,filterByProp:unref(store$1).filterByProp.value,searchText:unref(store$1).searchText.value,commonFilters:unref(store$1).commonFilters.value,detailsMode:unref(store$1).detailsMode.value,onlyCommonFilters:unref(store$1).onlyCommonFilters.value,isFilterLocked:unref(store$1).isFilterLocked,isFilterOptionLocked:unref(store$1).isFilterOptionLocked,isRangeFilterLocked:unref(store$1).isRangeFilterLocked,toggleFilter:unref(store$1).toggleFilter,updateRangeFilter:unref(store$1).updateRangeFilter,resetRangeFilter:unref(store$1).resetRangeFilter,setSearchText:unref(store$1).setSearchText,setDetailsMode:unref(store$1).setDetailsMode},null,8,[`filterList`,`filterByProp`,`searchText`,`commonFilters`,`detailsMode`,`onlyCommonFilters`,`isFilterLocked`,`isFilterOptionLocked`,`isRangeFilterLocked`,`toggleFilter`,`updateRangeFilter`,`resetRangeFilter`,`setSearchText`,`setDetailsMode`])])):unref(detailsMode)===`displayControls`?(openBlock(),createBlock(DisplayControls_default,{key:2,class:`scrollable-content`,displayData:unref(store$1).displayData.value,detailsMode:unref(store$1).detailsMode.value,updateDisplayData:unref(store$1).updateDisplayData,resetDisplayDataToDefaults:unref(store$1).resetDisplayDataToDefaults,setDetailsMode:unref(store$1).setDetailsMode},null,8,[`displayData`,`detailsMode`,`updateDisplayData`,`resetDisplayDataToDefaults`,`setDetailsMode`])):unref(detailsMode)===`detail`?(openBlock(),createElementBlock(Fragment,{key:3},[hasSelectedItem.value?(openBlock(),createElementBlock(`div`,_hoisted_11$67,[renderSlot(_ctx.$slots,`item-details`,{activeItem:unref(store$1).activeItem.value,activeItemDetails:unref(store$1).activeItemDetails.value,executeButton:unref(store$1).executeButton,toggleFavourite:unref(store$1).toggleFavourite,exploreFolder:unref(store$1).exploreFolder,goToMod:unref(store$1).goToMod,onFocusItem:setDetailsScope},void 0,!0)])):(openBlock(),createElementBlock(`div`,_hoisted_12$55,[createVNode(SearchBar_default,{searchText:unref(store$1).searchText.value,setSearchText:unref(store$1).setSearchText},null,8,[`searchText`,`setSearchText`]),createVNode(DetailedFilters_default,{filterList:unref(store$1).filterList.value,filterByProp:unref(store$1).filterByProp.value,searchText:unref(store$1).searchText.value,commonFilters:unref(store$1).commonFilters.value,detailsMode:unref(store$1).detailsMode.value,onlyCommonFilters:unref(store$1).onlyCommonFilters.value,isFilterLocked:unref(store$1).isFilterLocked,isFilterOptionLocked:unref(store$1).isFilterOptionLocked,isRangeFilterLocked:unref(store$1).isRangeFilterLocked,toggleFilter:unref(store$1).toggleFilter,updateRangeFilter:unref(store$1).updateRangeFilter,resetRangeFilter:unref(store$1).resetRangeFilter,setSearchText:unref(store$1).setSearchText,setDetailsMode:unref(store$1).setDetailsMode},null,8,[`filterList`,`filterByProp`,`searchText`,`commonFilters`,`detailsMode`,`onlyCommonFilters`,`isFilterLocked`,`isFilterOptionLocked`,`isRangeFilterLocked`,`toggleFilter`,`updateRangeFilter`,`resetRangeFilter`,`setSearchText`,`setDetailsMode`]),createVNode(DisplayControls_default,{displayData:unref(store$1).displayData.value,detailsMode:unref(store$1).detailsMode.value,updateDisplayData:unref(store$1).updateDisplayData,resetDisplayDataToDefaults:unref(store$1).resetDisplayDataToDefaults,setDetailsMode:unref(store$1).setDetailsMode},null,8,[`displayData`,`detailsMode`,`updateDisplayData`,`resetDisplayDataToDefaults`,`setDetailsMode`]),createVNode(unref(bngCardHeading_default),{type:`line`,class:`heading`},{default:withCtx(()=>[..._cache[6]||=[createTextVNode(`Info`,-1)]]),_:1}),_cache[7]||=createBaseVNode(`div`,{class:`scrollable-content`},` Please select an item to see details. `,-1)]))],64)):createCommentVNode(``,!0)],34)),[[unref(BngScopedNav_default),{activated:scopedNavState.isDetailsActive,canDeactivate:()=>!1,canBubbleEvent:canBubbleDetailsEvent,bubbleWhitelistEvents:[`menu`]}],[unref(BngOnUiNav_default),onToggleSectionScope,`context`],[unref(BngUiNavLabel_default),`Filters and more`,`context`],[unref(BngOnUiNav_default),onToggleFavorite,`action_2`],[unref(BngUiNavLabel_default),`Toggle favorite`,`action_2`],[unref(BngOnUiNav_default),onBackFromDetails,`back`,{focusRequired:!0}]])])]),_:3})),[[unref(BngBlur_default)],[unref(BngOnUiNav_default),()=>{},`rotate_h_cam,rotate_v_cam`]])}},GridSelector_default=__plugin_vue_export_helper_default(_sfc_main$311,[[`__scopeId`,`data-v-d340d12f`]]),_hoisted_1$277={class:`details`,"bng-nav-scroll":``},_hoisted_2$228={key:0,class:`preview`},_hoisted_3$202={key:1,class:`content-header`},_hoisted_4$173={key:0,class:`description`},_hoisted_5$149={key:0,class:`specs-grid`},_hoisted_6$128={class:`specs-grid-container`},_hoisted_7$114={class:`spec-content`},_hoisted_8$95={class:`spec-label`},_hoisted_9$85={class:`spec-value`},_hoisted_10$74={key:2,class:`buttons-section`},_sfc_main$310={__name:`AppDetails`,props:{activeItem:{type:Object,default:null},activeItemDetails:{type:Object,default:null},executeButton:{type:Function,required:!0},toggleFavourite:{type:Function,required:!0}},setup(__props){let props=__props,handleButtonClick=buttonId=>{props.executeButton(buttonId)};return(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$277,[__props.activeItemDetails?.preview?(openBlock(),createElementBlock(`div`,_hoisted_2$228,[createVNode(unref(aspectRatio_default),{class:`preview-image`,ratio:`16:8`,"external-image":__props.activeItemDetails.preview},null,8,[`external-image`])])):createCommentVNode(``,!0),__props.activeItemDetails?.headerTitle?(openBlock(),createElementBlock(`div`,_hoisted_3$202,[__props.activeItemDetails?.description?(openBlock(),createElementBlock(`div`,_hoisted_4$173,toDisplayString(__props.activeItemDetails.description),1)):createCommentVNode(``,!0)])):createCommentVNode(``,!0),(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.activeItemDetails?.specifications,(specList,specListIndex)=>(openBlock(),createElementBlock(Fragment,{key:specListIndex},[specList.length>0?(openBlock(),createElementBlock(`div`,_hoisted_5$149,[createBaseVNode(`div`,_hoisted_6$128,[(openBlock(!0),createElementBlock(Fragment,null,renderList(specList,specification=>(openBlock(),createElementBlock(`div`,{key:specification.key,class:`spec-cell`},[specification.icon?(openBlock(),createBlock(unref(bngIcon_default),{key:0,type:specification.icon,class:`spec-icon`},null,8,[`type`])):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_7$114,[createBaseVNode(`div`,_hoisted_8$95,toDisplayString(specification.label)+`:`,1),createBaseVNode(`div`,_hoisted_9$85,[createBaseVNode(`span`,null,toDisplayString(specification.value),1)])])]))),128))])])):createCommentVNode(``,!0)],64))),128)),__props.activeItemDetails?.buttonInfo?.length>0?(openBlock(),createElementBlock(`div`,_hoisted_10$74,[(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.activeItemDetails.buttonInfo,button=>(openBlock(),createBlock(unref(bngButton_default),{key:button.buttonId,"bng-scoped-nav-autofocus":button.primary,accent:button.primary?`main`:`secondary`,label:button.label,icon:button.icon,onClick:$event=>handleButtonClick(button.buttonId)},null,8,[`bng-scoped-nav-autofocus`,`accent`,`label`,`icon`,`onClick`]))),128))])):createCommentVNode(``,!0)])),[[unref(BngUiNavScroll_default),void 0,void 0,{force:!0}]])}},AppDetails_default=__plugin_vue_export_helper_default(_sfc_main$310,[[`__scopeId`,`data-v-c8fb13f2`]]),_sfc_main$309={__name:`AppSelector`,setup(__props){return(_ctx,_cache)=>(openBlock(),createBlock(GridSelector_default,{backendName:`appSelector`,routePath:`/app-selector`,defaultPath:{keys:[`allApps`]},defaultDetailsMode:`advanced`},{"item-details":withCtx(({activeItem,activeItemDetails,executeButton,toggleFavourite})=>[createVNode(AppDetails_default,{activeItem,activeItemDetails,executeButton,toggleFavourite},null,8,[`activeItem`,`activeItemDetails`,`executeButton`,`toggleFavourite`])]),_:1}))}},AppSelector_default=_sfc_main$309,routes_default=[{name:`menu.appselector`,path:`/app-selector/:pathMatch(.*)*`,component:AppSelector_default,props:!0,meta:{clickThrough:!1,infoBar:{visible:!0,showSysInfo:!1},uiApps:{shown:!1},topBar:{visible:!0}}},{name:`menu.appedit`,path:`/app-edit/`,component:NotFound_default,meta:{clickThrough:!0,infoBar:{visible:!0,showSysInfo:!1},uiApps:{shown:!0},topBar:{visible:!0}}}],_hoisted_1$276={class:`main-info`},_hoisted_2$227={class:`heading`},_hoisted_3$201={key:0,class:`stars`},_hoisted_4$172={key:1,class:`aggregate-primary`},_hoisted_5$148={class:`label`},_hoisted_6$127={class:`value`},_hoisted_7$113={key:2,class:`empty-gap`},_sfc_main$308={__name:`PoiCard`,props:{poi:{type:Object,required:!0},shown:{type:Boolean,default:!0}},emits:[`select`,`hover`],setup(__props,{emit:__emit}){let debugLog$1=(message,data)=>{},props=__props,emit$1=__emit,onSelect=()=>{props.poi.id,props.poi.name,emit$1(`select`,props.poi.id)},thumbLoaded=props.shown&&!!props.poi?.thumbnail,thumbShown=ref(thumbLoaded),thumb=ref(thumbLoaded?`url("${props.poi?.thumbnail}")`:`none`),lastThumb=thumbLoaded?props.poi?.thumbnail:void 0;return watch([()=>props.shown,()=>props.poi],()=>{if(props.shown&&props.poi?.thumbnail){let url=props.poi.thumbnail;if(lastThumb!==url){lastThumb=url,thumbLoaded=!1;let img=new Image;img.src=url,img.onload=()=>{lastThumb===url&&(thumbLoaded=!0,thumb.value=`url("${url}")`,thumbShown.value=!0)}}}else props.poi?.thumbnail||(lastThumb=void 0,thumbLoaded=!1,thumb.value=`none`,thumbShown.value=!1)},{immediate:!0}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,{class:normalizeClass([`poi-item`,{highlighted:__props.poi.isSelected}]),onClick:onSelect,"bng-nav-item":``},[createBaseVNode(`div`,{class:normalizeClass([`card-info`,{"content-shown":__props.shown,"thumb-show":thumbShown.value&&!!thumb.value}]),style:normalizeStyle({"--poi-image":thumb.value})},[__props.poi.icon?(openBlock(),createBlock(unref(bngIcon_default),{key:0,class:`mission-icon`,type:__props.poi.icon,color:`white`},null,8,[`type`])):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_1$276,[createBaseVNode(`div`,_hoisted_2$227,toDisplayString(__props.poi.name),1),__props.poi.formattedProgress?(openBlock(),createElementBlock(`div`,_hoisted_3$201,[__props.poi.formattedProgress.unlockedStars?(openBlock(),createBlock(unref(bngMainStars_default),{key:0,"individual-stars":__props.poi.formattedProgress.unlockedStars.defaults,class:`main-stars`,scale:.6,reverse:``},null,8,[`individual-stars`])):createCommentVNode(``,!0),__props.poi.formattedProgress.unlockedStars&&__props.poi.formattedProgress.unlockedStars.totalBonusStarCount>0?(openBlock(),createBlock(unref(bngMainStars_default),{key:1,"individual-stars":__props.poi.formattedProgress.unlockedStars.bonus,class:`bonus-stars`,scale:.6},null,8,[`individual-stars`])):createCommentVNode(``,!0)])):__props.poi.aggregatePrimary?(openBlock(),createElementBlock(`div`,_hoisted_4$172,[createBaseVNode(`span`,_hoisted_5$148,toDisplayString(__props.poi.aggregatePrimary.label)+`:`,1),createBaseVNode(`span`,_hoisted_6$127,toDisplayString(__props.poi.aggregatePrimary.value),1)])):(openBlock(),createElementBlock(`div`,_hoisted_7$113))]),createVNode(unref(bngBinding_default),{class:`input-icon`,"ui-event":`ok`,controller:``})],6)],2))}},PoiCard_default=__plugin_vue_export_helper_default(_sfc_main$308,[[`__scopeId`,`data-v-cd49bd11`]]),_hoisted_1$275={class:`poi-list`},_hoisted_2$226={class:`filter-header`},_hoisted_3$200={class:`poi-list-items`},_sfc_main$307={__name:`PoiList`,props:{store:{type:Object,required:!0}},setup(__props){let props=__props,poiListContainer=ref(null),shownCards=ref(new Set),{groupData,poiData,selectedPoi,selectPoi,onHover,debugLog:debugLog$1}=props.store,processedPoiData=computed(()=>{let processed={};if(!poiData.value)return processed;for(let[poiId,poi]of Object.entries(poiData.value))poi&&(processed[poiId]={id:poi.id||poiId,name:poi.name?$translate.instant(poi.name):``,icon:poi.icon?icons[poi.icon]:icons._empty,thumbnail:poi.thumbnailFile,formattedProgress:poi.formattedProgress,aggregatePrimary:poi.aggregatePrimary?.label&&poi.aggregatePrimary?.value?{label:$translate.instant(poi.aggregatePrimary.label),value:$translate.instant(poi.aggregatePrimary.value)}:null,isSelected:selectedPoi.value?.id===poi.id});return processed});debugLog$1(`PoiList`,`Component initialized`,{groupDataCount:groupData.value?.length||0,poiDataCount:Object.keys(poiData.value||{}).length,processedPoiCount:Object.keys(processedPoiData.value).length});let observer$2=new IntersectionObserver(entries=>{for(let entry of entries){let poiId=entry.target.getAttribute(`data-poi-id`);poiId&&entry.isIntersecting?shownCards.value.add(poiId):shownCards.value.delete(poiId)}},{threshold:.1,rootMargin:`10px`}),setupObserver=()=>{if(!poiListContainer.value)return;let elms$4=poiListContainer.value.querySelectorAll(`[data-poi-id]`),ids=[];for(let elm of elms$4){let poiId=elm.getAttribute(`data-poi-id`);poiId&&(ids.push(poiId),observer$2.observe(elm))}for(let id of shownCards.value)ids.includes(id)||shownCards.value.delete(id)};return watch(poiListContainer,cont=>cont&&nextTick(setupObserver),{immediate:!0}),watch([groupData,processedPoiData],()=>{nextTick(()=>{observer$2.disconnect(),setupObserver()})},{immediate:!1}),onUnmounted(()=>{shownCards.value.clear(),observer$2.disconnect()}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$275,[createBaseVNode(`div`,{class:`poi-list-content`,ref_key:`poiListContainer`,ref:poiListContainer},[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(groupData),section=>(openBlock(),createElementBlock(`div`,{key:section.key,class:`filter-section`},[createBaseVNode(`div`,_hoisted_2$226,[createVNode(unref(bngIcon_default),{type:section.icon},null,8,[`type`]),createBaseVNode(`span`,null,toDisplayString(section.title?_ctx.$tt(section.title):``),1)]),(openBlock(!0),createElementBlock(Fragment,null,renderList(section.groups,group=>(openBlock(),createElementBlock(`div`,{key:group.key,class:`mission-group`},[createVNode(unref(bngCardHeading_default),{class:`mission-group-header`,type:`ribbon`,outline:``},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(group.label)),1)]),_:2},1024),createBaseVNode(`div`,_hoisted_3$200,[(openBlock(!0),createElementBlock(Fragment,null,renderList(group.elementIds,poiId=>(openBlock(),createBlock(PoiCard_default,{key:poiId,"data-poi-id":poiId,shown:shownCards.value.has(poiId),poi:processedPoiData.value[poiId],onSelect:unref(selectPoi),onHover:unref(onHover)},null,8,[`data-poi-id`,`shown`,`poi`,`onSelect`,`onHover`]))),128))])]))),128))]))),128))],512)]))}},PoiList_default=__plugin_vue_export_helper_default(_sfc_main$307,[[`__scopeId`,`data-v-0ccba230`]]),_hoisted_1$274={class:`header`},_sfc_main$306={__name:`bngAdvCardHeading`,props:{blurDelay:Number,preheadings:Array,divider:Boolean,icon:String,type:{type:String,default:`line`,validator:v=>[`line`,`ribbon`].includes(v)||v===``}},setup(__props){let blurVal=ref(!1);onMounted(()=>window.setTimeout(()=>blurVal.value=!0,~~+props.blurDelay));let props=__props;return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,{class:normalizeClass([`bng-screen-header`,{[`heading-style-${__props.type}`]:!0,prehead:__props.preheadings}])},[_cache[0]||=createBaseVNode(`div`,{class:`decorator`},null,-1),__props.preheadings?(openBlock(),createElementBlock(`span`,{key:0,class:normalizeClass([`pre-header`,{"with-divider":__props.divider}])},[__props.icon?(openBlock(),createBlock(unref(bngIcon_default),{key:0,type:__props.icon,class:`pre-header-icon`},null,8,[`type`])):createCommentVNode(``,!0),(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.preheadings,preheading=>(openBlock(),createElementBlock(`span`,{class:`location`,key:preheading},toDisplayString(preheading),1))),128))],2)):createCommentVNode(``,!0),createBaseVNode(`h1`,_hoisted_1$274,[renderSlot(_ctx.$slots,`default`,{},void 0,!0)])],2))}},bngAdvCardHeading_default=__plugin_vue_export_helper_default(_sfc_main$306,[[`__scopeId`,`data-v-16619e8d`]]),_hoisted_1$273={key:0,class:`poi-icons`},_hoisted_2$225=[`onClick`],_hoisted_3$199={key:1,class:`poi-details`},_hoisted_4$171={class:`poi-content`},_hoisted_5$147={class:`poi-scrollable`},_hoisted_6$126={key:0,class:`poi-aggregate-display`},_hoisted_7$112={key:0,class:`poi-stars`},_hoisted_8$94={class:`stars`},_hoisted_9$84={key:1,class:`aggregate-primary`},_hoisted_10$73={class:`label`},_hoisted_11$66={class:`value`},_hoisted_12$54={key:1,class:`poi-description`},_hoisted_13$47={class:`poi-actions`},_sfc_main$305={__name:`PoiDetails`,props:{store:{type:Object,required:!0}},emits:[`setRoute`,`teleport`],setup(__props,{emit:__emit}){let props=__props,{selectedPoi,selectedPoiIds,poiData,debugLog:debugLog$1}=props.store;debugLog$1(`PoiDetails`,`Component initialized`,{selectedPoiId:selectedPoi.value?.id,selectedPoiIdsCount:selectedPoiIds.value?.length||0});let selectedPoisList=computed(()=>{if(!selectedPoiIds.value||selectedPoiIds.value.length===0)return selectedPoi.value?[selectedPoi.value]:[];let pois=[];for(let poiId of selectedPoiIds.value){let poi=poiData.value[poiId];poi&&pois.push(poi)}return debugLog$1(`PoiDetails`,`Final pois list`,pois),pois}),currentPoiIndex=computed(()=>{if(selectedPoisList.value.length<=1)return 0;let index=selectedPoisList.value.findIndex(poi=>poi.id===selectedPoi.value?.id);return index>=0?index:0}),selectPoi=index=>{index>=0&&index{let headings=[];return selectedPoi.value?.label&&headings.push($translate.instant(selectedPoi.value.label)),headings}),preview=computed(()=>selectedPoi.value?.previewFiles?.length>0?selectedPoi.value.previewFiles[0]:selectedPoi.value?.thumbnailFile||null),safeTranslate=key=>{if(!key)return``;try{return typeof key==`string`?$translate.instant(key):(typeof key==`object`&&key.txt,$translate.contextTranslate(key))}catch(e){return console.warn(`Translation failed for key:`,key,e),typeof key==`string`?key:key?.txt||``}},aggregatePrimary=computed(()=>{let poi=selectedPoi.value;return poi?.aggregatePrimary?.label&&poi?.aggregatePrimary?.value?poi.aggregatePrimary:null}),onAction=action=>{props.store.executePoiAction(action.actionId)};return(_ctx,_cache)=>(openBlock(),createElementBlock(Fragment,null,[selectedPoisList.value.length>=1?withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$273,[(openBlock(!0),createElementBlock(Fragment,null,renderList(selectedPoisList.value,(poi,index)=>(openBlock(),createElementBlock(`div`,{key:poi.id||index,class:normalizeClass([`poi-icon`,{active:index===currentPoiIndex.value}]),onClick:$event=>selectPoi(index)},[createVNode(unref(bngSpriteIcon_default),{src:`map_`+poi.spriteIcon,style:{width:`100%`,height:`100%`}},null,8,[`src`])],10,_hoisted_2$225))),128))])),[[unref(BngBlur_default),!0]]):createCommentVNode(``,!0),unref(selectedPoi)?withDirectives((openBlock(),createElementBlock(`div`,_hoisted_3$199,[createBaseVNode(`div`,_hoisted_4$171,[createVNode(bngAdvCardHeading_default,{class:`poi-details-header`,type:`line`,preheadings:preheadings.value},{default:withCtx(()=>[createTextVNode(toDisplayString(safeTranslate(unref(selectedPoi).name)),1)]),_:1},8,[`preheadings`]),createBaseVNode(`div`,_hoisted_5$147,[preview.value?(openBlock(),createBlock(aspectRatio_default,{key:0,class:`poi-thumbnail`,ratio:`16:9`,externalImage:preview.value,imageMode:`cover`},{default:withCtx(()=>[aggregatePrimary.value||unref(selectedPoi).formattedProgress?(openBlock(),createElementBlock(`div`,_hoisted_6$126,[unref(selectedPoi).formattedProgress?(openBlock(),createElementBlock(`div`,_hoisted_7$112,[createBaseVNode(`div`,_hoisted_8$94,[unref(selectedPoi).formattedProgress.unlockedStars?(openBlock(),createBlock(unref(bngMainStars_default),{key:0,individualStars:unref(selectedPoi).formattedProgress.unlockedStars.defaults,class:`main-stars`,scale:.8,reverse:``},null,8,[`individualStars`])):createCommentVNode(``,!0),unref(selectedPoi).formattedProgress.unlockedStars&&unref(selectedPoi).formattedProgress.unlockedStars.totalBonusStarCount>0?(openBlock(),createBlock(unref(bngMainStars_default),{key:1,individualStars:unref(selectedPoi).formattedProgress.unlockedStars.bonus,class:`bonus-stars`,scale:.8},null,8,[`individualStars`])):createCommentVNode(``,!0)])])):aggregatePrimary.value?(openBlock(),createElementBlock(`div`,_hoisted_9$84,[createBaseVNode(`span`,_hoisted_10$73,toDisplayString(_ctx.$t(aggregatePrimary.value.label))+`:`,1),createBaseVNode(`span`,_hoisted_11$66,toDisplayString(_ctx.$t(aggregatePrimary.value.value)),1)])):createCommentVNode(``,!0)])):createCommentVNode(``,!0)]),_:1},8,[`externalImage`])):createCommentVNode(``,!0),unref(selectedPoi).description?(openBlock(),createElementBlock(`div`,_hoisted_12$54,toDisplayString(safeTranslate(unref(selectedPoi).description)),1)):createCommentVNode(``,!0)]),createBaseVNode(`div`,_hoisted_13$47,[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(selectedPoi).actions,action=>(openBlock(),createBlock(unref(bngButton_default),{key:action.id,accent:unref(ACCENTS).secondary,"icon-right":action.icon,label:action.label,onClick:$event=>onAction(action)},null,8,[`accent`,`icon-right`,`label`,`onClick`]))),128))])])])),[[unref(BngBlur_default),!0]]):createCommentVNode(``,!0)],64))}},PoiDetails_default=__plugin_vue_export_helper_default(_sfc_main$305,[[`__scopeId`,`data-v-35e47e7e`]]),_hoisted_1$272={class:`poi-filters`},_hoisted_2$224={key:0,class:`filter-row`},_hoisted_3$198=[`onClick`],_hoisted_4$170=[`onClick`],_sfc_main$304={__name:`PoiFilters`,props:{store:{type:Object,required:!0}},setup(__props){let props=__props,{filterData,debugLog:debugLog$1}=props.store;debugLog$1(`PoiFilters`,`Component initialized`,{filterDataCount:filterData.value?.length||0});let getGroupVisualState=(filter,group)=>{if(!filter||!group||!filter.groups||!Array.isArray(filter.groups))return`inactive`;let visibleGroups=0,totalGroups=0;for(let filterGroup of filter.groups)filterGroup&&filterGroup.elementCount>0&&(totalGroups++,filterGroup.visible&&visibleGroups++);let isAllGroupsActive=visibleGroups===totalGroups,isGroupActive=group.visible;return isAllGroupsActive?`neutral`:isGroupActive?`active`:`inactive`},getGroupColor=(filter,group)=>{switch(getGroupVisualState(filter,group)){case`neutral`:return`var(--bng-off-white)`;case`active`:return`var(--bng-add-green-100)`;case`inactive`:default:return`var(--bng-add-red-300)`}},hasActiveFilters=filter=>{if(!filter||!filter.groups||!Array.isArray(filter.groups))return!1;let visibleGroups=0,totalGroups=0;for(let group of filter.groups)group&&group.elementCount>0&&(totalGroups++,group.visible&&visibleGroups++);return visibleGroups{debugLog$1(`PoiFilters`,`Toggling group visibility`,groupKey),props.store.toggleGroupVisibility(groupKey)},toggleFilterSectionVisibility=filterKey=>{debugLog$1(`PoiFilters`,`Toggling filter section visibility`,filterKey),props.store.toggleFilterSectionVisibility(filterKey)};return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$272,[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(filterData),filterSection=>(openBlock(),createElementBlock(Fragment,{key:filterSection.key},[filterSection&&filterSection.groups?withDirectives((openBlock(),createElementBlock(`div`,_hoisted_2$224,[createBaseVNode(`div`,{class:normalizeClass([`filter-icon`,{"has-active-filters":hasActiveFilters(filterSection)}]),onClick:$event=>toggleFilterSectionVisibility(filterSection.key)},[createVNode(bngTooltip_default,{text:_ctx.$tt(filterSection.title)},{default:withCtx(()=>[createVNode(unref(bngIcon_default),{type:filterSection.icon},null,8,[`type`])]),_:2},1032,[`text`])],10,_hoisted_3$198),_cache[0]||=createBaseVNode(`div`,{class:`filter-separator`},null,-1),(openBlock(!0),createElementBlock(Fragment,null,renderList(filterSection.groups,group=>(openBlock(),createElementBlock(Fragment,{key:group.key},[group&&group.elementCount>0?(openBlock(),createElementBlock(`div`,{key:0,class:normalizeClass([`filter-group`,{inactive:!group.visible}]),onClick:$event=>toggleGroupVisibility(group.key)},[createVNode(bngTooltip_default,{text:_ctx.$tt(group.label)+` ×`+group.elementCount},{default:withCtx(()=>[createVNode(unref(bngIcon_default),{type:group.icon||`info`,color:getGroupColor(filterSection,group)},null,8,[`type`,`color`])]),_:2},1032,[`text`])],10,_hoisted_4$170)):createCommentVNode(``,!0)],64))),128))])),[[unref(BngBlur_default),!0]]):createCommentVNode(``,!0)],64))),128))]))}},PoiFilters_default=__plugin_vue_export_helper_default(_sfc_main$304,[[`__scopeId`,`data-v-43aa27ac`]]);const debugLog=(component,message,data)=>{};function useBigMap(){let selectedPoi=ref(null),selectedPoiIds=ref([]),filterData=ref([]),groupData=ref([]),poiData=ref({}),gameMode=ref(``),levelData=ref({title:``}),isPoiListVisible=ref(!1),isDetailsVisible=ref(!1),{events:events$3}=useBridge(),translatedPreheadings=computed(()=>{let preheadings=[];return gameMode.value&&preheadings.push($translate.instant(`ui.playmodes.${gameMode.value}`)),levelData.value?.title&&preheadings.push($translate.instant(levelData.value.title)),preheadings}),currentFilterTitle=computed(()=>$translate.instant(`bigMap.sideMenu.pois`)),getStaticDataFromLua=async()=>{try{poiData.value=await Lua_default.freeroam_vueBigMap.getPoiData()||{};let gameStateResult=await Lua_default.freeroam_vueBigMap.getGameStateInfo();gameStateResult&&(gameMode.value=gameStateResult.gameMode||``,levelData.value=gameStateResult.levelData||{title:``}),poiData.value,gameMode.value}catch(error){console.error(`Error getting static data from Lua:`,error)}},getDynamicDataFromLua=async()=>{try{filterData.value=await Lua_default.freeroam_vueBigMap.getFilters()||[],groupData.value=await Lua_default.freeroam_vueBigMap.getGroups()||[],filterData.value,groupData.value}catch(error){console.error(`Error getting dynamic data from Lua:`,error)}},handleShowPoiDetails=data=>{let poiIds=data?.poiIds||[];if(selectedPoiIds.value=poiIds,poiIds.length===0){selectedPoi.value=null,isDetailsVisible.value=!1;return}let selectedPoiId=poiIds[0];selectedPoiId&&poiData.value[selectedPoiId]?(selectedPoi.value=poiData.value[selectedPoiId],isDetailsVisible.value=!0):(selectedPoi.value=null,isDetailsVisible.value=!1)},toggleGroupVisibility=async groupKey=>{try{let filterIds=[groupKey];await Lua_default.freeroam_vueBigMap.toggleFiltersByIds(filterIds),await getDynamicDataFromLua()}catch(error){console.error(`Error toggling group visibility:`,error)}},toggleFilterSectionVisibility=async filterKey=>{try{await Lua_default.freeroam_vueBigMap.toggleFilterSectionById(filterKey),await getDynamicDataFromLua()}catch(error){console.error(`Error toggling filter visibility:`,error)}},selectPoi=async poiId=>{try{let result=await Lua_default.freeroam_vueBigMap.selectPoiFromList(poiId);result===`success`?poiId?(selectedPoi.value=poiData.value[poiId],isDetailsVisible.value=!0):(selectedPoi.value=null,isDetailsVisible.value=!1):console.error(`Failed to select POI:`,result)}catch(error){console.error(`Error selecting POI:`,error)}};return{selectedPoi,selectedPoiIds,filterData,groupData,poiData,gameMode,levelData,isPoiListVisible,isDetailsVisible,translatedPreheadings,currentFilterTitle,initialize:async()=>{try{await Lua_default.freeroam_vueBigMap.enterBigMap(),await getStaticDataFromLua(),await getDynamicDataFromLua(),events$3.on(`showPoiDetails`,handleShowPoiDetails)}catch(error){console.error(`Error initializing bigmap:`,error)}},cleanup:async()=>{try{await Lua_default.freeroam_vueBigMap.exitBigMap(),events$3.off(`showPoiDetails`)}catch(error){console.error(`Error cleaning up bigmap:`,error)}},selectPoi,showPoiList:()=>{isPoiListVisible.value=!0},hidePoiList:()=>{isPoiListVisible.value=!1,selectedPoi.value&&selectPoi(null)},onHover:async(poiId,active)=>{try{await Lua_default.freeroam_vueBigMap.hoverPoiFromList(poiId,active)}catch(error){console.error(`Error hovering POI:`,error)}},executePoiAction:async actionId=>{try{await Lua_default.freeroam_vueBigMap.executePoiAction(actionId)}catch(error){console.error(`Error executing POI action:`,error)}},toggleGroupVisibility,toggleFilterSectionVisibility,debugLog}}var _hoisted_1$271={class:`bigmap-container`},_hoisted_2$223={class:`bigmap-content`},_hoisted_3$197={class:`bigmap-left-content`},_hoisted_4$169={class:`bigmap-poilist-outline`},_hoisted_5$146={key:0,class:`bigmap-details-outline`},_sfc_main$303={__name:`BigMap`,setup(__props){let store$1=useBigMap(),{isPoiListVisible,isDetailsVisible,translatedPreheadings,currentFilterTitle,onSetRoute,onTeleport,toggleGroupVisibility,initialize,cleanup,debugLog:debugLog$1}=store$1,handleToggleGroupVisibility=groupKey=>{debugLog$1(`BigMap`,`Toggle group visibility`,groupKey),toggleGroupVisibility(groupKey)};return onMounted(()=>{debugLog$1(`BigMap`,`Component mounted, initializing bigmap`),initialize()}),onUnmounted(()=>{debugLog$1(`BigMap`,`Component unmounted, cleaning up bigmap`),cleanup()}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$271,[createVNode(unref(bngScreenHeading_default),{class:`bigmap-heading`,preheadings:unref(translatedPreheadings),divider:!0,type:`line`},{default:withCtx(()=>[createTextVNode(toDisplayString(unref(currentFilterTitle)),1)]),_:1},8,[`preheadings`]),createBaseVNode(`div`,_hoisted_2$223,[createBaseVNode(`div`,_hoisted_3$197,[createVNode(PoiFilters_default,{store:unref(store$1),onToggleGroupVisibility:handleToggleGroupVisibility},null,8,[`store`]),createBaseVNode(`div`,_hoisted_4$169,[createVNode(unref(bngDrawer_default),{modelValue:unref(isPoiListVisible),"onUpdate:modelValue":_cache[0]||=$event=>isRef(isPoiListVisible)?isPoiListVisible.value=$event:null,position:`left`,blur:``,header:_ctx.$tt(`bigMap.sideMenu.pois`)},{default:withCtx(()=>[createVNode(PoiList_default,{class:`bigmap-poilist`,store:unref(store$1)},null,8,[`store`])]),_:1},8,[`modelValue`,`header`])])]),_cache[1]||=createBaseVNode(`div`,{class:`bigmap-center-outline`},null,-1),unref(isDetailsVisible)?(openBlock(),createElementBlock(`div`,_hoisted_5$146,[createVNode(PoiDetails_default,{store:unref(store$1),onSetRoute:unref(onSetRoute),onTeleport:unref(onTeleport)},null,8,[`store`,`onSetRoute`,`onTeleport`])])):createCommentVNode(``,!0)])]))}},BigMap_default=__plugin_vue_export_helper_default(_sfc_main$303,[[`__scopeId`,`data-v-e6716bb0`]]),_hoisted_1$270={class:`bigmap-view`},_sfc_main$302={__name:`BigMapView`,setup(__props){return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$270,[createVNode(BigMap_default)]))}},BigMapView_default=__plugin_vue_export_helper_default(_sfc_main$302,[[`__scopeId`,`data-v-044f4742`]]),routes_default$1=[{path:`/bigmap`,name:`bigmap`,component:BigMapView_default,meta:{uiApps:{shown:!1},infoBar:{visible:!0,showSysInfo:!0}}}],_hoisted_1$269={class:`progress-steps`},_hoisted_2$222={class:`step-container`},_hoisted_3$196={class:`step-header`},_hoisted_4$168={class:`step-number`},_hoisted_5$145={class:`step-icon`},_hoisted_6$125={class:`step-label`},_sfc_main$301={__name:`ProgressSteps`,props:{steps:{type:Array,required:!0,validator:steps=>steps.every(step=>step.label&&typeof step.label==`string`||step.title&&typeof step.title==`string`)},currentStep:{type:Number,required:!0,validator:step=>step>=0}},setup(__props){let props=__props,styles={answeredYes:{class:`answered-yes`,icon:`checkboxOn`},answeredNo:{class:`answered-no`,icon:`missionCheckboxCross`},current:{class:`not-answered current`,icon:`arrowLargeRight`},next:{class:`not-answered`,icon:`checkboxOff`}},steps=computed(()=>props.steps.map((step,idx)=>{let answer=step.isAnswered?step.answerType||`yes`:null,status=`next`;return idx(openBlock(),createElementBlock(`div`,_hoisted_1$269,[createBaseVNode(`div`,_hoisted_2$222,[(openBlock(!0),createElementBlock(Fragment,null,renderList(steps.value,(step,index)=>(openBlock(),createElementBlock(`div`,{key:index,class:normalizeClass([`step`,step.class])},[createBaseVNode(`div`,_hoisted_3$196,[createBaseVNode(`div`,_hoisted_4$168,toDisplayString(index+1),1),step.isLastStep?createCommentVNode(``,!0):(openBlock(),createElementBlock(Fragment,{key:0},[_cache[0]||=createBaseVNode(`div`,{class:`step-connector`},null,-1),createBaseVNode(`div`,_hoisted_5$145,[createVNode(unref(bngIcon_default),{type:step.icon},null,8,[`type`])])],64))]),createBaseVNode(`div`,_hoisted_6$125,toDisplayString(_ctx.$tt(step.label)),1)],2))),128))])]))}},ProgressSteps_default=__plugin_vue_export_helper_default(_sfc_main$301,[[`__scopeId`,`data-v-d5d29cd2`]]);function useWizard(options={}){let{allowSkip=!1,validateSteps=!0}=options,stepRegistry=ref(new Map),currentStepIndex=ref(0),completedSteps=ref(new Set),isFinished=ref(!1),steps=computed(()=>{if(stepRegistry.value.size===0)return[];let res=Array.from(stepRegistry.value.values());for(let step of res)if(!(!step.enabledWhen||step.enabledWhen.length===0)){for(let condition of step.enabledWhen)if(condition.step){let dependencyStep=res.find(s=>s.id===condition.step);if(!dependencyStep)continue;dependencyStep.requiredFor||=[],dependencyStep.requiredFor.includes(step.id)||dependencyStep.requiredFor.push(step.id)}}return res}),registerStep=stepConfig=>stepRegistry.value.set(stepConfig.id,stepConfig),unregisterStep=stepId=>stepRegistry.value.delete(stepId);provide(`registerWizardStep`,registerStep),provide(`unregisterWizardStep`,unregisterStep);let currentStep=computed(()=>steps.value[currentStepIndex.value]||null),isFirstStep=computed(()=>currentStepIndex.value===0),isLastStep=computed(()=>currentStepIndex.value===steps.value.length-1),canGoNext=computed(()=>{if(!validateSteps)return!0;let step=currentStep.value;return!step||!isStepEnabled(step)||step.advanceDisabled?!1:typeof step.validate==`function`?step.validate(step.modelValue||{}):step.type===`choice`&&step.required!==!1?step.modelValue?.choice!==void 0:(step.type,!0)}),isStepEnabled=step=>!step.enabledWhen||step.enabledWhen.length===0?!0:step.enabledWhen.every(condition=>{if(condition.step){let dependencyStepData=steps.value.find(s=>s.id===condition.step)?.modelValue||{};if(condition.value!==void 0)return dependencyStepData?.choice===condition.value||dependencyStepData?.[Object.keys(dependencyStepData)[0]]===condition.value;if(typeof condition.condition==`function`)return condition.condition(dependencyStepData)}return typeof condition.condition==`function`?condition.condition():!0}),canGoBack=computed(()=>!isFirstStep.value),canFinish=computed(()=>validateSteps?isLastStep.value&&canGoNext.value:isLastStep.value),goToStep=index=>{index<=0&&(currentStepIndex.value=0),index>=steps.value.length&&(currentStepIndex.value=steps.value.length-1),currentStepIndex.value=index},nextStep=async()=>{if(await nextTick(),!canGoNext.value)return!1;if(currentStep.value&&completedSteps.value.add(currentStepIndex.value),isLastStep.value)return!0;for(currentStepIndex.value++;currentStepIndex.value=steps.value.length&&(currentStepIndex.value=steps.value.length-1),!0};return{currentStepIndex,currentStep,completedSteps,isFinished,steps,stepRegistry,isFirstStep,isLastStep,canGoNext,canGoBack,canFinish,progress:computed(()=>steps.value.length===0?0:Math.round((currentStepIndex.value+1)/steps.value.length*100)),stepProgress:computed(()=>steps.value.map((step,index)=>{let data=step.modelValue||{},choiceAnalysis=null;if(step.type===`choice`&&step.choices&&data.choice!==void 0){let selectedChoice=step.choices.find(c=>c.value===data.choice),yesChoice=step.choices.find(c=>c.isYes),noChoice=step.choices.find(c=>c.isNo),answerType=null;selectedChoice&&(answerType=selectedChoice.isYes||yesChoice&&selectedChoice.value===yesChoice.value?`yes`:selectedChoice.isNo||noChoice&&selectedChoice.value===noChoice.value?`no`:!yesChoice&&!noChoice?`yes`:step.choices.length===2&&!selectedChoice.isYes&&!selectedChoice.isNo?`no`:`yes`),choiceAnalysis={selectedValue:data.choice,selectedChoice,answerType,hasYesFlag:!!yesChoice,hasNoFlag:!!noChoice}}return{...step,index,isCompleted:completedSteps.value.has(index),isCurrent:index===currentStepIndex.value,isAccessible:index<=currentStepIndex.value,isEnabled:isStepEnabled(step),data,hasData:Object.keys(data).length>0,isAnswered:step.type===`choice`?data.choice!==void 0:Object.keys(data).length>0,answerType:choiceAnalysis?.answerType||null,choiceAnalysis}})),goToStep,nextStep,previousStep:async()=>{if(await nextTick(),!canGoBack.value)return!1;for(currentStepIndex.value--;currentStepIndex.value>=0;){let targetStep=steps.value[currentStepIndex.value];if(isStepEnabled(targetStep)||targetStep.autoSkip===!1)break;currentStepIndex.value--}return currentStepIndex.value<0&&(currentStepIndex.value=0),!0},finish:()=>canFinish.value?(isFinished.value=!0,{success:!0,completedSteps:Array.from(completedSteps.value)}):{success:!1},reset:()=>{currentStepIndex.value=0,completedSteps.value.clear(),isFinished.value=!1},skip:()=>allowSkip?nextStep():!1,isStepEnabled,registerStep,unregisterStep}}var _hoisted_1$268={class:`wizard-container`},_hoisted_2$221={class:`wizard-content`},_hoisted_3$195={class:`wizard-step-content`},_hoisted_4$167={key:0,class:`wizard-validation`},_hoisted_5$144={class:`validation-message`},_hoisted_6$124={class:`wizard-navigation`},_hoisted_7$111={key:2,class:`switch-buttons`};const wizardProps={wizardOptions:{type:Object,default:()=>({})},title:String,preheadings:Array,showDivider:{type:Boolean,default:!0},showProgress:{type:Boolean,default:!0},showBackButton:{type:Boolean,default:!0},allowSkip:{type:Boolean,default:!1},backButtonText:{type:String,default:`ui.common.back`},nextButtonText:{type:String,default:`ui.common.next`},finishButtonText:{type:String,default:`ui.common.finish`},skipButtonText:{type:String,default:`ui.common.skip`},validationMessage:String};var _sfc_main$300={__name:`Wizard`,props:mergeModels(wizardProps,{modelValue:{default:()=>({})},modelModifiers:{}}),emits:mergeModels([`step-change`,`step-complete`,`wizard-finish`,`validation-error`],[`update:modelValue`]),setup(__props,{expose:__expose,emit:__emit}){let props=__props,modelValue=useModel(__props,`modelValue`),emit$1=__emit,{currentStepIndex,currentStep,isFirstStep,isLastStep,canGoNext,canGoBack,canFinish,progress,stepProgress,nextStep:wizardNextStep,previousStep:wizardPreviousStep,skip:wizardSkip,steps,registerStep:originalRegisterStep}=useWizard({...props.wizardOptions,allowSkip:props.allowSkip}),instance$1=getCurrentInstance(),hasCentralizedModel=computed(()=>!!(instance$1&&instance$1.attrs&&`onUpdate:modelValue`in instance$1.attrs));provide(`currentWizardStep`,currentStep),provide(`wizardNext`,()=>nextStep()),provide(`wizardSteps`,steps),provide(`registerWizardStep`,stepConfig=>hasCentralizedModel.value?originalRegisterStep({...stepConfig,get modelValue(){return modelValue.value?.[stepConfig.id]||{}},updateModelValue:newValue=>{modelValue.value={...modelValue.value,[stepConfig.id]:newValue}}}):originalRegisterStep(stepConfig)),provide(`unregisterWizardStep`,stepId=>{if(hasCentralizedModel.value&&props.modelValue[stepId]){let updatedData={...props.modelValue};delete updatedData[stepId],emit$1(`update:modelValue`,updatedData)}});let currentStepChoices=computed(()=>currentStep.value?.choices||[]),getChoiceButtonClass=(choiceValue,selectedChoice)=>selectedChoice?selectedChoice===choiceValue?`answered-selected`:`answered-not-selected`:`unanswered`,handleChoiceClick=choice=>{currentStep.value?.updateModelValue&&(currentStep.value.updateModelValue({...currentStep.value.modelValue,choice:choice.value}),nextTick(()=>!currentStep.value?.advanceDisabled&&nextStep()))},nextStep=()=>{let stepId=currentStep.value?.id,currentData=currentStep.value?.modelValue||{};emit$1(`step-complete`,{stepId,stepIndex:currentStepIndex.value,step:currentStep.value,data:currentData}),wizardNextStep()&&emit$1(`step-change`,{from:currentStepIndex.value-1,to:currentStepIndex.value,step:currentStep.value})},previousStep=()=>{let prevIndex=currentStepIndex.value;wizardPreviousStep()&&emit$1(`step-change`,{from:prevIndex,to:currentStepIndex.value,step:currentStep.value})},skip=()=>{wizardSkip()&&emit$1(`step-complete`,{stepId:currentStep.value?.id,stepIndex:currentStepIndex.value-1,skipped:!0,data:currentStep.value?.modelValue||{}})},handleFinish=()=>{let allStepData={};steps.value.forEach(step=>{step.modelValue&&Object.keys(step.modelValue).length>0&&(allStepData[step.id]=step.modelValue)}),canFinish.value?emit$1(`wizard-finish`,{success:!0,data:allStepData,completedSteps:Array.from({length:steps.value.length},(_,i)=>i)}):emit$1(`validation-error`,{step:currentStep.value,message:`Cannot finish wizard - validation failed`})};return __expose({currentStepIndex,currentStep,progress,stepProgress,nextStep,previousStep,finish:handleFinish,skip,steps}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$268,[createBaseVNode(`div`,_hoisted_2$221,[_ctx.title?(openBlock(),createBlock(unref(bngScreenHeading_default),{key:0,preheadings:_ctx.preheadings,"show-divider":_ctx.showDivider},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$tt(_ctx.title)),1)]),_:1},8,[`preheadings`,`show-divider`])):createCommentVNode(``,!0),_ctx.showProgress?(openBlock(),createBlock(unref(bngCard_default),{key:1,class:`wizard-progress-card`},{default:withCtx(()=>[createVNode(ProgressSteps_default,{steps:unref(stepProgress),"current-step":unref(currentStepIndex)},null,8,[`steps`,`current-step`])]),_:1})):createCommentVNode(``,!0),createVNode(unref(bngCard_default),{class:`wizard-main-card`},{buttons:withCtx(()=>[createBaseVNode(`div`,_hoisted_6$124,[_ctx.showBackButton&&!unref(isFirstStep)?(openBlock(),createBlock(unref(bngButton_default),{key:0,disabled:!unref(canGoBack),accent:unref(ACCENTS).secondary,onClick:previousStep},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$tt(_ctx.backButtonText)),1)]),_:1},8,[`disabled`,`accent`])):createCommentVNode(``,!0),_ctx.allowSkip&&!unref(isLastStep)&&unref(currentStep)?.type!==`choice`?(openBlock(),createBlock(unref(bngButton_default),{key:1,accent:unref(ACCENTS).secondary,onClick:skip},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$tt(_ctx.skipButtonText)),1)]),_:1},8,[`accent`])):createCommentVNode(``,!0),_cache[0]||=createBaseVNode(`div`,{class:`spacer`},null,-1),unref(currentStep)?.type===`choice`?(openBlock(),createElementBlock(`div`,_hoisted_7$111,[(openBlock(!0),createElementBlock(Fragment,null,renderList(currentStepChoices.value,choice=>(openBlock(),createBlock(unref(bngButton_default),{key:choice.value,class:normalizeClass(getChoiceButtonClass(choice.value,unref(currentStep)?.modelValue?.choice||null)),accent:unref(ACCENTS).custom,icon:unref(currentStep)?.modelValue?.choice===choice.value?unref(icons).checkmark:null,disabled:unref(currentStep)?.advanceDisabled,onClick:$event=>handleChoiceClick(choice)},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$tt(choice.label)),1)]),_:2},1032,[`class`,`accent`,`icon`,`disabled`,`onClick`]))),128))])):createCommentVNode(``,!0),!unref(isLastStep)&&unref(currentStep)?.type!==`choice`?(openBlock(),createBlock(unref(bngButton_default),{key:3,disabled:!unref(canGoNext),accent:unref(ACCENTS).primary,onClick:nextStep},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$tt(_ctx.nextButtonText)),1)]),_:1},8,[`disabled`,`accent`])):unref(isLastStep)?(openBlock(),createBlock(unref(bngButton_default),{key:4,disabled:!unref(canFinish),accent:unref(ACCENTS).primary,onClick:handleFinish},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$tt(_ctx.finishButtonText)),1)]),_:1},8,[`disabled`,`accent`])):createCommentVNode(``,!0)])]),default:withCtx(()=>[unref(currentStep)?.title?(openBlock(),createBlock(unref(bngCardHeading_default),{key:0,type:`ribbon`},{default:withCtx(()=>[renderSlot(_ctx.$slots,`step-title`,{step:unref(currentStep)},()=>[createTextVNode(toDisplayString(_ctx.$tt(unref(currentStep).title)),1)],!0)]),_:3})):createCommentVNode(``,!0),withDirectives((openBlock(),createElementBlock(`div`,_hoisted_3$195,[renderSlot(_ctx.$slots,`step`,{step:unref(currentStep),stepData:unref(currentStep)?.modelValue,updateStepData:unref(currentStep)?.updateModelValue,stepIndex:unref(currentStepIndex),isFirst:unref(isFirstStep),isLast:unref(isLastStep)},()=>[renderSlot(_ctx.$slots,`default`,{},void 0,!0)],!0),_ctx.validationMessage?(openBlock(),createElementBlock(`div`,_hoisted_4$167,[createBaseVNode(`div`,_hoisted_5$144,toDisplayString(_ctx.validationMessage),1)])):createCommentVNode(``,!0)])),[[unref(BngUiNavScroll_default)]])]),_:3})])]))}},Wizard_default=__plugin_vue_export_helper_default(_sfc_main$300,[[`__scopeId`,`data-v-69c7b9c4`]]),_sfc_main$299={__name:`WizardView`,props:mergeModels({...wizardProps},{modelValue:{},modelModifiers:{}}),emits:mergeModels([`step-change`,`step-complete`,`wizard-finish`,`validation-error`],[`update:modelValue`]),setup(__props,{expose:__expose}){let props=__props,slots=useSlots(),wizardRef=ref(),wizardModel=useModel(__props,`modelValue`);return __expose({wizard:wizardRef,get currentStepIndex(){return wizardRef.value?.currentStepIndex},get currentStep(){return wizardRef.value?.currentStep},get progress(){return wizardRef.value?.progress},get stepProgress(){return wizardRef.value?.stepProgress},get steps(){return wizardRef.value?.steps},nextStep:()=>wizardRef.value?.nextStep(),previousStep:()=>wizardRef.value?.previousStep(),finish:()=>wizardRef.value?.finish(),skip:()=>wizardRef.value?.skip()}),(_ctx,_cache)=>withDirectives((openBlock(),createBlock(unref(layoutSingle_default),{class:`layout-content-full content-center layout-paddings wizard-view`},{default:withCtx(()=>[createVNode(Wizard_default,mergeProps({ref_key:`wizardRef`,ref:wizardRef},props,{modelValue:wizardModel.value,"onUpdate:modelValue":_cache[0]||=$event=>wizardModel.value=$event,onStepChange:_cache[1]||=$event=>_ctx.$emit(`step-change`,$event),onStepComplete:_cache[2]||=$event=>_ctx.$emit(`step-complete`,$event),onWizardFinish:_cache[3]||=$event=>_ctx.$emit(`wizard-finish`,$event),onValidationError:_cache[4]||=$event=>_ctx.$emit(`validation-error`,$event)}),createSlots({_:2},[renderList(unref(slots),(slot,name)=>({name,fn:withCtx(props$1=>[renderSlot(_ctx.$slots,name,normalizeProps(guardReactiveProps(props$1)),void 0,!0)])}))]),1040,[`modelValue`])]),_:3})),[[unref(BngBlur_default)]])}},WizardView_default=__plugin_vue_export_helper_default(_sfc_main$299,[[`__scopeId`,`data-v-e47281c4`]]),_hoisted_1$267={key:0,class:`wizard-summary`},_sfc_main$298={__name:`WizardSummary`,props:{custom:{type:Array,default:()=>[],validator:items$2=>items$2.every(item=>item.label&&item.value!==void 0)},replace:{type:Boolean,default:!1}},setup(__props){let props=__props,steps=inject(`wizardSteps`,ref([])),summaryItems=computed(()=>{let customItems=props.custom.map(item=>({stepId:uniqueId(),title:item.label,selectedLabel:item.value,hasSelection:!item.disabled}));if(props.replace)return customItems;let stepsList=steps.value||[],automaticItems=[];return Array.isArray(stepsList)&&(automaticItems=stepsList.filter(step=>step.type===`choice`&&step.choices&&step.choices.length>0).map(step=>{let selectedChoice=step.modelValue?.choice,choiceOption=step.choices.find(choice=>choice.value===selectedChoice);return{stepId:step.id,title:step.title,selectedLabel:choiceOption?.label||null,hasSelection:!!selectedChoice}}).filter(item=>item.hasSelection)),[...automaticItems,...customItems]});return(_ctx,_cache)=>summaryItems.value.length>0?(openBlock(),createElementBlock(`div`,_hoisted_1$267,[(openBlock(!0),createElementBlock(Fragment,null,renderList(summaryItems.value,item=>(openBlock(),createElementBlock(`div`,{key:item.stepId,class:`summary-item`},[createBaseVNode(`strong`,null,toDisplayString(_ctx.$tt(item.title))+`:`,1),createBaseVNode(`span`,{class:normalizeClass({enabled:item.hasSelection,disabled:!item.hasSelection})},toDisplayString(_ctx.$tt(item.selectedLabel||`ui.common.unknown`)),3)]))),128))])):createCommentVNode(``,!0)}},WizardSummary_default=__plugin_vue_export_helper_default(_sfc_main$298,[[`__scopeId`,`data-v-69c45791`]]),_hoisted_1$266={key:0,class:`wizard-step-container`},_hoisted_2$220={key:0,class:`step-description`},_hoisted_3$194=[`innerHTML`],_hoisted_4$166={class:`step-content`},_hoisted_5$143={key:0,class:`wizard-choice-step`},_hoisted_6$123={key:1,class:`wizard-form-step`},_hoisted_7$110={key:2,class:`wizard-confirmation-step`},_hoisted_8$93={key:3,class:`wizard-custom-step`},_hoisted_9$83={class:`custom-placeholder`},_sfc_main$297={__name:`WizardStep`,props:mergeModels({id:{type:String,required:!0},title:String,description:String,type:{type:String,default:`custom`,validator:value=>[`choice`,`form`,`confirmation`,`custom`].includes(value)},autoSkip:{type:Boolean,default:!0},advanceDisabled:{type:Boolean,default:!1},advanceDelay:{type:Number,default:300},required:{type:Boolean,default:!0},validator:{type:Function,default:null},enabledWhen:{type:Array,default:()=>[]},choices:{type:Array,default:()=>[]},component:{type:[String,Object],default:null},componentProps:{type:Object,default:()=>({})}},{modelValue:{default:()=>({})},modelModifiers:{}}),emits:[`update:modelValue`],setup(__props,{expose:__expose}){let props=__props,modelValue=useModel(__props,`modelValue`),registerStep=inject(`registerWizardStep`,null),unregisterStep=inject(`unregisterWizardStep`,null),currentStep=inject(`currentWizardStep`,null),slots=useSlots(),stepContext={stepId:props.id,stepType:props.type};provide(`wizardStepContext`,stepContext),__expose({stepId:props.id,stepContext});let isCurrentStep=computed(()=>currentStep?.value?.id===props.id);return onMounted(()=>{registerStep?.({id:props.id,title:props.title,description:props.description,type:props.type,autoSkip:props.autoSkip,get advanceDisabled(){return props.advanceDisabled},advanceDelay:props.advanceDelay,required:props.required,enabledWhen:props.enabledWhen,validate:props.validator,component:props.component,componentProps:props.componentProps,choices:props.choices,get modelValue(){return modelValue.value},updateModelValue:value=>{modelValue.value=value},hasDefaultSlot:!!slots.default,hasDescriptionSlot:!!slots.description})}),onUnmounted(()=>{unregisterStep?.(props.id)}),(_ctx,_cache)=>isCurrentStep.value?(openBlock(),createElementBlock(`div`,_hoisted_1$266,[__props.description||_ctx.$slots.description?(openBlock(),createElementBlock(`div`,_hoisted_2$220,[renderSlot(_ctx.$slots,`description`,{},()=>[__props.description?(openBlock(),createElementBlock(`div`,{key:0,innerHTML:__props.description},null,8,_hoisted_3$194)):createCommentVNode(``,!0)],!0)])):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_4$166,[__props.type===`choice`?(openBlock(),createElementBlock(`div`,_hoisted_5$143,[renderSlot(_ctx.$slots,`default`,{},void 0,!0)])):__props.type===`form`?(openBlock(),createElementBlock(`div`,_hoisted_6$123,[renderSlot(_ctx.$slots,`default`,{},()=>[_cache[0]||=createBaseVNode(`div`,{class:`form-placeholder`},[createBaseVNode(`p`,null,`Add your form content here using BngInput, BngDropdown, etc.`),createBaseVNode(`p`,{class:`form-note`},`Use v-model bindings to connect to step data.`)],-1)],!0)])):__props.type===`confirmation`?(openBlock(),createElementBlock(`div`,_hoisted_7$110,[renderSlot(_ctx.$slots,`default`,{},()=>[createVNode(WizardSummary_default)],!0)])):(openBlock(),createElementBlock(`div`,_hoisted_8$93,[renderSlot(_ctx.$slots,`default`,{},()=>[createBaseVNode(`div`,_hoisted_9$83,[createBaseVNode(`p`,null,`Custom step content for: `+toDisplayString(__props.title),1),_cache[1]||=createBaseVNode(`p`,{class:`custom-note`},`Add your custom content in the WizardStep default slot`,-1)])],!0)]))])])):createCommentVNode(``,!0)}},WizardStep_default=__plugin_vue_export_helper_default(_sfc_main$297,[[`__scopeId`,`data-v-ede4abc3`]]),_hoisted_1$265={class:`description`},_hoisted_2$219={class:`image-section`},_hoisted_3$193={class:`image-row`},_hoisted_4$165=[`src`],_hoisted_5$142=[`src`],_sfc_main$296={__name:`ButtonLayoutView`,setup(__props){let settings$1=useSettings(),handleFinish=async()=>{await settings$1.apply({showedInputLayoutPopupV37:!0}),window.bngVue.gotoGameState(`menu.mainmenu`)},goToControls=async()=>{await settings$1.apply({showedInputLayoutPopupV37:!0}),window.bngVue.gotoGameState(`menu.options.controls.bindings`)};return onMounted(async()=>{await settings$1.waitForData()}),(_ctx,_cache)=>(openBlock(),createBlock(unref(WizardView_default),{title:`Input Changes`,class:`wizard-view`,"show-progress":!1,"finish-button-text":`ui.common.continue`,onWizardFinish:handleFinish},{default:withCtx(()=>[createVNode(unref(WizardStep_default),{id:`buttonLayout`,title:`Extended Modifier Buttons`,type:`confirmation`},{default:withCtx(()=>[withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$265,[_cache[1]||=createBaseVNode(`p`,null,` We updated the default button layout for Xbox and Playstation controllers using modifier buttons. Below you see the new default layout. `,-1),_cache[2]||=createBaseVNode(`p`,null,[createBaseVNode(`strong`,{class:`warning-text`},`If you made any changes to the default layout on Xbox or Playstation, we suggest you review your current layout and then either edit it or reset to the default if needed.`)],-1),createVNode(unref(bngButton_default),{accent:unref(ACCENTS).primary,onClick:goToControls},{default:withCtx(()=>[..._cache[0]||=[createTextVNode(` Go to Controls `,-1)]]),_:1},8,[`accent`])])),[[unref(BngUiNavScroll_default)]]),createBaseVNode(`div`,_hoisted_2$219,[_cache[3]||=createBaseVNode(`h4`,null,`New Button Layout`,-1),createBaseVNode(`div`,_hoisted_3$193,[createBaseVNode(`img`,{src:unref(getAssetURL)(`images/buttonLayout1.jpg`),alt:`Button Layout`,class:`button-layout-image`},null,8,_hoisted_4$165),createBaseVNode(`img`,{src:unref(getAssetURL)(`images/buttonLayout2.jpg`),alt:`Button Layout`,class:`button-layout-image`},null,8,_hoisted_5$142)])])]),_:1})]),_:1}))}},ButtonLayoutView_default=__plugin_vue_export_helper_default(_sfc_main$296,[[`__scopeId`,`data-v-ff98d0e0`]]),routes_default$2=[{path:`/buttonLayout`,name:`buttonLayout`,component:ButtonLayoutView_default,meta:{infoBar:{visible:!0,showSysInfo:!0},uiApps:{shown:!1}}}],_hoisted_1$264={class:`left`},_hoisted_2$218={class:`branch-icon-assembly`},_hoisted_3$192=[`innerHTML`],_hoisted_4$164=[`innerHTML`],_sfc_main$295={__name:`BranchSkillProgressBar`,props:{skill:Object,mode:{type:String,default:`long`,validator:value=>[`long`,`short`,`simple`,`with-value-label`].includes(value)},showLevel:{type:Boolean,default:!1},showLockedIcon:{type:Boolean,default:!1},isMainProgress:{type:Boolean,default:!1}},setup(__props){let props=__props,headerLeft=computed(()=>props.skill.name),headerRightLevelOrStars=computed(()=>props.skill.isInDevelopment?``:props.skill.unlocked?(props.showLevel&&props.skill.unlocked,props.skill.showProgressAsStars?$translate.contextTranslate({txt:`ui.career.slashStars`,context:{cur:props.skill.value,max:props.skill.max}}):props.skill.levelLabel?props.skill.levelLabel:props.skill.level?$translate.contextTranslate({txt:`ui.career.lvlLabel`,context:{lvl:props.skill.level}}):`Level ${props.skill.level}`):$translate.contextTranslate(`ui.career.locked`)),value=computed(()=>props.skill.max===-1?1:props.skill.value-props.skill.min),max$1=computed(()=>props.skill.max===-1?1:props.skill.max-props.skill.min),valueLabelFormat=computed(()=>{if(props.skill.isInDevelopment)return $translate.contextTranslate(`ui.career.inDevelopment`);if(!props.skill.unlocked)return $translate.contextTranslate(`ui.career.locked`);if(props.mode===`simple`)return props.skill.showProgressAsStars?$translate.contextTranslate({txt:`ui.career.slashStars`,context:{cur:value.value,max:max$1.value}}):$translate.contextTranslate({txt:`ui.career.lvlLabel`,context:{lvl:props.skill.level}});let unit=props.skill.showProgressAsStars?`Stars`:`XP`;return props.skill.max===-1?$translate.contextTranslate({txt:`ui.career.just`+unit,context:{cur:value.value}}):$translate.contextTranslate({txt:`ui.career.slashXP`,context:{cur:value.value,max:max$1.value}})}),skillIcon=computed(()=>props.skill.isInDevelopment?icons.roadblockL:props.skill.unlocked?props.skill.icon||`info`:`lockClosed`),belowValueLabelFormat=computed(()=>{if(!props.skill.unlocked&&props.skill.lockedReason)return $translate.contextTranslate(props.skill.lockedReason?.label||`ui.career.locked`);if(props.skill.isInDevelopment)return $translate.contextTranslate(`ui.career.inDevelopment`);if(props.skill.isMaxLevel)return``;if(!props.skill.showProgressAsStars)return $translate.contextTranslate({txt:`ui.career.justXP`,context:{cur:props.skill.value}})}),branchBackgroundStyle=computed(()=>{let color=props.skill.accentColor;return color?color.startsWith(`--`)?{"background-color":`var(${color})`}:color.startsWith(`#`)?{"background-color":color}:{"background-color":`rgb(${color})`}:{"background-color":`#555555`}});return(_ctx,_cache)=>__props.mode===`simple`?(openBlock(),createElementBlock(`div`,{key:0,class:normalizeClass([`simple-progress`,{"is-locked":!props.skill.unlocked}])},[createBaseVNode(`div`,_hoisted_1$264,[createBaseVNode(`div`,_hoisted_2$218,[!__props.skill.isSkill&&!__props.skill.isBranch?(openBlock(),createElementBlock(`div`,{key:0,class:`branch-background`,style:normalizeStyle(branchBackgroundStyle.value)},null,4)):createCommentVNode(``,!0),createVNode(unref(bngIcon_default),{type:skillIcon.value,class:`assembly-icon`},null,8,[`type`])]),createTextVNode(` `+toDisplayString(_ctx.$ctx_t(headerLeft.value)),1)]),createBaseVNode(`div`,{class:`right`,innerHTML:valueLabelFormat.value},null,8,_hoisted_3$192)],2)):(openBlock(),createElementBlock(`div`,{key:1,class:normalizeClass([`flex-column`,{"is-locked":!props.skill.unlocked}])},[createVNode(unref(bngProgressBar_default),{class:normalizeClass([`stat-progress-bar`,{short:__props.mode===`short`,isMainProgress:__props.isMainProgress}]),headerLeft:_ctx.$ctx_t(headerLeft.value),headerRight:_ctx.$ctx_t(headerRightLevelOrStars.value),value:value.value,max:max$1.value+.001,showValueLabel:!0,valueLabelFormat:``,valueColor:`#eeeeee`},null,8,[`class`,`headerLeft`,`headerRight`,`value`,`max`]),!props.skill.unlocked&&__props.mode===`with-value-label`&&props.showLockedIcon?(openBlock(),createElementBlock(Fragment,{key:0},[],64)):createCommentVNode(``,!0),__props.mode===`with-value-label`?(openBlock(),createElementBlock(`div`,{key:1,class:`below-progress-bar`,innerHTML:belowValueLabelFormat.value},null,8,_hoisted_4$164)):createCommentVNode(``,!0)],2))}},BranchSkillProgressBar_default=__plugin_vue_export_helper_default(_sfc_main$295,[[`__scopeId`,`data-v-2f641a65`]]);function hexToRgb(hex){hex=hex.replace(/^#/,``);let bigint=parseInt(hex,16);return`${bigint>>16&255}, ${bigint>>8&255}, ${bigint&255}`}function getBranchColorStyle({color,accentColor}){let style={};color&&(color.startsWith(`#`)?style[`--branch-color`]=hexToRgb(color):color.startsWith(`var(--`)&&(style[`--branch-color`]=color));let accent=accentColor||color;return accent&&(accent.startsWith(`#`)?style[`--branch-accent-color`]=hexToRgb(accent):accent.startsWith(`var(--`)&&(style[`--branch-accent-color`]=accent)),style}function getIconBackgroundStyle(color){return color?color.startsWith(`--`)?{"background-color":`var(${color})`}:color.startsWith(`#`)?{"background-color":color}:{"background-color":`rgb(${color})`}:{"background-color":`#555555`}}var _hoisted_1$263={class:`branch-details`},_hoisted_2$217={class:`backdrop`},_hoisted_3$191={class:`skill-levels-wrapper`},_hoisted_4$163={key:0,class:`branch-name-container`},_hoisted_5$141={key:2,class:`branch-footer`},_hoisted_6$122={key:0,class:`branch-description`},_hoisted_7$109={key:0,class:`branch-description`},_hoisted_8$92={class:`branch-footer-content`},_hoisted_9$82={class:`certification-text`},_hoisted_10$72={class:`status`},_hoisted_11$65={class:`unlock-info-row`},_hoisted_12$53={class:`icon-box`},_hoisted_13$46={class:`certification-text`},_sfc_main$294={__name:`BranchSkillCard`,props:{branchKey:String,displayMode:{type:String,default:`card`}},emits:[`openBranchPage`],setup(__props,{emit:__emit}){let props=__props,emit$1=__emit,branchData=ref();computed(()=>branchData.value&&`url(${getAssetURL(branchData.value.icon)})`);let branchColor=computed(()=>{let color=branchData.value&&branchData.value.color;return color?color.startsWith(`#`)?hexToRgb(color):color.startsWith(`var(--`)?`${color}`:`transparent`:``}),branchAccentColor=computed(()=>{let color=branchData.value&&(branchData.value.accentColor||branchData.value.color);return color?color.startsWith(`#`)?hexToRgb(color):color.startsWith(`var(--`)?`${color}`:`transparent`:``}),branchIconType=computed(()=>branchData.value&&branchData.value.isInDevelopment?icons.roadblockL:branchData.value&&branchData.value.unlocked?icons[branchData.value.glyphIcon]:icons.lockClosed),isHalf=computed(()=>{if(!branchData.value)return!1;let hasSkills=branchData.value.skills&&branchData.value.skills.length>0,hasDescription=branchData.value.shortDescription;return!hasSkills&&!hasDescription}),safeArray=arr=>Array.isArray(arr)?arr:[],openBranchPage=branchKey=>emit$1(`openBranchPage`,branchKey);function setup$3(data){branchData.value=data,branchData.value.skills=safeArray(data.skills)}let formatColor=color=>color?color.startsWith(`#`)?hexToRgb(color):color.startsWith(`var(--`)?`${color}`:`rgb(255, 255, 255)`:``;return onMounted(async()=>{setup$3(await Lua_default.career_modules_branches_landing.getBranchSkillCardData(props.branchKey))}),(_ctx,_cache)=>branchData.value?(openBlock(),createBlock(unref(bngCard_default),{key:0,class:normalizeClass([`branch-skill-card`,{"row-mode":__props.displayMode===`row`,locked:!branchData.value.unlocked,half:isHalf.value}]),onClick:_cache[0]||=$event=>openBranchPage(__props.branchKey),style:normalizeStyle({"--branch-color":branchColor.value,"--branch-accent-color":branchAccentColor.value})},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_1$263,[_cache[2]||=createBaseVNode(`div`,{class:`indicator left`},null,-1),_cache[3]||=createBaseVNode(`div`,{class:`indicator right`},null,-1),branchData.value.isDomain?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,{key:0,class:normalizeClass([`branch-progress`,{"in-development":branchData.value.isInDevelopment}])},[branchData.value.isDomain?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,{key:0,class:normalizeClass([`badge`,{"row-badge":__props.displayMode===`row`}])},[createBaseVNode(`div`,_hoisted_2$217,toDisplayString(branchData.value.value.color),1),createVNode(unref(bngIcon_default),{class:`icon-branch`,type:branchIconType.value},null,8,[`type`])],2))],2)),branchData.value.isDomain?(openBlock(),createBlock(unref(aspectRatio_default),{key:1,"external-image":branchData.value.cover,ratio:`16:9`,class:`image-container aspect-ratio`},null,8,[`external-image`])):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_3$191,[__props.displayMode===`row`?(openBlock(),createElementBlock(`div`,_hoisted_4$163,[branchData.value?(openBlock(),createBlock(BranchSkillProgressBar_default,{key:0,class:`main-stat-progress-bar`,skill:branchData.value,showLevel:!0,mode:(branchData.value.isInDevelopment&&isHalf.value,``)},null,8,[`skill`,`mode`])):createCommentVNode(``,!0)])):createCommentVNode(``,!0)]),isHalf.value?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_5$141,[branchData.value.isInDevelopment?(openBlock(),createElementBlock(`div`,_hoisted_6$122,toDisplayString(_ctx.$ctx_t(`ui.career.inDevelopment`)),1)):(openBlock(),createElementBlock(Fragment,{key:1},[branchData.value.shortDescription?(openBlock(),createElementBlock(`div`,_hoisted_7$109,toDisplayString(_ctx.$ctx_t(branchData.value.shortDescription)),1)):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_8$92,[branchData.value.skills?(openBlock(!0),createElementBlock(Fragment,{key:0},renderList(branchData.value.skills,skill=>(openBlock(),createElementBlock(`div`,null,[branchData.value?(openBlock(),createBlock(BranchSkillProgressBar_default,{key:0,skill,mode:`simple`},null,8,[`skill`])):createCommentVNode(``,!0)]))),256)):createCommentVNode(``,!0),(openBlock(!0),createElementBlock(Fragment,null,renderList(branchData.value.certifications,certification=>(openBlock(),createElementBlock(`div`,{class:normalizeClass([`certification-container`,certification.status])},[createVNode(unref(bngIcon_default),{type:unref(icons).badgeRoundStar,style:normalizeStyle({color:certification.status===`completed`?`white`:certification.status===`available`?`rgba(255, 255, 255, 0.6)`:`rgba(255, 255, 255, 0.5)`})},null,8,[`type`,`style`]),createBaseVNode(`div`,_hoisted_9$82,[createTextVNode(toDisplayString(_ctx.$ctx_t(`ui.career.certification.name`))+` `,1),createBaseVNode(`span`,_hoisted_10$72,toDisplayString(_ctx.$ctx_t(certification.statusLabel)),1)])],2))),256)),branchData.value.unlockInfos?(openBlock(),createElementBlock(Fragment,{key:1},[_cache[1]||=createBaseVNode(`div`,{class:`unlock-info-title`},`Required Certifications:`,-1),createBaseVNode(`div`,_hoisted_11$65,[(openBlock(!0),createElementBlock(Fragment,null,renderList(branchData.value.unlockInfos,unlockInfo=>(openBlock(),createElementBlock(`div`,{class:normalizeClass([`unlock-info-item`,unlockInfo.status]),style:normalizeStyle({"--unlock-color":formatColor(unlockInfo.color?unlockInfo.color:`var(--bng-cool-gray-500-rgb)`)})},[createBaseVNode(`div`,_hoisted_12$53,[createVNode(unref(bngIcon_default),{type:unref(icons).badgeRoundStar,class:`certification-icon`},null,8,[`type`])]),createBaseVNode(`div`,_hoisted_13$46,toDisplayString(_ctx.$ctx_t(unlockInfo.label)),1)],6))),256))])],64)):createCommentVNode(``,!0)])],64))]))])]),_:1},8,[`class`,`style`])):createCommentVNode(``,!0)}},BranchSkillCard_default=__plugin_vue_export_helper_default(_sfc_main$294,[[`__scopeId`,`data-v-4321db2f`]]),_hoisted_1$262={class:`condensed`},_hoisted_2$216={key:3,class:`dev-icon-container`},_hoisted_3$190={class:`main-info`},_hoisted_4$162={key:1,class:`stars`},_sfc_main$293={__name:`MissionCard`,props:{mission:Object,isSkeleton:Boolean,showStartableIcons:Boolean},emits:[`clicked`],setup(__props,{emit:__emit}){let props=__props,emit$1=__emit,clicked=()=>emit$1(`clicked`,props.mission),backgroundImageStyle=computed(()=>({backgroundImage:`url(${props.mission.thumbnail})`,maskImage:`linear-gradient(to left, rgba(0, 0, 0, ${props.mission.startable?.75:.2}) 50%, rgba(0, 0, 0, 0.1) 100%)`,filter:props.mission.startable?`none`:`grayscale(100%)`})),iconType$1=computed(()=>props.isSkeleton?icons.medal:icons[props.mission.icon]||icons.medal),iconColor=computed(()=>props.isSkeleton||!props.mission.startable?`var(--bng-cool-gray-600)`:`#fff`),showStartableIcons=computed(()=>!props.isSkeleton&&props.showStartableIcons);return(_ctx,_cache)=>(openBlock(),createBlock(unref(bngCard_default),{"bng-nav-item":``,onClick:clicked,class:normalizeClass({"card-wrapper":!0,"click-startable":__props.mission&&__props.mission.startable})},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_1$262,[__props.isSkeleton?createCommentVNode(``,!0):(openBlock(),createBlock(unref(aspectRatio_default),{key:0,class:`image`,style:normalizeStyle(backgroundImageStyle.value)},null,8,[`style`])),!__props.isSkeleton&&!__props.mission.startable?(openBlock(),createBlock(unref(bngIcon_default),{key:1,class:`locked-icon`,type:unref(icons).lockClosed,color:iconColor.value},null,8,[`type`,`color`])):createCommentVNode(``,!0),!__props.isSkeleton&&showStartableIcons.value?(openBlock(),createElementBlock(Fragment,{key:2},[__props.mission.canStartFromProgressScreen&&__props.mission.startable?(openBlock(),createBlock(unref(bngIcon_default),{key:0,class:`locked-icon`,type:unref(icons).play,color:iconColor.value},null,8,[`type`,`color`])):createCommentVNode(``,!0),!__props.mission.canStartFromProgressScreen&&__props.mission.startable?(openBlock(),createBlock(unref(bngIcon_default),{key:1,class:`locked-icon`,type:unref(icons).mapPoint,color:iconColor.value},null,8,[`type`,`color`])):createCommentVNode(``,!0)],64)):createCommentVNode(``,!0),!__props.isSkeleton&&__props.mission.devMission?(openBlock(),createElementBlock(`div`,_hoisted_2$216,[createVNode(unref(bngIcon_default),{class:`dev-icon`,type:unref(icons).bug,color:`white`},null,8,[`type`]),_cache[0]||=createBaseVNode(`div`,{class:`dev-text`},` DEV MISSION `,-1)])):createCommentVNode(``,!0),_cache[1]||=createBaseVNode(`div`,{class:`highlight-marker`},null,-1),createVNode(unref(bngIcon_default),{class:`mission-icon`,type:iconType$1.value,color:iconColor.value},null,8,[`type`,`color`]),createVNode(unref(bngBinding_default),{class:`input-icon`,"ui-event":`ok`,controller:``}),createBaseVNode(`div`,_hoisted_3$190,[__props.isSkeleton?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,{key:0,class:normalizeClass([`heading`,{locked:!__props.mission.startable}])},toDisplayString(_ctx.$tt(__props.mission.label)),3)),!__props.isSkeleton&&__props.mission.startable&&__props.mission.formattedProgress?(openBlock(),createElementBlock(`div`,_hoisted_4$162,[__props.mission.formattedProgress.unlockedStars&&__props.mission.formattedProgress.unlockedStars.totalDefaultStarCount?(openBlock(),createBlock(unref(bngMainStars_default),{key:0,individualStars:__props.mission.formattedProgress.unlockedStars.defaults,class:`main-stars`,scale:.6},null,8,[`individualStars`])):createCommentVNode(``,!0),__props.mission.formattedProgress.unlockedStars&&__props.mission.formattedProgress.unlockedStars.totalBonusStarCount>0?(openBlock(),createBlock(unref(bngMainStars_default),{key:1,individualStars:__props.mission.formattedProgress.unlockedStars.bonus,class:`bonus-stars`,scale:.6},null,8,[`individualStars`])):createCommentVNode(``,!0)])):createCommentVNode(``,!0)])])]),_:1},8,[`class`]))}},MissionCard_default=__plugin_vue_export_helper_default(_sfc_main$293,[[`__scopeId`,`data-v-52ea67db`]]),_hoisted_1$261={class:`rewards-pills-container`},_sfc_main$292={__name:`RewardPill`,props:{icon:String,attributeKey:String,rewardAmount:Number,highlight:Boolean,hideNumbers:Boolean,backgroundColor:{type:String,default:`rgba(var(--bng-cool-gray-900-rgb), 0.5)`}},setup(__props){return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$261,[createBaseVNode(`div`,{class:`pill`,style:normalizeStyle({backgroundColor:__props.backgroundColor,filter:__props.highlight?`brightness(350%)`:``})},[createVNode(unref(bngUnit_default),mergeProps({[__props.icon?`beamXP`:__props.attributeKey]:__props.rewardAmount},{options:__props.hideNumbers?{formatter:x=>null}:null,iconType:__props.icon?unref(icons)[__props.icon]:null,formatter:__props.attributeKey}),null,16,[`options`,`iconType`,`formatter`])],4)]))}},RewardPill_default=__plugin_vue_export_helper_default(_sfc_main$292,[[`__scopeId`,`data-v-7719e2fc`]]),_hoisted_1$260={class:`rewards-pills-container`},_sfc_main$291={__name:`RewardsPills`,props:{rewards:Object,hideNumbers:Boolean,negativeBackground:{type:Boolean,default:!0}},setup(__props){return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$260,[(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.rewards,reward=>(openBlock(),createBlock(RewardPill_default,{icon:reward.icon,hideNumbers:__props.hideNumbers,attributeKey:reward.attributeKey,rewardAmount:reward.rewardAmount,highlight:reward.highlight,backgroundColor:__props.negativeBackground&&reward.rewardAmount<0?`rgba(var(--bng-add-red-700-rgb), 0.5)`:void 0},null,8,[`icon`,`hideNumbers`,`attributeKey`,`rewardAmount`,`highlight`,`backgroundColor`]))),256))]))}},RewardsPills_default=__plugin_vue_export_helper_default(_sfc_main$291,[[`__scopeId`,`data-v-40e5103d`]]),_hoisted_1$259={key:0,class:`animated-border claimable`},_hoisted_2$215={key:1,class:`complete`},_hoisted_3$189={key:0,class:`complete`},_hoisted_4$161={key:1,class:`complete-badge`},_hoisted_5$140={key:2,class:`step`},_hoisted_6$121={key:3,class:`step`},_hoisted_7$108={class:`content`},_hoisted_8$91={class:`heading`},_hoisted_9$81={key:0,class:`middle-content`},_hoisted_10$71={key:1,class:`middle-content`},_hoisted_11$64={key:3,class:`progress`},_sfc_main$290={__name:`MilestoneCard`,props:{milestone:Object,isCondensed:Boolean},emits:[`claim`],setup(__props,{emit:__emit}){let props=__props,emit$1=__emit,claimMilestone=()=>{console.log(`claimMilestone`,props.milestone),props.milestone.claimable&&(emit$1(`claim`,props.milestone),console.log(props.milestone))},milestoneColor=computed(()=>{let color=props.milestone.color;return color?color.startsWith(`#`)?hexToRgb$1(color):color.startsWith(`var(--`)?`${color}`:`transparent`:``});function hexToRgb$1(hex){return`${parseInt(hex.slice(1,3),16)}, ${parseInt(hex.slice(3,5),16)}, ${parseInt(hex.slice(5,7),16)}`}return(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,{"bng-nav-item":``,onClick:claimMilestone,class:`condensed`},[__props.milestone.claimable?(openBlock(),createElementBlock(`div`,_hoisted_1$259)):createCommentVNode(``,!0),__props.milestone.completed?(openBlock(),createElementBlock(`div`,_hoisted_2$215)):createCommentVNode(``,!0),createVNode(unref(aspectRatio_default),{class:`image`,style:normalizeStyle({backgroundColor:`rgb(`+milestoneColor.value+`)`}),ratio:`21:9`},{default:withCtx(()=>[__props.milestone.completed?(openBlock(),createElementBlock(`div`,_hoisted_3$189)):createCommentVNode(``,!0),__props.milestone.completed?(openBlock(),createElementBlock(`div`,_hoisted_4$161,[createVNode(unref(bngIcon_default),{class:`glyph small`,type:unref(icons).checkmark},null,8,[`type`])])):createCommentVNode(``,!0),createVNode(unref(bngIcon_default),{class:`glyph`,type:unref(icons)[__props.milestone.icon]},null,8,[`type`]),__props.milestone.step!==void 0&&__props.milestone.maxStep!==void 0?(openBlock(),createElementBlock(`div`,_hoisted_5$140,toDisplayString(__props.milestone.step)+`/`+toDisplayString(__props.milestone.maxStep),1)):createCommentVNode(``,!0),__props.milestone.step!==void 0&&__props.milestone.maxStep===void 0?(openBlock(),createElementBlock(`div`,_hoisted_6$121,toDisplayString(__props.milestone.step),1)):createCommentVNode(``,!0)]),_:1},8,[`style`]),createBaseVNode(`div`,_hoisted_7$108,[createBaseVNode(`div`,_hoisted_8$91,toDisplayString(_ctx.$ctx_t(__props.milestone.label)),1),__props.milestone.description?(openBlock(),createElementBlock(`div`,_hoisted_9$81,toDisplayString(_ctx.$ctx_t(__props.milestone.description)),1)):createCommentVNode(``,!0),__props.milestone.rewards?(openBlock(),createElementBlock(`div`,_hoisted_10$71,[createVNode(RewardsPills_default,{rewards:__props.milestone.rewards},null,8,[`rewards`])])):createCommentVNode(``,!0),__props.milestone.completed?(openBlock(),createBlock(unref(bngProgressBar_default),{key:2,value:1,max:1,min:0,valueLabelFormat:`Complete!`,class:`progress`})):createCommentVNode(``,!0),__props.milestone.progress?(openBlock(),createElementBlock(`div`,_hoisted_11$64,[(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.milestone.progress,prog=>(openBlock(),createBlock(unref(bngProgressBar_default),{class:normalizeClass({claimProgressBar:__props.milestone.claimable}),value:prog.currValue,max:prog.maxValue,min:prog.minValue,valueLabelFormat:__props.milestone.claimable?`Click to claim!`:_ctx.$ctx_t(prog.label)},null,8,[`class`,`value`,`max`,`min`,`valueLabelFormat`]))),256))])):createCommentVNode(``,!0)])])),[[unref(BngOnUiNav_default),void 0,`ok`,{focusRequired:!0,asMouse:!0}]])}},MilestoneCard_default=__plugin_vue_export_helper_default(_sfc_main$290,[[`__scopeId`,`data-v-8fc3424a`]]),_hoisted_1$258={class:`progress-track`},_hoisted_2$214={key:0,class:`progress-fill`,style:{height:`100%`}},_hoisted_3$188={class:`header`},_hoisted_4$160={class:`name`},_hoisted_5$139={key:0,class:`stars`},_hoisted_6$120={key:1,class:`stars`},_hoisted_7$107={class:`info`},_hoisted_8$90={class:`unlock-condition`},_hoisted_9$80={class:`info`},_hoisted_10$70={class:`label`},_hoisted_11$63={class:`description`},_hoisted_12$52={key:0,class:`cards-container`},_hoisted_13$45={class:`basic-card locked coming-soon`},_hoisted_14$42={class:`label`},_hoisted_15$40={key:1,class:`right`},_sfc_main$289={__name:`LeagueRow`,props:{league:Object,leagueMissionClicked:Function,condensed:Boolean,vertical:Boolean,nowUnlocked:Boolean},setup(__props){let props=__props;function hexToRgb$1(hex){hex=hex.replace(/^#/,``);let bigint=parseInt(hex,16);return`${bigint>>16&255}, ${bigint>>8&255}, ${bigint&255}`}let leagueStyle=computed(()=>{if(!props.league.accentColor)return{};let style={};return props.league.accentColor.startsWith(`#`)?style[`--league-accent-color`]=hexToRgb$1(props.league.accentColor):props.league.accentColor.startsWith(`var(--`)&&(style[`--league-accent-color`]=props.league.accentColor),style});return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,{class:normalizeClass([`league-row`,{locked:!__props.league._unlocked,condensed:__props.condensed}]),style:normalizeStyle(leagueStyle.value)},[createBaseVNode(`div`,_hoisted_1$258,[__props.league._unlocked?(openBlock(),createElementBlock(`div`,_hoisted_2$214)):createCommentVNode(``,!0)]),createBaseVNode(`div`,_hoisted_3$188,[createBaseVNode(`div`,_hoisted_4$160,[createVNode(unref(bngIcon_default),{type:unref(icons)[__props.league.icon],class:`skill-icon`,color:__props.league._unlocked?`white`:`gray`},null,8,[`type`,`color`]),createTextVNode(` `+toDisplayString(_ctx.$ctx_t(__props.league.name)),1)]),__props.nowUnlocked?(openBlock(),createElementBlock(`div`,_hoisted_6$120,[createVNode(unref(bngIcon_default),{type:unref(icons).lockOpened},null,8,[`type`])])):(openBlock(),createElementBlock(`div`,_hoisted_5$139,[__props.league._unlocked?(openBlock(),createBlock(unref(bngMainStars_default),{key:0,"unlocked-stars":__props.league.totalStarsObtained,"total-stars":__props.league.totalStarsAvailable,class:`main-stars`,scale:.8,reverse:``,numerical:``},null,8,[`unlocked-stars`,`total-stars`])):createCommentVNode(``,!0)]))]),createBaseVNode(`div`,{class:normalizeClass([`content-row`,{vertical:__props.vertical}])},[createBaseVNode(`div`,_hoisted_7$107,[(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.league.unlock,cond=>(openBlock(),createElementBlock(Fragment,null,[cond.hidden?createCommentVNode(``,!0):(openBlock(),createBlock(unref(bngCard_default),{key:0},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_8$90,[createBaseVNode(`div`,_hoisted_9$80,[createVNode(unref(bngIcon_default),{class:`icon`,type:cond.met?unref(icons).lockOpened:unref(icons).lockClosed,color:cond.met?`white`:`gray`},null,8,[`type`,`color`]),createBaseVNode(`div`,_hoisted_10$70,toDisplayString(cond.label),1)]),cond.progress?(openBlock(),createBlock(unref(bngProgressBar_default),{key:0,value:cond.progress.cur,min:cond.progress.min,max:cond.progress.max,valueLabelFormat:``,class:`progress`},null,8,[`value`,`min`,`max`])):createCommentVNode(``,!0)])]),_:2},1024))],64))),256)),createBaseVNode(`div`,_hoisted_11$63,toDisplayString(_ctx.$ctx_t(__props.league.description)),1)]),__props.condensed?(openBlock(),createElementBlock(`div`,_hoisted_15$40,toDisplayString(__props.league.missions.length)+` Challenges `,1)):(openBlock(),createElementBlock(`div`,_hoisted_12$52,[(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.league.missions,mission=>(openBlock(),createBlock(MissionCard_default,{class:`clickable-card`,key:mission.id,mission,onClicked:__props.leagueMissionClicked,showStartableIcons:!0},null,8,[`mission`,`onClicked`]))),128)),(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.league.driftSpots,driftSpot=>(openBlock(),createBlock(MissionCard_default,{class:`clickable-card`,key:driftSpot.id,mission:driftSpot,onClicked:__props.leagueMissionClicked},null,8,[`mission`,`onClicked`]))),128)),__props.league.comingSoon?(openBlock(!0),createElementBlock(Fragment,{key:0},renderList(__props.league.comingSoon,info=>(openBlock(),createBlock(unref(bngCard_default),{class:`card-height`},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_13$45,[createVNode(unref(bngIcon_default),{class:`icon`,type:unref(icons)[info.icon],color:`gray`},null,8,[`type`]),createBaseVNode(`div`,_hoisted_14$42,toDisplayString(info.label),1)])]),_:2},1024))),256)):createCommentVNode(``,!0)]))],2)],6))}},LeagueRow_default=__plugin_vue_export_helper_default(_sfc_main$289,[[`__scopeId`,`data-v-f92a650f`]]),_hoisted_1$257={class:`label`},_hoisted_2$213={class:`text`},_hoisted_3$187={class:`description`},_sfc_main$288={__name:`TaskGoal`,props:{label:[String,Object],description:[String,Object],complete:Boolean,success:Boolean,settings:{type:Object,default:{animate:!1,animateOnMount:!1,successCallback:Function}}},setup(__props){let props=__props,slots=useSlots(),animationSettings=inject(`animationSettings`,props.settings),animate=ref(!1),labelParsed=computed(()=>parse$1($translate.contextTranslate(props.label,!0))),descriptionParsed=computed(()=>parse$1($translate.contextTranslate(props.description,!0))),checkboxSvgs=computed(()=>({"--checkbox-empty":`url(${getAssetURL(`icons/general/checkbox-empty.svg`)})`,"--checkbox-ok":`url(${getAssetURL(`icons/general/checkbox-ok.svg`)})`,"--checkbox-nope":`url(${getAssetURL(`icons/general/checkbox-nope.svg`)})`}));return watch(()=>[props.complete,props.success],(newValues,oldValues)=>{let isComplete=newValues[0],isSuccess=newValues[1];animate.value=animationSettings.animate&&isComplete,isSuccess&&animationSettings.successCallback()}),onBeforeMount(()=>{animate.value=props.settings.animate&&props.settings.animateOnMount}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,{class:normalizeClass([`task-goal`,{success:__props.complete&&__props.success,fail:__props.complete&&!__props.success,animate:animate.value}])},[createBaseVNode(`div`,_hoisted_1$257,[createBaseVNode(`span`,{class:`checkbox`,style:normalizeStyle(checkboxSvgs.value)},null,4),createBaseVNode(`span`,_hoisted_2$213,[unref(slots).label?renderSlot(_ctx.$slots,`label`,{key:0},void 0,!0):__props.label?(openBlock(),createBlock(unref(dynamicComponent_default),{key:1,template:labelParsed.value},null,8,[`template`])):createCommentVNode(``,!0)])]),createBaseVNode(`span`,_hoisted_3$187,[unref(slots).description?renderSlot(_ctx.$slots,`description`,{key:0},void 0,!0):__props.description?(openBlock(),createBlock(unref(dynamicComponent_default),{key:1,template:descriptionParsed.value},null,8,[`template`])):createCommentVNode(``,!0)])],2))}},TaskGoal_default=__plugin_vue_export_helper_default(_sfc_main$288,[[`__scopeId`,`data-v-5a381682`]]),_hoisted_1$256={key:0,class:`wrapper`},_hoisted_2$212={class:`heading`},_hoisted_3$186={class:`description`},_hoisted_4$159={key:1,class:`tasklist wrapper`},_hoisted_5$138={class:`task-content`},_hoisted_6$119={class:`heading`},_hoisted_7$106={class:`description`},_sfc_main$287={__name:`UnlockCard`,props:{data:Object},setup(__props){return(_ctx,_cache)=>(openBlock(),createElementBlock(Fragment,null,[__props.data.type==`tasklist`?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_1$256,[createVNode(unref(bngIcon_default),{class:`icon`,type:unref(icons)[__props.data.icon]},null,8,[`type`]),createBaseVNode(`div`,_hoisted_2$212,toDisplayString(__props.data.heading),1),createBaseVNode(`div`,_hoisted_3$186,toDisplayString(__props.data.description),1)])),__props.data.type==`tasklist`?(openBlock(),createElementBlock(`div`,_hoisted_4$159,[(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.data.tasklistData.tasks,task=>(openBlock(),createElementBlock(`div`,{class:`task`,key:task.label},[createVNode(unref(bngIcon_default),{class:`icon`,type:unref(icons)[task.done?`checkboxOn`:`checkboxOff`]},null,8,[`type`]),createBaseVNode(`div`,_hoisted_5$138,[createBaseVNode(`div`,_hoisted_6$119,toDisplayString(task.label),1),createBaseVNode(`div`,_hoisted_7$106,toDisplayString(task.description),1)])]))),128))])):createCommentVNode(``,!0)],64))}},UnlockCard_default=__plugin_vue_export_helper_default(_sfc_main$287,[[`__scopeId`,`data-v-c5fa6ca1`]]),_hoisted_1$255={class:`unlock-rows`},_hoisted_2$211={class:`rows-container`},_hoisted_3$185={class:`progress-track`},_hoisted_4$158={key:0,class:`progress-fill`,style:{height:`100%`}},_hoisted_5$137={class:`header`},_hoisted_6$118={class:`level-name-and-heading`},_hoisted_7$105={class:`level-label`},_hoisted_8$89={key:0,class:`description-heading`},_hoisted_9$79={class:`content-row`},_hoisted_10$69={class:`description-column`},_hoisted_11$62={class:`unlock-condition`},_hoisted_12$51={class:`info`},_hoisted_13$44={class:`label`},_hoisted_14$41={key:1,class:`description-text`},_hoisted_15$39={class:`unlocks-column`},_hoisted_16$38={key:0,class:`unlocks-list`},_sfc_main$286={__name:`UnlockRows`,props:{value:{type:Number,default:0},min:{type:Number,default:0},max:{type:Number,required:!0},maxRequiredValue:{type:Number,required:!1},tiers:Array,currentTier:Number,unlocked:Boolean,progressFillColor:{type:String,default:`#ff6600`}},setup(__props){useCssVars(_ctx=>({v1b3c87f1:props.progressFillColor.startsWith(`var(--`)&&props.progressFillColor.endsWith(`-rgb)`)?`rgb(${props.progressFillColor})`:props.progressFillColor}));let props=__props;function hexToRgb$1(hex){hex=hex.replace(/^#/,``);let bigint=parseInt(hex,16);return`${bigint>>16&255}, ${bigint>>8&255}, ${bigint&255}`}let progressStyle=computed(()=>{if(!props.progressFillColor)return{};let style={};return props.progressFillColor.startsWith(`#`)?style[`--progress-fill-color`]=hexToRgb$1(props.progressFillColor):props.progressFillColor.startsWith(`var(--`)&&(style[`--progress-fill-color`]=props.progressFillColor),style});return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$255,[createBaseVNode(`div`,_hoisted_2$211,[(openBlock(!0),createElementBlock(Fragment,null,renderList(__props.tiers,(tier,idx)=>(openBlock(),createElementBlock(`div`,{key:tier.index,class:normalizeClass({"tier-row":!0,"grayed-out":__props.currentTier<=tier.index-1,completed:__props.currentTier+1>tier.index,"in-development":tier.isInDevelopment,"first-tier":idx===0,"last-tier":idx===__props.tiers.length-1})},[createBaseVNode(`div`,_hoisted_3$185,[__props.currentTier+1>tier.index?(openBlock(),createElementBlock(`div`,_hoisted_4$158)):createCommentVNode(``,!0)]),createBaseVNode(`div`,_hoisted_5$137,[createBaseVNode(`div`,_hoisted_6$118,[createBaseVNode(`span`,_hoisted_7$105,`Level `+toDisplayString(tier.label?tier.label:tier.index),1),tier.description&&tier.description.heading?(openBlock(),createElementBlock(`span`,_hoisted_8$89,`: `+toDisplayString(tier.description.heading),1)):createCommentVNode(``,!0)])]),createBaseVNode(`div`,_hoisted_9$79,[createBaseVNode(`div`,_hoisted_10$69,[tier.isInDevelopment||__props.currentTier+1<=tier.index||!__props.unlocked?(openBlock(),createBlock(unref(bngCard_default),{key:0,class:`unlock-condition-card`,style:normalizeStyle(progressStyle.value)},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_11$62,[createBaseVNode(`div`,_hoisted_12$51,[createVNode(unref(bngIcon_default),{class:`icon`,type:tier.isInDevelopment?unref(icons).roadblockL:unref(icons).lockClosed,color:`gray`},null,8,[`type`]),createBaseVNode(`div`,_hoisted_13$44,[tier.isInDevelopment?(openBlock(),createElementBlock(Fragment,{key:0},[createTextVNode(` Coming Soon! `)],64)):(openBlock(),createElementBlock(Fragment,{key:1},[createTextVNode(toDisplayString(tier.xpCurrent)+` / `+toDisplayString(tier.xpRequired)+` XP `,1)],64))])]),!tier.isInDevelopment&&tier.currentValue&&tier.requiredValue?(openBlock(),createBlock(unref(bngProgressBar_default),{key:0,value:tier.xpCurrent,min:0,max:tier.xpRequired,valueLabelFormat:``,class:`progress`},null,8,[`value`,`max`])):createCommentVNode(``,!0)])]),_:2},1032,[`style`])):createCommentVNode(``,!0),tier.description&&tier.description.description?(openBlock(),createElementBlock(`div`,_hoisted_14$41,toDisplayString(tier.description.description),1)):createCommentVNode(``,!0)]),createBaseVNode(`div`,_hoisted_15$39,[tier.list&&tier.list.length>0?(openBlock(),createElementBlock(`div`,_hoisted_16$38,[(openBlock(!0),createElementBlock(Fragment,null,renderList(tier.list,(item,idx$1)=>(openBlock(),createBlock(UnlockCard_default,{key:idx$1,class:`unlock-item`,data:item},null,8,[`data`]))),128))])):createCommentVNode(``,!0)])])],2))),128))])]))}},UnlockRows_default=__plugin_vue_export_helper_default(_sfc_main$286,[[`__scopeId`,`data-v-ec31f890`]]),_hoisted_1$254={class:`flex-row`},_hoisted_2$210={class:`player-content`},_hoisted_3$184={class:`stats-row`},_hoisted_4$157={class:`stat-content`},_sfc_main$285={__name:`careerSimpleStats`,setup(__props,{expose:__expose}){let careerStatsData=ref({}),handleCareerSimpleStats=data=>{data.branches.forEach(entry=>{entry.hasOwnProperty(`levelLabel`)&&(entry.name=$translate.contextTranslate(entry.name,!0),entry.levelLabel=$translate.contextTranslate(entry.levelLabel,!0))}),careerStatsData.value=data},updateDisplay=()=>{Lua_default.career_modules_uiUtils.getCareerSimpleStats().then(handleCareerSimpleStats)};return onMounted(()=>{updateDisplay()}),__expose({updateDisplay}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$254,[createBaseVNode(`div`,_hoisted_2$210,toDisplayString(careerStatsData.value.saveSlotName),1),createBaseVNode(`div`,_hoisted_3$184,[(openBlock(!0),createElementBlock(Fragment,null,renderList(careerStatsData.value.branches,branch=>(openBlock(),createElementBlock(`div`,_hoisted_4$157,[createVNode(unref(bngProgressBar_default),{class:`stat-progress-bar`,headerLeft:branch.name,headerRight:branch.levelLabel,min:branch.min,value:branch.value,max:branch.max},null,8,[`headerLeft`,`headerRight`,`min`,`value`,`max`])]))),256))])]))}},careerSimpleStats_default=__plugin_vue_export_helper_default(_sfc_main$285,[[`__scopeId`,`data-v-94a9390d`]]),_sfc_main$284={__name:`careerStatus`,props:{slim:{type:Boolean,default:!1}},setup(__props,{expose:__expose}){let careerStatusData=ref({}),handleCareerStatusData=data=>careerStatusData.value=data,updateDisplay=()=>Lua_default.career_modules_uiUtils.getCareerStatusData().then(handleCareerStatusData);return onMounted(updateDisplay),__expose({updateDisplay}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,null,[createBaseVNode(`div`,{class:normalizeClass([`career-status-progress`,{slim:__props.slim}])},[createVNode(unref(bngUnit_default),{class:`career-status-value`,insuranceScore:careerStatusData.value.insuranceScore},null,8,[`insuranceScore`]),createVNode(unref(bngDivider_default)),createVNode(unref(bngUnit_default),{class:`career-status-value`,vouchers:careerStatusData.value.vouchers},null,8,[`vouchers`]),createVNode(unref(bngDivider_default)),createVNode(unref(bngUnit_default),{class:`career-status-value`,money:careerStatusData.value.money},null,8,[`money`])],2)]))}},careerStatus_default=__plugin_vue_export_helper_default(_sfc_main$284,[[`__scopeId`,`data-v-0446c53b`]]),_hoisted_1$253={key:0},_sfc_main$283={__name:`TutorialButton`,props:{text:{type:String,default:``},icon:{type:Object,default:()=>icons.questionmark},pages:{type:Object,default:[]}},setup(__props){let props=__props,buttonRef=ref(null),seen$3=ref(!0);function clickHandler(){for(let key of props.pages)Lua_default.career_modules_linearTutorial.introPopup(key,!0);seen$3.value=!0}return onMounted(()=>{}),onUnmounted(()=>{}),(_ctx,_cache)=>withDirectives((openBlock(),createBlock(unref(bngButton_default),{ref_key:`buttonRef`,ref:buttonRef,class:normalizeClass([`tut-btn`,{blink:!seen$3.value}]),icon:__props.icon,onClick:withModifiers(clickHandler,[`stop`])},{default:withCtx(()=>[__props.text?(openBlock(),createElementBlock(`span`,_hoisted_1$253,toDisplayString(__props.text),1)):createCommentVNode(``,!0)]),_:1},8,[`icon`,`class`])),[[unref(BngTooltip_default),__props.text?void 0:`View tutorial for this section`]])}},TutorialButton_default=__plugin_vue_export_helper_default(_sfc_main$283,[[`__scopeId`,`data-v-3e539b42`]]),_hoisted_1$252={class:`content`},_hoisted_2$209={class:`insurance-perks-div`},_hoisted_3$183={key:0,class:`leaving-insurance-wrapper`},_hoisted_4$156={class:`breakdown-items-wrapper`},_hoisted_5$136={class:`breakdown-item`},_hoisted_6$117={class:`orange-price`},_hoisted_7$104={class:`breakdown-item`},_hoisted_8$88={class:`red-price`},_hoisted_9$78={class:`breakdown-item total`},_hoisted_10$68={class:`breakdown-item-value-total green-price`},_hoisted_11$61={key:1,class:`no-insurance-wrapper`},_hoisted_12$50={key:2,class:`group-discount-wrapper`},_hoisted_13$43={class:`group-discount-icon-wrapper`},_hoisted_14$40={class:`group-discount-main-text`},_hoisted_15$38={class:`tier-text`},_hoisted_16$37={class:`tier-text`},_hoisted_17$31={class:`discount-text`},_hoisted_18$28={class:`grey-small-text`},_hoisted_19$24={key:3,class:`price-details-wrapper`},_hoisted_20$20={class:`price-tile`},_hoisted_21$18={key:0,class:`old-price-wrapper`},_hoisted_22$16={class:`old-price`},_hoisted_23$15={class:`price-tile-value-wrapper`},_hoisted_24$14={key:1,class:`deductible-discount`},_hoisted_25$13={class:`price-tile`},_hoisted_26$11={class:`price-tile-title`},_hoisted_27$11={class:`price-tile-value-wrapper`},_hoisted_28$10={class:`premium-extra-info`},_hoisted_29$10={class:`renewal-distance`},_sfc_main$282={__name:`insuranceCard`,props:{insuranceData:Object,isSelected:Boolean,isCurrentProvider:{type:Boolean,default:!1}},emits:[`select`],setup(__props,{emit:__emit}){let props=__props,{units}=useBridge(),emit$1=__emit,hasNoInsurance=computed(()=>props.insuranceData?.id===-1),pillText=computed(()=>{if(props.isCurrentProvider)return`CURRENT PROVIDER`;if(props.insuranceData.groupDiscountData){if(props.insuranceData.groupDiscountData?.willHaveGroupDiscountForTheFirstTime)return`MULTI-VEHICLE DISCOUNT AVAILABLE`;if(props.insuranceData.groupDiscountData?.willBumpTheirDiscount)return`BIGGER DISCOUNT AVAILABLE`;if(props.insuranceData.groupDiscountData?.currentTierData&&props.insuranceData.groupDiscountData?.currentTierData.id>0)return`MULTI-VEHICLE DISCOUNT ACTIVE`}return null}),renewsInFormatted=computed(()=>props.insuranceData?.renewsIn?units.buildString(`length`,props.insuranceData.renewsIn*1e3,0):``),leavingInsuranceRenewsInFormatted=computed(()=>props.insuranceData?.leavingInsuranceInfo?.renewsIn?units.buildString(`length`,props.insuranceData.leavingInsuranceInfo.renewsIn*1e3,0):``),selectCard=()=>{emit$1(`select`,props.insuranceData.id)},cardStyles=computed(()=>{let styles={};return!hasNoInsurance.value&&props.insuranceData.color&&(styles[`--insurance-card-rgb`]=hexToRgb(props.insuranceData.color)),styles});return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,{class:normalizeClass([`insurance-card-container`,{selected:__props.isSelected,"no-insurance-card":hasNoInsurance.value,"current-provider":__props.isCurrentProvider}]),style:normalizeStyle(cardStyles.value),onClick:selectCard,"bng-nav-item":``},[pillText.value===null?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,{key:0,class:normalizeClass([`top-pill`,{"no-insurance":hasNoInsurance.value,"orange-pill":__props.insuranceData.groupDiscountData?.willHaveGroupDiscountForTheFirstTime,"current-provider-pill":__props.isCurrentProvider}])},[createBaseVNode(`div`,null,toDisplayString(pillText.value),1)],2)),createBaseVNode(`div`,_hoisted_1$252,[createVNode(unref(insuranceIdentity_default),{class:`insurance-identity`,insuranceData:__props.insuranceData},null,8,[`insuranceData`]),_cache[13]||=createBaseVNode(`div`,{class:`separator`},null,-1),createBaseVNode(`div`,_hoisted_2$209,[hasNoInsurance.value?(openBlock(),createElementBlock(`div`,{key:0,class:normalizeClass([`perks-header`,{"no-insurance":hasNoInsurance.value}])},toDisplayString(hasNoInsurance.value?`Consequences`:`Included Benefits`),3)):createCommentVNode(``,!0),createVNode(unref(insurancePerks_default),{insuranceData:__props.insuranceData},null,8,[`insuranceData`])]),_cache[14]||=createBaseVNode(`div`,{class:`separator`},null,-1),hasNoInsurance.value&&__props.insuranceData.leavingInsuranceInfo&&!__props.isCurrentProvider?(openBlock(),createElementBlock(`div`,_hoisted_3$183,[_cache[4]||=createBaseVNode(`div`,{class:`leaving-insurance-title`},`Cancellation Refund`,-1),createBaseVNode(`div`,_hoisted_4$156,[createBaseVNode(`div`,_hoisted_5$136,[createBaseVNode(`span`,null,` Unused coverage (`+toDisplayString(leavingInsuranceRenewsInFormatted.value)+`) `,1),createBaseVNode(`span`,_hoisted_6$117,[_cache[0]||=createTextVNode(` + `,-1),createVNode(unref(bngUnit_default),{money:__props.insuranceData.leavingInsuranceInfo.coverageRefundPrice},null,8,[`money`])])]),createBaseVNode(`div`,_hoisted_7$104,[_cache[2]||=createBaseVNode(`span`,null,` Early Cancellation Fee (25%) `,-1),createBaseVNode(`span`,_hoisted_8$88,[_cache[1]||=createTextVNode(` - `,-1),createVNode(unref(bngUnit_default),{money:__props.insuranceData.leavingInsuranceInfo.earlyTerminationPenalty},null,8,[`money`])])]),createBaseVNode(`div`,_hoisted_9$78,[_cache[3]||=createBaseVNode(`span`,{class:`breakdown-item-label-total`},` You'll receive `,-1),createBaseVNode(`span`,_hoisted_10$68,[createVNode(unref(bngUnit_default),{money:__props.insuranceData.leavingInsuranceInfo.netRefundPrice},null,8,[`money`])])])])])):createCommentVNode(``,!0),hasNoInsurance.value?(openBlock(),createElementBlock(`div`,_hoisted_11$61,[..._cache[5]||=[createBaseVNode(`span`,{class:`no-insurance-warning`},` You will pay full repair costs `,-1),createBaseVNode(`span`,null,` No coverage or benefits included `,-1)]])):createCommentVNode(``,!0),!hasNoInsurance.value&&__props.insuranceData.groupDiscountData?.mainText?(openBlock(),createElementBlock(`div`,_hoisted_12$50,[createBaseVNode(`div`,null,[createBaseVNode(`span`,_hoisted_13$43,[createVNode(unref(bngIcon_default),{type:unref(icons).checkmark},null,8,[`type`])]),createBaseVNode(`span`,_hoisted_14$40,toDisplayString(__props.insuranceData.groupDiscountData?.mainText),1)]),createBaseVNode(`div`,null,[_cache[7]||=createBaseVNode(`span`,{class:`grey-small-text`},` Currently Insured : `,-1),createBaseVNode(`span`,null,[createVNode(unref(bngIcon_default),{class:`vehicles-icon`,type:unref(icons).car},null,8,[`type`])]),createBaseVNode(`span`,_hoisted_15$38,toDisplayString(__props.insuranceData.carsInsuredCount),1),__props.insuranceData.groupDiscountData?.currentTierData?.id>0?(openBlock(),createElementBlock(Fragment,{key:0},[_cache[6]||=createBaseVNode(`span`,{class:`vertical-separator`},` | `,-1),createBaseVNode(`span`,_hoisted_16$37,` Tier `+toDisplayString(__props.insuranceData.groupDiscountData?.currentTierData?.id),1),createBaseVNode(`span`,_hoisted_17$31,` - `+toDisplayString(__props.insuranceData.groupDiscountData?.currentTierData?.discount*100)+`% off `,1)],64)):createCommentVNode(``,!0)]),createBaseVNode(`div`,_hoisted_18$28,toDisplayString(__props.insuranceData.groupDiscountData?.secondaryText),1)])):createCommentVNode(``,!0),hasNoInsurance.value?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_19$24,[createBaseVNode(`div`,_hoisted_20$20,[_cache[9]||=createBaseVNode(`span`,{class:`price-tile-title`},`Deductible`,-1),__props.insuranceData.baseDeductibledData?.oldPrice?(openBlock(),createElementBlock(`div`,_hoisted_21$18,[createBaseVNode(`div`,_hoisted_22$16,[createVNode(unref(bngUnit_default),{money:__props.insuranceData.baseDeductibledData.oldPrice},null,8,[`money`]),_cache[8]||=createBaseVNode(`div`,{class:`strike`},null,-1)])])):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_23$15,[createVNode(unref(bngUnit_default),{money:__props.insuranceData.baseDeductibledData.price,class:normalizeClass(__props.insuranceData.baseDeductibledData.oldPrice?`green-price`:`orange-price`)},null,8,[`money`,`class`])]),_cache[10]||=createBaseVNode(`div`,{class:`deductible-tips`},[createBaseVNode(`div`,null,` - You pay your deductible for each crash repair `),createBaseVNode(`div`,null,` - Customize this value after purchase `)],-1),__props.insuranceData.baseDeductibledData.perkData?(openBlock(),createElementBlock(`div`,_hoisted_24$14,toDisplayString(__props.insuranceData.baseDeductibledData.perkData.discount*100)+`% discount applied `,1)):createCommentVNode(``,!0)]),createBaseVNode(`div`,_hoisted_25$13,[createBaseVNode(`span`,_hoisted_26$11,toDisplayString(__props.insuranceData.amountDue>0?`Amount Due`:`Credit Received`),1),createBaseVNode(`div`,_hoisted_27$11,[createVNode(unref(bngUnit_default),{money:Math.abs(__props.insuranceData.amountDue),class:`green-price`},null,8,[`money`])]),createBaseVNode(`div`,_hoisted_28$10,[createBaseVNode(`div`,null,[_cache[11]||=createTextVNode(` Total policy : `,-1),createVNode(unref(bngUnit_default),{money:__props.insuranceData.futurePremiumDetails.totalPriceWithDriverScore},null,8,[`money`])]),createBaseVNode(`div`,null,[_cache[12]||=createBaseVNode(`span`,null,`Renews in : `,-1),createBaseVNode(`span`,_hoisted_29$10,toDisplayString(renewsInFormatted.value),1)])])])]))]),createBaseVNode(`div`,{class:normalizeClass([`background`,{"no-insurance":hasNoInsurance.value}])},null,2)],6))}},insuranceCard_default=__plugin_vue_export_helper_default(_sfc_main$282,[[`__scopeId`,`data-v-e481fbef`]]),_hoisted_1$251={class:`premium-wrapper`},_hoisted_2$208={class:`breakdown-item`},_hoisted_3$182={class:`breakdown-item-value`},_hoisted_4$155={class:`premium-value-wrapper`},_hoisted_5$135={class:`breakdown-item`},_hoisted_6$116={class:`breakdown-item-value`},_hoisted_7$103={class:`breakdown-item`},_hoisted_8$87={class:`breakdown-item-value`},_hoisted_9$77={class:`breakdown-item`},_hoisted_10$67={class:`breakdown-item-value orange-text`},_hoisted_11$60={class:`perks`},_hoisted_12$49={key:0,class:`grey-text`},_hoisted_13$42={key:1,class:`grey-text`},_hoisted_14$39={class:`group-discount-savings`},_hoisted_15$37={class:`breakdown-item`},_hoisted_16$36={key:0,class:`grey-text`},_hoisted_17$30={key:1,class:`grey-text`},_hoisted_18$27={class:`buttons`},_sfc_main$281={__name:`smallInsuranceCard`,props:{insuranceData:{type:Object,required:!0},driverScoreData:{type:Object,required:!0}},setup(__props){let{units}=useBridge(),props=__props,renewsEveryFormatted=computed(()=>units.buildString(`length`,props.insuranceData.renewsEvery*1e3,0)),renewsInFormatted=computed(()=>units.buildString(`length`,props.insuranceData.renewsIn*1e3,0)),buttonsDisabled=computed(()=>props.insuranceData.carsInsuredCount===0),openVehicleList=()=>{addPopup(vehicleInsuranceList_default,{insuranceData:props.insuranceData,driverScoreData:props.driverScoreData})},openEditPolicy=()=>{addPopup(editPolicy_default,{insuranceData:props.insuranceData,driverScoreData:props.driverScoreData})},tierToDisplay=computed(()=>props.insuranceData.groupDiscountData.currentTierData.id>0?props.insuranceData.groupDiscountData.currentTierData:props.insuranceData.groupDiscountData.groupDiscountTiers[0]);return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,{class:normalizeClass([`small-insurance-card`,{"no-vehicles":buttonsDisabled.value}]),style:normalizeStyle({"border-top":`0.7rem solid ${props.insuranceData.color}`,background:`linear-gradient(180deg, ${props.insuranceData.color}80 0%, ${props.insuranceData.color}30 10%, ${props.insuranceData.color}10 35%, var(--bng-cool-gray-800) 50%, var(--blue-shade-100) 100%)`})},[createVNode(unref(insuranceIdentity_default),{class:`insurance-identity`,insuranceData:props.insuranceData},null,8,[`insuranceData`]),createBaseVNode(`div`,_hoisted_1$251,[createBaseVNode(`div`,_hoisted_2$208,[createBaseVNode(`span`,null,`Premium / `+toDisplayString(renewsEveryFormatted.value),1),createBaseVNode(`span`,_hoisted_3$182,[createBaseVNode(`div`,_hoisted_4$155,[createVNode(unref(bngUnit_default),{money:props.insuranceData.currentPremiumDetails.totalPriceWithDriverScore},null,8,[`money`])])])]),createBaseVNode(`div`,_hoisted_5$135,[_cache[0]||=createBaseVNode(`span`,null,`Renews in `,-1),createBaseVNode(`span`,_hoisted_6$116,[props.insuranceData.carsInsuredCount===0?(openBlock(),createElementBlock(Fragment,{key:0},[createTextVNode(` - `)],64)):(openBlock(),createElementBlock(Fragment,{key:1},[createTextVNode(toDisplayString(renewsInFormatted.value),1)],64))])]),createBaseVNode(`div`,_hoisted_7$103,[_cache[1]||=createBaseVNode(`span`,null,`Vehicle Coverage`,-1),createBaseVNode(`span`,_hoisted_8$87,[createVNode(unref(bngUnit_default),{money:props.insuranceData.totalInsuranceVehsValue},null,8,[`money`])])]),createBaseVNode(`div`,_hoisted_9$77,[_cache[2]||=createBaseVNode(`span`,null,`Vehicles`,-1),createBaseVNode(`span`,_hoisted_10$67,toDisplayString(props.insuranceData.carsInsuredCount),1)])]),createBaseVNode(`div`,_hoisted_11$60,[createVNode(unref(insurancePerks_default),{insuranceData:props.insuranceData,noDescription:!0},null,8,[`insuranceData`])]),createBaseVNode(`div`,{class:normalizeClass([`group-discount-wrapper`,{disabled:props.insuranceData.groupDiscountData.currentTierData.id===-1}])},[props.insuranceData.carsInsuredCount===0?(openBlock(),createElementBlock(`div`,_hoisted_12$49,` No vehicles insured under this policy `)):props.insuranceData.carsInsuredCount===1?(openBlock(),createElementBlock(`div`,_hoisted_13$42,` Add a second vehicle to unlock Tier 1 (`+toDisplayString(props.insuranceData.groupDiscountData.groupDiscountTiers[0].discount*100)+`%) coverage savings. `,1)):(openBlock(),createElementBlock(Fragment,{key:2},[_cache[4]||=createBaseVNode(`div`,{class:`group-discount`},` MULTI-VEHICLE DISCOUNT `,-1),createBaseVNode(`div`,_hoisted_14$39,[_cache[3]||=createTextVNode(` Savings :`,-1),createVNode(unref(bngUnit_default),{money:props.insuranceData.currentPremiumDetails.groupDiscountSavings},null,8,[`money`])]),createBaseVNode(`div`,_hoisted_15$37,[tierToDisplay.value.max?(openBlock(),createElementBlock(`span`,_hoisted_16$36,` Your coverage falls in the `+toDisplayString(tierToDisplay.value.min/1e3)+`k - `+toDisplayString(tierToDisplay.value.max/1e3)+`k range `,1)):(openBlock(),createElementBlock(`span`,_hoisted_17$30,` Your coverage falls in the `+toDisplayString(tierToDisplay.value.min/1e3)+`k+ range `,1))]),createBaseVNode(`div`,null,[createVNode(unref(insuranceTiers_default),{showTier:!0,tiers:props.insuranceData.groupDiscountData.groupDiscountTiers},null,8,[`tiers`])])],64))],2),createBaseVNode(`div`,_hoisted_18$27,[createVNode(unref(bngButton_default),{class:`edit-policy-button bigger-button`,accent:`custom`,onClick:openEditPolicy,disabled:buttonsDisabled.value},{default:withCtx(()=>[createVNode(unref(bngIcon_default),{class:normalizeClass([`button-icon`,{disabled:buttonsDisabled.value}]),type:unref(icons).adjust},null,8,[`type`,`class`]),createBaseVNode(`span`,{class:normalizeClass([`button-text`,{disabled:buttonsDisabled.value}])},`Edit Policy`,2)]),_:1},8,[`disabled`]),createVNode(unref(bngButton_default),{class:`see-vehicles-button bigger-button`,accent:`custom`,onClick:openVehicleList,disabled:buttonsDisabled.value},{default:withCtx(()=>[createVNode(unref(bngIcon_default),{class:normalizeClass([`button-icon`,{disabled:buttonsDisabled.value}]),type:unref(icons).car},null,8,[`type`,`class`]),createBaseVNode(`span`,{class:normalizeClass([`button-text`,{disabled:buttonsDisabled.value}])},`See Vehicles`,2)]),_:1},8,[`disabled`])])],6))}},smallInsuranceCard_default=__plugin_vue_export_helper_default(_sfc_main$281,[[`__scopeId`,`data-v-38392c0c`]]),_hoisted_1$250={class:`insurance-details-wrapper`,"bng-ui-scope":`insuranceDetailsPopup`},_hoisted_2$207={class:`card-content`},_hoisted_3$181={class:`header`},_hoisted_4$154={class:`header-left`},_hoisted_5$134={class:`insurance-identity`},_hoisted_6$115={class:`insurance-name`},_hoisted_7$102={class:`insurance-slogan`},_hoisted_8$86={class:`covers-renew-info`},_hoisted_9$76={class:`header-right`},_hoisted_10$66={class:`vehicle-name`},_hoisted_11$59={class:`vehicle-value blue-price`},_hoisted_12$48={key:0,class:`group-discount-wrapper`},_hoisted_13$41={class:`group-discount-header`},_hoisted_14$38={class:`group-discount-icon-wrapper`},_hoisted_15$36={class:`group-discount-text-wrapper`},_hoisted_16$35={class:`group-discount-main-text`},_hoisted_17$29={class:`tiers-wrapper`},_hoisted_18$26={class:`textual-tiers-wrapper`},_hoisted_19$23={class:`tier-number`},_hoisted_20$19={class:`money-bracket`},_hoisted_21$17={key:0},_hoisted_22$15={key:1},_hoisted_23$14={class:`current-after-discount-price`},_hoisted_24$13={class:`tier-discount-price`},_hoisted_25$12={class:`policy-value`},_hoisted_26$10={class:`policy-tier`},_hoisted_27$10={class:`tier-discount-price isFutureTier`},_hoisted_28$9={class:`policy-value`},_hoisted_29$9={class:`policy-tier isFuture`},_hoisted_30$9={class:`price-breakdown-wrapper`},_hoisted_31$9={class:`prices-breakdown-header`},_hoisted_32$9={class:`breakdown-item`},_hoisted_33$9={class:`breakdown-details`},_hoisted_34$9={class:`breakdown-item-value`},_hoisted_35$8={class:`breakdown-value`},_hoisted_36$8={class:`breakdown-item-value orange`},_hoisted_37$7={class:`breakdown-value`},_hoisted_38$6={key:0,class:`breakdown-item-value orange`},_hoisted_39$6={class:`breakdown-label`},_hoisted_40$5={class:`breakdown-value`},_hoisted_41$5={class:`breakdown-item-value result`},_hoisted_42$4={class:`breakdown-value result`},_hoisted_43$4={class:`breakdown-item`},_hoisted_44$4={class:`breakdown-details`},_hoisted_45$4={key:0,class:`breakdown-item-value`},_hoisted_46$2={key:0,class:`strikethrough-line`},_hoisted_47$2={key:1,class:`breakdown-item-value`},_hoisted_48$2={class:`breakdown-label`},_hoisted_49$2={class:`tier-discount-badge`},_hoisted_50$2={class:`breakdown-value green-price`},_hoisted_51$2={key:0,class:`breakdown-item-value`},_hoisted_52$2={class:`breakdown-label`},_hoisted_53$2={class:`breakdown-value`},_hoisted_54$2={class:`breakdown-item-value subtotal`},_hoisted_55$2={class:`breakdown-value`},_hoisted_56$2={class:`breakdown-item-value`},_hoisted_57$1={class:`breakdown-item-value result`},_hoisted_58$1={class:`breakdown-value`},_hoisted_59$1={class:`sum-to-pay`},_hoisted_60$1={class:`sum-to-pay-value`},_hoisted_61$1={class:`closeButton`},__default__$5={wrapper:{fade:!0,blur:!0,style:popupContainer.default},position:[popupPosition.center,popupPosition.center]},_sfc_main$280=Object.assign(__default__$5,{__name:`purchaseInsuranceDetails`,props:{insuranceData:Object,vehicleInfo:Object,driverScoreData:Object},emits:[`return`],setup(__props,{emit:__emit}){let{units}=useBridge();useUINavScope(`insuranceDetailsPopup`);let props=__props,emit$1=__emit,closePopup=()=>{emit$1(`return`,!0)},driverScoreAdjustmentText=computed(()=>{let multiplier=props.driverScoreData.tier.multiplier;return multiplier<1?`↓${((1-multiplier)*100).toFixed(0)}%`:multiplier>1?`↑${((multiplier-1)*100).toFixed(0)}%`:`0%`}),driverScoreClass=computed(()=>{let multiplier=props.driverScoreData.tier.multiplier;return multiplier<1?`driver-score-discount`:multiplier>1?`driver-score-penalty`:``}),groupDiscountText=computed(()=>{if(props.insuranceData.groupDiscountData){if(props.insuranceData.groupDiscountData.willHaveGroupDiscountForTheFirstTime)return`Multi-vehicle discount available`;if(props.insuranceData.groupDiscountData.willBumpTheirDiscount)return`Bigger discount available`;if(props.insuranceData.groupDiscountData.currentTierData&&props.insuranceData.groupDiscountData.currentTierData.id>0)return`Multi-vehicle discount active`}return null}),renewsEveryFormatted=computed(()=>props.insuranceData?.renewsEvery?units.buildString(`length`,props.insuranceData.renewsEvery*1e3,0):``);return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$250,[createBaseVNode(`div`,_hoisted_2$207,[createBaseVNode(`div`,_hoisted_3$181,[createBaseVNode(`div`,_hoisted_4$154,[_cache[2]||=createBaseVNode(`div`,{class:`policy-details`},` Policy details `,-1),createBaseVNode(`div`,_hoisted_5$134,[createBaseVNode(`span`,_hoisted_6$115,toDisplayString(props.insuranceData.name),1),_cache[0]||=createBaseVNode(`span`,{class:`name-slogan-seperator`},null,-1),createBaseVNode(`span`,_hoisted_7$102,toDisplayString(props.insuranceData.slogan),1)]),createBaseVNode(`div`,_hoisted_8$86,[createBaseVNode(`span`,null,`Covers `+toDisplayString(props.insuranceData.carsInsuredCount)+` Vehicles`,1),_cache[1]||=createBaseVNode(`span`,{class:`covers-renew-seperator`},null,-1),createBaseVNode(`span`,null,`Renews every `+toDisplayString(renewsEveryFormatted.value),1)])]),createBaseVNode(`div`,_hoisted_9$76,[_cache[4]||=createBaseVNode(`div`,{class:`action-type`},`Adding vehicle`,-1),createBaseVNode(`div`,_hoisted_10$66,toDisplayString(props.vehicleInfo.Name),1),createBaseVNode(`div`,_hoisted_11$59,[_cache[3]||=createTextVNode(`Value : `,-1),createVNode(unref(bngUnit_default),{money:props.vehicleInfo.Value},null,8,[`money`])])])]),props.insuranceData.groupDiscountData.willHaveGroupDiscountForTheFirstTime||props.insuranceData.groupDiscountData.willBumpTheirDiscount||props.insuranceData.groupDiscountData.currentTierData.id>0?(openBlock(),createElementBlock(`div`,_hoisted_12$48,[createBaseVNode(`div`,_hoisted_13$41,[createBaseVNode(`div`,_hoisted_14$38,[createVNode(unref(bngIcon_default),{type:unref(icons).checkmark},null,8,[`type`])]),createBaseVNode(`div`,_hoisted_15$36,[createBaseVNode(`div`,_hoisted_16$35,toDisplayString(groupDiscountText.value),1),_cache[5]||=createBaseVNode(`div`,{class:`group-discount-secondary-text`},` Insurance discounts are based on the total value of your fleet. `,-1)])]),createBaseVNode(`div`,_hoisted_17$29,[createBaseVNode(`div`,_hoisted_18$26,[(openBlock(!0),createElementBlock(Fragment,null,renderList(props.insuranceData.groupDiscountData.groupDiscountTiers,tier=>(openBlock(),createElementBlock(`div`,{class:`tier`,key:tier.id},[createBaseVNode(`div`,_hoisted_19$23,` Tier `+toDisplayString(tier.id),1),createBaseVNode(`div`,_hoisted_20$19,[createBaseVNode(`span`,null,toDisplayString(tier.min/1e3)+`k`,1),tier.max?(openBlock(),createElementBlock(`span`,_hoisted_21$17,`-`+toDisplayString(tier.max/1e3)+`k`,1)):(openBlock(),createElementBlock(`span`,_hoisted_22$15,`+`))])]))),128))]),createVNode(unref(insuranceTiers_default),{tiers:props.insuranceData.groupDiscountData.groupDiscountTiers},null,8,[`tiers`])]),createBaseVNode(`div`,_hoisted_23$14,[createBaseVNode(`div`,_hoisted_24$13,[_cache[7]||=createBaseVNode(`div`,{class:`section-label deactivated`},` Current Tier `,-1),createBaseVNode(`div`,_hoisted_25$12,[_cache[6]||=createTextVNode(` Policy Value : `,-1),createVNode(unref(bngUnit_default),{money:props.insuranceData.totalInsuranceVehsValue},null,8,[`money`])]),createBaseVNode(`div`,_hoisted_26$10,` Tier `+toDisplayString(Math.max(props.insuranceData.groupDiscountData.currentTierData.id,0))+` - `+toDisplayString(props.insuranceData.groupDiscountData.currentTierData.discount*100)+`% off `,1)]),createBaseVNode(`div`,_hoisted_27$10,[_cache[9]||=createBaseVNode(`div`,{class:`section-label`},` After Purchase `,-1),createBaseVNode(`div`,_hoisted_28$9,[_cache[8]||=createTextVNode(` Policy Value : `,-1),createVNode(unref(bngUnit_default),{money:props.insuranceData.totalInsuranceVehsValue+props.insuranceData.vehicleValue},null,8,[`money`])]),createBaseVNode(`div`,_hoisted_29$9,` Tier `+toDisplayString(props.insuranceData.groupDiscountData.futureTierData.id)+` - `+toDisplayString(props.insuranceData.groupDiscountData.futureTierData.discount*100)+`% off `,1)])])])):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_30$9,[createBaseVNode(`div`,_hoisted_31$9,[createBaseVNode(`div`,_hoisted_32$9,[_cache[13]||=createBaseVNode(`div`,{class:`section-label`},` Vehicle `,-1),createBaseVNode(`div`,_hoisted_33$9,[createBaseVNode(`div`,_hoisted_34$9,[_cache[10]||=createBaseVNode(`span`,{class:`breakdown-label`},` Coverage Cost `,-1),createBaseVNode(`span`,_hoisted_35$8,[createVNode(unref(bngUnit_default),{money:props.insuranceData.nonProRatedVehiclePremium},null,8,[`money`])])]),createBaseVNode(`div`,_hoisted_36$8,[_cache[11]||=createBaseVNode(`span`,{class:`breakdown-label`},` Pro-rated Renewal `,-1),createBaseVNode(`span`,_hoisted_37$7,` × `+toDisplayString(props.insuranceData.proRatedPercentage)+`% `,1)]),props.insuranceData.groupDiscountData?.currentTierData.id>0?(openBlock(),createElementBlock(`div`,_hoisted_38$6,[createBaseVNode(`span`,_hoisted_39$6,` Tier `+toDisplayString(props.insuranceData.groupDiscountData?.currentTierData.id)+` discount `,1),createBaseVNode(`span`,_hoisted_40$5,` - `+toDisplayString(props.insuranceData.groupDiscountData?.currentTierData.discount*100)+`% `,1)])):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_41$5,[_cache[12]||=createBaseVNode(`span`,{class:`breakdown-label`},` Policy Add-On Cost `,-1),createBaseVNode(`span`,_hoisted_42$4,[createVNode(unref(bngUnit_default),{money:props.insuranceData.proRatedVehiclePremium},null,8,[`money`])])])])]),createBaseVNode(`div`,_hoisted_43$4,[_cache[18]||=createBaseVNode(`div`,{class:`section-label`},` New Premium `,-1),createBaseVNode(`div`,_hoisted_44$4,[props.insuranceData.futurePremiumDetails.items.vehsCoverage?(openBlock(),createElementBlock(`div`,_hoisted_45$4,[_cache[14]||=createBaseVNode(`div`,{class:`breakdown-label`},` Vehicles Coverage `,-1),createBaseVNode(`div`,{class:normalizeClass([`breakdown-value strikethrough-container`,{"strikethrough-grey":props.insuranceData.futurePremiumDetails.groupDiscountSavings>0}])},[createVNode(unref(bngUnit_default),{money:props.insuranceData.futurePremiumDetails.items.vehsCoverage.priceWithoutGroupDiscount},null,8,[`money`]),props.insuranceData.futurePremiumDetails.groupDiscountSavings>0?(openBlock(),createElementBlock(`div`,_hoisted_46$2)):createCommentVNode(``,!0)],2)])):createCommentVNode(``,!0),props.insuranceData.futurePremiumDetails.items.vehsCoverage&&props.insuranceData.futurePremiumDetails.groupDiscountSavings>0?(openBlock(),createElementBlock(`div`,_hoisted_47$2,[createBaseVNode(`div`,_hoisted_48$2,[createTextVNode(toDisplayString(props.insuranceData.futurePremiumDetails.items.vehsCoverage.name)+` `,1),createBaseVNode(`span`,null,[createTextVNode(`: Tier `+toDisplayString(props.insuranceData.groupDiscountData.currentTierData.id)+` `,1),createBaseVNode(`span`,_hoisted_49$2,`(`+toDisplayString(props.insuranceData.groupDiscountData.currentTierData.discount*100)+`% off)`,1)])]),createBaseVNode(`div`,_hoisted_50$2,[createVNode(unref(bngUnit_default),{money:props.insuranceData.futurePremiumDetails.items.vehsCoverage.price},null,8,[`money`])])])):createCommentVNode(``,!0),(openBlock(!0),createElementBlock(Fragment,null,renderList(props.insuranceData.futurePremiumDetails.items,(item,key)=>(openBlock(),createElementBlock(Fragment,{key},[key===`vehsCoverage`?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_51$2,[createBaseVNode(`div`,_hoisted_52$2,toDisplayString(item.name),1),createBaseVNode(`div`,_hoisted_53$2,[createVNode(unref(bngUnit_default),{money:item.price},null,8,[`money`])])]))],64))),128)),createBaseVNode(`div`,_hoisted_54$2,[_cache[15]||=createBaseVNode(`div`,{class:`breakdown-label`},` Subtotal `,-1),createBaseVNode(`div`,_hoisted_55$2,[createVNode(unref(bngUnit_default),{money:props.insuranceData.futurePremiumDetails.totalPrice},null,8,[`money`])])]),createBaseVNode(`div`,_hoisted_56$2,[_cache[16]||=createBaseVNode(`div`,{class:`breakdown-label`},` Driver Score Adjustment `,-1),createBaseVNode(`div`,{class:normalizeClass([`breakdown-value`,driverScoreClass.value])},toDisplayString(driverScoreAdjustmentText.value),3)]),createBaseVNode(`div`,_hoisted_57$1,[_cache[17]||=createBaseVNode(`div`,{class:`breakdown-label`},` Total Premium `,-1),createBaseVNode(`div`,_hoisted_58$1,[createVNode(unref(bngUnit_default),{money:props.insuranceData.futurePremiumDetails.totalPriceWithDriverScore},null,8,[`money`])])])])])]),createBaseVNode(`div`,_hoisted_59$1,[_cache[19]||=createBaseVNode(`span`,null,`Amount due today`,-1),createBaseVNode(`span`,_hoisted_60$1,[createVNode(unref(bngUnit_default),{class:`green-price`,money:props.insuranceData.addVehiclePrice},null,8,[`money`])])])]),createBaseVNode(`div`,_hoisted_61$1,[createVNode(unref(bngButton_default),{accent:unref(ACCENTS).primary,onClick:closePopup},{default:withCtx(()=>[..._cache[20]||=[createTextVNode(` Close `,-1)]]),_:1},8,[`accent`])])])]))}}),purchaseInsuranceDetails_default=__plugin_vue_export_helper_default(_sfc_main$280,[[`__scopeId`,`data-v-9f20c127`]]),_hoisted_1$249={class:`content`},_hoisted_2$206={class:`top-banner`},_hoisted_3$180={class:`top-banner-left`},_hoisted_4$153={class:`insurance-details`},_hoisted_5$133={class:`insurance-name`},_hoisted_6$114={class:`insurance-slogan`},_hoisted_7$101={class:`small-grey-text`},_hoisted_8$85={class:`small-grey-text`},_hoisted_9$75={class:`top-banner-right`},_hoisted_10$65={class:`information-wrapper`},_hoisted_11$58={class:`information-value`},_hoisted_12$47={class:`driver-score-tier`},_hoisted_13$40={class:`premium-effect`},_hoisted_14$37={class:`switching-details-wrapper`},_hoisted_15$35={class:`three-columns-grid`},_hoisted_16$34={class:`switching-column column-leaving`},_hoisted_17$28={class:`column-header`},_hoisted_18$25={class:`column-details`},_hoisted_19$22={class:`detail-item`},_hoisted_20$18={class:`detail-value`},_hoisted_21$16={class:`detail-item`},_hoisted_22$14={class:`detail-item divider-above`},_hoisted_23$13={class:`detail-value-positive`},_hoisted_24$12={class:`detail-item`},_hoisted_25$11={class:`detail-value-negative`},_hoisted_26$9={class:`detail-item divider-above`},_hoisted_27$9={class:`detail-value-positive-bold`},_hoisted_28$8={class:`detail-note`},_hoisted_29$8={class:`switching-column column-vehicle`},_hoisted_30$8={class:`vehicle-display-box`},_hoisted_31$8=[`src`],_hoisted_32$8={class:`column-details`},_hoisted_33$8={class:`detail-item`},_hoisted_34$8={class:`detail-value-bold`},_hoisted_35$7={class:`detail-item`},_hoisted_36$7={class:`detail-value-bold`},_hoisted_37$6={class:`detail-item divider-above`},_hoisted_38$5={class:`detail-value-highlight`},_hoisted_39$5={class:`detail-note`},_hoisted_40$4={class:`switching-column column-joining`},_hoisted_41$4={class:`column-header`},_hoisted_42$3={class:`column-details`},_hoisted_43$3={class:`detail-item`},_hoisted_44$3={class:`detail-value`},_hoisted_45$3={class:`detail-item`},_hoisted_46$1={class:`detail-item divider-above`},_hoisted_47$1={class:`detail-value-negative`},_hoisted_48$1={class:`detail-item divider-above`},_hoisted_49$1={class:`detail-item divider-above`},_hoisted_50$1={class:`detail-value-bold`},_hoisted_51$1={class:`detail-note`},_hoisted_52$1={class:`final-amount-content-row`},_hoisted_53$1={class:`final-amount-label`},_hoisted_54$1={class:`final-amount-breakdown`},_hoisted_55$1={class:`buttons`},_hoisted_56$1={key:0},_sfc_main$279={__name:`changeInsuranceDetails`,props:{insuranceData:{type:Object,required:!0},vehicleInfo:{type:Object,default:()=>({})},driverScoreData:{type:Object,default:()=>({})}},emits:[`return`,`switch`],setup(__props,{emit:__emit}){let{units}=useBridge(),props=__props,emit$1=__emit,premiumSavingPercent=computed(()=>(1-(props.driverScoreData?.tier?.multiplier||1))*100),leavingInfo=computed(()=>props.insuranceData.leavingInsuranceInfo||null),leavingInsuranceName=computed(()=>leavingInfo.value?.currentInsuranceName||`Current Insurance`),tierDropped=computed(()=>leavingInfo.value?leavingInfo.value.discountTierData?.id>leavingInfo.value.newDiscountTierData?.id:!1),tierIncreased=computed(()=>{let current=props.insuranceData.groupDiscountData?.currentTierData?.id||0;return(props.insuranceData.groupDiscountData?.futureTierData?.id||current)>current}),currentTierId=computed(()=>props.insuranceData.groupDiscountData?.currentTierData?.id||0),futureTierId=computed(()=>props.insuranceData.groupDiscountData?.futureTierData?.id||props.insuranceData.groupDiscountData?.currentTierData?.id||0),proRatedPercentage=computed(()=>Math.round(props.insuranceData.proRatedPercentage||100)),driverScoreImpactPercent=computed(()=>(1-(props.driverScoreData?.tier?.multiplier||1))*100),driverScoreImpactClass=computed(()=>driverScoreImpactPercent.value>0?`saving`:driverScoreImpactPercent.value<0?`increase`:`neutral`),driverScoreImpactText=computed(()=>driverScoreImpactPercent.value>0?`↓${driverScoreImpactPercent.value.toFixed(0)}%`:driverScoreImpactPercent.value<0?`↑${Math.abs(driverScoreImpactPercent.value).toFixed(0)}%`:`0%`),renewsEveryFormatted=computed(()=>props.insuranceData?.renewsEvery?units.buildString(`length`,props.insuranceData.renewsEvery*1e3,0):``),renewsInFormatted=computed(()=>props.insuranceData?.renewsIn?units.buildString(`length`,props.insuranceData.renewsIn*1e3,0):``),leavingRenewsInFormatted=computed(()=>leavingInfo.value?.renewsIn?units.buildString(`length`,leavingInfo.value.renewsIn*1e3,0):``),closePopup=()=>{emit$1(`return`,!0)},onSwitchClick=()=>{Lua_default.career_modules_insurance_insurance.changeInvVehInsurance(props.vehicleInfo.invVehId,props.insuranceData.id),emit$1(`return`,!0)};return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$249,[createBaseVNode(`div`,_hoisted_2$206,[createBaseVNode(`div`,_hoisted_3$180,[_cache[2]||=createBaseVNode(`div`,{class:`title`},` Change Insurance `,-1),createBaseVNode(`div`,_hoisted_4$153,[createBaseVNode(`span`,_hoisted_5$133,toDisplayString(props.insuranceData.name),1),_cache[0]||=createBaseVNode(`span`,{class:`name-slogan-seperator`},null,-1),createBaseVNode(`span`,_hoisted_6$114,` "`+toDisplayString(props.insuranceData.slogan)+`" `,1)]),createBaseVNode(`div`,null,[createBaseVNode(`span`,_hoisted_7$101,` Covers `+toDisplayString(props.insuranceData.carsInsuredCount)+` Vehicles `,1),_cache[1]||=createBaseVNode(`span`,{class:`dot-seperator`},null,-1),createBaseVNode(`span`,_hoisted_8$85,` Renews every `+toDisplayString(renewsEveryFormatted.value),1)])]),createBaseVNode(`div`,_hoisted_9$75,[createBaseVNode(`div`,_hoisted_10$65,[_cache[4]||=createBaseVNode(`div`,{class:`small-grey-text`},` Driver Score `,-1),createBaseVNode(`div`,_hoisted_11$58,toDisplayString(props.driverScoreData.score)+`: `+toDisplayString(props.driverScoreData.tier.risk),1),createBaseVNode(`div`,_hoisted_12$47,toDisplayString(props.driverScoreData.tier.name),1),createBaseVNode(`div`,_hoisted_13$40,[_cache[3]||=createBaseVNode(`span`,{class:`small-grey-text`},` Premium Effect : `,-1),createBaseVNode(`span`,{class:normalizeClass([`premium-effect-value`,{saving:premiumSavingPercent.value>0,increase:premiumSavingPercent.value<0}])},toDisplayString(premiumSavingPercent.value>0?`${premiumSavingPercent.value.toFixed(0)}% saving`:premiumSavingPercent.value<0?`${Math.abs(premiumSavingPercent.value).toFixed(0)}% increase`:`No change`),3)])])])]),createBaseVNode(`div`,_hoisted_14$37,[createBaseVNode(`div`,_hoisted_15$35,[createBaseVNode(`div`,_hoisted_16$34,[createBaseVNode(`div`,_hoisted_17$28,[_cache[5]||=createBaseVNode(`span`,null,`←`,-1),createTextVNode(` Leaving `+toDisplayString(leavingInsuranceName.value),1)]),createBaseVNode(`div`,_hoisted_18$25,[createBaseVNode(`div`,_hoisted_19$22,[_cache[6]||=createBaseVNode(`span`,{class:`detail-label`},`Vehicles:`,-1),createBaseVNode(`span`,_hoisted_20$18,toDisplayString(leavingInfo.value.vehicleCount)+` → `+toDisplayString(leavingInfo.value.newVehicleCount),1)]),createBaseVNode(`div`,_hoisted_21$16,[_cache[7]||=createBaseVNode(`span`,{class:`detail-label`},`Discount Tier:`,-1),createBaseVNode(`span`,{class:normalizeClass([`detail-value`,{"tier-change-down":tierDropped.value}])},toDisplayString(leavingInfo.value.discountTierData.id)+` → `+toDisplayString(leavingInfo.value.newDiscountTierData.id),3)]),createBaseVNode(`div`,_hoisted_22$14,[_cache[9]||=createBaseVNode(`span`,{class:`detail-label`},`Coverage refund:`,-1),createBaseVNode(`span`,_hoisted_23$13,[_cache[8]||=createTextVNode(`+`,-1),createVNode(unref(bngUnit_default),{money:leavingInfo.value.coverageRefundPrice},null,8,[`money`])])]),createBaseVNode(`div`,_hoisted_24$12,[_cache[11]||=createBaseVNode(`span`,{class:`detail-label`},`Cancellation fee (25%):`,-1),createBaseVNode(`span`,_hoisted_25$11,[_cache[10]||=createTextVNode(`-`,-1),createVNode(unref(bngUnit_default),{money:leavingInfo.value.earlyTerminationPenalty},null,8,[`money`])])]),createBaseVNode(`div`,_hoisted_26$9,[_cache[12]||=createBaseVNode(`span`,{class:`detail-label-bold`},`Net Refund:`,-1),createBaseVNode(`span`,_hoisted_27$9,[createVNode(unref(bngUnit_default),{money:leavingInfo.value.netRefundPrice},null,8,[`money`])])]),createBaseVNode(`div`,_hoisted_28$8,toDisplayString(leavingRenewsInFormatted.value)+` unused `,1)])]),createBaseVNode(`div`,_hoisted_29$8,[_cache[16]||=createBaseVNode(`div`,{class:`column-header column-header-center`},`Moving Vehicle`,-1),createBaseVNode(`div`,_hoisted_30$8,[createBaseVNode(`img`,{src:props.vehicleInfo?.thumbnail,alt:``,class:`vehicle-thumbnail`},null,8,_hoisted_31$8)]),createBaseVNode(`div`,_hoisted_32$8,[createBaseVNode(`div`,_hoisted_33$8,[_cache[13]||=createBaseVNode(`span`,{class:`detail-label`},`Vehicle:`,-1),createBaseVNode(`span`,_hoisted_34$8,toDisplayString(props.vehicleInfo.Name),1)]),createBaseVNode(`div`,_hoisted_35$7,[_cache[14]||=createBaseVNode(`span`,{class:`detail-label`},`Value:`,-1),createBaseVNode(`span`,_hoisted_36$7,[createVNode(unref(bngUnit_default),{money:props.vehicleInfo.Value},null,8,[`money`])])]),createBaseVNode(`div`,_hoisted_37$6,[_cache[15]||=createBaseVNode(`span`,{class:`detail-label`},`Joining mid-cycle:`,-1),createBaseVNode(`span`,_hoisted_38$5,`× `+toDisplayString(proRatedPercentage.value)+`%`,1)]),createBaseVNode(`div`,_hoisted_39$5,toDisplayString(renewsInFormatted.value)+` remaining in cycle `,1)])]),createBaseVNode(`div`,_hoisted_40$4,[createBaseVNode(`div`,_hoisted_41$4,[createTextVNode(` Joining `+toDisplayString(props.insuranceData.name)+` `,1),_cache[17]||=createBaseVNode(`span`,null,`→`,-1)]),createBaseVNode(`div`,_hoisted_42$3,[createBaseVNode(`div`,_hoisted_43$3,[_cache[18]||=createBaseVNode(`span`,{class:`detail-label`},`Vehicles:`,-1),createBaseVNode(`span`,_hoisted_44$3,toDisplayString(props.insuranceData.carsInsuredCount)+` → `+toDisplayString(props.insuranceData.carsInsuredCount+1),1)]),createBaseVNode(`div`,_hoisted_45$3,[_cache[19]||=createBaseVNode(`span`,{class:`detail-label`},`Discount Tier:`,-1),createBaseVNode(`span`,{class:normalizeClass([`detail-value`,{"tier-change-up":tierIncreased.value}])},toDisplayString(currentTierId.value)+` → `+toDisplayString(futureTierId.value),3)]),createBaseVNode(`div`,_hoisted_46$1,[_cache[21]||=createBaseVNode(`span`,{class:`detail-label`},`Add vehicle cost:`,-1),createBaseVNode(`span`,_hoisted_47$1,[_cache[20]||=createTextVNode(`+`,-1),createVNode(unref(bngUnit_default),{money:props.insuranceData.addVehiclePrice},null,8,[`money`])])]),createBaseVNode(`div`,_hoisted_48$1,[_cache[22]||=createBaseVNode(`span`,{class:`detail-label`},`Driver Score Impact:`,-1),createBaseVNode(`span`,{class:normalizeClass([`detail-value-impact`,driverScoreImpactClass.value])},toDisplayString(driverScoreImpactText.value),3)]),createBaseVNode(`div`,_hoisted_49$1,[_cache[23]||=createBaseVNode(`span`,{class:`detail-label-bold`},`New Policy Premium:`,-1),createBaseVNode(`span`,_hoisted_50$1,[createVNode(unref(bngUnit_default),{money:props.insuranceData.futurePremiumDetails.totalPriceWithDriverScore},null,8,[`money`])])]),createBaseVNode(`div`,_hoisted_51$1,toDisplayString(renewsInFormatted.value)+` until renewal `,1)])])]),createBaseVNode(`div`,{class:normalizeClass([`final-amount-box`,props.insuranceData.netSwitchingCost>0?`amount-credit`:`amount-payment`])},[createBaseVNode(`div`,_hoisted_52$1,[createBaseVNode(`div`,null,[createBaseVNode(`div`,_hoisted_53$1,toDisplayString(props.insuranceData.netSwitchingCost>0?`Credit Received Today`:`Amount Due Today`),1),createBaseVNode(`div`,_hoisted_54$1,[createVNode(unref(bngUnit_default),{money:leavingInfo.value.netRefundPrice},null,8,[`money`]),_cache[24]||=createTextVNode(` refund - `,-1),createVNode(unref(bngUnit_default),{money:props.insuranceData.addVehiclePrice},null,8,[`money`]),_cache[25]||=createTextVNode(` new cost `,-1)])]),createBaseVNode(`div`,{class:normalizeClass([`final-amount-total`,props.insuranceData.netSwitchingCost<0?`negative`:`positive`])},[createVNode(unref(bngUnit_default),{money:Math.abs(props.insuranceData.netSwitchingCost)},null,8,[`money`])],2)])],2)]),createBaseVNode(`div`,_hoisted_55$1,[createVNode(unref(bngButton_default),{class:`gray-button bigger-button`,accent:`custom`,onClick:closePopup},{default:withCtx(()=>[..._cache[26]||=[createTextVNode(` Cancel `,-1)]]),_:1}),createVNode(unref(bngButton_default),{class:`save-button bigger-button`,accent:`custom`,onClick:onSwitchClick},{default:withCtx(()=>[_cache[27]||=createTextVNode(` Switch for `,-1),props.insuranceData.netSwitchingCost<0?(openBlock(),createElementBlock(`div`,_hoisted_56$1,[createVNode(unref(bngUnit_default),{money:Math.abs(props.insuranceData.netSwitchingCost)},null,8,[`money`])])):createCommentVNode(``,!0)]),_:1})])]))}},changeInsuranceDetails_default=__plugin_vue_export_helper_default(_sfc_main$279,[[`__scopeId`,`data-v-9624a106`]]),_hoisted_1$248={class:`insurance-tiers`},_hoisted_2$205={key:0},_sfc_main$278={__name:`insuranceTiers`,props:{tiers:{type:Array,required:!0},showTier:{type:Boolean,default:!1}},setup(__props){let props=__props;return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$248,[(openBlock(!0),createElementBlock(Fragment,null,renderList(props.tiers,tier=>(openBlock(),createElementBlock(`div`,{class:`tier`,key:tier.id},[createBaseVNode(`div`,{class:normalizeClass([`tier-discount`,{isCurrent:tier.isCurrent}])},[props.showTier?(openBlock(),createElementBlock(`div`,_hoisted_2$205,` Tier `+toDisplayString(tier.id),1)):createCommentVNode(``,!0),createBaseVNode(`div`,null,toDisplayString(tier.discount*100)+`% `,1)],2)]))),128))]))}},insuranceTiers_default=__plugin_vue_export_helper_default(_sfc_main$278,[[`__scopeId`,`data-v-ccd1e875`]]),_hoisted_1$247={class:`popup-content`},_hoisted_2$204={class:`top-banner`},_hoisted_3$179={class:`top-info`},_hoisted_4$152={class:`top-info-title`},_hoisted_5$132={class:`top-info-policy-name`},_hoisted_6$113={class:`customize-coverage section`},_hoisted_7$100={class:`premium-details section`},_hoisted_8$84={class:`premium-details-content`},_hoisted_9$74={class:`premium-details-left`},_hoisted_10$64={class:`premium-details-label`},_hoisted_11$57={class:`premium-details-right`},_hoisted_12$46={key:0,class:`price-diff-container`},_hoisted_13$39={class:`premium-details-total premium-details-item`},_hoisted_14$36={class:`premium-details-left`},_hoisted_15$34={class:`driver-score-details-wrapper`},_hoisted_16$33={class:`driver-score-details`},_hoisted_17$27={class:`premium-details-right`},_hoisted_18$24={key:0,class:`price-diff-container`},_hoisted_19$21={class:`buttons`},_sfc_main$277={__name:`editPolicy`,props:{insuranceData:{type:Object,required:!0},driverScoreData:{type:Object,required:!0}},emits:[`return`],setup(__props,{emit:__emit}){let props=__props,changedCoverageOptions=ref({}),newPremiumDetails=ref({}),computedNewPremiumDiffs=computed(()=>{if(!newPremiumDetails.value?.items)return{};let diffs={};for(let key in newPremiumDetails.value.items){let newPrice=newPremiumDetails.value.items[key]?.price||0,oldPrice=props.insuranceData.currentPremiumDetails.items[key]?.price||0;diffs[key]={priceDiff:newPrice-oldPrice,newPrice,oldPrice}}return diffs}),computedTotalPriceDiff=computed(()=>newPremiumDetails.value?.totalPrice?newPremiumDetails.value.totalPrice-props.insuranceData.currentPremiumDetails.totalPrice:0),driverScoreColorClass=computed(()=>{let multiplier=props.driverScoreData?.tier?.multiplier;return multiplier?multiplier<1?`driver-score-good`:multiplier>1?`driver-score-bad`:``:``}),hasChangedCoverageOptions=computed(()=>props.insuranceData?.coverageOptionsData?props.insuranceData.coverageOptionsData.some(option=>changedCoverageOptions.value[option.key]!==option.currentValueId):!1);onMounted(()=>{props.insuranceData?.coverageOptionsData&&props.insuranceData.coverageOptionsData.forEach(option=>{changedCoverageOptions.value[option.key]=option.currentValueId})});let emit$1=__emit,closePopup=()=>{emit$1(`return`,!0)},openVehicleList=()=>{addPopup(vehicleInsuranceList_default,{insuranceData:props.insuranceData,driverScoreData:props.driverScoreData}),closePopup()},onSaveClick=()=>{Lua_default.career_modules_insurance_insurance.saveNewInsuranceCoverageOptions(props.insuranceData.id,changedCoverageOptions.value),emit$1(`return`,!0)},updatePremiumDetails=async()=>{newPremiumDetails.value=await Lua_default.career_modules_insurance_insurance.calculateInsurancePremium(props.insuranceData.id,changedCoverageOptions.value,null)},onToggleChange=(coverageOption,newValue)=>{let targetChoiceIndex=coverageOption.choices.findIndex(choice=>choice.value===newValue);targetChoiceIndex!==-1&&(changedCoverageOptions.value[coverageOption.key]=targetChoiceIndex+1,updatePremiumDetails())},onChoiceClick=(coverageOption,choice)=>{changedCoverageOptions.value[coverageOption.key]=choice.id,updatePremiumDetails()};return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$247,[createBaseVNode(`div`,_hoisted_2$204,[createBaseVNode(`div`,_hoisted_3$179,[createBaseVNode(`div`,_hoisted_4$152,[_cache[0]||=createTextVNode(` Edit Policy: `,-1),createBaseVNode(`span`,_hoisted_5$132,toDisplayString(props.insuranceData.name),1)]),_cache[1]||=createBaseVNode(`div`,{class:`top-info-description`},` These settings apply to all vehicles under this policy. Set deductibles per vehicle by clicking "Edit Vehicles" `,-1)]),createVNode(unref(bngButton_default),{class:`edit-vehicles-button`,accent:`custom`,onClick:openVehicleList},{default:withCtx(()=>[..._cache[2]||=[createTextVNode(` Edit Vehicles `,-1)]]),_:1})]),createBaseVNode(`div`,_hoisted_6$113,[(openBlock(!0),createElementBlock(Fragment,null,renderList(props.insuranceData.coverageOptionsData,coverageOption=>(openBlock(),createBlock(unref(coverageOption_default),{key:coverageOption.name,coverageOption,changedCoverageOptions:changedCoverageOptions.value,onChoiceClick,onToggleChange},null,8,[`coverageOption`,`changedCoverageOptions`]))),128))]),createBaseVNode(`div`,_hoisted_7$100,[_cache[5]||=createBaseVNode(`div`,{class:`premium-details-header`},` Premium Breakdown `,-1),createBaseVNode(`div`,_hoisted_8$84,[(openBlock(!0),createElementBlock(Fragment,null,renderList(props.insuranceData.currentPremiumDetails.items,(detail,key)=>(openBlock(),createElementBlock(`div`,{class:`premium-details-item`,key},[createBaseVNode(`div`,_hoisted_9$74,[createBaseVNode(`div`,_hoisted_10$64,toDisplayString(detail.name),1)]),createBaseVNode(`div`,_hoisted_11$57,[computedNewPremiumDiffs.value[key]&&computedNewPremiumDiffs.value[key].priceDiff!==0?(openBlock(),createElementBlock(`div`,_hoisted_12$46,[createBaseVNode(`span`,{class:normalizeClass([`arrow`,{"green-price":computedNewPremiumDiffs.value[key].priceDiff<0,"red-price":computedNewPremiumDiffs.value[key].priceDiff>0}])},toDisplayString(computedNewPremiumDiffs.value[key].priceDiff>0?`↑`:`↓`),3),createVNode(unref(bngUnit_default),{class:normalizeClass([`price-diff`,{"green-price":computedNewPremiumDiffs.value[key].priceDiff<0,"red-price":computedNewPremiumDiffs.value[key].priceDiff>0}]),money:computedNewPremiumDiffs.value[key].priceDiff},null,8,[`class`,`money`])])):createCommentVNode(``,!0),createVNode(unref(bngUnit_default),{money:newPremiumDetails.value?.items?.[key]?.price||detail.price},null,8,[`money`])])]))),128)),createBaseVNode(`div`,_hoisted_13$39,[createBaseVNode(`div`,_hoisted_14$36,[_cache[4]||=createBaseVNode(`div`,null,` Final Premium `,-1),createBaseVNode(`div`,_hoisted_15$34,[createBaseVNode(`span`,_hoisted_16$33,[_cache[3]||=createTextVNode(` Base Premium : `,-1),createVNode(unref(bngUnit_default),{money:props.insuranceData.currentPremiumDetails.totalPrice},null,8,[`money`]),createTextVNode(` × Driver Score `+toDisplayString(props.driverScoreData.score)+` @ `,1)]),createBaseVNode(`span`,{class:normalizeClass([`driver-score`,driverScoreColorClass.value])},toDisplayString(Math.round(props.driverScoreData.tier.multiplier*100))+`% `,3)])]),createBaseVNode(`div`,_hoisted_17$27,[computedTotalPriceDiff.value===0?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_18$24,[createBaseVNode(`span`,{class:normalizeClass([`arrow`,{"green-price":computedTotalPriceDiff.value<0,"red-price":computedTotalPriceDiff.value>0}])},toDisplayString(computedTotalPriceDiff.value>0?`↑`:`↓`),3),createVNode(unref(bngUnit_default),{class:normalizeClass([`price-diff`,{"green-price":computedTotalPriceDiff.value<0,"red-price":computedTotalPriceDiff.value>0}]),money:computedTotalPriceDiff.value},null,8,[`class`,`money`])])),createVNode(unref(bngUnit_default),{money:newPremiumDetails.value?.totalPriceWithDriverScore||props.insuranceData.currentPremiumDetails.totalPriceWithDriverScore},null,8,[`money`])])])])]),createBaseVNode(`div`,_hoisted_19$21,[createVNode(unref(bngButton_default),{class:`cancel-button bigger-button`,accent:`custom`,onClick:closePopup},{default:withCtx(()=>[..._cache[6]||=[createTextVNode(` Cancel `,-1)]]),_:1}),createVNode(unref(bngButton_default),{class:`save-button bigger-button`,accent:`custom`,onClick:onSaveClick,disabled:!props.insuranceData.canPayPaperworkFees||!hasChangedCoverageOptions.value},{default:withCtx(()=>[props.insuranceData.canPayPaperworkFees?(openBlock(),createElementBlock(Fragment,{key:1},[_cache[7]||=createTextVNode(` Apply for `,-1),createVNode(unref(bngUnit_default),{money:props.insuranceData.paperworkFees},null,8,[`money`])],64)):(openBlock(),createElementBlock(Fragment,{key:0},[createTextVNode(` Insufficient funds `)],64))]),_:1},8,[`disabled`])])]))}},editPolicy_default=__plugin_vue_export_helper_default(_sfc_main$277,[[`__scopeId`,`data-v-081fecf3`]]),_sfc_main$276={__name:`insurancePerkIcon`,props:{perkIconData:{type:Object,required:!0}},setup(__props){let props=__props,computedColor=computed(()=>props.perkIconData.isSignaturePerk===void 0?props.perkIconData.color:props.perkIconData.isSignaturePerk?`green`:`blue`);return(_ctx,_cache)=>withDirectives((openBlock(),createElementBlock(`div`,{class:normalizeClass({"insurance-perk-icon":!__props.perkIconData.iconOnly,[computedColor.value]:computedColor.value})},[createVNode(unref(bngIcon_default),{type:unref(icons).shieldCheckmark,class:normalizeClass({"glowing-icon":!0,[computedColor.value]:computedColor.value})},null,8,[`type`,`class`]),__props.perkIconData.iconOnly?createCommentVNode(``,!0):(openBlock(),createElementBlock(`span`,{key:0,class:normalizeClass({"small-text":!0,[computedColor.value]:computedColor.value})},toDisplayString(__props.perkIconData.smallText),3))],2)),[[unref(BngTooltip_default),__props.perkIconData.iconOnly?null:__props.perkIconData.tooltipText,`top`]])}},insurancePerkIcon_default=__plugin_vue_export_helper_default(_sfc_main$276,[[`__scopeId`,`data-v-d2b025b6`]]),_hoisted_1$246={class:`insurance-perks-container`},_hoisted_2$203={class:`left`},_hoisted_3$178={class:`insurance-perk-icon-wrapper`},_hoisted_4$151={key:1},_hoisted_5$131={class:`insurance-perk-texts`},_hoisted_6$112={class:`insurance-perk-intro`},_hoisted_7$99={key:0,class:`insurance-perk-description`},_hoisted_8$83={key:0,class:`signature-perk-wrapper`},_sfc_main$275={__name:`insurancePerks`,props:{insuranceData:Object,noDescription:Boolean},setup(__props){let props=__props,sortedPerks=computed(()=>props.insuranceData.perks?[...Array.isArray(props.insuranceData.perks)?props.insuranceData.perks:Object.values(props.insuranceData.perks)].sort((a$1,b)=>Number(b.isSignaturePerk||!1)-Number(a$1.isSignaturePerk||!1)):[]);return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$246,[(openBlock(!0),createElementBlock(Fragment,null,renderList(sortedPerks.value,perk=>(openBlock(),createElementBlock(`div`,{key:perk.id,class:normalizeClass([`insurance-perk`,{highlighted:perk.isSignaturePerk,"no-insurance":__props.insuranceData.id===-1}])},[createBaseVNode(`div`,_hoisted_2$203,[createBaseVNode(`div`,_hoisted_3$178,[__props.insuranceData.id===-1?(openBlock(),createElementBlock(`span`,_hoisted_4$151,`-`)):(openBlock(),createBlock(insurancePerkIcon_default,{key:0,perkIconData:{iconOnly:!0,isSignaturePerk:perk.isSignaturePerk&&perk.isSignaturePerk||!1}},null,8,[`perkIconData`]))]),createBaseVNode(`div`,_hoisted_5$131,[createBaseVNode(`div`,_hoisted_6$112,toDisplayString(perk.intro),1),__props.noDescription?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_7$99,toDisplayString(perk.description),1))])]),perk.isSignaturePerk?(openBlock(),createElementBlock(`div`,_hoisted_8$83,[..._cache[0]||=[createBaseVNode(`div`,{class:`signature-perk`},` SIGNATURE PERK `,-1)]])):createCommentVNode(``,!0)],2))),128))]))}},insurancePerks_default=__plugin_vue_export_helper_default(_sfc_main$275,[[`__scopeId`,`data-v-75e74910`]]),_hoisted_1$245={class:`insurance-perk-notice`},_sfc_main$274={__name:`insurancePerkNotice`,props:{perkText:{type:String,required:!0}},setup(__props){let props=__props;return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$245,[createVNode(insurancePerkIcon_default,{perkIconData:{iconOnly:!0}}),createTextVNode(` `+toDisplayString(props.perkText),1)]))}},insurancePerkNotice_default=__plugin_vue_export_helper_default(_sfc_main$274,[[`__scopeId`,`data-v-a98b3238`]]),_hoisted_1$244={class:`popup-content`},_hoisted_2$202={class:`top-info`},_hoisted_3$177={class:`top-info-title`},_hoisted_4$150={class:`top-info-veh-name`},_hoisted_5$130={class:`top-info-value-and-insurance`},_hoisted_6$111={class:`section`},_hoisted_7$98={class:`section`},_hoisted_8$82={class:`contribution-wrapper`},_hoisted_9$73={class:`contribution-item-value`},_hoisted_10$63={key:0,class:`price-diff-container`},_hoisted_11$56={class:`contribution-item-value`},_hoisted_12$45={key:0,class:`price-diff-container`},_hoisted_13$38={class:`buttons`},_sfc_main$273={__name:`editVehicleCoverage`,props:{insuranceData:{type:Object,required:!0},vehicleData:{type:Object,required:!0}},emits:[`return`],setup(__props,{emit:__emit}){let props=__props,newPremiumPrice=ref(0),newInsurancePremiumDetails=ref({totalPriceWithDriverScore:0}),computedNewPremiumDiff=computed(()=>newPremiumPrice.value-props.vehicleData.insuranceData.currentPremiumPrice),computedNewInsurancePremiumDiff=computed(()=>newInsurancePremiumDetails.value.totalPriceWithDriverScore-props.insuranceData.currentPremiumDetails.totalPriceWithDriverScore),hasChangedCoverageOptions=computed(()=>props.vehicleData?.insuranceData?.coverageOptionsData?.currentCoverageOptionsSanitized?props.vehicleData.insuranceData.coverageOptionsData.currentCoverageOptionsSanitized.some(option=>changedCoverageOptions.value[option.key]!==option.currentValueId):!1),emit$1=__emit,closePopup=()=>{emit$1(`return`,!0)},changedCoverageOptions=ref({}),updatePremiumPrice=async()=>{newPremiumPrice.value=(await Lua_default.career_modules_insurance_insurance.calculateVehiclePremium(props.vehicleData.id,null,changedCoverageOptions.value)).cost,newInsurancePremiumDetails.value=await Lua_default.career_modules_insurance_insurance.calculateInsurancePremium(props.insuranceData.id,null,{[props.vehicleData.id]:changedCoverageOptions.value})},onChoiceClick=(coverageOption,choice)=>{changedCoverageOptions.value[coverageOption.key]=choice.id,updatePremiumPrice()},onToggleChange=(coverageOption,newValue)=>{let targetChoiceIndex=coverageOption.choices.findIndex(choice=>choice.value===newValue);targetChoiceIndex!==-1&&(changedCoverageOptions.value[coverageOption.key]=targetChoiceIndex+1),updatePremiumPrice()},onSaveClick=()=>{Lua_default.career_modules_insurance_insurance.saveNewVehicleCoverageOptions(props.vehicleData.id,changedCoverageOptions.value),emit$1(`return`,!0)},openSwitchProvider=()=>{addPopup(ChooseInsuranceMain_default,{menuMode:`change`,params:{vehicleId:props.vehicleData.id}})};return onMounted(()=>{props.vehicleData.insuranceData.coverageOptionsData.currentCoverageOptionsSanitized.forEach(option=>{changedCoverageOptions.value[option.key]=option.currentValueId}),updatePremiumPrice()}),(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$244,[createBaseVNode(`div`,_hoisted_2$202,[createBaseVNode(`div`,_hoisted_3$177,[_cache[0]||=createTextVNode(` Select Deductible: `,-1),createBaseVNode(`span`,_hoisted_4$150,toDisplayString(props.vehicleData.name),1)]),createBaseVNode(`div`,_hoisted_5$130,[_cache[1]||=createTextVNode(` Value: `,-1),createVNode(unref(bngUnit_default),{money:props.vehicleData.initialValue},null,8,[`money`]),createTextVNode(` • Policy: `+toDisplayString(props.insuranceData.name),1)]),_cache[2]||=createBaseVNode(`div`,{class:`top-info-description`},` Choose how much you'll pay out-of-pocket when repairing this vehicle. Lower deductibles cost more per km. `,-1)]),createBaseVNode(`div`,_hoisted_6$111,[_cache[3]||=createBaseVNode(`div`,null,[createBaseVNode(`div`,{class:`header title`},` Choose Your Deductible `),createBaseVNode(`div`,{class:`under-title`},` You pay this amount per repair. `)],-1),createBaseVNode(`div`,null,[(openBlock(!0),createElementBlock(Fragment,null,renderList(props.vehicleData.insuranceData.coverageOptionsData.currentCoverageOptionsSanitized,coverageOption=>(openBlock(),createBlock(unref(coverageOption_default),{class:`coverage-option`,key:coverageOption.name,coverageOption,onlyShowMainText:!0,changedCoverageOptions:changedCoverageOptions.value,dontShowName:!0,onChoiceClick,onToggleChange},null,8,[`coverageOption`,`changedCoverageOptions`]))),128))])]),createBaseVNode(`div`,_hoisted_7$98,[_cache[6]||=createBaseVNode(`div`,{class:`title`},` Policy Impact `,-1),createBaseVNode(`div`,_hoisted_8$82,[createBaseVNode(`div`,{class:normalizeClass([`contribution-item`,{green:computedNewInsurancePremiumDiff.value<0,red:computedNewInsurancePremiumDiff.value>0}])},[_cache[4]||=createBaseVNode(`div`,{class:`contribution-item-title`},` Insurance Premium `,-1),createBaseVNode(`div`,_hoisted_9$73,[createVNode(unref(bngUnit_default),{money:props.insuranceData.currentPremiumDetails.totalPriceWithDriverScore},null,8,[`money`]),computedNewInsurancePremiumDiff.value!==0&&!isNaN(computedNewInsurancePremiumDiff.value)?(openBlock(),createElementBlock(`div`,_hoisted_10$63,` → `)):createCommentVNode(``,!0),computedNewInsurancePremiumDiff.value!==0&&!isNaN(computedNewInsurancePremiumDiff.value)?(openBlock(),createBlock(unref(bngUnit_default),{key:1,money:newInsurancePremiumDetails.value.totalPriceWithDriverScore},null,8,[`money`])):createCommentVNode(``,!0)])],2),createBaseVNode(`div`,{class:normalizeClass([`contribution-item`,{green:computedNewInsurancePremiumDiff.value<0,red:computedNewInsurancePremiumDiff.value>0}])},[_cache[5]||=createBaseVNode(`div`,{class:`contribution-item-title`},` Vehicle Contribution `,-1),createBaseVNode(`div`,_hoisted_11$56,[createVNode(unref(bngUnit_default),{money:props.vehicleData.insuranceData.currentPremiumPrice},null,8,[`money`]),computedNewPremiumDiff.value!==0&&!isNaN(computedNewPremiumDiff.value)?(openBlock(),createElementBlock(`div`,_hoisted_12$45,` → `)):createCommentVNode(``,!0),computedNewPremiumDiff.value!==0&&!isNaN(computedNewPremiumDiff.value)?(openBlock(),createBlock(unref(bngUnit_default),{key:1,money:newPremiumPrice.value},null,8,[`money`])):createCommentVNode(``,!0)])],2)])]),createBaseVNode(`div`,_hoisted_13$38,[createVNode(unref(bngButton_default),{class:`gray-button bigger-button`,accent:`custom`,onClick:closePopup},{default:withCtx(()=>[..._cache[7]||=[createTextVNode(` Cancel `,-1)]]),_:1}),createVNode(unref(bngButton_default),{class:`save-button bigger-button`,accent:`custom`,onClick:onSaveClick,disabled:!props.insuranceData.canPayPaperworkFees||!hasChangedCoverageOptions.value},{default:withCtx(()=>[props.insuranceData.canPayPaperworkFees?(openBlock(),createElementBlock(Fragment,{key:1},[_cache[8]||=createTextVNode(` Apply for `,-1),createVNode(unref(bngUnit_default),{money:props.insuranceData.paperworkFees},null,8,[`money`])],64)):(openBlock(),createElementBlock(Fragment,{key:0},[createTextVNode(` Insufficient funds `)],64))]),_:1},8,[`disabled`]),createVNode(unref(bngButton_default),{class:`gray-button bigger-button`,accent:`custom`,onClick:openSwitchProvider},{default:withCtx(()=>[..._cache[9]||=[createTextVNode(` Switch Provider `,-1)]]),_:1})])]))}},editVehicleCoverage_default=__plugin_vue_export_helper_default(_sfc_main$273,[[`__scopeId`,`data-v-9f014d2d`]]),_hoisted_1$243=[`innerHTML`],_hoisted_2$201={key:2,class:`insurance-icon`},_hoisted_3$176={class:`insurance-name`},_hoisted_4$149={key:3,class:`insurance-slogan`},_sfc_main$272={__name:`insuranceIdentity`,props:{insuranceData:{type:Object,required:!0}},setup(__props){let props=__props,hasInsurance=computed(()=>svgContent.value||props.insuranceData.image),hasNoInsurance=computed(()=>props.insuranceData?.id===-1),svgContent=ref(null);return watch(()=>props.insuranceData.image,async newPath=>{if(newPath&&newPath.endsWith(`.svg`))try{let rawSvg=await getFile(`/${newPath}`);rawSvg?svgContent.value=rawSvg.replace(/