Definition
-- @/=[C]:-1
function format(...)
Callers
@/ui/lib/ext/angular/angular.js
* the HTML5 date input, a text element will be used. In that case, text must be entered in a valid ISO-8601
* date format (yyyy-MM-dd), for example: `2009-01-06`. Since many
* modern browsers do not yet support this input type, it is important to provide cues to users on the
* the HTML5 date input, a text element will be used. In that case, the text must be entered in a valid ISO-8601
* local datetime format (yyyy-MM-ddTHH:mm:ss), for example: `2010-12-28T14:57:00`.
*
* @param {string=} min Sets the `min` validation error key if the value entered is less than `min`.
* This must be a valid ISO datetime format (yyyy-MM-ddTHH:mm:ss). You can also use interpolation
* inside this attribute (e.g. `min="{{minDatetimeLocal | date:'yyyy-MM-ddTHH:mm:ss'}}"`).
* @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`.
* This must be a valid ISO datetime format (yyyy-MM-ddTHH:mm:ss). You can also use interpolation
* inside this attribute (e.g. `max="{{maxDatetimeLocal | date:'yyyy-MM-ddTHH:mm:ss'}}"`).
* the HTML5 time input, a text element will be used. In that case, the text must be entered in a valid ISO-8601
* local time format (HH:mm:ss), for example: `14:57:00`. Model must be a Date object. This binding will always output a
* Date object to the model of January 1, 1970, or local date `new Date(1970, 0, 1, HH, mm, ss)`.
* @param {string=} min Sets the `min` validation error key if the value entered is less than `min`.
* This must be a valid ISO time format (HH:mm:ss). You can also use interpolation inside this
* attribute (e.g. `min="{{minTime | date:'HH:mm:ss'}}"`). Note that `min` will also add
* @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`.
* This must be a valid ISO time format (HH:mm:ss). You can also use interpolation inside this
* attribute (e.g. `max="{{maxTime | date:'HH:mm:ss'}}"`). Note that `max` will also add
* the HTML5 week input, a text element will be used. In that case, the text must be entered in a valid ISO-8601
* week format (yyyy-W##), for example: `2013-W02`.
*
* @param {string=} min Sets the `min` validation error key if the value entered is less than `min`.
* This must be a valid ISO week format (yyyy-W##). You can also use interpolation inside this
* attribute (e.g. `min="{{minWeek | date:'yyyy-Www'}}"`). Note that `min` will also add
* @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`.
* This must be a valid ISO week format (yyyy-W##). You can also use interpolation inside this
* attribute (e.g. `max="{{maxWeek | date:'yyyy-Www'}}"`). Note that `max` will also add
* the HTML5 month input, a text element will be used. In that case, the text must be entered in a valid ISO-8601
* month format (yyyy-MM), for example: `2009-01`.
*
* @param {string=} min Sets the `min` validation error key if the value entered is less than `min`.
* This must be a valid ISO month format (yyyy-MM). You can also use interpolation inside this
* attribute (e.g. `min="{{minMonth | date:'yyyy-MM'}}"`). Note that `min` will also add
* @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`.
* This must be a valid ISO month format (yyyy-MM). You can also use interpolation inside this
* attribute (e.g. `max="{{maxMonth | date:'yyyy-MM'}}"`). Note that `max` will also add
@/lua/ge/extensions/editor/rallyEditor.lua
if missionId and missionDir then
log('D', logTag, string.format('Setting up RallyManager for toolbox: missionId=%s missionDir=%s', missionId, missionDir))
local rallyManager = RallyManager(missionDir, missionId)
if diff > 3600*24 then
im.Text(string.format("saved %dd ago", math.floor(diff / (3600*24))))
elseif diff > 3600 then
elseif diff > 3600 then
im.Text(string.format("saved %dh ago", math.floor(diff / 3600)))
elseif diff > 60 then
elseif diff > 60 then
im.Text(string.format("saved %dm ago", math.floor(diff / 60)))
else
else
im.Text(string.format("saved %ds ago", diff))
end
@/gameplay/missionTypes/scatterPickup/customNodes/scatterPrefabSetupNode.lua
local amount = math.ceil((option.frequency / totalFrequency) * (n))
print(string.format("%s : %d / %d", option.mesh, amount, n))
for _ = 1, amount do
@/lua/ge/extensions/core/hotlapping.lua
timeInMillis = math.floor(timeInMillis+ .5)
return string.format("%.2d:%.2d.%.3d", (timeInMillis / 1000) / 60, (timeInMillis / 1000) % 60, timeInMillis % 1000)
end
local date = os.date("*t")
local now = string.format("%.4d-%.2d-%.2d_%.2d-%.2d-%.2d", date.year, date.month, date.day, date.hour, date.min, date.sec)
filePath = filePath or rootDir..getCurrentLevelIdentifier()..'/'..now..'.race.json'
@/lua/vehicle/powertrain.lua
if currentDamage > lastDamage then
--print(string.format("Damage detected: %s:%s -> %.4f (%.4f)", device.name, deformGroupData.groupType, currentDamage - lastDamage, currentDamage))
if device.applyDeformGroupDamage then
orderedDevices[i]:calculateInertia()
--log("D", "powertrain.calculateTreeInertia", string.format("Cumulative downstream inertia for %s: %.3f", orderedDevices[i].name, orderedDevices[i].cumulativeInertia))
end
end
log("W", "powertrain.buildDeviceTree", string.format("Adding a dummy shaft to device '%s' on output '%d'", t.name, index))
t.children = t.children or {}
t.connectedChildrenCount = t.connectedChildrenCount - 1
log("E", "powertrain.buildDeviceTree", string.format("Can't add child (%q) to parent (%q) on port %d, parent does not have a matching output port", v.name, t.name, v.inputIndex))
end
for i = 1, deviceCount, 1 do
table.insert(speedUpdateTable, string.format("%s(speedOrderedDevices[%i], dt)", deviceSpeedUpdateNameLookup[speedOrderedDevices[i].speedUpdate], i))
end
for i = 1, deviceCount, 1 do
table.insert(torqueUpdateTable, string.format("%s(torqueOrderedDevices[%i], dt)", deviceTorqueUpdateNameLookup[torqueOrderedDevices[i].torqueUpdate], i))
end
@/lua/console/json-performance.lua
local filenames = FS:findFiles('/vehicles', '*.jbeam', -1, false, false)
print(' * Finding all ' .. tostring(#filenames) .. ' json files took ' .. string.format('%0.3f', hp:stopAndReset()) .. 's')
local t = hp:stopAndReset()
print(' * Reading into memory took ' .. string.format('%0.3f', t) .. 's. Size: ' .. string.format('%0.3f', (totalSize) /1000/1000 ) .. ' MB. Performance: ' .. string.format('%0.3f', (totalSize / t) /1000/1000 ) .. ' MB/s')
local t = hp:stopAndReset()
print(' * Reading into memory took ' .. string.format('%0.3f', t) .. 's. Size: ' .. string.format('%0.3f', (totalSize) /1000/1000 ) .. ' MB. Performance: ' .. string.format('%0.3f', (totalSize / t) /1000/1000 ) .. ' MB/s')
local t = hp:stopAndReset()
print(' * Reading into memory took ' .. string.format('%0.3f', t) .. 's. Size: ' .. string.format('%0.3f', (totalSize) /1000/1000 ) .. ' MB. Performance: ' .. string.format('%0.3f', (totalSize / t) /1000/1000 ) .. ' MB/s')
local totalSizeReruns = totalSize * reruns
print(' * Parsing (' .. tostring(reruns) .. 'x = '.. string.format('%0.3f', totalSizeReruns /1000000 ) .. ' MB) took ' .. string.format('%0.3f', t) .. 's. Performance: ' .. string.format('%0.3f', (totalSizeReruns/1000000) / t ) .. ' MB/s'..string.format(' in %0.3f sec', t))
end
local totalSizeReruns = totalSize * reruns
print(' * Parsing (' .. tostring(reruns) .. 'x = '.. string.format('%0.3f', totalSizeReruns /1000000 ) .. ' MB) took ' .. string.format('%0.3f', t) .. 's. Performance: ' .. string.format('%0.3f', (totalSizeReruns/1000000) / t ) .. ' MB/s'..string.format(' in %0.3f sec', t))
end
local totalSizeReruns = totalSize * reruns
print(' * Parsing (' .. tostring(reruns) .. 'x = '.. string.format('%0.3f', totalSizeReruns /1000000 ) .. ' MB) took ' .. string.format('%0.3f', t) .. 's. Performance: ' .. string.format('%0.3f', (totalSizeReruns/1000000) / t ) .. ' MB/s'..string.format(' in %0.3f sec', t))
end
local totalSizeReruns = totalSize * reruns
print(' * Parsing (' .. tostring(reruns) .. 'x = '.. string.format('%0.3f', totalSizeReruns /1000000 ) .. ' MB) took ' .. string.format('%0.3f', t) .. 's. Performance: ' .. string.format('%0.3f', (totalSizeReruns/1000000) / t ) .. ' MB/s'..string.format(' in %0.3f sec', t))
end
print('Total packed size = '..totalPackSize)
print(' * Encoding (' .. tostring(reruns) .. 'x = '.. string.format('%0.3f', totalSizeReruns /1000000 ) .. ' MB) took ' .. string.format('%0.3f', t) .. 's. Performance: ' .. string.format('%0.3f', (totalSizeReruns/1000000) / t ) .. ' MB/s'..string.format(' in %0.3f sec', t))
end
print('Total packed size = '..totalPackSize)
print(' * Encoding (' .. tostring(reruns) .. 'x = '.. string.format('%0.3f', totalSizeReruns /1000000 ) .. ' MB) took ' .. string.format('%0.3f', t) .. 's. Performance: ' .. string.format('%0.3f', (totalSizeReruns/1000000) / t ) .. ' MB/s'..string.format(' in %0.3f sec', t))
end
print('Total packed size = '..totalPackSize)
print(' * Encoding (' .. tostring(reruns) .. 'x = '.. string.format('%0.3f', totalSizeReruns /1000000 ) .. ' MB) took ' .. string.format('%0.3f', t) .. 's. Performance: ' .. string.format('%0.3f', (totalSizeReruns/1000000) / t ) .. ' MB/s'..string.format(' in %0.3f sec', t))
end
print('Total packed size = '..totalPackSize)
print(' * Encoding (' .. tostring(reruns) .. 'x = '.. string.format('%0.3f', totalSizeReruns /1000000 ) .. ' MB) took ' .. string.format('%0.3f', t) .. 's. Performance: ' .. string.format('%0.3f', (totalSizeReruns/1000000) / t ) .. ' MB/s'..string.format(' in %0.3f sec', t))
end
local totalSizeReruns = totalPackSize
print(' * Parsing (' .. tostring(reruns) .. 'x = '.. string.format('%0.3f', totalSizeReruns /1000000 ) .. ' MB) took ' .. string.format('%0.3f', t) .. 's. Performance: ' .. string.format('%0.3f', (totalSizeReruns/1000000) / t ) .. ' MB/s'..string.format(' in %0.3f sec', t))
end
local totalSizeReruns = totalPackSize
print(' * Parsing (' .. tostring(reruns) .. 'x = '.. string.format('%0.3f', totalSizeReruns /1000000 ) .. ' MB) took ' .. string.format('%0.3f', t) .. 's. Performance: ' .. string.format('%0.3f', (totalSizeReruns/1000000) / t ) .. ' MB/s'..string.format(' in %0.3f sec', t))
end
local totalSizeReruns = totalPackSize
print(' * Parsing (' .. tostring(reruns) .. 'x = '.. string.format('%0.3f', totalSizeReruns /1000000 ) .. ' MB) took ' .. string.format('%0.3f', t) .. 's. Performance: ' .. string.format('%0.3f', (totalSizeReruns/1000000) / t ) .. ' MB/s'..string.format(' in %0.3f sec', t))
end
local totalSizeReruns = totalPackSize
print(' * Parsing (' .. tostring(reruns) .. 'x = '.. string.format('%0.3f', totalSizeReruns /1000000 ) .. ' MB) took ' .. string.format('%0.3f', t) .. 's. Performance: ' .. string.format('%0.3f', (totalSizeReruns/1000000) / t ) .. ' MB/s'..string.format(' in %0.3f sec', t))
end
print('Total packed size = '..totalPackSize)
print(' * Encoding (' .. tostring(reruns) .. 'x = '.. string.format('%0.3f', totalSizeReruns /1000000 ) .. ' MB) took ' .. string.format('%0.3f', t) .. 's. Performance: ' .. string.format('%0.3f', (totalSizeReruns/1000000) / t ) .. ' MB/s'..string.format(' in %0.3f sec', t))
end
print('Total packed size = '..totalPackSize)
print(' * Encoding (' .. tostring(reruns) .. 'x = '.. string.format('%0.3f', totalSizeReruns /1000000 ) .. ' MB) took ' .. string.format('%0.3f', t) .. 's. Performance: ' .. string.format('%0.3f', (totalSizeReruns/1000000) / t ) .. ' MB/s'..string.format(' in %0.3f sec', t))
end
print('Total packed size = '..totalPackSize)
print(' * Encoding (' .. tostring(reruns) .. 'x = '.. string.format('%0.3f', totalSizeReruns /1000000 ) .. ' MB) took ' .. string.format('%0.3f', t) .. 's. Performance: ' .. string.format('%0.3f', (totalSizeReruns/1000000) / t ) .. ' MB/s'..string.format(' in %0.3f sec', t))
end
print('Total packed size = '..totalPackSize)
print(' * Encoding (' .. tostring(reruns) .. 'x = '.. string.format('%0.3f', totalSizeReruns /1000000 ) .. ' MB) took ' .. string.format('%0.3f', t) .. 's. Performance: ' .. string.format('%0.3f', (totalSizeReruns/1000000) / t ) .. ' MB/s'..string.format(' in %0.3f sec', t))
end
print('Total packed size = '..totalPackSize)
print(' * Encoding (' .. tostring(reruns) .. 'x = '.. string.format('%0.3f', totalSizeReruns /1000000 ) .. ' MB) took ' .. string.format('%0.3f', t) .. 's. Performance: ' .. string.format('%0.3f', (totalSizeReruns/1000000) / t ) .. ' MB/s'..string.format(' in %0.3f sec', t))
end
print('Total packed size = '..totalPackSize)
print(' * Encoding (' .. tostring(reruns) .. 'x = '.. string.format('%0.3f', totalSizeReruns /1000000 ) .. ' MB) took ' .. string.format('%0.3f', t) .. 's. Performance: ' .. string.format('%0.3f', (totalSizeReruns/1000000) / t ) .. ' MB/s'..string.format(' in %0.3f sec', t))
end
print('Total packed size = '..totalPackSize)
print(' * Encoding (' .. tostring(reruns) .. 'x = '.. string.format('%0.3f', totalSizeReruns /1000000 ) .. ' MB) took ' .. string.format('%0.3f', t) .. 's. Performance: ' .. string.format('%0.3f', (totalSizeReruns/1000000) / t ) .. ' MB/s'..string.format(' in %0.3f sec', t))
end
print('Total packed size = '..totalPackSize)
print(' * Encoding (' .. tostring(reruns) .. 'x = '.. string.format('%0.3f', totalSizeReruns /1000000 ) .. ' MB) took ' .. string.format('%0.3f', t) .. 's. Performance: ' .. string.format('%0.3f', (totalSizeReruns/1000000) / t ) .. ' MB/s'..string.format(' in %0.3f sec', t))
end
local totalSizeReruns = totalPackSize
print(' * Parsing (' .. tostring(reruns) .. 'x = '.. string.format('%0.3f', totalSizeReruns /1000000 ) .. ' MB) took ' .. string.format('%0.3f', t) .. 's. Performance: ' .. string.format('%0.3f', (totalSizeReruns/1000000) / t ) .. ' MB/s'..string.format(' in %0.3f sec', t))
end
local totalSizeReruns = totalPackSize
print(' * Parsing (' .. tostring(reruns) .. 'x = '.. string.format('%0.3f', totalSizeReruns /1000000 ) .. ' MB) took ' .. string.format('%0.3f', t) .. 's. Performance: ' .. string.format('%0.3f', (totalSizeReruns/1000000) / t ) .. ' MB/s'..string.format(' in %0.3f sec', t))
end
local totalSizeReruns = totalPackSize
print(' * Parsing (' .. tostring(reruns) .. 'x = '.. string.format('%0.3f', totalSizeReruns /1000000 ) .. ' MB) took ' .. string.format('%0.3f', t) .. 's. Performance: ' .. string.format('%0.3f', (totalSizeReruns/1000000) / t ) .. ' MB/s'..string.format(' in %0.3f sec', t))
end
local totalSizeReruns = totalPackSize
print(' * Parsing (' .. tostring(reruns) .. 'x = '.. string.format('%0.3f', totalSizeReruns /1000000 ) .. ' MB) took ' .. string.format('%0.3f', t) .. 's. Performance: ' .. string.format('%0.3f', (totalSizeReruns/1000000) / t ) .. ' MB/s'..string.format(' in %0.3f sec', t))
end
@/lua/vehicle/powertrain/compressor.lua
if device.engaged then
--log("D", "compressor.updateVelocity", ("playing %q at %d"):format(device.purgeSoundEvent, device.purgeSoundNodeId))
obj:playSFXOnce(device.purgeSoundEvent, device.purgeSoundNodeId, device.purgeSoundVolume, 1)
if storage.energyType ~= device.requiredEnergyType then
log("E", "compressor.registerStorage", ("provided energyStorage for compressor %q has wrong energyType (compressor wants %q, storage is %q)"):format(device.name, device.requiredEnergyType, storage.energyType))
return
device.purgeSoundNodeId = purgeSoundNode or device.parent.engineNodeID or 0
--log("D", "compressor.initSounds", ("purgeSoundNode: %q | purgeSoundNodeId: %d"):format(purgeSoundNode, device.purgeSoundNodeId))
device.purgeSoundEvent = jbeamData.pumpPurgeEvent or "event:>Vehicle>Pneumatics>Air_Dryer_Purge"
@/lua/ge/extensions/editor/dynamicDecals/layerTypes/brushStroke.lua
if editor.uiInputText(
string.format("##%s_%s_%s", layer.uid, guiId, "layerName"),
editor.getTempCharPtr(layer.name),
im.NextColumn()
if im.Checkbox(string.format("##%s_%s_%s", layer.uid, guiId, "enabled"), editor.getTempBool_BoolBool(layer.enabled)) then
layer.enabled = editor.getTempBool_BoolBool()
im.NextColumn()
im.TextUnformatted(string.format("%s layer", api.layerTypesMap[layer.type]))
im.NextColumn()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if im.InputFloat3(string.format("##%s_%s_%s", layer.uid, guiId, "camPosition"), editor.getTempFloatArray3_Vec3Vec3(layer.camPosition), "%.6f") then
layer.camPosition = editor.getTempFloatArray3_Vec3Vec3()
im.PushItemWidth(im.GetContentRegionAvailWidth() - ((layer.colorPaletteMapId > 0) and (im.GetStyle().ItemSpacing.x + math.ceil(im.GetFontSize()) + 2 * im.GetStyle().FramePadding.y) or 0))
if im.Combo2(string.format("##%s_%s_%s", layer.uid, guiId, "colorpalettemapid"), editor.getTempInt_NumberNumber(layer.colorPaletteMapId), "zero\0one\0two\0three\0\0") then
layer.colorPaletteMapId = editor.getTempInt_NumberNumber()
im.SameLine()
im.ColorButton(string.format("##%s_%s_%s", layer.uid, guiId, "colorpalettemapidbutton"), editor.getTempImVec4_TableTable(col))
im.tooltip("Vehicle color palette color")
im.NextColumn()
if im.Checkbox(string.format("##%s_%s_%s", layer.uid, guiId, "decalUseGradientColor"), editor.getTempBool_BoolBool(layer.decalUseGradientColor)) then
layer.decalUseGradientColor = editor.getTempBool_BoolBool()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiColorEdit4(string.format("##%s_%s_%s", layer.uid, guiId, "color"), editor.getTempFloatArray4_TableTable(layer.color:toTable()), nil, editor.getTempBool_BoolBool(false)) then
layer.color = Point4F.fromTable(editor.getTempFloatArray4_TableTable())
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiSliderFloat3(string.format("##%s_%s_%s", layer.uid, guiId, "decalScale"), editor.getTempFloatArray3_Vec3Vec3(layer.decalScale), 0.05, 6.0, nil, nil, editor.getTempBool_BoolBool(false)) then
layer.decalScale = editor.getTempFloatArray3_Vec3Vec3()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiSliderFloat(string.format("##%s_%s_%s", layer.uid, guiId, "decalRotation"), editor.getTempFloat_NumberNumber(layer.decalRotation * 180 / math.pi), 0, 360, nil, nil, editor.getTempBool_BoolBool(false)) then
layer.decalRotation = (editor.getTempFloat_NumberNumber() / 180 * math.pi)
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiSliderFloat2(string.format("##%s_%s_%s", layer.uid, guiId, "decalSkew"), editor.getTempFloatArray2_TableTable({layer.decalSkew.x, layer.decalSkew.y}), -2.0, 2.0, nil, nil, editor.getTempBool_BoolBool(false)) then
local value = editor.getTempFloatArray2_TableTable()
im.NextColumn()
if im.Checkbox(string.format("##%s_%s_%s", layer.uid, guiId, "mirrored"), editor.getTempBool_BoolBool(layer.mirrored)) then
layer.mirrored = editor.getTempBool_BoolBool()
im.NextColumn()
if im.Checkbox(string.format("##%s_%s_%s", layer.uid, guiId, "flipMirroredDecal"), editor.getTempBool_BoolBool(layer.flipMirroredDecal)) then
layer.flipMirroredDecal = editor.getTempBool_BoolBool()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiSliderFloat2(string.format("##%s_%s_%s", layer.uid, guiId, "colorTextureScale"), editor.getTempFloatArray2_TableTable({layer.colorTextureScale.x, layer.colorTextureScale.y}), 0.01, 6.0, nil, nil, editor.getTempBool_BoolBool(false)) then
local value = editor.getTempFloatArray2_TableTable()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if im.Combo2(string.format("##%s_%s_%s", layer.uid, guiId, "alphaMaskChannel"), editor.getTempInt_NumberNumber(layer.alphaMaskChannel), "red\0green\0blue\0alpha\0\0") then
layer.alphaMaskChannel = editor.getTempInt_NumberNumber()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if im.Combo2(string.format("##%s_%s_%s", layer.uid, guiId, "alphaMaskBlendMode"), editor.getTempInt_NumberNumber(layer.alphaMaskBlendMode), "multiply\0add\0\0") then
layer.alphaMaskBlendMode = editor.getTempInt_NumberNumber()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiSliderFloat2(string.format("##%s_%s_%s", layer.uid, guiId, "alphaMaskScale"), editor.getTempFloatArray2_TableTable({layer.alphaMaskScale.x, layer.alphaMaskScale.y}), 0.01, 6.0, nil, nil, editor.getTempBool_BoolBool(false)) then
local value = editor.getTempFloatArray2_TableTable()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiSliderFloat(string.format("##%s_%s_%s", layer.uid, guiId, "alphaMaskRotation"), editor.getTempFloat_NumberNumber(layer.alphaMaskRotation * 180 / math.pi), 0, 360, nil, nil, editor.getTempBool_BoolBool(false)) then
layer.alphaMaskRotation = (editor.getTempFloat_NumberNumber() / 180 * math.pi)
local val = 0
if editor.uiSliderFloat(string.format("##%s_%s_%s", layer.uid, guiId, "alphaMaskIntensity"), editor.getTempFloat_NumberNumber(layer.alphaMaskIntensity), 0.0, 2.0, "%.2f", nil, editor.getTempBool_BoolBool(false)) then
layer.alphaMaskIntensity = editor.getTempFloat_NumberNumber()
im.NextColumn()
if im.Checkbox(string.format("##%s_%s_%s", layer.uid, guiId, "wrapAlphaMaskX"), editor.getTempBool_BoolBool(layer.wrapAlphaMaskX)) then
layer.wrapAlphaMaskX = editor.getTempBool_BoolBool()
im.NextColumn()
if im.Checkbox(string.format("##%s_%s_%s", layer.uid, guiId, "wrapAlphaMaskY"), editor.getTempBool_BoolBool(layer.wrapAlphaMaskY)) then
layer.wrapAlphaMaskY = editor.getTempBool_BoolBool()
im.NextColumn()
if im.Checkbox(string.format("##%s_%s_%s", layer.uid, guiId, "wrapColorTextureX"), editor.getTempBool_BoolBool(layer.wrapColorTextureX)) then
layer.wrapColorTextureX = editor.getTempBool_BoolBool()
im.NextColumn()
if im.Checkbox(string.format("##%s_%s_%s", layer.uid, guiId, "wrapColorTextureY"), editor.getTempBool_BoolBool(layer.wrapColorTextureY)) then
layer.wrapColorTextureY = editor.getTempBool_BoolBool()
im.NextColumn()
if im.Checkbox(string.format("##%s_%s_%s", layer.uid, guiId, "alphaMaskInvert"), editor.getTempBool_BoolBool(layer.alphaMaskInvert)) then
layer.alphaMaskInvert = editor.getTempBool_BoolBool()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiInputInt(string.format("##%s_%s_%s", layer.uid, guiId, "interpolationSteps"), editor.getTempInt_NumberNumber(layer.interpolationSteps), 1, 2) then
local value = editor.getTempInt_NumberNumber()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiSliderFloat(string.format("##%s_%s_%s", layer.uid, guiId, "sdfThickness"), editor.getTempFloat_NumberNumber(layer.sdfThickness), 0.0, 1.0, "%.2f", nil, editor.getTempBool_BoolBool(false)) then
layer.sdfThickness = editor.getTempFloat_NumberNumber()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiSliderFloat(string.format("##%s_%s_%s", layer.uid, guiId, "sdfSoftness"), editor.getTempFloat_NumberNumber(layer.sdfSoftness), 0.0, 1.0, "%.2f", nil, editor.getTempBool_BoolBool(false)) then
layer.sdfSoftness = editor.getTempFloat_NumberNumber()
local sdfOutlineColorTbl = layer.sdfOutlineColor:toTable()
if editor.uiColorEdit4(string.format("##%s_%s_%s", layer.uid, guiId, "sdfOutlineColor"), editor.getTempFloatArray3_TableTable({sdfOutlineColorTbl[1]/255, sdfOutlineColorTbl[2]/255, sdfOutlineColorTbl[3]/255}), nil, editor.getTempBool_BoolBool(false)) then
local value = editor.getTempFloatArray3_TableTable()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiSliderFloat(string.format("##%s_%s_%s", layer.uid, guiId, "sdfOutlineThickness"), editor.getTempFloat_NumberNumber(layer.sdfOutlineThickness), 0.0, 1.0, "%.2f", nil, editor.getTempBool_BoolBool(false)) then
layer.sdfOutlineThickness = editor.getTempFloat_NumberNumber()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiSliderFloat(string.format("##%s_%s_%s", layer.uid, guiId, "sdfOutlineSoftness"), editor.getTempFloat_NumberNumber(layer.sdfOutlineSoftness), 0.0, 1.0, "%.2f", nil, editor.getTempBool_BoolBool(false)) then
layer.sdfOutlineSoftness = editor.getTempFloat_NumberNumber()
local count = #layer.dataPoints
im.TextUnformatted(string.format("count: %d", count))
editor.uiButtonRightAlign(string.format("Show data points##%s", layer.uid), nil, true)
if im.IsItemHovered() then
debugDrawer:drawSphere(pos, editor.getPreference("dynamicDecalsTool.general.dataPointSphereSize"), ColorF(col[1], col[2], col[3], col[4]), col[4] < 0.99 and true or false)
debugDrawer:drawTextAdvanced(pos, String(string.format(" %d ", i)), ColorF(1,1,0,1), true, false, ColorI(40, 40, 40, 0.75*255))
end
im.SameLine()
if editor.uiIconImageButton(editor.icons.delete, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, string.format("##%s_%s_%s_%d", layer.uid, guiId, "interpolationSteps_removedataPointsEntry", k)) then
table.remove(layer.dataPoints, k)
if k == count then im.BeginDisabled() end
if editor.uiIconImageButton(editor.icons.content_copy, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, string.format("##%s_%s_%s_%d", layer.uid, guiId, "interpolationSteps_insertdataPointsEntry", k)) then
local nextPoint = layer.dataPoints[k + 1]
if editor.uiIconImageButton(editor.icons.move, im.ImVec2(tool.getIconSize(), tool.getIconSize()), (gizmo.data.uid == layer.uid and gizmo.data.dataPointIndex == k) and editor.color.beamng.Value or nil, nil, nil, string.format("MoveBrushStrokePoint_%s_%d", layer.uid, k)) then
local layerData = deepcopy(layer)
debugDrawer:drawSphere(pos, editor.getPreference("dynamicDecalsTool.general.dataPointSphereSize"), ColorF(col[1], col[2], col[3], col[4]), col[4] < 0.99 and true or false)
debugDrawer:drawTextAdvanced(pos, String(string.format(" %d ", k)), ColorF(1,1,0,1), true, false, ColorI(40, 40, 40, 0.75*255))
end
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiSliderFloat2(string.format("##%s_%s_%s_%d", layer.uid, guiId, "brushdataPoints_cursorPosScreenUv", k), editor.getTempFloatArray2_TableTable({data.x, data.y}), 0.0, 1.0, nil, nil, editor.getTempBool_BoolBool(false)) then
local value = editor.getTempFloatArray2_TableTable()
im.TableNextColumn()
if im.Button(string.format("Highlight##DecalPropertiesTable_%s", property.name)) then
tool.setSectionOpenState("Decal Properties", true)
tool.setSectionOpenState("Decal Properties", true)
widgets.highlight(string.format("##Decal Properties_section_%s", property.id), 5)
end
@/lua/common/jbeam/expressionParser.lua
end,
__newindex = function(tbl, key, value) error(string.format("Attempt to modify read-only table entry: %s = %s", key, value)) end,
__metatable = false
end,
__newindex = function(tbl, key, value) error(string.format("Attempt to modify read-only table entry: %s = %s", key, value)) end,
__metatable = false
@/lua/ge/extensions/core/input/bindings.lua
if not isMenuActionMap then
log("E", "", string.format("Failed to run setMenuActionEnabled(%q, %q, %q): the action map name '%q' isn't related to menus", enabled, actionName, actionMapName, actionMapName, prefix))
return
if not isMenuIndependentValid then
log("E", "", string.format("Failed to run setMenuActionEnabled(%q, %q, %q): the %q action map name '%q' isn't recognized", enabled, actionName, actionMapName, prefix, actionMapName))
return
if not am then
log("E", "", string.format("Failed to run setMenuActionEnabled(%q, %q, %q): the action map '%q' does not exist", enabled, actionName, actionMapName, actionMapName))
return
@/lua/ge/extensions/gameplay/rally/notebook/structured/visualCompositor.lua
for i,vp in ipairs(visualPacenotes) do
vp.id = string.format("%s_%d", string.gsub(pacenote.name, ' ', '_'), i)
vp.pnId = pacenote.id
@/inspector/Views/AuditTestCaseContentView.js
durationElement.classList.add("async");
durationElement.title = WI.UIString("%s eval\n%s async").format(evalDuration, asyncDuration);
}
if (!this.placeholderElement || !this.placeholderElement.__placeholderRunning) {
this.placeholderElement = WI.createMessageTextView(WI.UIString("Running the \u201C%s\u201D audit").format(this.representedObject.name));
this.placeholderElement.__placeholderRunning = true;
@/lua/ge/extensions/career/modules/delivery/progress.lua
for _, c in ipairs(confirmedDropOffData.cargo) do
local gId = string.format("%d-%d", c.groupId, c.loadedAtTimeStamp or -1)
cargoByGroupId[gId] = cargoByGroupId[gId] or {}
for gId, group in pairs(cargoByGroupId) do
table.insert(itemNames, string.format("%dx %s", #group, group[1].name))
end
for _, formattedOffer in ipairs(confirmedDropOffData.offers) do
table.insert(itemNames, string.format("%s %s",formattedOffer.offer.name, formattedOffer.offer.vehicle.name))
table.insert(rewards, formattedOffer.adjustedRewards)
]]
career_modules_playerAttributes.addAttributes(rewardSum,{label=string.format("Rewards for %s", table.concat(itemNames, ", ")), tags={"gameplay"}})
showLevelUpPopup = true,
unlockPopupHeader = string.format("%s %s: Level %d", translateLanguage(branch.name, branch.name), branch.isSkill and "Skill" or "Branch", career_branches.getBranchLevel(branch.id) or 0)
}
disabledReasonHeader = "Facility not yet unlocked!",
disabledReasonContent = string.format("Deliver %d Items here to be able to deliver from here.",tgt),
progress = {
progress = {
{type="progressBar",minValue=0,maxValue=tgt,currValue=val, label=string.format("%d / %d Items delivered.", val, tgt)}
}
@/lua/ge/extensions/editor/fileDialog.lua
im.NextColumn()
im.TextUnformatted(string.format("%d x %d", imgSize.x, imgSize.y))
im.Columns(1, "FilePreviewColumns")
@/lua/ge/extensions/career/modules/milestones/generalMilestones/branches.lua
getDescription = function(step, displayValue, target) return {txt=isBranch and "ui.career.milestones.branches.reachBranchLevel.description" or "ui.career.milestones.branches.reachSkillLevel.description", context={lvl = step+1, name = branchInfo.name}} end,
getProgressLabel = function(step, current, target) return string.format("%d xp / %d xp", current, target) end,
getTarget = function(step) return branchInfo.levels[step+1].requiredValue end,
@/lua/ge/extensions/gameplay/markers/crawlMarker.lua
if iconRendererObj then
local iconId = iconRendererObj:addIcon(string.format("%s-gsIcon",cluster.id), cluster.icon, cluster.iconPos)
local iconInfo = iconRendererObj:getIconById(iconId)
@/lua/ge/extensions/ui/apps/genericMissionData.lua
local element = item.element
im.BulletText(string.format("[%d] %s: %s (order: %d)", i, item.category, element.txt, element.order))
end
@/lua/ge/extensions/editor/rallyEditor/pacenotes/structuredForm.lua
elseif pacenote:getAudioMode() == RallyEnums.pacenoteAudioMode.structuredOffline then
local codriverHelpTxt = string.format("codriver source=shared voice=%s", settings.getValue('rallyTextCompositorVoice'))
im.Text(codriverHelpTxt)
@/inspector/Controllers/Formatter.js
format(from, to)
{
@/inspector/Views/BreakpointTreeElement.js
if (displayColumnNumber > 0)
this.mainTitle = WI.UIString("Line %d:%d").format(displayLineNumber + 1, displayColumnNumber + 1); // The user visible line and column numbers are 1-based.
else
else
this.mainTitle = WI.UIString("Line %d").format(displayLineNumber + 1); // The user visible line number is 1-based.
this.tooltip = this.mainTitle + " \u2014 " + WI.UIString("originally %s").format(sourceCodeLocation.originalLocationString());
}
@/inspector/Models/RecordingAction.js
if (payload.length > 0)
WI.Recording.synthesizeWarning(WI.UIString("non-number %s").format(WI.unlocalizedString("name")));
if (payload.length > 1)
WI.Recording.synthesizeWarning(WI.UIString("non-array %s").format(WI.unlocalizedString("parameters")));
if (payload.length > 2)
WI.Recording.synthesizeWarning(WI.UIString("non-array %s").format(WI.unlocalizedString("swizzleTypes")));
if (payload.length > 3)
WI.Recording.synthesizeWarning(WI.UIString("non-number %s").format(WI.unlocalizedString("trace")));
if (payload.length > 4)
WI.Recording.synthesizeWarning(WI.UIString("non-number %s").format(WI.unlocalizedString("snapshot")));
WI.Recording.synthesizeWarning(WI.UIString("\u0022%s\u0022 is not valid for %s").format(name, prototype.constructor.name));
}
WI.Recording.synthesizeWarning(WI.UIString("\u0022%s\u0022 threw an error").format(this._name));
}
@/lua/ge/extensions/core/sounds.lua
audioBlurLog('I','AUDIO',string.format("ui changed: %s => %s gameAudioBlurValue = %0.1f (old = %0.1f) (interactingWithMissionUI = %s)", tostring(fromState), tostring(toState), gameAudioBlurValue, old_value, tostring(interactingWithMissionUI)))
end
end
audioBlurLog('I','AUDIO',string.format("missionInfo changed: %s => %s gameAudioBlurValue = %0.1f (interactingWithMissionUI = %s)", tostring(fromState), tostring(toState), gameAudioBlurValue, tostring(interactingWithMissionUI)))
end
local function onActivityAcceptGatherData(elemData, activityData)
audioBlurLog('I','AUDIO',string.format("onActivityAcceptGatherData: elemData = %s, activityData = %s",dumps(elemData),(activityData)))
missionMarkerInteraction = false
M.setAudioBlur = function (value)
audioBlurLog('I','AUDIO',string.format("gameAudioBlurValue changed manually: gameAudioBlurValue = %0.1f (old = %0.1f)", value, gameAudioBlurValue))
gameAudioBlurValue = value
@/lua/ge/extensions/flowgraph/nodes/scene/raycast.lua
debugDrawer:drawLine(vec3(pos), vec3(hitPos), ColorF(0,0,1,0.5))
debugDrawer:drawTextAdvanced(hitPos, String(string.format("%0.3f",hitDist)), ColorF(1,1,1,1), true, false, ColorI(0,0,0,192))
end
@/inspector/Views/CPUUsageCombinedView.js
this._legendMainThreadElement.textContent = WI.UIString("Main: %s").format(Number.percentageString(mainThreadUsage / 100));
this._legendWorkerThreadsElement.textContent = WI.UIString("Worker: %s").format(Number.percentageString(workerThreadUsage / 100));
this._legendMainThreadElement.textContent = WI.UIString("Main: %s").format(Number.percentageString(mainThreadUsage / 100));
this._legendWorkerThreadsElement.textContent = WI.UIString("Worker: %s").format(Number.percentageString(workerThreadUsage / 100));
this._legendOtherThreadsElement.textContent = WI.UIString("Other: %s").format(Number.percentageString((webkitThreadUsage + unknownThreadUsage) / 100));
this._legendWorkerThreadsElement.textContent = WI.UIString("Worker: %s").format(Number.percentageString(workerThreadUsage / 100));
this._legendOtherThreadsElement.textContent = WI.UIString("Other: %s").format(Number.percentageString((webkitThreadUsage + unknownThreadUsage) / 100));
this._legendTotalThreadsElement.textContent = WI.UIString("Total: %s").format(Number.percentageString(usage / 100));
this._legendOtherThreadsElement.textContent = WI.UIString("Other: %s").format(Number.percentageString((webkitThreadUsage + unknownThreadUsage) / 100));
this._legendTotalThreadsElement.textContent = WI.UIString("Total: %s").format(Number.percentageString(usage / 100));
}
this._detailsAverageElement.textContent = WI.UIString("Average: %s").format(Number.isFinite(maxSize) ? Number.percentageString(averageSize / 100) : emDash);
this._detailsMaxElement.textContent = WI.UIString("Highest: %s").format(Number.isFinite(maxSize) ? Number.percentageString(maxSize / 100) : emDash);
this._detailsAverageElement.textContent = WI.UIString("Average: %s").format(Number.isFinite(maxSize) ? Number.percentageString(averageSize / 100) : emDash);
this._detailsMaxElement.textContent = WI.UIString("Highest: %s").format(Number.isFinite(maxSize) ? Number.percentageString(maxSize / 100) : emDash);
}
@/lua/ge/extensions/editor/dragRaceEditor/waypoints.lua
local isSelected = i == selectedWaypointIndex
local label = string.format("%s", waypoint.type or "unknown")
if im.IsItemHovered() then
im.tooltip(string.format("Type: %s",
waypoint.type or "N/A"))
@/lua/ge/extensions/ui/policeInfo.lua
local seconds = math.floor(v.txt - minutes * 60)
v.txt = string.format("%02d:%02d", minutes, seconds)
end
@/lua/ge/extensions/flowgraph/nodes/environment/directionalGravity.lua
local grav = C.gConst * (self.planet.mass / (h*h))
debugDrawer:drawText(veh:getPosition(), String("Force: " .. string.format('%0.2E', grav)), ColorF(0,0,0,1))
end
@/lua/ge/extensions/career/modules/delivery/vehicleOfferManager.lua
if task.lookupType == "vehNeedsRepair" or task.lookupType == "vehLargeTruckNeedsRepair" then
return string.format("Bring to %s for repairs.",dParcelManager.getLocationLabelShort(task.destination))
end
if task.lookupType == "vehForPrivate" then
return string.format("Bring to private home near %s.",dParcelManager.getLocationLabelShort(task.destination))
end
if task.lookupType == "vehRepairFinished" then
return string.format("Repair complete, bring back to %s.",dParcelManager.getLocationLabelShort(task.destination))
end
if task.lookupType == "vehLargeTruck" then
return string.format("Bring to %s.",dParcelManager.getLocationLabelShort(task.destination))
end
end
return string.format("Bring to %s.",dParcelManager.getLocationLabelShort(task.destination))
elseif task.type == "trailerDropOff" then
elseif task.type == "trailerDropOff" then
return string.format("Tow to %s.", dParcelManager.getLocationLabelShort(task.destination))
elseif task.destination then
elseif task.destination then
return string.format("Drop Off at %s.", dParcelManager.getLocationLabelShort(task.destination))
else
offer.vehicle.vehId = vehId
veh:queueLuaCommand(string.format("partCondition.initConditions(nil, %d, nil, %f)", mileage, career_modules_vehicleShopping.getVisualValueFromMileage(mileage)))
-- turn vehicle off
local prevMult, nextMult = dProgress.getMoneyMultiplerForSkill('vehicleDelivery', tier-1), dProgress.getMoneyMultiplerForSkill('vehicleDelivery', tier)
log("I","",string.format("Reached tier %d of vehicle delivery. Increasing money rewards from %0.2f to %0.2f", tier, prevMult, nextMult))
for _, offer in ipairs(allOffers) do
local prevMult, nextMult = dProgress.getMoneyMultiplerForSkill('delivery', tier-1), dProgress.getMoneyMultiplerForSkill('delivery', tier)
log("I","",string.format("Reached tier %d of delivery. Increasing money rewards from %0.2f to %0.2f", tier, prevMult, nextMult))
for _, offer in ipairs(allOffers) do
@/lua/ge/extensions/editor/dynamicDecals/inspector.lua
local function inspectLayerGui(layer, guiId)
if im.Button(string.format("Dump##%s_%s", layer.uid, guiId)) then dump(layer) end
if editor.getPreference("dynamicDecalsTool.general.debug") then
im.SameLine()
if im.Button(string.format("Dumpz 3##%s_%s", layer.uid, guiId)) then dumpz(layer, 3) end
end
local widgetId = string.format("%s_%s", layer.uid, guiId)
im.TextUnformatted("uid")
im.PushItemWidth(im.GetContentRegionAvailWidth())
im.InputText(string.format("##uid_%s", widgetId), editor.getTempCharPtr(layer.uid), nil, im.InputTextFlags_ReadOnly)
im.tooltip("Read-only type")
im.PushItemWidth(im.GetContentRegionAvailWidth())
im.InputText(string.format("##type_%s", widgetId), editor.getTempCharPtr(string.format("%s Layer", helper.splitAndCapitalizeCamelCase(api.layerTypesMap[layer.type]))), nil, im.InputTextFlags_ReadOnly)
im.tooltip("Read-only type")
im.PushItemWidth(im.GetContentRegionAvailWidth())
im.InputText(string.format("##type_%s", widgetId), editor.getTempCharPtr(string.format("%s Layer", helper.splitAndCapitalizeCamelCase(api.layerTypesMap[layer.type]))), nil, im.InputTextFlags_ReadOnly)
im.tooltip("Read-only type")
if multiSelect then
if im.TreeNode1(string.format("%s - %s", layerData.uid, layerData.name)) then
inspectLayerGui(layerData, "inspector")
for layerType, layerTypeId in pairs(api.layerTypes) do
layerGui[layerTypeId] = function() im.TextUnformatted(string.format("No layerGui available for '%s'", layerType)) end
end
@/lua/ge/extensions/gameplay/drift/display.lua
flashMessage(string.format("+ %i points", data.addedScore))
guihooks.trigger("setDriftPersistentDriftScored", data.addedScore, data.combo)
local function onDonutDriftScored(score)
flashMessage(string.format("Donut! + %i points", score))
guihooks.trigger("stuntZoneScored",{type = "donut", score = score})
local function onNearPoleScored(score)
flashMessage(string.format("Near pole drift! + %i points", score))
guihooks.trigger("stuntZoneScored",{type = "nearPole", score = score})
local function onTightDriftScored(score)
flashMessage(string.format("Drift through! + %i points", score))
guihooks.trigger("stuntZoneScored",{type = "tightDrift", score = score})
local function onHitPoleScored(score)
flashMessage(string.format("Pole hit! + %i points", score))
guihooks.trigger("stuntZoneScored",{type = "hitPole", score = score})
title = "missions.missions.general.distRemaining",
txt = string.format("%d m", remainingDist),
meters = remainingDist,
core_jobsystem.create(function(job)
rtMessage(string.format(data.newRecord and "New record! Score: %i" or "Drift zone finished! Score: %i", data.score))
job.sleep(data.duration)
local function onDriftScoreWrappedUp(score)
flashMessage(string.format("+ %i points for current drift", math.floor(score)))
end
local function onNewDriftTierReached(tierData)
flashMessage(string.format("%s", tierData.name))
end
@/flowgraphEditor/Tower/customNodes/towerNode.lua
local amount = math.ceil((option.frequency / totalFrequency) * (n))
print(string.format("%s : %d / %d", option.mesh, amount, n))
for _ = 1, amount do
local _, fn, ext = path.split(room.file, true)
local name = generateObjectNameForClass('Prefab', string.format("%s - %d - ", string.sub(fn, 1, string.len(fn) - string.len(ext)-1), i))
local scenetreeObject = spawnPrefab(name , self.mgr.savedDir .. room.file, "0 0 0", "0 0 1 0", "1 1 1", false)
@/lua/ge/extensions/trackbuilder/trackBuilder.lua
im.TextUnformatted(tex.path)
im.TextUnformatted(string.format("%d x %d", tex.size.x, tex.size.y))
im.PopTextWrapPos()
local function setColor(mat, color)
local value = string.format('%f %f %f %f', color[0], color[1], color[2], color[3])
if mat == 'center_base' then
im.TextColored(style.textColor,string.format(translateLanguage("ui.trackBuilder.base.banking", "Banking") .. ": %.1f°", modifierValues.bank.value[0]))
im.TextColored(style.textColor,string.format(translateLanguage("ui.trackBuilder.base.height", "Height") .. ": %.1fm", modifierValues.height.value[0]))
im.Spacing()
im.TextColored(style.textColor,string.format(translateLanguage("ui.trackbuilder.base.banking", "Banking") .. ": %.1f°", modifierValues.bank.value[0]))
mainModifiers('bank','tb_bank_left','tb_bank_right',15,1,60,-720,720)
im.TextColored(style.textColor,string.format(translateLanguage("ui.trackBuilder.base.height", "Height") .. ": %.1fm", modifierValues.height.value[0]))
mainModifiers('height','tb_height_lower','tb_height_higher',1,5,25,-50000,50000)
@/lua/ge/extensions/editor/masterSpline/layerMgr.lua
spline.layers[#spline.layers + 1] = {
name = string.format("New Layer %d", #spline.layers + 1),
id = Engine.generateUUID(),
@/lua/vehicle/controller/vehicleController/shiftLogic/dctGearbox.lua
M.shiftingAggression = shiftAggression
--print(string.format("GR: %.2f, AG: %.2f, IN: %.2f -> %.2f", gearRatioCoef, aggressionCoef, inertiaCoef, shiftAggression))
end
end
--print(string.format("Clutch1: %.2f, Clutch 2: %.2f",electrics.values.clutchRatio1,electrics.values.clutchRatio2))
@/lua/ge/extensions/ui/liveryEditor/utils.lua
-- return math.floor(value + 0.5)
-- local truncated = string.format("%.1f", value)
-- return tonumber(truncated)
local radians = degrees * (math.pi / 180)
local truncated = string.format("%.14f", radians)
return tonumber(truncated)
@/lua/ge/extensions/flowgraph/nodes/gameplay/rally/rallySuperCountdown.lua
self.cachedSpName = spName
-- log('D', logTag, string.format('Start position cached: %s', spName))
return true
self.startPosValid = false
log('W', logTag, string.format('Start position not found: %s', spName or 'nil'))
return false
-- log('D', logTag, string.format('Cache updated: event=%s, mission=%s, time=%s',
-- eventName or 'nil', currentMissionId or 'nil',
-- eventName or 'nil', currentMissionId or 'nil',
-- scheduledEventTime and string.format('%.2f', scheduledEventTime) or 'nil'))
end
self.warningsTriggered[warningTime] = true
-- log('D', logTag, string.format('Marking %ds warning as already passed (%.1fs until event)', warningTime, timeUntilEvent))
end
-- log('D', logTag, string.format('Rescheduled to %.2f (attempt %d/%d)',
-- result.newTime, self.rescheduleCount, maxReschedules))
self.warningsTriggered[warningTime] = true
-- log('D', logTag, string.format('Marking %ds warning as already passed (%.1fs until event)', warningTime, timeUntilEvent))
end
-- log('D', logTag, string.format('Initialized: staging check at %.2f, countdown start at %.2f, event at %.2f',
-- self.stagingCheckTime, self.targetStartTime, scheduledEventTime))
local warningMsg = string.format('%d seconds', warningTime)
if self:shouldShowVisualCountdown() or self.data.useMessages or self.data.useImgui then
if old <= self.maxAnnounced then
local countdownMsg = string.format(COUNTDOWN_MSG_FORMAT, old)
local bigMsg = COUNTDOWN_MSG_FORMAT == "%d"
self.warningsTriggered[warningTime] = true
-- log('D', logTag, string.format('Marking %ds warning as already passed after skip', warningTime))
end
-- log('I', logTag, string.format('Skipped countdown from %.2fs to %.2fs', oldClock, targetEpochTime))
end
@/lua/ge/extensions/flowgraph/nodes/types/getVariable.lua
if not var then
log("I","GetVariable", string.format("Variable %s not found. own id, graph id: %s, %s", name, self.id, self.graph.id))
return
@/lua/ge/extensions/gameplay/rally/cameraPathPlayer.lua
local cam_path = loadPath(points, heightOffset, fov, playbackRateMetersPerSecond)
log('D', logTag, string.format('playing camPath buffer_before=%f, buffer_after=%f, height_offset=%f, fov=%f, playback_rate=%fkph', metersBefore, metersAfter, heightOffset, fov, playbackRateKph))
core_paths.playPath(cam_path)
@/lua/ge/extensions/editor/dynamicDecals/export.lua
for _, v in ipairs(maps) do
local path = string.format("%s%s%s.%s", dirPath, texturesExport_Name, v, exportTexturesFileTypes[texturesExport_exportFormatId])
table.insert(texturesExport_exportPaths, {path, FS:fileExists(path)})
@/lua/vehicle/wheels.lua
state = "measuring"
guihooks.message({txt = string.format("Measuring braking distance from %dkm/h...", targetSpeed * 3.6), context = {}}, 1, "vehicle.brakingdistance")
end
local avgDeceleration = -(square(airspeed) - square(targetSpeed)) / (2 * distance)
guihooks.message({txt = string.format("Brakingdistance from %dkm/h: %.2fm, G: %.2f", targetSpeed * 3.6, distance, avgDeceleration / -powertrain.currentGravity), context = {}}, 5, "vehicle.brakingdistance")
startPosition = nil
@/inspector/Views/ConsoleDrawer.js
{
this._toggleDrawerButton.defaultToolTip = WI.UIString("Hide Console (%s)").format(keyboardShortcut.displayName);
}
@/lua/ge/extensions/editor/assemblySpline.lua
local sourceCount = selSpline.importedKit and #selSpline.importedKit.sourceMeshPaths or 0
im.TextColored(cols.blueB, string.format('[Imported from %d TSStatics]', sourceCount))
im.tooltip('This assembly spline was imported from scene TSStatic objects.')
end
im.TextColored(cols.redB, string.format("[%s]", aliasName))
im.tooltip("The alias name for this bridge instance.")
im.SameLine()
im.TextColored(cols.redB, string.format("[%s]", aliasName)) -- Include the alias name, if this is an aliased entry.
end
@/lua/ge/extensions/gameplay/route/raceRoute.lua
-- log('D', logTag, string.format("RaceRoute:init with removeFirst=%s useMapPathfinding=%s closeDistSquared=%s", tostring(self.removeFirst), tostring(self.useMapPathfinding), tostring(self.closeDistSquared)))
-- if last.metadata and cur.metadata then
-- log('D', '', string.format("merging last.stableId=%s cur.stableId=%s", last.metadata and last.metadata.stableId or 'nil', cur.metadata and cur.metadata.stableId or 'nil'))
-- else
-- else
-- log('D', '', string.format("merging last.wp=%s cur.wp=%s", tostring(last.wp), tostring(cur.wp)))
-- end
-- if stableId then
-- msg = string.format('callbackResult=%s source="%s" stableId="%s"', tostring(callbackResult), source, stableId)
-- else
-- end
-- log('D', '', string.format('recalculateRouteWithOriginalPositions i=%d %s', i, msg))
end
-- debugDrawer:drawSquarePrism(p1, p2, Point2F(0.2, 0.2), Point2F(0.2, 0.2), ColorF(1,0,0,0.5))
-- debugDrawer:drawTextAdvanced(p1, string.format("i=%d", i), ColorF(0,0,0,1), true, false, ColorI(255,0,0,255), false, false)
-- debugDrawer:drawTextAdvanced(p2, string.format("j=%d", j), ColorF(0,0,0,1), true, false, ColorI(255,0,0,255), false, false)
-- debugDrawer:drawTextAdvanced(p1, string.format("i=%d", i), ColorF(0,0,0,1), true, false, ColorI(255,0,0,255), false, false)
-- debugDrawer:drawTextAdvanced(p2, string.format("j=%d", j), ColorF(0,0,0,1), true, false, ColorI(255,0,0,255), false, false)
-- local d = math.sqrt(distSq)
-- debugDrawer:drawTextAdvanced(currentPos, string.format("CURR i=%d d=%0.2f", i, d), ColorF(0,0,0,1), true, false, ColorI(0,255,0,255), false, false)
-- end
local idx, minDistance = self:getPositionOffset(pos)
-- debugDrawer:drawTextAdvanced(pos, string.format("idx=%d minD=%0.2f", idx, minDistance), ColorF(1,1,1,1), true, false, ColorI(0,0,255,255), false, false)
@/lua/ge/extensions/core/chat.lua
s:hook('OnChat', function(user, channel, message)
--log('D', 'chat', (("[%s] %s: %s"):format(channel, user.nick, message)))
extensions.hook('onChatMessage', user, channel, message)
@/lua/ge/extensions/gameplay/markers/missionMarker.lua
local hitDist = castRayStatic(data.camPos, tmpVec, rayLength, nil)
--simpleDebugText3d(string.format("distanceFromMarker: %0.3f, missionIconAlphaDist: %s, focus: %s, hitDist: %0.4f, rayLength: %0.4f", distanceFromMarker, missionIconAlphaDist, self.cluster.focus, hitDist, rayLength), iconInfo.worldPosition, 1)
if hitDist < rayLength then
local missionIconAlpha = clamp(self.iconAlphaSmoother:getWithRateUncapped(missionIconAlphaDist * data.globalAlpha, data.dt, iconAlphaRate), 0,1) * bigMapAlpha
--simpleDebugText3d(string.format("bigMapActive: %s, bigmapalpha: %s, missionIconAlpha: %s, missionIconAlphaDist: %s, globalAlpha: %s, focus: %s", bigMapActive, bigMapAlpha, missionIconAlpha, missionIconAlphaDist, data.globalAlpha, self.cluster.focus), self.pos, 1)
end
--simpleDebugText3d(string.format("missionIconAlpha: %0.3f", missionIconAlpha), self.pos)
if count > 1 then
cluster.icon = string.format("mission_no-%02d_triangle",math.min(count, 9))
end
@/lua/common/tech/techCommunication.lua
local length = #message
local stringLength = string.format('%016d', length)
message = stringLength .. message
Try to restart BeamNG and use a different port number.]]
log('E', logTag, string.format(msg, port))
end
@/lua/common/libs/resty/template/microbenchmark.lua
print(format("Running %d iterations in each test", iterations))
local z = clock() - x
print(format(" Parsing Time: %.6f", z))
total = total + z
z = clock() - x
print(format("Compilation Time: %.6f (template)", z))
total = total + z
z = clock() - x
print(format("Compilation Time: %.6f (template, cached)", z))
total = total + z
z = clock() - x
print(format(" Execution Time: %.6f (same template)", z))
total = total + z
z = clock() - x
print(format(" Execution Time: %.6f (same template, cached)", z))
total = total + z
z = clock() - x
print(format(" Execution Time: %.6f (different template)", z))
total = total + z
z = clock() - x
print(format(" Execution Time: %.6f (different template, cached)", z))
total = total + z
z = clock() - x
print(format(" Execution Time: %.6f (different template, different context)", z))
total = total + z
z = clock() - x
print(format(" Execution Time: %.6f (different template, different context, cached)", z))
total = total + z
total = total + z
print(format(" Total Time: %.6f", total))
end
@/lua/ge/extensions/editor/dynamicDecals/inspector/utils.lua
im.PushItemWidth(im.GetContentRegionAvailWidth() - 2 * tool.getIconSize() - 2 * im.GetStyle().ItemSpacing.x)
im.InputText(string.format("##%s_%s_%s_%s", layer.uid, guiId, propert, "texturePath"), editor.getTempCharPtr(layer[property]), nil, im.InputTextFlags_ReadOnly)
im.PopItemWidth()
im.SameLine()
if editor.uiIconImageButton(editor.icons.folder, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, string.format("##%s_%s_%s_%s", layer.uid, guiId, propert, "button")) then
editor_fileDialog.openFile(
im.SameLine()
if editor.uiIconImageButton(editor.icons.delete, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, string.format("##%s_%s_%s_%s", layer.uid, guiId, propert, "removeButton")) then
layer[property] = removeTextureOverridePath or "/"
im.SetCursorPos(im.ImVec2(cursorPos.x, cursorPos.y + size - 20))
if editor.uiColorEdit4(string.format("##%s_%s_%s", layer.uid, guiId, "gradientColorBottomLeft"), editor.getTempFloatArray4_TableTable(gradientColorBottomLeft), im.flags(im.ColorEditFlags_AlphaPreview, im.ColorEditFlags_NoInputs), editor.getTempBool_BoolBool(false)) then
local value = editor.getTempFloatArray4_TableTable()
im.SetCursorPos(cursorPos)
if editor.uiColorEdit4(string.format("##%s_%s_%s", layer.uid, guiId, "gradientColorTopLeft"), editor.getTempFloatArray4_TableTable(gradientColorTopLeft), im.flags(im.ColorEditFlags_AlphaPreview, im.ColorEditFlags_NoInputs), editor.getTempBool_BoolBool(false)) then
local value = editor.getTempFloatArray4_TableTable()
im.SetCursorPos(im.ImVec2(cursorPos.x, cursorPos.y + size - 20))
if editor.uiColorEdit4(string.format("##%s_%s_%s", layer.uid, guiId, "gradientColorBottomRight"), editor.getTempFloatArray4_TableTable(gradientColorBottomRight), im.flags(im.ColorEditFlags_AlphaPreview, im.ColorEditFlags_NoInputs), editor.getTempBool_BoolBool(false)) then
local value = editor.getTempFloatArray4_TableTable()
im.SetCursorPos(cursorPos)
if editor.uiColorEdit4(string.format("##%s_%s_%s", layer.uid, guiId, "gradientColorTopRight"), editor.getTempFloatArray4_TableTable(gradientColorTopRight), im.flags(im.ColorEditFlags_AlphaPreview, im.ColorEditFlags_NoInputs), editor.getTempBool_BoolBool(false)) then
local value = editor.getTempFloatArray4_TableTable()
@/lua/ge/extensions/gameplay/crawl/saveSystem.lua
log('D', logTag, string.format('Found %d %s files in path: %s', #files, type, path))
@/lua/ge/extensions/scenario/damageGoal.lua
if minutes > 0 then
timeStr = string.format("%02.0f:%05.2f", minutes, seconds)
else
else
timeStr = string.format("%0.2f", seconds) .. 's'
end
@/inspector/Views/HeapSnapshotInstanceFetchMoreDataGridNode.js
buttonElement.classList.add("more");
buttonElement.textContent = WI.UIString("Show %d More").format(this._batchCount);
buttonElement.addEventListener("click", (event) => { this._fetchCallback(this._batchCount); });
buttonElement.classList.add("more");
buttonElement.textContent = WI.UIString("Show Remaining (%d)").format(this._remainingCount);
buttonElement.addEventListener("click", (event) => { this._fetchCallback(this._remainingCount); });
@/lua/ge/extensions/editor/dynamicDecals/camera.lua
for name, val in pairs(presets) do
if im.Button(string.format("%s##%s_%s", name:gsub("^%l", string.upper), "Generate Materials", guiId), im.ImVec2(im.GetContentRegionAvailWidth(), 0)) then
setCamera(vec3(val[1], val[2], val[3]))
if im.Button(string.format("%s##%s", "Show Preferences", guiId), im.ImVec2(im.GetContentRegionAvailWidth(), 0)) then
editor.showPreferences("dynamicDecalsTool")
for name, val in pairs(presets) do
if editor.uiIconImageButton(editor.icons.delete, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, string.format("##dynDecals_camera_presets_remove_%d", i)) then
presets[name] = nil
editor.uiInputText(string.format("##dynDecals_camera_presets_name_%d", i), editor.getTempCharPtr(name), nil, nil, nil, nil, editor.getTempBool_BoolBool(false))
if editor.getTempBool_BoolBool() == true then
editor.uiInputFloat3(string.format("##dynDecals_camera_presets_val_%d", i), editor.getTempFloatArray3_TableTable(val), "%.1f", nil, editor.getTempBool_BoolBool(false))
if editor.getTempBool_BoolBool() == true then
local i = 0
local name = string.format("preset_%d", i)
i = i + 1
name = string.format("preset_%d", i)
end
@/lua/ge/extensions/career/career.lua
local function createOrLoadCareerAndStart(name, specificAutosave, tutorial)
log("I","",string.format("Create or Load Career: %s - %s", name, specificAutosave))
if career_saveSystem.setSaveSlot(name, specificAutosave) then
@/inspector/Views/LayoutTimelineDataGridNode.js
case "height":
return isNaN(value) ? emDash : WI.UIString("%dpx").format(value);
case "area":
return isNaN(value) ? emDash : WI.UIString("%dpx\u00B2").format(value);
@/lua/common/settings.lua
else
log("E", "", string.format("Unable to apply a steamdeck setting '%s'=%s that is not defined in the defaults file: '%s'", k, dumps(v), M.pathDefaults))
end
if type(CppSettings[k]) ~= type(value) then
log("E", "", string.format("Unable to parse setting '%s': it should be a %s, but is a %s. The ignored value is: %s", k, type(CppSettings[k]), type(value), dumps(value)))
values[k] = nil
@/lua/vehicle/extensions/telemetryLogger.lua
local pos = obj:getPosition()
local position = string.format("(%s,%s,%s)", pos.x, pos.y, pos.z)
timeStamp = timeStamp + dt
@/inspector/Models/AuditTestBase.js
if (this._supports > WI.AuditTestBase.Version) {
WI.AuditManager.synthesizeWarning(WI.UIString("\u0022%s\u0022 is too new to run in this Web Inspector").format(this.name));
this._supported = false;
} else if (InspectorBackend.domains.Audit && this._supports > InspectorBackend.domains.Audit.VERSION) {
WI.AuditManager.synthesizeWarning(WI.UIString("\u0022%s\u0022 is too new to run on this inspected page").format(this.name));
this._supported = false;
@/lua/vehicle/controller/driveModes.lua
simpleControlButtons[id].offColorElectric = offColorElectric
simpleControlButtons[id].onClick = onClick or string.format("controller.getController(%q).nextDriveMode()", M.name)
updateSimpleControlButton(simpleControlButtons[id])
if driveModes[mode.order] then
log("E", "driveModes.init", string.format("Duplicate mode order (%d) with mode: %s", mode.order, mode.name))
end
-- if driveModeOrder[mode.order] then
-- log("E", "driveModes.init", string.format("Duplicate mode order (%d) with mode: %s", mode.order, mode.name))
-- end
@/lua/ge/extensions/flowgraph/nodes/ui/customUiLayout.lua
im.Text(self.storedLayout and string.format("Stored Layout (%d Elements)", #self.storedLayout) or "No Layout!")
if im.BeginCombo("loadlayout","Copy Layout from...") then
@/lua/ge/extensions/editor/dynamicDecals/textures.lua
if im.ImTextureHandlerIsCached(filePath) then
if im.ImageButton(string.format("##textures_imageButton_%s", filePath), editor.getTempTextureObj(filePath).texId, im.ImVec2(thumbnailSize, thumbnailSize), im.ImVec2Zero, im.ImVec2One, (sel and tableContains(sel, filePath)) and selectedTextureCol.Value or nil) then
handleTextureImageTileClicked(filePath, textureFilePaths)
im.PushID1("Texture_" .. tostring(k))
if im.ImageButton(string.format("##textures_imageButton_%s", filePath), editor.getTempTextureObj(filePath).texId, im.ImVec2(thumbnailSize, thumbnailSize), im.ImVec2Zero, im.ImVec2One, (sel and tableContains(sel, filePath)) and selectedTextureCol.Value or nil) then
handleTextureImageTileClicked(filePath, textureFilePaths)
if im.ImTextureHandlerIsCached(filePath) then
if im.ImageButton(string.format("##textures_imageButton_%s", filePath), editor.getTempTextureObj(filePath).texId, im.ImVec2(thumbnailSize, thumbnailSize), im.ImVec2Zero, im.ImVec2One, (sel and tableContains(sel, filePath)) and selectedTextureCol.Value or nil) then
handleTextureImageTileClicked(filePath, textureFilePaths)
im.PushID1("Texture_" .. tostring(k))
if im.ImageButton(string.format("##textures_imageButton_%s", filePath), editor.getTempTextureObj(filePath).texId, im.ImVec2(thumbnailSize, thumbnailSize), im.ImVec2Zero, im.ImVec2One, (sel and tableContains(sel, filePath)) and selectedTextureCol.Value or nil) then
handleTextureImageTileClicked(filePath, textureFilePaths)
end
im.tooltip(string.format("%s\nDouble-click to set texture as color texture\nLMB to select texture\nCtrl+LMB Add texture to selection\nRMB to open context menu", fileName))
im.SameLine()
-- for _, tag in ipairs(tags) do
-- im.TextUnformatted(string.format("%s [%d]", tag, #tagsWithReferences[tag]))
-- end
for _, tag in ipairs(tags) do
if im.TreeNodeEx1(string.format("%s [%d]##BrowserTagsTab", tag, #tagsWithReferences[tag])) then
drawTextureTiles(tagsWithReferences[tag], nil, true)
im.NextColumn()
im.TextUnformatted(string.format("x: %d y: %d", img.size.x, img.size.y))
im.NextColumn()
@/lua/vehicle/extensions/tech/roadsSensor.lua
obj:queueGameEngineLua(string.format("tech_sensors.updateRoadsSensorLastReadings(%q)", lpack.encode(readingsData)))
local adHocData = { requestId = adHocRequestId, reading = data.readings }
obj:queueGameEngineLua(string.format("tech_sensors.updateRoadsSensorAdHocRequest(%q)", lpack.encode(adHocData)))
end
@/lua/ge/extensions/career/modules/delivery/cargoScreen.lua
if group[1].destination.type ~= "multi" then
ret.bigMapIds[string.format("delivery-parking-%s-%s", group[1].destination.facId, group[1].destination.psPath)] = true
else
for _, loc in ipairs(group[1].destination.destinations) do
ret.bigMapIds[string.format("delivery-parking-%s-%s", loc.facId, loc.psPath)] = true
end
ret.bigMapIds = {}
ret.bigMapIds[string.format("delivery-parking-%s-%s", group[1].location.facId, group[1].location.psPath)] = true
end
--if not c.hiddenInFacility then
local gId = string.format("%d-%d", c.groupId, c.loadedAtTimeStamp or -1)
cargoByGroupId[gId] = cargoByGroupId[gId] or {}
local isCargoDeliveryTutorialActive = dTutorial.isCargoDeliveryTutorialActive()
item.bigMapIds[string.format("delivery-parking-%s-%s", offer.task.destination.facId, offer.task.destination.psPath)] = true
}
item.bigMapIds[string.format("delivery-parking-%s-%s", offer.task.destination.facId, offer.task.destination.psPath)] = true
if item.type == "vehicle" then
item.taskList = {string.format("Enter the vehicle.")}
else
else
item.taskList = {string.format("Couple the trailer.")}
end
if task.type == "coupleTrailer" then
item.taskList = {string.format("Couple the trailer.")}
elseif task.type == "enterVehicle" then
elseif task.type == "enterVehicle" then
item.taskList = {string.format("Enter the vehicle.")}
elseif task.type == "bringToDestination" or task.type == "confirmDropOff" then
elseif task.type == "bringToDestination" or task.type == "confirmDropOff" then
item.taskList = {string.format("Drop off %s at %s.", item.type == "trailer" and "the trailer" or "the vehicle", item.destinationName)}
elseif task.type == "putIntoParkingSpot" then
distance = dGenerator.getDistanceBetweenFacilities(facPsLocation, {type="facilityParkingspot", facId = fac.id, psPath = destinationAp.psPath}),
bigMapId = string.format("delivery-parking-%s-%s", destinationAp.facId, destinationAp.psPath),
storage = fac.materialStorages[materialType],
if remainingVolume > 0 then
log("W","",string.format("Tried loading %0.1fL %s from %s, but %0.1fL remained unloaded!",amount, materialType, fac.id, remainingVolume))
end
local distanceKey = string.format("%d-%s-%s", con.vehId, fac.facId, fac.dropOffSpots[1]:getPath())
if vehToLocationDistanceCache[distanceKey] == nil then
if cargo.destination.type == "facilityParkingspot" then
local distanceKey = string.format("%d-%s-%s", con.vehId, cargo.destination.facId, cargo.destination.psPath)
if vehToLocationDistanceCache[distanceKey] == nil then
log("I","",string.format("Commited Delivery Configuration. (Cargo Added: %d. Remaining to be loaded: %d)",#movedCargo, #remainingCargo))
ui_message(string.format("Thrown away %d items. Penalty: %0.2f", countDeleted, deletedMoneySum * dGeneral.getDeliveryAbandonPenaltyFactor()))
career_modules_playerAttributes.addAttributes({money=-deletedMoneySum * dGeneral.getDeliveryAbandonPenaltyFactor()}, {tags={"delivery","gameplay","fine"}, label="Penalty for throwing away cargo."})
end
log("I","",string.format("%0.2fs delay after adjusting weights for cargo.", maxDelay))
end
if target.type == "facilityParkingspot" then
local targetId = string.format("%s-%s", target.facId, target.psPath)
hasTargetableCargo = true
@/lua/ge/extensions/editor/rendererComponents.lua
else
return string.format('%f', tempFloatPtr[0])
end
else
return string.format('%f %f %f', tempFloatArr3[0], tempFloatArr3[1], tempFloatArr3[2])
end
else
return string.format('%f %f %f %f', tempFloatArr4[0], tempFloatArr4[1], tempFloatArr4[2], tempFloatArr4[3])
end
if field.format then
im.TextUnformatted(string.format(field.format, value))
else
local inFocusWidth = (aperture / math.max(steepness, 0.01))
im.TextUnformatted(string.format("Estimated In-Focus Width: %.2f units", inFocusWidth))
if im.Button("Reset to defaults") then
@/inspector/Views/DOMNodeDetailsSidebarPanel.js
let moreNodesButton = container.createChild("button", "expand-list-button");
moreNodesButton.textContent = WI.UIString("%d More\u2026").format(listItemCount - itemsToShow);
moreNodesButton.addEventListener("click", () => {
if (accessibilityProperties.hidden)
ignored = WI.UIString("%s (hidden)").format(ignored);
else if (accessibilityProperties.ignoredByDefault)
else if (accessibilityProperties.ignoredByDefault)
ignored = WI.UIString("%s (default)").format(ignored);
}
if (buttonType && roleType)
role = WI.UIString("%s (%s, %s)").format(role, buttonType, roleType);
else if (roleType || buttonType) {
let extraInfo = roleType || buttonType;
role = WI.UIString("%s (%s)").format(role, extraInfo);
}
@/lua/vehicle/controller/sbrGauges.lua
htmlTexture.call(gaugesScreenName, "setUnits", {unitType = unitType})
obj:queueGameEngineLua(string.format('extensions.ui_uiNavi.requestVehicleDashboardMap(%q, "initMap", %d)', gaugesScreenName, obj:getID()))
else
@/lua/ge/extensions/editor/visualization.lua
if count > 1 then
chips[#chips][1] = ("Mipmap LOD %d (minimum resolution)"):format(count - 1)
end
@/inspector/Views/DOMTreeElement.js
if (offsetHeight === naturalHeight && offsetWidth === naturalWidth)
this.tooltip = WI.UIString("%d \xd7 %d pixels").format(offsetWidth, offsetHeight);
else
else
this.tooltip = WI.UIString("%d \xd7 %d pixels (Natural: %d \xd7 %d pixels)").format(offsetWidth, offsetHeight, naturalWidth, naturalHeight);
} catch (e) {
this.expandAllButtonElement.textContent = WI.UIString("Show All Nodes (%d More)").format(totalChildrenCount - expandedChildCount);
} else if (this.expandAllButtonElement)
if (node.shadowRootType()) {
fragmentElement.textContent = WI.UIString("Shadow Content (%s)").format(WI.DOMTreeElement.shadowRootTypeDisplayName(node.shadowRootType()));
this.listItemElement.classList.add("shadow");
@/lua/ge/extensions/core/ropeVisualTest.lua
if debugSettings.debugMass and nodes[i].mass then
local massText = string.format("%.3f kg", nodes[i].mass)
debugDrawer:drawText(nodes[i].pos, massText, ColorF(1.0, 0.7, 0.3, 1.0))
if debugSettings.debugText then
local text = string.format("Rope %d | %d nodes | len: %.2fm | rest: %.2fm | strain max: %.1f%%, avg %.1f%% | sim: %.3fms @ %dHz",
rope.id, rope.nodeCount, rope.currentLength, rope.restLength,
end
im.Text(string.format("Max Strain: %.4f", selectedRope.maxStrain))
if im.IsItemHovered() then
end
im.Text(string.format("Avg Strain: %.4f", selectedRope.avgStrain))
if im.IsItemHovered() then
end
im.Text(string.format("Current Length: %.4f", selectedRope.currentLength))
if im.IsItemHovered() then
end
im.Text(string.format("Segment (Rest) Length: %.4f", selectedRope.restLength))
if im.IsItemHovered() then
end
im.Text(string.format("Sim Time: %.3f ms", selectedRope.simTime))
if im.IsItemHovered() then
im.Text(string.format("FPS: %.1f", perfStats.fps))
if im.IsItemHovered() then
im.Text(string.format("Frame Time: Sim %.1f%% + Render %.1f%% = %.1f%%",
avgSimPercent, avgRenderPercent, avgSimPercent + avgRenderPercent))
im.Text(string.format("Objects: %d", mgrStats.objectsRendered))
if im.IsItemHovered() then
im.Text(string.format("Total Sim: %.3f ms avg (%.1f%% frame)",
perfStats.avgTotalSimTime, avgSimPercent))
if im.IsItemHovered() then
im.SetTooltip(string.format("Average time spent simulating all rope physics (%.3f ms current)",
perfStats.totalSimTime))
im.Text(string.format("Total Render: %.3f ms avg (%.1f%% frame)",
perfStats.avgTotalRenderTime, avgRenderPercent))
if im.IsItemHovered() then
im.SetTooltip(string.format("Average time spent rendering all rope visuals (%.3f ms current)",
perfStats.totalRenderTime))
im.Text(string.format("Avg Sim per Object: %.3f ms", avgSimPerObject))
if im.IsItemHovered() then
if im.IsItemHovered() then
im.SetTooltip(string.format("Average simulation time per rope object (%d ropes with stats)",
ropesWithStats))
@/inspector/Views/LayerTreeDetailsSidebarPanel.js
this._layersCountLabel.textContent = WI.UIString("Layer Count: %d").format(layerCount);
this._layersMemoryLabel.textContent = WI.UIString("Memory: %s").format(Number.bytesToString(totalMemory));
this._layersCountLabel.textContent = WI.UIString("Layer Count: %d").format(layerCount);
this._layersMemoryLabel.textContent = WI.UIString("Memory: %s").format(Number.bytesToString(totalMemory));
}
@/lua/ge/extensions/flowgraph/nodes/gameplay/dragRace/dragTimes.lua
if not timerData then
local errorMsg = string.format("Timer data not found for vehicle ID: %s. Vehicle may not be part of the drag race.", tostring(vehId))
self:__setNodeError('timers', errorMsg)
@/lua/ge/extensions/tech/capturePlayer.lua
-- For some responses (camera data for example), we want to convert the data into a nice format.
-- These are the handlers which convert the data to a better readable format (defined below).
local ResponseCallbacks = {}
local vid = captureState.portToVid[port]
local serializedData = string.format("tech_techCapture.injectMessage(lpack.decode(%q))", lpack.encode(payload))
be:queueObjectLua(vid, serializedData)
@/lua/common/jit/v.lua
elseif fi.addr then
return format("C:%x", fi.addr)
else
end
err = format(fmt, info)
end
if loc ~= startloc then
out:write(format("[TRACE --- %s%s -- %s at %s]\n",
startex, startloc, fmterr(otr, oex), loc))
else
out:write(format("[TRACE --- %s%s -- %s]\n",
startex, startloc, fmterr(otr, oex)))
if ltype == "interpreter" then
out:write(format("[TRACE %3s %s%s -- fallback to interpreter]\n",
tr, startex, startloc))
elseif ltype == "stitch" then
out:write(format("[TRACE %3s %s%s %s %s]\n",
tr, startex, startloc, ltype, fmtfunc(func, pc)))
elseif link == tr or link == 0 then
out:write(format("[TRACE %3s %s%s %s]\n",
tr, startex, startloc, ltype))
elseif ltype == "root" then
out:write(format("[TRACE %3s %s%s -> %d]\n",
tr, startex, startloc, link))
else
out:write(format("[TRACE %3s %s%s -> %d %s]\n",
tr, startex, startloc, link, ltype))
else
out:write(format("[TRACE %s]\n", what))
end
@/lua/ge/extensions/freeroam/freeroam.lua
if loadTraffic then
log('I', logTag, string.format('Now spawning traffic for freeroam mode (%s parked vehicles), police ratio: %0.2f', loadParkedVehicles and 'with' or 'without', policeRatio or -1))
if loadParkedVehicles then
elseif loadParkedVehicles then
log('I', logTag, string.format('Now spawning parked vehicles only for freeroam mode (%s parked vehicles)', parkedVehiclesAmount))
gameplay_parking.setupVehicles(parkedVehiclesAmount)
@/lua/ge/extensions/editor/perfProfiler.lua
im.BulletText("Remove FPS Limiter")
im.BulletText(string.format("There are %d vehicle spawned", #getAllVehicles()))
if im.Button("Delete All Vehicles", im.ImVec2(im.GetContentRegionAvailWidth(), 0)) then
@/lua/vehicle/extensions/tech/LINBus/LINBusPeak.lua
local function dumpsByteHex(b)
return string.format("0x%x", b)
end
end
return string.format("0x%x -> %s", msg.FrameId, dumps(data))
end
if sendResult ~= M.errorCodes.OK then
log("E", "LINBusPeak.sendLINMessage", string.format("Non-OK send result for %q: %q", tag, M.errorCodeLookup[sendResult]))
end
@/lua/common/extensions/ui/improfiler.lua
if not prof_raw then
outString = outString .. (format("%s%2d%% %s\n", indent, pct, k))
elseif prof_raw == "r" then
elseif prof_raw == "r" then
outString = outString .. (format("%s%5d %s\n", indent, v, k))
else
else
outString = outString .. (format("%s %d\n", k, v))
end
if f0 == 40 or f0 == 91 then
outString = outString .. (format("\n====== %s ======\n[Cannot annotate non-file]\n", file))
break
if not fp then
outString = outString .. (format("====== ERROR: %s: %s\n", file, err))
break
end
outString = outString .. (format("\n====== %s ======\n", file))
local fl = files[file]
show = n+ann
outString = outString .. (format("@@ %d @@\n", n))
end
if v then
outString = outString .. (format(fmtv, v, line))
else
else
outString = outString .. (format(fmtn, line))
end
@/lua/ge/extensions/core/multiSpawn.lua
for i, data in ipairs(spawnData) do
log('I', logTag, string.format('Vehicle group spawning in progress (%d / %d)', i, #spawnData))
local veh = spawn.spawnVehicle(data.model, data.config, data.pos, data.rot, data)
spawningBusy = false
log('I', logTag, string.format('Vehicle group spawning completed: %s', spawnOptions.name or ''))
extensions.hook('onVehicleGroupSpawned', vehIds, groupId, spawnOptions.name)
if randomPaints and randomPaints.paintName1 then
log('I', logTag, string.format('Applying random paints for this vehicle: %s', options.model or ''))
options.paintName = randomPaints.paintName1
else
log('W', logTag, string.format('Failed to get random paints for vehicle: %s (config: %s), using default paints', options.model or '', options.config or ''))
options.paintName = modelData.model.defaultPaintName1 or 'White'
else
log('E', logTag, string.format('Vehicle model not found: %s', options.model or ''))
spawnData[i] = deepcopy(defaultOptions)
spawningBusy = true
log('I', logTag, string.format('Spawning vehicle group with %d vehicles: %s', amount, options.name or ''))
return spawnProcessedGroup(setVehicleSpawnData(group, amount), options) -- returns unique group id
@/lua/common/libs/luasocket/socket/ftp.lua
self.pasvt = {
ip = string.format("%d.%d.%d.%d", a, b, c, d),
port = p1*256 + p2
local ph = (port - pl)/256
local arg = string.gsub(string.format("%s,%d,%d", ip, ph, pl), "%.", ",")
self.try(self.tp:command("port", arg))
@/lua/ge/extensions/editor/drivePathEditor.lua
if vehicle then
im.Text(string.format('Linked To Vehicle: [%s]', vehicle.name))
else
im.SameLine()
im.Text(string.format('[%s]', linkedSpline.name))
else
im.SameLine()
im.Text(string.format('[time: %.2fs]', record.getRecordingTime()))
elseif isPlaying then
im.SameLine()
im.Text(string.format('[time: %.2fs]', playback.getPlaybackTime()))
else
@/lua/ge/extensions/core/highscores.lua
else
return string.format("%.2d:%.2d.%.3d", (timeInMillis/1000)/60, (timeInMillis/1000)%60, timeInMillis%1000)
end
record.timeInMillis = timeInMillis
record.formattedTime = string.format("%.2d:%.2d.%.3d", (timeInMillis/1000)/60, (timeInMillis/1000)%60, timeInMillis%1000)
@/lua/ge/extensions/editor/dynamicDecals/helper.lua
im.Image(img.texId, im.ImVec2(imgWidth, imgHeight), im.ImVec2(0,0), im.ImVec2(1,1), nil, editor.color.beamng.Value)
im.TextUnformatted(string.format("%d x %d", img.size.x, img.size.y))
end
im.Image(img.texId, im.ImVec2(imgWidth, imgHeight), im.ImVec2(0,0), im.ImVec2(1,1), nil, editor.color.beamng.Value)
im.TextUnformatted(string.format("%d x %d", img.size.x, img.size.y))
im.EndTooltip()
@/lua/ge/extensions/flowgraph/nodes/environment/setWind.lua
if not self.pinIn.vehId.value or self.pinIn.vehId.value == veh:getId() then
veh:queueLuaCommand('obj:setWind('..string.format('%6f, %6f, %6f', windVec.x, windVec.y, windVec.z)..')')
end
@/lua/ge/extensions/editor/rallyEditor/pacenotes/measurementsForm.lua
if not meters then return "N/A" end
return string.format("%.0fm", meters)
end
im.SameLine()
im.TextColored(im.ImVec4(0.5, 1, 0.5, 1), string.format("(fit: %.3f)", pacenote.autoSelectedFitValue))
end
im.PushFont3("cairo_semibold_large")
im.Text(string.format("%s Severity: %s %s", corner1Label, string.upper(measurement1.severity.name), string.upper(measurement1.direction)))
im.PopFont()
-- Display corner1 measurement
local angle1Text = measurement1.angleDegrees and string.format(" angle=%.0f°", measurement1.angleDegrees) or ""
im.Text(string.format("%s: D=%s arc_len=%s pts_len=%s total_len=%s%s fit=%.3f",
local angle1Text = measurement1.angleDegrees and string.format(" angle=%.0f°", measurement1.angleDegrees) or ""
im.Text(string.format("%s: D=%s arc_len=%s pts_len=%s total_len=%s%s fit=%.3f",
corner1Label,
im.PushFont3("cairo_semibold_large")
im.Text(string.format("Second Half Severity: %s %s", string.upper(measurement2.severity.name), string.upper(measurement2.direction)))
im.PopFont()
local angle2Text = measurement2.angleDegrees and string.format(" angle=%.0f°", measurement2.angleDegrees) or ""
im.Text(string.format("Second Half: D=%s arc_len=%s pts_len=%s total_len=%s%s fit=%.3f",
local angle2Text = measurement2.angleDegrees and string.format(" angle=%.0f°", measurement2.angleDegrees) or ""
im.Text(string.format("Second Half: D=%s arc_len=%s pts_len=%s total_len=%s%s fit=%.3f",
formatDistance(measurement2.diameter),
changeColor = im.ImVec4(0.3, 1, 0.3, 1) -- Green for opening
changeText = string.format("Opens: D+%s (%.1f%%)", formatDistance(diameterChange.change), diameterChange.changePercent)
elseif diameterChange.isTightening then
changeColor = im.ImVec4(1, 0.3, 0.3, 1) -- Red for tightening
changeText = string.format("Tightens: d%s (%.1f%%)", formatDistance(diameterChange.change), diameterChange.changePercent)
else
end
im.Text(string.format("Total points length: %s", formatDistance(pacenote.measurements.totalPointsLength)))
end
@/inspector/Views/RecordingStateDetailsSidebarPanel.js
else {
section.title = WI.UIString("Save %d").format(index + 1);
sourceElement.classList.add("source");
sourceElement.textContent = WI.UIString("(Action %s)").format(sourceIndex);
}
@/lua/ge/extensions/freeroam/levelStats.lua
s.lastUsed = now
log('D', '', string.format("Saving stats for level %q, spawnpoint %q, to file: %q", levelName, spawnPointName, statsFilePath))
jsonWriteFile(statsFilePath, stats, true)
@/lua/ge/extensions/editor/dynamicDecals/settings.lua
local changed = false
if im.SliderFloat(string.format("##%s_x", widgetId), editor.getTempFloat_NumberNumber(cursorPosition.x), 0, 1, "%.3f") then
local newVal = editor.getTempFloat_NumberNumber()
im.PushItemWidth(width)
if im.SliderFloat(string.format("##%s_y", widgetId), editor.getTempFloat_NumberNumber(cursorPosition.y), 0, 1, "%.3f") then
local newVal = editor.getTempFloat_NumberNumber()
if im.TreeNodeEx1(string.format("Materials##VehicleLiveryEditor_Settings_%s", widgetId), im.TreeNodeFlags_DefaultOpen) then
editor.uiInputSearchTextFilter("Materials Filter", materialsFilter, im.GetContentRegionAvailWidth())
editor.uiInputSearchTextFilter("Materials Filter", materialsFilter, im.GetContentRegionAvailWidth())
im.BeginChild1(string.format("MaterialsChild_VehicleLiveryEditor_Settings_%s", widgetId), im.ImVec2(0, 280), true)
local enabled = tableContains(materialIndices, id)
if im.Checkbox(string.format("##%s_material_%d_checkbox", widgetId, id), editor.getTempBool_BoolBool(enabled)) then
local newValue = editor.getTempBool_BoolBool()
im.SameLine()
if im.Selectable1(string.format("%s##%s_material_%d_selectable", name, widgetId, id), enabled) then
if enabled == false then
if im.TreeNodeEx1(string.format("Meshes##VehicleLiveryEditor_Settings_%s", widgetId), im.TreeNodeFlags_DefaultOpen) then
local sMeshes = api.getShapeMeshes()
if im.Button(string.format("Enable all##Meshes_%s", widgetId)) then
api.enableAllMeshes()
im.SameLine()
if im.Button(string.format("Disable all##Meshes_%s", widgetId)) then
api.disableAllMeshes()
im.SameLine()
editor.uiInputSearchTextFilter(string.format("Meshes Filter##%s", widgetId), meshesFilter, im.GetContentRegionAvailWidth())
im.BeginChild1(string.format("MeshesChild_VehicleLiveryEditor_Settings_%s", widgetId), im.ImVec2(0, 280), true)
editor.uiInputSearchTextFilter(string.format("Meshes Filter##%s", widgetId), meshesFilter, im.GetContentRegionAvailWidth())
im.BeginChild1(string.format("MeshesChild_VehicleLiveryEditor_Settings_%s", widgetId), im.ImVec2(0, 280), true)
local i = 0
if im.ImGuiTextFilter_PassFilter(meshesFilter, name) then
if im.Checkbox(string.format("##%s_shapeMesh_%d_checkbox", widgetId, i), editor.getTempBool_BoolBool(enabled)) then
api.setMeshEnable(name, not enabled)
im.SameLine()
if im.Selectable1(string.format("%s##%s_shapeMesh_%d_selectable", name, widgetId, i), enabled) then
api.setMeshEnable(name, not enabled)
local textureResolution = api.getTextureResolution()
im.TextUnformatted(string.format("Current x: %d y: %d", textureResolution.x, textureResolution.y))
@/lua/ge/extensions/core/groundMarkerArrows.lua
--simpleDebugText3d(string.format("Arrow %s: state=%s", id, proxy.state), proxy.pos)
else
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)
end
im.TableNextColumn()
im.Text(string.format("%.1f, %.1f, %.1f", proxy.pos.x, proxy.pos.y, proxy.pos.z))
im.TableNextColumn()
local scale = proxy.nearFarScaleSmoother:get(proxy.nearFarScaleSmootherTarget, 0)
im.Text(string.format("%.2f", scale))
im.TableNextColumn()
if proxy then
im.Text(string.format("%s (Scale: %.2f)", proxy.state, proxy.nearFarScaleSmoother:get(proxy.nearFarScaleSmootherTarget, 0)))
else
im.TableNextColumn()
im.Text(string.format("%.1f", wpLog.distToVehicle or -1))
im.TableNextColumn()
im.TableNextColumn()
im.Text(string.format("%.1f°", wpLog.nodeToNodeAngle or -1))
end
@/lua/ge/extensions/scenario/scenarios.lua
local seconds = finalTime - (minutes * 60);
local timeStr = string.format("%02.0f:%05.2f", minutes, seconds)
return timeStr
@/lua/ge/extensions/career/modules/milestones/generalMilestones/missions.lua
end,
getLabel = function(step, displayValue, target) return string.format("Star Collector") end,
getDescription = function(step, displayValue, target) return string.format("Collect %d stars from any challenge.", target) end,
getLabel = function(step, displayValue, target) return string.format("Star Collector") end,
getDescription = function(step, displayValue, target) return string.format("Collect %d stars from any challenge.", target) end,
getProgressLabel = function(step, current, target) return string.format("%d Stars / %d Stars", current, target) end,
getDescription = function(step, displayValue, target) return string.format("Collect %d stars from any challenge.", target) end,
getProgressLabel = function(step, current, target) return string.format("%d Stars / %d Stars", current, target) end,
getTarget = function(step) return step == 0 and 0 or math.ceil(stepPercent[step]*totalStarCount) end,
end,
getLabel = function(step, displayValue, target) return string.format("Challenge Passer") end,
getDescription = function(step, displayValue, target) return string.format("To pass a challenge, you need to get at least one default star.", target) end,
getLabel = function(step, displayValue, target) return string.format("Challenge Passer") end,
getDescription = function(step, displayValue, target) return string.format("To pass a challenge, you need to get at least one default star.", target) end,
getProgressLabel = function(step, current, target) return string.format("%d Challenges / %d Challenges", current, target) end,
getDescription = function(step, displayValue, target) return string.format("To pass a challenge, you need to get at least one default star.", target) end,
getProgressLabel = function(step, current, target) return string.format("%d Challenges / %d Challenges", current, target) end,
getTarget = function(step) return step == 0 and 0 or math.ceil(stepPercent[step]*missionCount) end,
end,
getLabel = function(step, displayValue, target) return string.format("Challenge Completionist", step) end,
getDescription = function(step, displayValue, target) return string.format("To complete a challenge, you need to get at all default and all bonus stars.", target) end,
getLabel = function(step, displayValue, target) return string.format("Challenge Completionist", step) end,
getDescription = function(step, displayValue, target) return string.format("To complete a challenge, you need to get at all default and all bonus stars.", target) end,
getProgressLabel = function(step, current, target) return string.format("%d Challenges / %d Challenges", current, target) end,
getDescription = function(step, displayValue, target) return string.format("To complete a challenge, you need to get at all default and all bonus stars.", target) end,
getProgressLabel = function(step, current, target) return string.format("%d Challenges / %d Challenges", current, target) end,
getTarget = function(step) return step == 0 and 0 or math.ceil(stepPercent[step]*missionCount) end,
end,
getLabel = function(step, displayValue, target) return string.format("%s Star Collector", branchName) end,
getDescription = function(step, displayValue, target) return string.format("Collect %d stars from challenges in the %s %s.", target, branchName, career_branches.getBranchById(branchKey).isSkill and "Skill" or "Branch" ) end,
getLabel = function(step, displayValue, target) return string.format("%s Star Collector", branchName) end,
getDescription = function(step, displayValue, target) return string.format("Collect %d stars from challenges in the %s %s.", target, branchName, career_branches.getBranchById(branchKey).isSkill and "Skill" or "Branch" ) end,
getProgressLabel = function(step, current, target) return string.format("%d Stars / %d Stars", current, target) end,
getDescription = function(step, displayValue, target) return string.format("Collect %d stars from challenges in the %s %s.", target, branchName, career_branches.getBranchById(branchKey).isSkill and "Skill" or "Branch" ) end,
getProgressLabel = function(step, current, target) return string.format("%d Stars / %d Stars", current, target) end,
getTarget = function(step) return step == 0 and 0 or math.ceil(stepPercent[step]*totalStarCount) end,
end,
getLabel = function(step, displayValue, target) return string.format("%s Challenge Passer", branchName) end,
getDescription = function(step, displayValue, target) return string.format("To pass a challenge, you need to get at least one default star.", target) end,
getLabel = function(step, displayValue, target) return string.format("%s Challenge Passer", branchName) end,
getDescription = function(step, displayValue, target) return string.format("To pass a challenge, you need to get at least one default star.", target) end,
getProgressLabel = function(step, current, target) return string.format("%d Challenges / %d Challenges", current, target) end,
getDescription = function(step, displayValue, target) return string.format("To pass a challenge, you need to get at least one default star.", target) end,
getProgressLabel = function(step, current, target) return string.format("%d Challenges / %d Challenges", current, target) end,
getTarget = function(step) return step == 0 and 0 or math.ceil(stepPercent[step]*missionCount) end,
end,
getLabel = function(step, displayValue, target) return string.format("%s Challenge Completionist", branchName) end,
getDescription = function(step, displayValue, target) return string.format("To complete a challenge, you need to get at all default and all bonus stars.", target) end,
getLabel = function(step, displayValue, target) return string.format("%s Challenge Completionist", branchName) end,
getDescription = function(step, displayValue, target) return string.format("To complete a challenge, you need to get at all default and all bonus stars.", target) end,
getProgressLabel = function(step, current, target) return string.format("%d Challenges / %d Challenges", current, target) end,
getDescription = function(step, displayValue, target) return string.format("To complete a challenge, you need to get at all default and all bonus stars.", target) end,
getProgressLabel = function(step, current, target) return string.format("%d Challenges / %d Challenges", current, target) end,
getTarget = function(step) return step == 0 and 0 or math.ceil(stepPercent[step]*missionCount) end,
getValue = function() return milestones.saveData.general['mission_unlockMissions'].unlockedCount end,
getLabel = function(step, displayValue, target) return string.format("Challenge Unlocker %d", step) end,
getDescription = function(step, displayValue, target) return string.format("Unlock new challenges by completing challenges and gaining branch levels.", target) end,
getLabel = function(step, displayValue, target) return string.format("Challenge Unlocker %d", step) end,
getDescription = function(step, displayValue, target) return string.format("Unlock new challenges by completing challenges and gaining branch levels.", target) end,
getProgressLabel = function(step, current, target) return string.format("%d Challenges / %d Challenges", current, target) end,
getDescription = function(step, displayValue, target) return string.format("Unlock new challenges by completing challenges and gaining branch levels.", target) end,
getProgressLabel = function(step, current, target) return string.format("%d Challenges / %d Challenges", current, target) end,
getTarget = function(step) return (step+1)*1 end,
@/lua/ge/extensions/editor/vehicleEditor/liveEditor/veNodeTriSelfCollisionDetector.lua
debugDrawer:drawSphere(nodePos, resultData.nodeCollisionRadius, orangeColor)
local nodeText = node.name and string.format("Node: %d (%s)", nodeId, node.name) or tostring(nodeId)
debugDrawer:drawText(nodePos, nodeText, blackColor)
local triNode1, triNode2, triNode3 = nodes[tri.id1], nodes[tri.id2], nodes[tri.id3]
local triNode1Text = triNode1.name and string.format("%d (%s)", tri.id1, triNode1.name) or tostring(tri.id1)
local triNode2Text = triNode2.name and string.format("%d (%s)", tri.id2, triNode2.name) or tostring(tri.id2)
local triNode1Text = triNode1.name and string.format("%d (%s)", tri.id1, triNode1.name) or tostring(tri.id1)
local triNode2Text = triNode2.name and string.format("%d (%s)", tri.id2, triNode2.name) or tostring(tri.id2)
local triNode3Text = triNode3.name and string.format("%d (%s)", tri.id3, triNode3.name) or tostring(tri.id3)
local triNode2Text = triNode2.name and string.format("%d (%s)", tri.id2, triNode2.name) or tostring(tri.id2)
local triNode3Text = triNode3.name and string.format("%d (%s)", tri.id3, triNode3.name) or tostring(tri.id3)
local triText = string.format("Triangle: %s - %s - %s", triNode1Text, triNode2Text, triNode3Text)
local triNode3Text = triNode3.name and string.format("%d (%s)", tri.id3, triNode3.name) or tostring(tri.id3)
local triText = string.format("Triangle: %s - %s - %s", triNode1Text, triNode2Text, triNode3Text)
debugDrawer:drawText(tempTriPos, triText, blackColor)
local nodeText = node.name and string.format("%d (%s)", nodeId, node.name) or tostring(nodeId)
local triNode1Text = triNode1.name and string.format("%d (%s)", tri.id1, triNode1.name) or tostring(tri.id1)
local nodeText = node.name and string.format("%d (%s)", nodeId, node.name) or tostring(nodeId)
local triNode1Text = triNode1.name and string.format("%d (%s)", tri.id1, triNode1.name) or tostring(tri.id1)
local triNode2Text = triNode2.name and string.format("%d (%s)", tri.id2, triNode2.name) or tostring(tri.id2)
local triNode1Text = triNode1.name and string.format("%d (%s)", tri.id1, triNode1.name) or tostring(tri.id1)
local triNode2Text = triNode2.name and string.format("%d (%s)", tri.id2, triNode2.name) or tostring(tri.id2)
local triNode3Text = triNode3.name and string.format("%d (%s)", tri.id3, triNode3.name) or tostring(tri.id3)
local triNode2Text = triNode2.name and string.format("%d (%s)", tri.id2, triNode2.name) or tostring(tri.id2)
local triNode3Text = triNode3.name and string.format("%d (%s)", tri.id3, triNode3.name) or tostring(tri.id3)
local triText = string.format("%s - %s - %s", triNode1Text, triNode2Text, triNode3Text)
local triNode3Text = triNode3.name and string.format("%d (%s)", tri.id3, triNode3.name) or tostring(tri.id3)
local triText = string.format("%s - %s - %s", triNode1Text, triNode2Text, triNode3Text)
print(string.format("Node %s is colliding with triangle %s at distance %.3f m", nodeText, triText, dist))
local triText = string.format("%s - %s - %s", triNode1Text, triNode2Text, triNode3Text)
print(string.format("Node %s is colliding with triangle %s at distance %.3f m", nodeText, triText, dist))
end
@/lua/ge/extensions/editor/meshSpline/splineMgr.lua
local folderNameId = Engine.generateUUID()
newFolder:registerObject(string.format("%s - %s", uniqueName, folderNameId))
newFolder.cansave = true
-- Main mesh component properties.
spline.mainComponentPath = string.format('main_%s', preset.meshPath)
spline.extentsW_Center = mesh_extentsW_Center
spline.alias1MeshName = preset.alias1MeshName
spline.alias1ComponentPath = string.format('alias1_%s', preset.alias1MeshPath)
spline.alias2MeshName = preset.alias2MeshName
spline.alias2ComponentPath = string.format('alias2_%s', preset.alias2MeshPath)
spline.alias3MeshName = preset.alias3MeshName
spline.alias3ComponentPath = string.format('alias3_%s', preset.alias3MeshPath)
spline.startCapMeshName = preset.startCapMeshName
spline.startCapComponentPath = string.format('startCap_%s', preset.startCapMeshPath)
spline.endCapMeshName = preset.endCapMeshName
spline.endCapComponentPath = string.format('endCap_%s', preset.endCapMeshPath)
end
-- Ensure we have a unique mesh spline name.
local baseName = string.format(toolPrefixStr .. " %d", #meshSplines + 1)
local uniqueName = util.generateUniqueName(baseName, toolPrefixStr)
local newFolder = createObject("SimGroup")
newFolder:registerObject(string.format("%s - %s", uniqueName, id))
newFolder.cansave = true
-- Ensure we have a unique mesh spline name.
local baseName = string.format(toolPrefixStr .. " %d", #meshSplines + 1)
local uniqueName = util.generateUniqueName(baseName, toolPrefixStr)
local newFolder = createObject("SimGroup")
newFolder:registerObject(string.format("%s - %s", uniqueName, spline.id))
newFolder.cansave = true
end
log('I', logTag, string.format("Converted %d traced paths to mesh splines. %d paths were too small to import.", #paths, #paths - #meshSplines))
end
@/lua/common/libs/luasec/options.lua
local function printf(str, ...)
print(string.format(str, ...))
end
local name = string.lower(string.sub(option, 8))
print(string.format([[#if defined(%s)]], option))
print(string.format([[ {"%s", %s},]], name, option))
print(string.format([[#if defined(%s)]], option))
print(string.format([[ {"%s", %s},]], name, option))
print([[#endif]])
@/lua/common/jsonPrettyEncoderCustom.lua
local vtype = type(v)
if vtype == 'string' then return string.format('"%s"', jsonEscapeString(v)) end
if vtype == 'number' then
if numberPrecision == nil then
return string.format('%.10g', v) -- .10g is needed for time
else
if v ~= math.floor(v) then
return string.format('%' .. numberPrecision .. '.' .. numberPrecision .. 'f', v)
else
else
return string.format('%d', v)
end
if not fold then
return string.format('[\n'..indent .. '%s\n'.. indentPrev ..']', table.concat(tmp, ',\n' .. indent))
end
end
return string.format('[%s]', table.concat(tmp, ', '))
else
local cv = encode(vv, lvl + 1, numberPrecision, tableWeights, foldingCallback, _levelPath .. '/' .. tostring(kk))
if cv ~= nil then table.insert(tmp, string.format('"%s":%s', jsonEscapeString(tostring(kk)), cv)) end
end
if not fold then
return string.format('{\n'..indent .. '%s\n'.. indentPrev ..'}', table.concat(tmp, ',\n' .. indent))
end
end
return string.format('{%s}', table.concat(tmp, ', '))
end
if ffi.offsetof(v, 'w') ~= nil then
return string.format('{"x":%.10g,"y":%.10g,"z":%.10g,"w":%.10g}', v.x, v.y, v.z, v.w)
else
else
return string.format('{"x":%.10g,"y":%.10g,"z":%.10g}', v.x, v.y, v.z)
end
@/lua/ge/extensions/util/precompileShaders.lua
local v = levels[levelToLoad]
log('I', logTag, string.format('Loading level %s (%d/%d).', v.levelName, levelToLoad, #levels))
if string.find(v.fullfilename, '.mis') then
log('I', logTag, string.format('Will precompile data for %d levels.', #levels))
levelToLoad = 1
@/lua/ge/extensions/editor/terrainEditor.lua
if value then
local softSelectFilterString = string.format( "%.6f %.6f %.6f %.6f %.6f %.6f %.6f", value[1], value[2], value[3], value[4], value[5], value[6], value[7])
terrainEditor:setField('softSelectFilter', 0, softSelectFilterString)
else
prev = matProxy.material:getField(string.format("%sDetailTex", 'baseColor'), 0)
end
if im.IsItemHovered() and not var.sc_dragId then
im.tooltip(string.format("%.2f", var.softSelectFilter[i]))
if im.IsMouseClicked(0) then
@/inspector/Views/RenderingFrameTimelineOverviewGraph.js
label.classList.add("label");
label.innerText = WI.UIString("%d fps").format(framesPerSecond);
divider.appendChild(label);
@/lua/ge/extensions/ui/gameplaySelector/tileGenerators/scenarioTiles.lua
local function getKeyFromDetails(details)
return string.format("scenario_%s", details.scenarioSourceFile)
end
if scenario.maxPlayers and scenario.maxPlayers > 1 then
local playersValue = string.format("From %d up to %d local players", scenario.minPlayers or 1, scenario.maxPlayers)
table.insert(specifications, {
@/lua/ge/extensions/core/replay.lua
if M.state.state == 'playback' and not M.requestedStartLevel then
log("I", "", string.format("Stopping replay playback. Reason: level changed from \"%s\" to \"%s\"", getLoadedFile(), levelPath))
displayMsg("info", "replay.stopPlayback")
@/lua/vehicle/controller/lineLock.lua
local inputPercentage = ceil(electrics.values.brake * 100)
guihooks.message(string.format("Linelock: Enabled (%s brake lines locked at %d%%)", wheelNamesString, inputPercentage), 3, "vehicle.linelock.status")
else
@/lua/ge/extensions/editor/missionEditor/previewChecker.lua
if self.previewImage.size.x ~= 1920 or self.previewImage.size.y ~= 1080 then
table.insert(issues, {label = string.format('Preview file dimensions off! %d x %d instead of 1920 x 1080!', self.previewImage.size.x, self.previewImage.size.y), severity='warning'})
end
if previewSizeInKb > 1025 then
table.insert(issues, {label = string.format('Preview filesize too big! Is %d kb but should be <= 1024 kb', previewSizeInKb), severity='warning'})
end
if self.thumbImage.size.x < 200 or self.thumbImage.size.x > 400 or self.thumbImage.size.x ~= self.thumbImage.size.y then
table.insert(issues, {label = string.format('Thumbnail file dimensions off! %d x %d instead of 200 < X < 400 square!', self.thumbImage.size.x, self.thumbImage.size.y), severity='warning'})
end
if thumbSizeInKb > 101 then
table.insert(issues, {label = string.format('Thumbnail filesize too big! Is %d kb but should be <= 100 kb', thumbSizeInKb), severity='warning'})
end
@/lua/ge/extensions/gameplay/crawl/debug.lua
local secs = seconds % 60
return string.format("%02d:%06.3f", minutes, secs)
end
im.TextColored(im.ImVec4(0.5, 0.5, 1, 1), "=== INFRACTION DATA ===")
im.Text("Driving Backwards Cooldown: " .. string.format("%.1f", infData.drivingBackwardsCooldown or 0))
im.Text("Boundary Violation Cooldown: " .. string.format("%.1f", infData.boundaryViolationCooldown or 0))
im.Text("Driving Backwards Cooldown: " .. string.format("%.1f", infData.drivingBackwardsCooldown or 0))
im.Text("Boundary Violation Cooldown: " .. string.format("%.1f", infData.boundaryViolationCooldown or 0))
im.Text("Recovery Cooldown: " .. string.format("%.1f", infData.recoveryCooldown or 0))
im.Text("Boundary Violation Cooldown: " .. string.format("%.1f", infData.boundaryViolationCooldown or 0))
im.Text("Recovery Cooldown: " .. string.format("%.1f", infData.recoveryCooldown or 0))
im.Text("Recently Recovered: " .. (infData.recentlyRecovered and "Yes" or "No"))
im.Text("Index: " .. (rcp.index or "N/A"))
im.Text("Position: " .. string.format("%.1f, %.1f, %.1f", rcp.position.x, rcp.position.y, rcp.position.z))
im.Text("Time: " .. formatTime(rcp.time))
im.TextColored(im.ImVec4(1, 0.8, 0, 1), "=== BOUNDARY EXIT POINT ===")
im.Text("Exit Point: " .. string.format("%.1f, %.1f, %.1f", exitPoints.x, exitPoints.y, exitPoints.z))
local distance = vehiclePos:distance(exitPoints)
im.Text("Distance from Exit: " .. string.format("%.1f m", distance))
local vd = debugData.crawlerData.dynamicData
im.Text("Position: " .. string.format("%.2f, %.2f, %.2f", vd.vehPos.x, vd.vehPos.y, vd.vehPos.z))
im.Text("Velocity: " .. string.format("%.2f m/s", vd.vehVelocity:length()))
im.Text("Position: " .. string.format("%.2f, %.2f, %.2f", vd.vehPos.x, vd.vehPos.y, vd.vehPos.z))
im.Text("Velocity: " .. string.format("%.2f m/s", vd.vehVelocity:length()))
im.Text("Boundary Status: " .. getBoundaryStatus(debugData.crawlerData, debugData.trail))
local nodeText = string.format("%d. %s", i, pathnode.name or "Unknown")
if isRecovery then
im.SameLine()
im.TextColored(color, string.format("(%.1f, %.1f, %.1f)", pathnode.pos.x, pathnode.pos.y, pathnode.pos.z))
@/lua/ge/extensions/editor/dynamicDecals/layerStack.lua
if k == #parentStack then im.BeginDisabled() end
if editor.uiIconImageButton(editor.icons.keyboard_arrow_up, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, string.format("moveup##%s_%d", guiId, k)) then
api.moveLayer(k, parentUid, k+1, parentUid)
if k == 1 then im.BeginDisabled() end
if editor.uiIconImageButton(editor.icons.keyboard_arrow_down, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, string.format("movedown##%s_%d", guiId, k)) then
api.moveLayer(k, parentUid, k-1, parentUid)
if k == 1 then im.BeginDisabled() end
if editor.uiIconImageButton(editor.icons.keyboard_arrow_up, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, string.format("moveup##%s_%d", guiId, k)) then
api.moveLayer(k, parentUid, k-1, parentUid)
if k == #parentStack then im.BeginDisabled() end
if editor.uiIconImageButton(editor.icons.keyboard_arrow_down, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, string.format("movedown##%s_%d", guiId, k)) then
api.moveLayer(k, parentUid, k+1, parentUid)
if editor.getPreference("dynamicDecalsTool.general.debug") then
im.TextUnformatted(string.format("%s_%s_%s_%d", name, layer.uid, guiId, id))
layerElementDragDropTargetDebug(dbgColor or {1,1,1,1})
end
im.BeginChild1(string.format("%s_%s_%s_%d", name, layer.uid, guiId, id), im.ImVec2(0, layerDropHeight), true)
im.EndChild()
if editor.getPreference("dynamicDecalsTool.general.debug") then
print(string.format("layerElementDragDropTargetDebug before\nfrom: %d\nfromParentUid: %s\nto: %d\ntoParentUid: %s", from or -1, fromParentUid or "nil", to or -1, toParentUid or "nil"))
end
if editor.getPreference("dynamicDecalsTool.general.debug") then
print(string.format("layerElementDragDropTargetDebug after\nfrom: %d\nfromParentUid: %s\nto: %d\ntoParentUid: %s", from or -1, fromParentUid or "nil", to or -1, toParentUid or "nil"))
end
if editor.getPreference("dynamicDecalsTool.general.debug") then
print(string.format("drag drop: %s, from: %d, fromParentUid: %s, to: %d, toParentUid: %s", name, from or -1, fromParentUid or "nil", to or -1, toParentUid or "nil"))
end
local function layerElement(k, layer, guiId, parentUid, parentStack, layerLevel)
editor.uiIconImageButton(editor.icons.menu, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, string.format("%s_%s_%s", "layerdrag##", guiId, layer.uid))
im.tooltip("LMB + drag to move layer")
if editor.getPreference("dynamicDecalsTool.general.debug") then
im.TextUnformatted(string.format("%d", k))
im.SameLine()
editor.uiInputText(
string.format("%s_%s_%s", "##LayerName", guiId, layer.uid),
editor.getTempCharPtr(layer.name),
im.SetCursorPosX(im.GetCursorPosX() + (im.GetContentRegionAvailWidth() - (tool.getIconSize() * im.uiscale[0])))
if editor.uiIconImageButton(layer.enabled and editor.icons.visibility or editor.icons.visibility_off, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, string.format("##enabled_%s_%s", guiId, layer.uid)) then
layer.enabled = not layer.enabled
if selectionData and selectionData[layer.uid] then
if editor.uiIconImageButton(editor.icons.near_me, im.ImVec2(tool.getIconSize(), tool.getIconSize()), editor.color.beamng.Value, nil, nil, string.format("select##%s_%s", guiId, layer.uid)) then
selection.deselectLayer(im.IsKeyDown(im.GetKeyIndex(im.Key_ReservedForModCtrl)) and layer.uid or nil)
else
if editor.uiIconImageButton(editor.icons.near_me, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, string.format("select##%s_%s", guiId, layer.uid)) then
selection.selectLayer(layer.uid, im.IsKeyDown(im.GetKeyIndex(im.Key_ReservedForModCtrl)))
im.SameLine()
if editor.uiIconImageButton(editor.icons.delete, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, string.format("remove##%s_%s", guiId, layer.uid)) then
removeLayer(k, layer.uid, parentUid)
im.SameLine()
if editor.uiIconImageButton(editor.icons.content_copy, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, string.format("duplicate##%s_%s", guiId, layer.uid)) then
api.duplicateLayer(k, parentUid)
im.SameLine()
if editor.uiIconImageButton(editor.icons.content_copy, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, string.format("duplicateAndMirror##%s_%s", guiId, layer.uid)) then
api.duplicateAndMirrorLayer(k, parentUid, true) -- args: id, parentUid, mirrorChildren
-- LAYER MASK EDITING + COPY/PASTE
local layerMaskContextMenuPopupName = string.format("CopyLayerMask_%s_%d_%d", layer.uid, layerLevel, k)
if im.BeginPopup(layerMaskContextMenuPopupName) then
layerMaskCopyData = deepcopy(layer.mask)
editor.logInfo(string.format("%s: %s", logTag, "Copied layer mask"))
im.CloseCurrentPopup()
api.setLayer(layerCopy, true)
editor.logInfo(string.format("%s: %s", logTag, layer.mask and "Replaced Layer Mask" or "Pasted Layer Mask"))
im.CloseCurrentPopup()
api.setLayer(layerCopy, true)
editor.logInfo(string.format("%s: %s", logTag, "Appended Layer Mask"))
im.CloseCurrentPopup()
if im.Button("Export layer mask") then
-- api.exportLayerMask(layer, string.format("%sexport/masks/", tool.directoryPath), "niceexport", "png")
im.CloseCurrentPopup()
false,
string.format("%sexport/masks/", tool.directoryPath),
"File already exists.\nOverwrite?"
im.SameLine()
if editor.uiIconImageButton(editor.icons.ab_asset_material, im.ImVec2(tool.getIconSize(), tool.getIconSize()), editor.color.beamng.Value, nil, nil, string.format("disable_mask##%s_%s", guiId, layer.uid)) then
tool.setCurrentMaskEditingLayerUid(nil)
im.SameLine()
if editor.uiIconImageButton(editor.icons.ab_asset_material, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, string.format("enable_mask##%s_%s", guiId, layer.uid)) then
tool.setCurrentMaskEditingLayerUid(layer.uid)
im.ImVec2(tool.getIconSize(), tool.getIconSize()),
isHighlighted and editor.color.beamng.Value or nil, nil, nil, string.format("highlightLayerButton##%s_%s", guiId, layer.uid)
) then
im.SameLine()
if im.Button(string.format("dump##%s", layer.uid)) then
dump(layer)
im.SameLine()
editor.uiIconImageButton(editor.icons.warning, im.ImVec2(tool.getIconSize(), tool.getIconSize()), editor.color.warning.Value, nil, nil, string.format("missingTextureFiles", guiId, layer.uid))
im.tooltip("Missing texture files: " .. dumps(layer.status.missingTextureFiles))
im.SameLine()
editor.uiIconImageButton(editor.icons.warning, im.ImVec2(tool.getIconSize(), tool.getIconSize()), editor.color.warning.Value, nil, nil, string.format("missingFontFile", guiId, layer.uid))
im.tooltip("Missing font file: " .. layer.status.missingFontFile.path)
im.SameLine()
local text = string.format("%.4fs", layer.status.bakingTime or -99)
local textWidth = im.CalcTextSize(text).x
im.SetCursorPosX(indentedCursorPosX)
if im.Checkbox(string.format("##%s_%s_%s", layer.uid, guiId, "layerMaskEnabled"), editor.getTempBool_BoolBool(layer.mask.enabled)) then
if editor.getTempBool_BoolBool() then
im.SameLine()
if editor.uiIconImageButton(editor.icons.delete, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, string.format("%s_%s", layer.uid, "removeLayerMask")) then
local layerCopy = deepcopy(layer)
im.SameLine()
if im.TreeNodeEx1(string.format("Layer Mask##%s_%s", layer.uid, guiId)) then
for k, maskLayer in ipairs(layer.mask.layers) do
im.Indent(indentWidth)
if im.Checkbox(string.format("##%s_%s_%s_%d", layer.uid, guiId, "layerMaskLayerEnabled", k), editor.getTempBool_BoolBool(maskLayer.enabled)) then
local layerCopy = deepcopy(layer)
if selectionData and selectionData[maskLayer.uid] then
if editor.uiIconImageButton(editor.icons.near_me, im.ImVec2(tool.getIconSize(), tool.getIconSize()), editor.color.beamng.Value, nil, nil, string.format("select##%s_%s", guiId, layer.uid)) then
selection.deselectLayer(maskLayer.uid)
else
if editor.uiIconImageButton(editor.icons.near_me, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, string.format("select##%s_%s", guiId, layer.uid)) then
selection.selectLayer(maskLayer.uid)
if editor.uiIconImageButton(editor.icons.delete, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, string.format("%s_%d_%s", layer.uid, k, "removeLayerMaskLayer")) then
local layerCopy = deepcopy(layer)
im.TextUnformatted(string.format("type: %s", api.layerTypesMap[maskLayer.type]))
im.SameLine()
if im.Button(string.format("Dump##%s_%s_%s_%d", layer.uid, guiId, "layerMaskLayerDumbButton", k)) then
dump(maskLayer)
im.ImVec2(tool.getIconSize(), tool.getIconSize()),
isHighlighted and editor.color.beamng.Value or nil, nil, nil, string.format("highlightLayerMaskButton##%s_%s_%s_%d", layer.uid, guiId, "layerMaskLayerHighlightButton", k)) then
if layer.children and #layer.children > 0 then
if im.TreeNodeEx1(string.format("Children##%s_%s", layer.uid, guiId), im.TreeNodeFlags_DefaultOpen) then
im.SameLine()
local layerCountText = string.format("Layer count: %d", api.getLayerCount())
end
im.BeginChild1(string.format("##%s_%s_%s", guiId, layer.uid, "before"), im.ImVec2(0, layerDropHeight), true)
im.EndChild()
if editor.getPreference("dynamicDecalsTool.general.debug") then
print(string.format("drag drop: before 1, from: %d, fromParentUid: %s, to: %d, toParentUid: %s", from or -1, fromParentUid or "nil", to or -1, toParentUid or "nil"))
end
if editor.getPreference("dynamicDecalsTool.general.debug") then
print(string.format("drag drop: before 2, from: %d, fromParentUid: %s, to: %d, toParentUid: %s", from or -1, fromParentUid or "nil", to or -1, toParentUid or "nil"))
end
end
im.BeginChild1(string.format("##%s_%s_%s", guiId, "XXXX-XXXX", "after_last"), im.ImVec2(0, layerDropHeight), true)
im.EndChild()
if editor.getPreference("dynamicDecalsTool.general.debug") then
print(string.format("drag drop: after_last, from: %d, fromParentUid: %s, to: %d, toParentUid: %s", from or -1, fromParentUid or "nil", to or -1, toParentUid or "nil"))
end
@/lua/ge/extensions/editor/flowgraph/main.lua
ui_flowgraph_editor.setViewState(graph.viewPos, graph.viewZoom)
--print(string.format(graph.name.. " Restoring View to: %d %d / %0.2f", graph.viewPos[0].x, graph.viewPos[1].y, graph.viewZoom[0]))
else
--if o1 ~= graph.viewPos[0].x or o2 ~= graph.viewPos[0].y or o3 ~= graph.viewZoom[0] then
-- print(string.format(graph.name.." Saved View to: %d %d / %0.2f", graph.viewPos[0].x, graph.viewPos[1].y, graph.viewZoom[0]))
--end
graph.viewZoom[0] = 1
print(string.format("Restoring to: %d %d / %0.2f", graph.viewPos[0].x, graph.viewPos[1].y, graph.viewZoom[0]))
ui_flowgraph_editor.setViewState(graph.viewPos, graph.viewZoom)
local txt = n
if editor.getPreference("flowgraph.debug.displayIds") then txt = string.format("[%d] " .. n, lIds[i]) end
local cursor = im.GetCursorPos()
local txt = sib.name
if editor.getPreference("flowgraph.debug.displayIds") then txt = string.format("[%d] " .. sib.name, sib.id) end
if im.Selectable1(txt) then
im.Text(string.format("Lows: %d/%d | Highs: %d", self.mgr.__graphNodeOffset or 0, self.mgr.__nextFreeGraphNodeStart or 0, -1*((2^29) - (self.mgr.__nextFreePinLinkStart or 2^29))))
if im.IsItemClicked() then
table.sort(nIds[b])
dump(string.format("%ders: %s", (b-1)*100, table.concat(nIds[b],", ")))
end
@/lua/vehicle/extensions/tech/CANBus/ProjectBavariaController.lua
end
obj:queueGameEngineLua(string.format("core_input_virtualInput.emit(%d, %q, %d, %q, %.3f)", virtualInputDeviceInstance, objType, objInstance, action, value))
end
local id = objectId
local cmdString = string.format(cmdStringTemplate, virtualInputVidPid, id)
log("I", "ProjectBavariaController.requestExistingVirtualInput", "Requesting existing virtual input device for vidpid: " .. virtualInputVidPid)
local id = objectId
local cmdString = string.format(cmdStringTemplate, virtualInputDeviceName, virtualInputVidPid, virtualInputNumberOfAxes, virtualInputNumberOfButtons, virtualInputNumberOfPOVs, id)
log("I", "ProjectBavariaController.registerNewVirtualInput", "Registering new virtual input device for vidpid: " .. virtualInputVidPid)
]]
local cmdString = string.format(cmdStringTemplate, deviceInstance)
obj:queueGameEngineLua(cmdString)
local function virtualInputCallback(deviceInstance, deviceInfo)
log("I", "ProjectBavariaController.virtualInputCallback", string.format("Received virtual input callback with deviceInstance %d and device info %s", deviceInstance or -1, dumps(deviceInfo)))
@/lua/common/libs/LuLPeg/lulpeg.lua
or s:sub(i,i+20) .. "..."
msg = ("pattern error near '%s'"):format(msg)
error(msg, 2)
@/lua/common/extensions/ui/imguiUtils.lua
imgui.PushStyleColor2(imgui.Col_Text, imgui.ImVec4(0.7, 1, 1, 1))
imgui.Text(string.format('float3(%g,%g,%g)', data.x, data.y, data.z))
imgui.PopStyleColor()
imgui.BeginTooltip()
imgui.TextUnformatted("Last: " .. string.format(formatString, newValue))
imgui.TextUnformatted("Sampled: " .. string.format(formatString, sampledVal))
imgui.TextUnformatted("Last: " .. string.format(formatString, newValue))
imgui.TextUnformatted("Sampled: " .. string.format(formatString, sampledVal))
imgui.TextUnformatted("Min: " .. string.format(formatString, minVal))
imgui.TextUnformatted("Sampled: " .. string.format(formatString, sampledVal))
imgui.TextUnformatted("Min: " .. string.format(formatString, minVal))
imgui.TextUnformatted("Max: " .. string.format(formatString, maxVal))
imgui.TextUnformatted("Min: " .. string.format(formatString, minVal))
imgui.TextUnformatted("Max: " .. string.format(formatString, maxVal))
imgui.TextUnformatted("Update interval: " .. string.format('%0.1f', self.sampleTime) .. 's')
imgui.TextUnformatted("Max: " .. string.format(formatString, maxVal))
imgui.TextUnformatted("Update interval: " .. string.format('%0.1f', self.sampleTime) .. 's')
imgui.Separator()
@/lua/ge/extensions/util/stepHandler.lua
for i, step in ipairs(taskData.steps) do
im.TextWrapped(string.format("%s%d - %s",taskData.currentStep == i and "ACTIVE " or "", i, step.name or "Unnamed Step"))
im.Text(dumps(step))
if os.clockhp() - stepToHandle._startingTime > (stepToHandle.timeout or 120) then
local descriptor = string.format("%s: %s", stepToHandle.name or "Unknown Step", stepToHandle.origin or "Unknown Step")
log("E","","This step timed out ("..(stepToHandle.timeout or 120).."s). Step will be set to complete. Origin: "..dumps(descriptor))
if stepToHandle.complete then
local descriptor = string.format("%s: %s", stepToHandle.name or "Unknown Step", stepToHandle.origin or "Unknown Step")
log("I", logTag, string.format("Completed Step %0.2f: %s ", os.clockhp(), descriptor))
local descriptor = string.format("%s: %s", stepToHandle.name or "Unknown Step", stepToHandle.origin or "Unknown Step")
log("I", logTag, string.format("Completed Step %0.2f: %s ", os.clockhp(), descriptor))
taskData.currentStep = taskData.currentStep + 1
@/lua/ge/extensions/editor/dynamicDecals/history.lua
im.BeginChild1(string.format("DynamicDecalsHistoryChild%s", guiId), im.ImVec2(0, childHeight), true)
if im.Button("Delete All History##DynamicDecalsTool") then history:clear() end
@/inspector/Views/DatabaseContentView.js
else
message = WI.UIString("An unexpected error %s occurred.").format(error.code);
@/lua/ge/extensions/render/openxr.lua
translationId = "unkownType"
log("E", "", string.format("An OpenXR error was detected, but a wrong error type was passed: %s ('%s')", type(err), dumps(err)))
end
@/inspector/Models/AuditTestGroup.js
if (typeof payload.name !== "string") {
WI.AuditManager.synthesizeError(WI.UIString("\u0022%s\u0022 has a non-string \u0022%s\u0022 value").format(payload.name, WI.unlocalizedString("name")));
return null;
if (!Array.isArray(payload.tests)) {
WI.AuditManager.synthesizeError(WI.UIString("\u0022%s\u0022 has a non-array \u0022%s\u0022 value").format(payload.name, WI.unlocalizedString("tests")));
return null;
else if ("description" in payload)
WI.AuditManager.synthesizeWarning(WI.UIString("\u0022%s\u0022 has a non-string \u0022%s\u0022 value").format(payload.name, WI.unlocalizedString("description")));
else if ("supports" in payload)
WI.AuditManager.synthesizeWarning(WI.UIString("\u0022%s\u0022 has a non-number \u0022%s\u0022 value").format(payload.name, WI.unlocalizedString("supports")));
else if ("setup" in payload)
WI.AuditManager.synthesizeWarning(WI.UIString("\u0022%s\u0022 has a non-string \u0022%s\u0022 value").format(payload.name, WI.unlocalizedString("setup")));
@/lua/ge/extensions/gameplay/missions/missionManager.lua
for i, step in ipairs(taskData.steps) do
im.TextWrapped(string.format("%s%d - %s",taskData.currentStep == i and "ACTIVE " or "", i, step.name or "Unnamed Step"))
im.Text(dumps(step))
if stepToHandle.complete then
log("I", logTag, string.format("Completed Step: %s", stepToHandle.name or "Unnamed Task"))
taskData.currentStep = taskData.currentStep + 1
@/lua/ge/extensions/tech/pythonExport.lua
if ffi.offsetof(value, 'w') ~= nil then -- quat
return string.format('(%.4g, %.4g, %.4g, %.4g)', value.x, value.y, value.z, value.w)
end
end
return string.format('(%.4g, %.4g, %.4g)', value.x, value.y, value.z)
end
if math.floor(value) ~= value then
return string.format("%.4g", value)
end
local function getScenarioConfig(buffer, vehicle, vehData)
local line = string.format("scenario = Scenario('%s', 'we_export')\n", getCurrentLevelIdentifier())
buffer:put(line)
local vehModel = vehicle:getJBeamFilename()
line = string.format("%s = Vehicle('%s', '%s')\n", vehName, vehName, vehModel)
buffer:put(line)
local vehPos = vehicle:getPosition()
line = string.format("scenario.add_vehicle(%s, pos=%s", vehName, formatValueAsPython(vehPos))
buffer:put(line)
obj:queueGameEngineLua(
string.format('extensions.tech_pythonExport.getFullConfigVehicleCallback(%d, %q)', obj:getID(), lpack.encode(data))
)
@/lua/ge/extensions/editor/sidewalkSpline/populate.lua
local id = Engine.generateUUID()
obj:registerObject(string.format('SidewalkMesh_%s', id))
obj.cansave = true
@/inspector/Views/EventBreakpointPopover.js
this._domEventNameInputElement.setAttribute("dir", "ltr");
this._domEventNameInputElement.placeholder = WI.UIString("Example: \u201C%s\u201D").format("click");
this._domEventNameInputElement.spellcheck = false;
@/lua/ge/extensions/flowgraph/modules/uiModule.lua
local isBest = lap.lapTime == bestLapTime
local differenceText = isBest and "Best" or string.format("+%d:%02d:%03d",
math.floor((lap.lapTime - bestLapTime) / 60),
{ text = i },
{ format = "detailledTime", detailledTime = lap.lapTime, text = string.format("%d:%02d:%03d",
math.floor(lap.lapTime / 60),
@/inspector/Views/DOMEventsBreakdownView.js
if (fullscreenRange.originator)
fullscreenArea.title = WI.UIString("Full-Screen from \u201C%s\u201D").format(fullscreenRange.originator.displayName);
else
@/inspector/Base/Utilities.js
{
return "String.format(\"" + format + "\", \"" + Array.from(substitutions).join("\", \"") + "\")";
}
{
return String.format(this, arguments, String.standardFormatters, "", function(a, b) { return a + b; }).formattedResult;
}
if (higherResolution)
return WI.UIString("%.2fms").format(ms);
return WI.UIString("%.1fms").format(ms);
return WI.UIString("%.2fms").format(ms);
return WI.UIString("%.1fms").format(ms);
}
if (ms < epsilon)
return WI.UIString("%.0fms").format(0);
if (higherResolution)
return WI.UIString("%.3fms").format(ms);
return WI.UIString("%.2fms").format(ms);
return WI.UIString("%.3fms").format(ms);
return WI.UIString("%.2fms").format(ms);
}
if (higherResolution)
return WI.UIString("%.2fms").format(ms);
return WI.UIString("%.1fms").format(ms);
return WI.UIString("%.2fms").format(ms);
return WI.UIString("%.1fms").format(ms);
}
if (higherResolution)
return WI.UIString("%.1fms").format(ms);
return WI.UIString("%.0fms").format(ms);
return WI.UIString("%.1fms").format(ms);
return WI.UIString("%.0fms").format(ms);
}
if (higherResolution || Math.abs(seconds) < 60)
return WI.UIString("%.2fs").format(seconds);
if (Math.abs(minutes) < 60)
return WI.UIString("%.1fmin").format(minutes);
if (Math.abs(hours) < 24)
return WI.UIString("%.1fhrs").format(hours);
let days = hours / 24;
return WI.UIString("%.1f days").format(days);
}
if (Math.abs(bytes) < 1024)
return WI.UIString("%.0f B").format(bytes);
if (higherResolution || Math.abs(kilobytes) < 10)
return WI.UIString("%.2f KB").format(kilobytes);
return WI.UIString("%.1f KB").format(kilobytes);
return WI.UIString("%.2f KB").format(kilobytes);
return WI.UIString("%.1f KB").format(kilobytes);
}
if (higherResolution || Math.abs(megabytes) < 10)
return WI.UIString("%.2f MB").format(megabytes);
return WI.UIString("%.1f MB").format(megabytes);
return WI.UIString("%.2f MB").format(megabytes);
return WI.UIString("%.1f MB").format(megabytes);
}
if (higherResolution || Math.abs(gigabytes) < 10)
return WI.UIString("%.2f GB").format(gigabytes);
return WI.UIString("%.1f GB").format(gigabytes);
return WI.UIString("%.2f GB").format(gigabytes);
return WI.UIString("%.1f GB").format(gigabytes);
}
if (num < 1000000)
return WI.UIString("%.1fK").format(Math.round(num / 100) / 10);
if (num < 1000000000)
return WI.UIString("%.1fM").format(Math.round(num / 100000) / 10);
return WI.UIString("%.1fB").format(Math.round(num / 100000000) / 10);
}
@/lua/vehicle/controller/powertrainControl/antiLag.lua
if not controlledEngine then
log("E", "anitlag.init", string.format("Can't find requested engine with name: %q, antilag won't work!", engineName))
M.updateGFX = nop
if not controlledEngine.turbocharger then
log("E", "anitlag.init", string.format("Engine %q does not have a turbocharger, antilag won't work!", engineName))
M.updateGFX = nop
@/inspector/Views/RecordingContentView.js
if (this.representedObject.type === WI.Recording.Type.Canvas2D && this.representedObject.ready)
this._exportButtonNavigationItem.tooltip = WI.UIString("Export recording (%s)\nShift-click to export a HTML reduction").format(WI.saveKeyboardShortcut.displayName);
else
else
this._exportButtonNavigationItem.tooltip = WI.UIString("Export recording (%s)").format(WI.saveKeyboardShortcut.displayName);
}
this._sliderElement.max = visualActionIndexes.length;
this._sliderValueElement.textContent = WI.UIString("%d of %d").format(visualActionIndex, visualActionIndexes.length);
}
@/lua/ge/extensions/career/modules/speedTraps.lua
Engine.Audio.playOnce('AudioGui','event:>UI>Career>Speedcam_Snapshot')
ui_message(string.format("Traffic Violation (Failure to stop at Red Light): \n - %q | Fine %d$", core_vehicles.getVehicleLicenseText(veh), fine.money.amount), 10, "speedTrap")
else
else
ui_message(string.format("Traffic Violation (Failure to stop at Red Light): \n - No license plate detected | Fine could not be issued"), 10, "speedTrap")
end
@/lua/vehicle/controller/hydraulics/hydraulicTrailerFeet.lua
end
--print(string.format("Detached: %.2f, attached: %.2f, current: %.2f", detachedPosition, attachedPosition, currentPosition))
end
@/lua/vehicle/controller/airplaneSurfaces.lua
if abs(v - lastTrimValues[k]) > 0.005 then
guihooks.message(string.format("Trim (%s): %d%%", k, v * 100), 1, "vehicle.trimvalue" .. k)
lastTrimValues[k] = v
if abs(flap - lastFlap) > 0.005 then
guihooks.message(string.format("Flaps: %d%%", flap * 100), 1, "vehicle.flaps")
lastFlap = flap
if abs(slat - lastSlat) > 0.005 then
guihooks.message(string.format("Slats: %d%%", slat * 100), 1, "vehicle.slats")
lastSlat = slat
guihooks.message(string.format("Trim mode: %s", currentTrimMode), 5, "vehicle.trimmode")
end
@/lua/ge/extensions/ui/uiNavi.lua
targetVeh:queueJSUITexture(dashboard, string.format("%s(%s)", initmap or "map.setData", jsonEncode(mapTable)))
end
@/lua/common/libs/luasocket/socket/http.lua
if not chunk then return sock:send("0\r\n\r\n") end
local size = string.format("%X\r\n", string.len(chunk))
return sock:send(size .. chunk .. "\r\n")
function metat.__index:sendrequestline(method, uri)
local reqline = string.format("%s %s HTTP/1.1\r\n", method or "GET", uri)
return self.try(self.c:send(reqline))
@/lua/ge/extensions/core/repository.lua
--log('I', 'repository', 'request progress: ' .. dumps(r))
--log('D', 'repository', 'request progress: ' .. string.format('% 4.2f', r.dlnow / r.dltotal * 100) .. ' %. Speed: ' .. string.format('%2.2f kB/s', r.dlspeed / 1024))
--log('I', 'repository', 'request progress: ' .. dumps(r))
--log('D', 'repository', 'request progress: ' .. string.format('% 4.2f', r.dlnow / r.dltotal * 100) .. ' %. Speed: ' .. string.format('%2.2f kB/s', r.dlspeed / 1024))
@/inspector/Views/TimelineTabContentView.js
let toolTip = WI.UIString("Start recording (%s)\nCreate new recording (%s)").format(this._toggleRecordingShortcut.displayName, this._toggleNewRecordingShortcut.displayName);
let altToolTip = WI.UIString("Stop recording (%s)").format(this._toggleRecordingShortcut.displayName);
let toolTip = WI.UIString("Start recording (%s)\nCreate new recording (%s)").format(this._toggleRecordingShortcut.displayName, this._toggleNewRecordingShortcut.displayName);
let altToolTip = WI.UIString("Stop recording (%s)").format(this._toggleRecordingShortcut.displayName);
this._recordButton = new WI.ToggleButtonNavigationItem("record-start-stop", toolTip, altToolTip, "Images/Record.svg", "Images/Stop.svg", 13, 13);
case WI.TimelineRecord.Type.RenderingFrame:
return WI.UIString("Frame %d").format(timelineRecord.frameNumber);
case WI.TimelineRecord.Type.HeapAllocations:
if (timelineRecord.heapSnapshot.imported)
return WI.UIString("Imported \u2014 %s").format(timelineRecord.heapSnapshot.title);
if (timelineRecord.heapSnapshot.title)
if (timelineRecord.heapSnapshot.title)
return WI.UIString("Snapshot %d \u2014 %s").format(timelineRecord.heapSnapshot.identifier, timelineRecord.heapSnapshot.title);
return WI.UIString("Snapshot %d").format(timelineRecord.heapSnapshot.identifier);
return WI.UIString("Snapshot %d \u2014 %s").format(timelineRecord.heapSnapshot.identifier, timelineRecord.heapSnapshot.title);
return WI.UIString("Snapshot %d").format(timelineRecord.heapSnapshot.identifier);
case WI.TimelineRecord.Type.Media:
@/lua/common/tech/pcdLib.lua
function Pcd:setViewpoint(pos, rotQuat)
self.viewpoint = string.format('%f %f %f %f %f %f %f', pos.x, pos.y, pos.z, rotQuat.w, rotQuat.x, rotQuat.y, rotQuat.z)
end
@/lua/common/libs/StackTracePlus/StackTracePlus.lua
local ok, err = pcall(tostring, value)
if ok then return err else return (": '%s'"):format(err) end
end
function Dumper:add_f (fmt, ...)
self:add(fmt:format(...))
end
@/lua/ge/extensions/editor/dynamicDecals/layerTypes/linkedSet.lua
local function inspectLayerGui(layer, guiId)
if im.BeginPopup(string.format("%s_%s_AddPropertyPopup", layer.uid, guiId)) then
for cat, properties in pairs(api.properties) do
if not layer.properties[property.id] then
if im.Selectable1(string.format("%s##LinkedSet_AddProperty_%s_%s_%s", property.name, cat, guiId, layer.uid)) then
if layer.properties[property.id] then
if layer.properties[property.id] then
editor.logWarn(string.format("%s: %s", logTag, "Can't add the same property twice"))
return
-- local btnSize = im.GetFontSize() + 2 * im.GetStyle().FramePadding.y
-- if editor.uiIconImageButton(editor.icons.add, im.ImVec2(btnSize, btnSize), nil, nil, nil, string.format("PropertiesAddButton_%s_%s", guiId, layer.uid)) then
-- im.OpenPopup(string.format("%s_%s_AddPropertyPopup", layer.uid, guiId))
-- if editor.uiIconImageButton(editor.icons.add, im.ImVec2(btnSize, btnSize), nil, nil, nil, string.format("PropertiesAddButton_%s_%s", guiId, layer.uid)) then
-- im.OpenPopup(string.format("%s_%s_AddPropertyPopup", layer.uid, guiId))
-- end
if im.Button(string.format("Add##LinkedSet_%s_%s", guiId, layer.uid), im.ImVec2(im.GetContentRegionAvailWidth(), 0)) then
im.OpenPopup(string.format("%s_%s_AddPropertyPopup", layer.uid, guiId))
if im.Button(string.format("Add##LinkedSet_%s_%s", guiId, layer.uid), im.ImVec2(im.GetContentRegionAvailWidth(), 0)) then
im.OpenPopup(string.format("%s_%s_AddPropertyPopup", layer.uid, guiId))
end
-- dump(property)
if editor.uiIconImageButton(editor.icons.delete, tool.getIconSizeVec2(), nil, nil, nil, string.format("PropertiesRemoveButton_%s_%s_%s", guiId, layer.uid, property.id)) then
layer.properties[property.id] = nil
im.SameLine()
if widgets.draw(property.value, api.propertiesMap[property.id], string.format("%s_properties_%s", layer.uid, guiId), editor.getTempBool_BoolBool(false)) then
property.value = api.propertiesMap[property.id].value
im.Separator()
if im.Button(string.format("Apply##%s_%s_LinkedSetProperties", layer.uid, guiId), im.ImVec2(im.GetContentRegionAvailWidth(), 0)) then
setPropertiesInChildrenRec(layer, layer.properties)
@/lua/ge/extensions/core/levels.lua
previewCache[lowerLevelName] = preview
print(string.format("getLevelPreview: %s -> %s", levelName, preview or "nil"))
return preview
previewCache[lowerLevelName] = nil
print(string.format("getLevelPreview: %s -> nil", levelName))
return nil
@/lua/vehicle/beamstate.lua
local tooManyBreakGroupsBroken = breakGroupCount > 0 and (brokenBreakGroupCount > 1 or (brokenBreakGroupCount == breakGroupCount))
--print(string.format("%q: Breakgroups: %s, broken beams: %s/%s, deformed beams: %s/%s", partId, brokenBreakGroupCount, brokenBeamCount, #damageableBeams, deformedBeamCount, #damageableBeams))
local function sendObjectCouplingChange()
obj:queueGameEngineLua(string.format("onObjectCouplingChange(%s,%s)", objectId, serialize(attachedCouplers)))
end
obj:detachCoupler(val.cid, 0)
obj:queueGameEngineLua(string.format("onCouplerDetach(%s,%s)", obj:getId(), val.cid))
end
local function couplerFound(nodeId, obj2id, obj2nodeId)
--print(string.format("coupler found %s.%s->%s.%s", obj:getId(), nodeId, obj2id, obj2nodeId))
end
--print(string.format("coupler attached %s.%s->%s.%s", obj:getId(),nodeId,obj2id, obj2nodeId))
if objectId < obj2id then
if objectId < obj2id then
obj:queueGameEngineLua(string.format("onCouplerAttached(%s,%s,%s,%s)", objectId, obj2id, nodeId, obj2nodeId))
end
local function onCouplerDetached(nodeId, obj2id, obj2nodeId)
--print(string.format("coupler detached %s.%s->%s.%s", obj:getId(),nodeId,obj2id, obj2nodeId))
attachedCouplers[nodeId] = nil
if objectId < obj2id then
obj:queueGameEngineLua(string.format("onCouplerDetached(%s,%s,%s,%s)", objectId, obj2id, nodeId, obj2nodeId))
end
if damageSum > lastDisplayedDamage * 1.05 then
--guihooks.message(string.format("Car Damage: $%.2f", damageSum), 5, "vehicle.damageSum")
lastDisplayedDamage = damageSum
end
obj:queueObjectLuaCommand(coupler.obj2id, string.format("beamstate.importCouplerData(%s, %s)", coupler.obj2nodeId, serialize(data)))
end
@/lua/ge/extensions/core/vehicleBridge.lua
end
local cmd = string.format("extensions.gameplayInterface.getSystemData(0, %d, %s)", id, table.concat(params, ", "))
M.logCommand(veh, cmd)
M.vehicleData[vehicleId].registeredCallbacks[electricsKey] = id
local cmd = string.format("extensions.gameplayInterface.registerValueChangeNotification(0,%d,'%s')", id, electricsKey)
log("D","","Registering for value change notification: " .. cmd)
if id then
local cmd = string.format("extensions.gameplayInterface.unregisterValueChangeNotification(0,%d,'%s')", id, electricsKey)
log("D","","Unregistering for value change notification: " .. cmd)
--end
local cmd = string.format("extensions.gameplayInterface.executeAction(0,%d, %s)", id, table.concat(params, ", "))
M.logCommand(veh, cmd)
@/lua/vehicle/extensions/tech/powertrainSensor.lua
obj:queueGameEngineLua(string.format("tech_sensors.updatePowertrainLastReadings(%q)", lpack.encode(readingsData)))
local adHocData = { requestId = adHocRequestId, reading = data.readings }
obj:queueGameEngineLua(string.format("tech_sensors.updatePowertrainAdHocRequest(%q)", lpack.encode(adHocData)))
end
@/inspector/Views/QuickConsole.js
if (frame.name)
return WI.UIString("%s (%s)").format(frame.name, frame.mainResource.displayName);
return frame.mainResource.displayName;
this._automaticExecutionContextPathComponent.displayName = WI.UIString("Auto - %s").format(preferredName || executionContext.name);
}
console.assert(target.type === WI.Target.Type.Worker);
let preferredName = WI.UIString("Worker \u2014 %s").format(target.displayName);
let executionContextPathComponent = this._createExecutionContextPathComponent(target.executionContext, preferredName);
@/lua/vehicle/energyStorage.lua
else
log("D", "energyStorage.getStorageSafe", string.format("Didn't find storage '%s', returning nilStorage.", name))
--log("D", "energyStorage.getStorageSafe", debug.traceback())
@/lua/common/jsonDebug.lua
if curlen >= i then
error(string.format("%s near line %d, '%s'",msg, n, w:match'^%s*(.*%S)' or ''))
end
if curlen >= i then
table.insert(warnings, string.format("%s: %s near line %d, '%s'", ctx, msg, n, w:match'^%s*(.*%S)' or ''))
return
local pm = byte(s, si - 1)
jsonError(string.format("Invalid number: '%s'", sub(s, si - ((pm == 45 or pm == 43) and 1 or 0), infend)), si)
end
local pm = byte(s, si - 1)
jsonError(string.format("Invalid number: '%s'", sub(s, si - ((pm == 45 or pm == 43) and 1 or 0), i-1)), si)
end
if i < si then
jsonError(string.format("Expected dictionary key"), i)
end
if c ~= 58 and c ~= 61 then -- : =
jsonError(string.format("Expected dictionary separator ':' or '=' instead of: '%s'", string.char(c)), i - 1)
end
if result[key] then
jsonWarning(string.format("Duplicate key found: '%s'", key), i)
end
if result[key] then
jsonWarning(string.format("Duplicate key found: '%s'", key), i)
end
@/inspector/Test/TestHarness.js
values = values.map(this._expectationValueAsString.bind(this));
message = message || this._expectationMessageFormat(type).format(...values);
}
message += "\n Expected: " + this._expectedValueFormat(type).format(...values.slice(1));
message += "\n Actual: " + values[0];
@/lua/ge/extensions/flowgraph/nodes/mission/selectGarageSpots.lua
log("I","",string.format("G2G Route: %s/%s to %s/%s direct distance: %0.1f", self.pinOut.startSpot.value, self.pinOut.startLocation.value, self.pinOut.endSpot.value, self.pinOut.endLocation.value, (self.startSpot.pos - self.endSpot.pos):length()))
self.state = 2
@/lua/common/libs/xlsxlib/tests/tests.lua
local content = string.format('// Test args: %s\r\n', serialize(queryArgs))
content = content .. jsonEncodePretty({data}, 1)
@/inspector/Views/TypeTokenView.js
if (titleType === WI.TypeTokenView.TitleType.Variable)
return WI.UIString("Type information for variable: %s").format(functionOrVariableName);
if (functionOrVariableName)
return WI.UIString("Return type for function: %s").format(functionOrVariableName);
@/lua/ge/extensions/career/modules/painting.lua
if not career_modules_payment.canPay(price) then return end
career_modules_payment.pay(price, {label = string.format("Repainted the vehicle"), tags = {"vehiclePainting", "buying"}})
Engine.Audio.playOnce('AudioGui', 'event:>UI>Career>Buy_01')
if partName then
vehicleObject:queueLuaCommand(string.format("partCondition.setPartPaints(%s, %s, 0)", partName, serialize(chosenPaints)))
else
else
vehicleObject:queueLuaCommand(string.format("partCondition.setAllPartPaints(%s, 0)", serialize(chosenPaints)))
end
@/inspector/Views/ScriptTimelineDataGridNode.js
if (this.record.details.repeating)
this._subtitle = WI.UIString("%s interval").format(timeoutString);
else
else
this._subtitle = WI.UIString("%s delay").format(timeoutString);
} else if (this.record.eventType === WI.ScriptTimelineRecord.EventType.EventDispatched) {
@/inspector/Views/SourceCodeTextEditor.js
textElement.className = "text";
textElement.textContent = threads.length === 1 ? threads[0].displayName : WI.UIString("%d Threads").format(threads.length);
} else {
iconElement.classList.add(this._iconClassNameForIssueLevel(issue.level));
textElement.textContent = WI.UIString("%d Errors, %d Warnings").format(errorsCount, warningsCount);
} else if (errorsCount) {
iconElement.classList.add(this._iconClassNameForIssueLevel(issue.level));
textElement.textContent = WI.UIString("%d Errors").format(errorsCount);
} else if (warningsCount) {
iconElement.classList.add(this._iconClassNameForIssueLevel(issue.level));
textElement.textContent = WI.UIString("%d Warnings").format(warningsCount);
}
@/lua/ge/extensions/flowgraph/nodes/activity/getProgress.lua
if type(val) == 'number' then
text = text .. string.format("%s: %0.2d. ", k, val or 0)
html = html .. string.format("%s: %0.2d", k, val or 0)
text = text .. string.format("%s: %0.2d. ", k, val or 0)
html = html .. string.format("%s: %0.2d", k, val or 0)
else
else
text = text .. string.format("%s: %s. ", k, val or "")
html = html .. string.format("%s: %s", k, val or "")
text = text .. string.format("%s: %s. ", k, val or "")
html = html .. string.format("%s: %s", k, val or "")
end
@/lua/ge/extensions/editor/crawlEditor/waypoints.lua
local midPoint = (fromNode.pos + toNode.pos) / 2
local segmentName = string.format("Segment %d-%d", fromNode.id, toNode.id)
debugDrawer:drawTextAdvanced(
local isSelected = pathnode.id == self.index
local displayText = string.format("%s %d", pathnode.name, i)
else
im.Text(string.format("Position: (%.1f, %.1f, %.1f)", pathnode.pos.x, pathnode.pos.y, pathnode.pos.z))
im.Text(string.format("Radius: %.1f", pathnode.radius))
im.Text(string.format("Position: (%.1f, %.1f, %.1f)", pathnode.pos.x, pathnode.pos.y, pathnode.pos.z))
im.Text(string.format("Radius: %.1f", pathnode.radius))
if pathnode.isRecovery then
@/lua/common/libs/slaxml/slaxml.lua
pi = function(target,content)
print(string.format("%s %s?>",target,content))
end,
comment = function(content)
print(string.format("",content))
end,
if nsPrefix then io.write(nsPrefix,":") end
io.write(name,'=',string.format('%q',value))
if nsURI then io.write(" (ns='",nsURI,"')") end
text = function(text,cdata)
print(string.format(" %s: %q",cdata and 'cdata' or 'text',text))
end,
for i=#nsStack,1,-1 do if nsStack[i][prefix] then return nsStack[i][prefix] end end
error(("Cannot find namespace for prefix %s"):format(prefix))
end
if current==doc then
if doc.root then error(("Encountered element '%s' when the document already has a root '%s' element"):format(name,doc.root.name)) end
doc.root = el
attribute = function(name,value,nsURI)
if not current or current.type~="element" then error(("Encountered an attribute %s=%s but I wasn't inside an element"):format(name,value)) end
local attr = {type='attribute',name=name,nsURI=nsURI,value=value,parent=rich and current or nil}
closeElement = function(name)
if current.name~=name or current.type~="element" then error(("Received a close element notification for '%s' but was inside a '%s' %s"):format(name,current.name,current.type)) end
pop(stack)
if current.type~='document' then
if current.type~="element" then error(("Received a text notification '%s' but was inside a %s"):format(value,current.type)) end
push(current.kids,{type='text',name='#text',value=value,parent=rich and current or nil})
@/lua/ge/extensions/freeroam/facilities/fuelPrice.lua
end
local priceStr = string.format("%.3f", price):gsub("%.", "")
for i=1, #v2.displayObjects do
@/lua/ge/extensions/editor/dynamicDecals/colorHistory.lua
for k, color in ipairs(data) do
im.ColorEdit4(string.format("##colorHistoryColorWidget_%s_%d", guiId, k), editor.getTempFloatArray4_TableTable(color), im.flags(im.ColorEditFlags_NoInputs, im.ColorEditFlags_AlphaPreview))
im.SameLine()
im.SameLine()
if im.Button(string.format("Set as decal color##colorHistory_%s_%d", guiId, k)) then
api.setDecalColor(Point4F(color[1], color[2], color[3], color[4]))
im.SameLine()
if im.Button(string.format("Set as fill layer color##colorHistory_%s_%d", guiId, k)) then
api.setFillLayerColor(Point4F(color[1], color[2], color[3], color[4]))
if editor.uiIconImageButton(editor.icons.delete, im.ImVec2(uiIconSize, uiIconSize), nil, nil, nil, string.format("remove##ColorHistory_%s_%d", guiId, k)) then
table.remove(data, k)
@/lua/ge/extensions/editor/flowgraph/garbageDebug.lua
im.SameLine()
im.Text(string.format("[%d]", entry.activeCount))
end
plotHelperUtil:draw(im.GetContentRegionAvailWidth(),250, im.GetIO().DeltaTime)
im.Text(string.format("Change | Avg: %d | Q25: %d | Q75: %d | Q90: %d | (only active)", entry.averageChange or -1, entry.q25 or -1, entry.q50 or -1, entry.q75 or -1))
table.clear(plot)
if node then
local nLabel = string.format("%s (%d)", node.name, node.id, entry.value or -1)
self:drawStats(nLabel, entry)
@/lua/ge/extensions/editor/crawlEditor/missionPortTool.lua
node.flags.isRecoveryCheckpoint = true
log('D', logTag, string.format("Marked pathnode %d (%s) as recovery checkpoint", i, node.name))
end
if not startPosData and #raceData.startPositions > 0 then
log('W', logTag, string.format("Could not find startPosition with oldId %d, using first entry", defaultStartOldId or -1))
startPosData = raceData.startPositions[1]
rotation = quatFromDir(direction, vec3(0, 0, 1))
log('D', logTag, string.format("Calculated start rotation pointing to first checkpoint (distance: %.2f)", direction:length()))
else
log('I', logTag, string.format("Successfully ported mission %s (starting position: %s)", missionName, startingPositionId and "yes" or "no"))
return true
@/lua/ge/extensions/tech/adasUltrasonic.lua
if #lowering_readings > 0 then
be:queueObjectLua(vid, string.format("extensions.tech_adasUltrasonic.applyBrakes(%f)", math.min(unpack(lowering_readings))))
else
be:queueObjectLua(vid, "extensions.tech_vehiclePOI.collectVehiclePOIData('tech_adasUltrasonic.receivePOI')")
be:queueObjectLua(vid, string.format("extensions.tech_adasUltrasonic.setup(%s, %s, %s)", tostring(parkAssist), tostring(blindSpots), tostring(args.hasCrawl == nil and true or args.hasCrawl)))
@/lua/vehicle/controller/tech/cosimulationCoupling.lua
-- Create filenames with date and time
local sendFileName = string.format("CoSimulationInternalLog_%s.csv", timestamp)
csvSendData:write(sendFileName)
if enableCosim then
local receiveFileName = string.format("CoSimulationExternalLog_%s.csv", timestamp)
csvReceiveData:write(receiveFileName)
@/lua/ge/extensions/ui/gameplaySelector/general.lua
end
title = string.format("%s", filterValue)
else
else
title = string.format("%s", clusterKey, groupKey, groupName)
end
@/inspector/Models/Resource.js
{
let errorString = WI.UIString("Unable to show certificate for \u201C%s\u201D").format(this.url);
@/lua/ge/extensions/flowgraph/nodes/vehicle/groundDistance.lua
if self.data.drawDebug then
debugDrawer:drawTextAdvanced(point, String(string.format("%0.3f", point.z - hit)), ColorF(1,1,1,1), true, false, ColorI(0,0,0,192))
end
@/lua/ge/extensions/career/modules/partInventory.lua
end
career_modules_log.addLog(string.format("Added new vehicles' parts to inventory %d", inventoryId), "partInventory")
return newParts
for vehicleModel, _ in pairs(vehicleModels) do
local vehicleDir = string.format("/vehicles/%s/", vehicleModel)
if FS:directoryExists(vehicleDir) then
@/lua/common/guihooks.lua
sendStreamsToGELua = function(streams)
local command = string.format('extensions.hook("onGeLuaStreamsFromVehicleTest", %q)', lpack.encode(streams))
obj:queueGameEngineLua(command)
for i,v in ipairs(values) do
v[1] = v[1] or string.format("#%i", i) -- key
v[2] = v[2] or 0 -- value
for _,v in ipairs(values) do
table.insert(keys, string.format(v[4]=="" and "%s%s" or "%s (%s)", v[1], v[4]))
end
csvfile = require('csvlib').newCSV(unpack(keys))
csvfilename = filename or string.format("graphcsv.%s.csv", os.date("%Y-%d-%mT%H_%M_%S"))
end
@/lua/ge/extensions/editor/toolUtilities/render.lua
local function markupInsertNode(pos) drawMarkupCulled(pos, '[Click To Insert Node]') end
local function markupRoadLength(pos, l) drawMarkupCulledInvertedCols(pos, string.format('[Length = %.2f m]', l)) end
local function markupAdjustWidth(pos) drawMarkupCulled(pos, '[Drag To Adjust Width. Hold SHIFT For Precision]') end
local function markupAdjustBar(pos) drawMarkupCulled(pos, '[Drag To Adjust Height. Hold SHIFT For Precision]') end
local function markupWidthDisplay(pos, w) drawMarkupCulled(pos, string.format('[Width = %.2f m]', w)) end
local function markupAddPolygonNode(pos) drawMarkupCulled(pos, '[Click To Add Node. Double-Click To Finish]') end
local function markupNode3(pos) drawMarkupCulled(pos, 'Node [3]') end
local function markupSplineName(pos, str) drawMarkupCulled(pos, string.format('[%s]', str)) end
local function markupActiveSurf(pos) drawMarkupCulled(pos, '[Active Surface (2D)]') end
local function markupVolume(pos) drawMarkupCulled(pos, '[Active Volume (3D)]') end
local function markupElevation(pos, elev) drawMarkupCulled(pos, string.format('[Elevation = %.2f m]', elev)) end
local function markupTwistAngle(pos, angleDeg) drawMarkupCulled(pos, string.format('[Twist Angle = %.2f deg]', angleDeg)) end
local function markupElevation(pos, elev) drawMarkupCulled(pos, string.format('[Elevation = %.2f m]', elev)) end
local function markupTwistAngle(pos, angleDeg) drawMarkupCulled(pos, string.format('[Twist Angle = %.2f deg]', angleDeg)) end
local function markupVelocity(pos, vel, isBarsLimit, unitsStr)drawMarkupCulled(pos, string.format('[%s = %.2f %s]', isBarsLimit and 'Limit' or 'Velocity', vel, unitsStr)) end
local function markupTwistAngle(pos, angleDeg) drawMarkupCulled(pos, string.format('[Twist Angle = %.2f deg]', angleDeg)) end
local function markupVelocity(pos, vel, isBarsLimit, unitsStr)drawMarkupCulled(pos, string.format('[%s = %.2f %s]', isBarsLimit and 'Limit' or 'Velocity', vel, unitsStr)) end
local function markupGraphNodeHover(pos) drawMarkupCulled(pos, '[Click To Add/Remove From Path]') end
local function markupGraphFreeSpace(pos) drawMarkupCulled(pos, '[Click NavGraph Node To Add To Path]') end
local function markupPathNode(pos, i) drawMarkupCulled(pos, string.format('Path Node [%d]', i)) end
local function markupLoop(pos) drawMarkupCulled(pos, '[Hold SHIFT + Drop To Form Loop]') end
local function markupLoopedSplineCannotAdd(pos) drawMarkupCulled(pos, '[Looped Spline - Cannot Add Here]') end
local function markupObstacleDistance(pos, dist) drawMarkupCulledAlwaysShow(pos, string.format('[Obstacle: %.1f m]', dist)) end
local function markupObstacleDistanceWithElevation(pos, dist, elevDiff) drawMarkupCulledAlwaysShow(pos, string.format('[Obstacle: %.1f m; dZ = %.1fm]', dist, elevDiff)) end
local function markupObstacleDistance(pos, dist) drawMarkupCulledAlwaysShow(pos, string.format('[Obstacle: %.1f m]', dist)) end
local function markupObstacleDistanceWithElevation(pos, dist, elevDiff) drawMarkupCulledAlwaysShow(pos, string.format('[Obstacle: %.1f m; dZ = %.1fm]', dist, elevDiff)) end
local function markupAngleAndDistance(pos, dist, angleRad) drawMarkupCulledAlwaysShow(pos, string.format('%.1f m; %.1f°', dist, deg(angleRad))) end
local function markupObstacleDistanceWithElevation(pos, dist, elevDiff) drawMarkupCulledAlwaysShow(pos, string.format('[Obstacle: %.1f m; dZ = %.1fm]', dist, elevDiff)) end
local function markupAngleAndDistance(pos, dist, angleRad) drawMarkupCulledAlwaysShow(pos, string.format('%.1f m; %.1f°', dist, deg(angleRad))) end
local function markupAngleDistanceWithElevation(pos, dist, angleRad, elevDiff) drawMarkupCulledAlwaysShow(pos, string.format('%.1f m; %.1f°; dZ = %.1fm', dist, deg(angleRad), elevDiff)) end
local function markupAngleAndDistance(pos, dist, angleRad) drawMarkupCulledAlwaysShow(pos, string.format('%.1f m; %.1f°', dist, deg(angleRad))) end
local function markupAngleDistanceWithElevation(pos, dist, angleRad, elevDiff) drawMarkupCulledAlwaysShow(pos, string.format('%.1f m; %.1f°; dZ = %.1fm', dist, deg(angleRad), elevDiff)) end
@/lua/vehicle/controller/esc.lua
if isDebugMode and config.escEnabled then
log("D", "ESC", string.format("Calculated EG: %s --> %.6f", config.name, eg))
log("D", "ESC", string.format("Calculated characteristic speed: %s --> %.2f m/s", config.name, characteristicSpeed))
log("D", "ESC", string.format("Calculated EG: %s --> %.6f", config.name, eg))
log("D", "ESC", string.format("Calculated characteristic speed: %s --> %.2f m/s", config.name, characteristicSpeed))
if eg < 0 then
if eg < 0 then
log("W", "ESC", string.format("Calculated EG (%s) is lower than 0 (oversteery car setup), ESC might not work perfectly!", config.name))
end
@/lua/common/libs/xlsxlib/tests/TestManager.lua
local func = tests[name]
local displayName = string.format("%-60s", name:gsub('_shouldFail$', ''))
@/ui/ui-vue/src/bridge/libs/UIUnits.js
maximumFractionDigits: numDecs
}).format(helper.val)
return formattedVal + ' ' + helper.unit
minimumFractionDigits: 2
}).format(+x)
}
@/lua/ge/extensions/core/versionUpdate.lua
local lastMajor = getMajorVersion(lastVersion)
log("D", "", string.format("Current version: '%s' ('%s'), last version: '%s' ('%s'), newInstall: '%s'", dumps(beamng_version), dumps(currentMajor), dumps(lastVersion), dumps(lastMajor), dumps(newInstall)))
if newInstall or (currentMajor == lastMajor) then
M.updateBackupPath = FS:folderCleanup(M.lastVersion)
log("I", "", string.format("Folder cleanup done. Destination backup path: %s", dumps(M.updateBackupPath)))
end
extensions.hookUpdate("onUpdate")
log("D", "", string.format("Saving lastVersion to disk: %s", dumps(beamng_version)))
settings.setValue('lastVersion', beamng_version)
@/lua/ge/extensions/editor/api/dynamicDecals.lua
if id > #tableToRemoveFrom then
print(string.format("%s.deleteLayer(): Can't delete layer. Id [%d] is out of bounds!", logTag, id))
return
lyr["meshes"] = layer.meshes or nil
lyr["name"] = (layer.name or string.format("%s", "Decal Layer"))
lyr["normalIntensity"] = layer.normalIntensity or 1.0
elseif layer.type == M.layerTypes.fill then
lyr["name"] = (layer.name or string.format("%s", "Fill Layer"))
lyr["blendMode"] = layer.blendMode
elseif layer.type == M.layerTypes.textureFill then
lyr["name"] = (layer.name or string.format("%s", "Texture Fill Layer"))
lyr["blendMode"] = layer.blendMode
elseif layer.type == M.layerTypes.group then
lyr["name"] = (layer.name or string.format("%s", "Group Layer"))
lyr["type"] = layer.type
lyr["flipMirroredDecal"] = layer.flipMirroredDecal or false
lyr["name"] = (layer.name or string.format("%s", "Group Layer"))
lyr["normalIntensity"] = layer.normalIntensity or 1.0
lyr["flipMirroredDecal"] = layer.flipMirroredDecal or false
lyr["name"] = (layer.name or string.format("%s", "Group Layer"))
lyr["normalIntensity"] = layer.normalIntensity or 1.0
elseif layer.type == M.layerTypes.linkedSet then
lyr["name"] = (layer.name or string.format("%s", "Linked Set Layer"))
lyr["type"] = layer.type
}
-- id, name, description, type, default, min (for widget), max(for widget) [, format (for widget)] [,getMod (fn)] [, setMod (fn)] [, widget type]
M.properties = {
if not layer then
print(string.format("%s.addMaskDecal(): Couldn't find layer for layerUid '%s'. Couldn't undo 'addMaskDecal' action.", logTag, actionData.baseLayerUid))
return
if not layer then
print(string.format("%s.addMaskDecal(): Couldn't find layer for layerUid '%s'. No layer mask decal has been added.", logTag, actionData.baseLayerUid))
return
if not layerUid_string then
print(string.format("%s.addMaskDecal(): 'layerUid' must be set. No layer mask decal has been added.", logTag))
return
if not layer then
print(string.format("%s.addMaskDecal(): Couldn't find layer for layerUid '%s'. No layer mask decal has been added.", logTag, layerUid_string))
return
decalData.uid = getRandomUid()
decalData.name = string.format("%s", "Decal Mask Layer")
decalData.enabled = true
if M.debug then
print(string.format("%s.addMaskDecal()\ndecalData:\n%s\n### ######## ###", logTag, dumps(decalData)))
end
if M.debug then
print(string.format("%s.addDecal()\ndecalData:\n%s\n### ######## ###", logTag, dumps(decalData)))
end
if M.debug then
print(string.format("%s.addPathDataPoint()\nlayerData:\n%s\n### ######## ###", logTag, dumps(layerData)))
end
if M.debug then
print(string.format("%s.addFillLayer()\nlayerData:\n%s\n### ######## ###", logTag, dumps(layerData)))
end
history:commitAction(
string.format("Add Fill Layer (%s)", layerData.uid),
layerData,
if M.debug then
print(string.format("%s.addTextureFillLayer()\nlayerData:\n%s\n### ######## ###", logTag, dumps(layerData)))
end
if M.debug then
print(string.format("%s.addGroup()\nlayerData:\n%s\n### ######## ###", logTag, dumps(layerData)))
end
if M.debug then
print(string.format("%s.addLinkedSet()\nlayerData:\n%s\n### ######## ###", logTag, dumps(layerData)))
end
if M.debug then
print(string.format("%s.addBrushStrokeLayer()\nlayerData:\n%s\n### ######## ###", logTag, dumps(layerData)))
end
if M.debug then
print(string.format("%s - Material '%s' has been added", logTag, materialName))
end
if M.debug then
print(string.format("%s - Material set to '%s'", logTag, materialName))
end
if M.debug then
print(string.format("%s - Material set to '%s'", logTag, mat1[2]))
end
if M.debug then
print(string.format("%s - Material set to '%s'", logTag, mat2[2]))
end
end
print(string.format("%s - Not able to set the default material", logTag))
M.setLayerVisibility = function(layerUid_string, visibility_bool)
if visibility_bool == nil then print(string.format("%s.setLayerVisibility(): 'visibility_bool' argument must be given.", logTag)) return end
local layer = M.getLayerByUid(layerUid_string)
history:commitAction(
string.format("Toggle Layer Visibility: ", layerUid_string),
{layerUid = layerUid_string},
if not vehicleObj then
print(string.format("%s.bakeLayers(layers): Can't bake layers, vehicle's missing.", logTag))
return
if M.debug then
print(string.format("%s.bakeLayers(layers)\nresult:\n%s\n### ######## ###", logTag, dumps(res)))
end
if M.debug then
print(string.format("%s.highlightLayer(decal)\ndecal:\n%s\n### ######## ###", logTag, dumps(layer_table)))
end
if M.debug then
print(string.format("%s.highlightLayerByUid(decal)\ndecal:\n%s\n### ######## ###", logTag, dumps(layer)))
end
if not res then
print(string.format("%s.reprojectLayers(): Failed", logTag))
return
if not res then
print(string.format("%s.getLayerByUid(layerUid_string): No layer found with given uid '%s'", logTag, layerUid_string))
end
if not fromLayer then
print(string.format("%s.setLayer(layerData_table, doReproject_bool): Couldn't find layer for layerUid '%s'. Can't update layer.", logTag, layerData_table.uid))
return
if M.debug then
print(string.format("moveLayer, from: %d fromParentUid: %s, to: %d toParentUid: %s", from_number or -1, fromParentUid_string or "nil", to_number or -1, toParentUid_string or "nil"))
end
if layer.uid == toParentUid_string then
print(string.format("Can't make a layer its own child. Aborting moving layer '%s'", layer.name))
return
setRandomLayerUidRec(newLayerData)
newLayerData.name = string.format("%s %s", newLayerData.name, "Copy")
setRandomLayerUidRec(newLayerData)
newLayerData.name = string.format("%s %s", newLayerData.name, "Mirrored Copy")
else
print(string.format("%s : Can't find Dynamic Decals preset material: %s", logTag, matSkinPresetName))
end
if found == 0 then
print(string.format("%s : No materials skin preset has been found", logTag))
return
print(string.format("%s : Skin files exported to '%s'", logTag, modDirectory))
@/lua/ge/extensions/ui/gameplayAppContainers.lua
if currentMessage then
im.Text(string.format("Timer: %.2f / %.2f", currentMessage.timer, currentMessage.duration))
local remaining = currentMessage.duration - currentMessage.timer
local remaining = currentMessage.duration - currentMessage.timer
im.Text(string.format("Remaining: %.2f seconds", remaining))
im.Text("Source: " .. currentMessage.source)
local text = (msg.data and msg.data[1] and msg.data[1][1]) or "Unknown"
im.Text(string.format(" %d. [%s] %.1fs: %s", i, msg.source, msg.duration, text))
end
@/lua/ge/extensions/core/checkpoints.lua
-- Queued for round trip to allow setpositionrotation to take effect
local callbackCommand = string.format('obj:queueGameEngineLua("if getObjectByID('..vehId..') then getObjectByID('..vehId..'):autoplace(false); core_checkpoints.completeReset(%u,%s) end")', vehId, "'"..vehicleName.."'")
vehicle:queueLuaCommand(callbackCommand)
vehicle:queueLuaCommand(callbackCommand)
local command = string.format("recovery.clear()")
vehicle:queueLuaCommand(command)
@/lua/ge/extensions/gameplay/markerInteraction.lua
showMarker = showMarker and (not cluster.visibleBySetting or markerVisibilityBySetting[cluster.visibleBySetting] or cluster.focus)
--dump(string.format("cluster %s, is nearby: %s, marker focus: %s, cluster focus: %s", cluster.id, nearbyIds[cluster.id], marker.focus, cluster.focus))
--dump(string.format("cluster %s, is showMarker: %s", cluster.id, showMarker))
--dump(string.format("cluster %s, is nearby: %s, marker focus: %s, cluster focus: %s", cluster.id, nearbyIds[cluster.id], marker.focus, cluster.focus))
--dump(string.format("cluster %s, is showMarker: %s", cluster.id, showMarker))
if showMarker then
@/inspector/Views/StyleOriginView.js
this.element.title = WI.UIString("%s cannot be modified").format(styleTitle);
}
@/inspector/Views/MemoryCategoryView.js
this._detailsMaxElement.textContent = WI.UIString("Highest: %s").format(Number.isFinite(maxSize) ? Number.bytesToString(maxSize) : emDash);
this._detailsMinElement.textContent = WI.UIString("Lowest: %s").format(Number.isFinite(minSize) ? Number.bytesToString(minSize) : emDash);
this._detailsMaxElement.textContent = WI.UIString("Highest: %s").format(Number.isFinite(maxSize) ? Number.bytesToString(maxSize) : emDash);
this._detailsMinElement.textContent = WI.UIString("Lowest: %s").format(Number.isFinite(minSize) ? Number.bytesToString(minSize) : emDash);
}
@/lua/ge/extensions/editor/dynamicDecals/selection.lua
local function selectLayer(uid, addToSelection)
if not uid then editor.logWarn(string.format("%s.selectLayer(): 'uid' argument must not be empty.", logTag)) return end
if not addToSelection then
@/lua/ge/extensions/editor/scriptAIEditor.lua
-- Rounding functions.
local function round1(n) return tonumber(string.format("%.1f", n)) end
local function round2(n) return tonumber(string.format("%.2f", n)) end
local function round1(n) return tonumber(string.format("%.1f", n)) end
local function round2(n) return tonumber(string.format("%.2f", n)) end
local nodes = {}
-- Check if data is already in pointer format (has .x[0] structure) or value format (has .x structure).
if d[1] and d[1].x and type(d[1].x) == "table" and d[1].x[0] ~= nil then -- Data is already in pointer format.
local nodes = {}
-- Check if data is already in pointer format (has .x[0] structure) or value format (has .x structure).
if d[1] and d[1].x and type(d[1].x) == "table" and d[1].x[0] ~= nil then -- Data is already in pointer format.
@/lua/ge/extensions/career/modules/milestones/generalMilestones/money.lua
getLabel = function(step, displayValue, target) return modeConfig.label end,
getDescription = function(step, displayValue, target) return string.format(modeConfig.description, target) end,
getProgressLabel = function(step, current, target) return string.format("%0.2f / %0.2f", current, target) end,
getDescription = function(step, displayValue, target) return string.format(modeConfig.description, target) end,
getProgressLabel = function(step, current, target) return string.format("%0.2f / %0.2f", current, target) end,
getTarget = function(step) return values[step] end,
@/lua/ge/extensions/editor/tech/roadArchitect/export.lua
-- Exports the Road Architect network to OpenDRIVE format (.xodr).
local function export()
@/lua/ge/extensions/gameplay/drag/general.lua
customGrav = math.abs(core_environment.getGravity() - 9.81) > 0.01,
gravity = string.format("%0.2f m/s²", math.abs(core_environment.getGravity())),
}
for _, timeLabel in ipairs(timerKeys) do
timers[timeLabel] = string.format("%0.3f", racer.timers[timeLabel].value)
end
for _, velLabel in ipairs(velocityKeys) do
velocities[velLabel..'_km/h'] = string.format("%0.3f", racer.timers[velLabel].value * 3.6)
velocities[velLabel..'_mph'] = string.format("%0.3f", racer.timers[velLabel].value * 2.23694)
velocities[velLabel..'_km/h'] = string.format("%0.3f", racer.timers[velLabel].value * 3.6)
velocities[velLabel..'_mph'] = string.format("%0.3f", racer.timers[velLabel].value * 2.23694)
end
local poi = {
id = string.format("drag##%s-%s", data._fnWithoutExt or "unknown", lane.shortName or "lane" .. i),
markerInfo = {
@/lua/ge/extensions/util/terrainGenerator.lua
for _, prop in ipairs(materialTextureProperties) do
local field = string.format(prop, map)
if data[field] then
@/lua/ge/extensions/core/vehicles.lua
else
log("E", "", string.format("Cannot parse path %s with regex %s. Can be caused by uncommon characters, subfolders...", dumps(path), dumps(modelRegex)))
end
else
log("E", "", string.format("Cannot parse path %s with regex %s. Can be caused by uncommon characters, subfolders...", dumps(path), dumps(modelRegexPC)))
end
if not model then
log("E", "", string.format("Cannot parse path %s with regex %s. Can be caused by uncommon characters, subfolders...", dumps(path), dumps(modelRegexDir)))
goto continue
if M.couplerTagsOptions[vehCouplerTag] == "autoCouple" then
veh:queueLuaCommand(string.format('beamstate.activateAutoCoupling("%s")', vehCouplerTag))
end
if curFormat ~= "30-15" then
textureTagPrefix = string.format("@licenseplate-%s", curFormat)
end
local paint = validateVehiclePaint(opt.paint)
local color = string.format("%s %s %s %s", paint.baseColor[1], paint.baseColor[2], paint.baseColor[3], paint.baseColor[4])
local metallicPaintData = vehicleMetallicPaintString(paint.metallic, paint.roughness, paint.clearcoat, paint.clearcoatRoughness)
@/lua/ge/extensions/gameplay/discover/discover_037.lua
local parkedVehiclesAmountFromSettings = settings.getValue('trafficParkedAmount')
log("I", "037_limousine", string.format('Halving traffic and parked vehicles from settings: %d -> %d, %d -> %d', trafficAmountFromSettings, math.ceil(trafficAmountFromSettings / 2), parkedVehiclesAmountFromSettings, math.ceil(parkedVehiclesAmountFromSettings / 2)))
-- half traffic for this experience
local windVec = vec3(25+random()*10,0,0)
v:queueLuaCommand('obj:setWind('..string.format('%6f, %6f, %6f', windVec.x, windVec.y, windVec.z)..')')
end
local windVec = vec3(25+random()*10,0,0)
veh:queueLuaCommand('obj:setWind('..string.format('%6f, %6f, %6f', windVec.x, windVec.y, windVec.z)..')')
balls[i] = veh
local windVec = vec3(25+random()*10,0,0)
veh:queueLuaCommand('obj:setWind('..string.format('%6f, %6f, %6f', windVec.x, windVec.y, windVec.z)..')')
end
local windVec = vec3(25+random()*10,0,0)
veh:queueLuaCommand('obj:setWind('..string.format('%6f, %6f, %6f', windVec.x, windVec.y, windVec.z)..')')
end
local planetRadius = 5
local command = string.format('obj:setPlanets({%f, %f, %f, %d, %f})', worldPoint.x, worldPoint.y, worldPoint.z, planetRadius, mass * vehicleSizeFactor * 1)
@/lua/ge/extensions/flowgraph/nodes/gameplay/rally/loop/rallyClock.lua
log('D', logTag, string.format('Cache updated: event=%s, mission=%s, time=%s',
eventName or 'nil', currentMissionId or 'nil',
eventName or 'nil', currentMissionId or 'nil',
scheduledEventTime and string.format('%.2f', scheduledEventTime) or 'nil'))
end
@/inspector/Controllers/TimelineManager.js
{
message = WI.UIString("Timeline Recording Import Error: %s").format(message);
let identifier = this._nextRecordingIdentifier++;
let newRecording = new WI.TimelineRecording(identifier, WI.UIString("Timeline Recording %d").format(identifier), instruments);
@/lua/vehicle/mapmgr.lua
local function requestMap()
obj:queueGameEngineLua(string.format('map.request(%s,%s)', objectId, mapBuildSerial))
end
@/lua/ge/extensions/core/camera.lua
--for i,v in ipairs(runningCamsOrderCache) do
--log("D", "", string.format(" #%i: order=%5.3f, name=%s", i, v.cam.runningOrder, v.name))
--end
if editor and editor.active and editor.showNotification then
editor.showNotification(string.format("Camera Speed: %.2f", camData.speed), nil, "CamSpeed", nil, false)
end
@/inspector/Debug/Bootstrap.js
let inspectionLevel = InspectorFrontendHost.inspectionLevel();
const inspectInspectorToolTip = WI.unlocalizedString("Open Web Inspector [%d]").format(inspectionLevel + 1);
let inspectInspectorToolbarItem = new WI.ButtonToolbarItem("inspect-inspector", inspectInspectorToolTip);
@/lua/ge/extensions/gameplay/rally/loop/speedingDetector.lua
if self.strictMode then
im.TextColored(im.ImVec4(1, 0.3, 0.3, 1), string.format("STRICT MODE (max %d kph over, %.1f%% prob)", self.strictMaxSpeedOver, self.strictMaxProbability * 100))
end
if currentSpeed then
im.Text(string.format("Current Speed: %.1f kph", currentSpeed))
else
local color = isSpeeding and im.ImVec4(1, 0.2, 0.2, 1) or im.ImVec4(1, 1, 1, 1)
im.TextColored(color, string.format("Average Speed: %.1f kph", avgSpeed))
else
local statusText = isPenaltyReady and "" or " (RATE LIMITED)"
im.TextColored(probColor, string.format("Penalty Probability: %.1f%%%s", probability * 100, statusText))
end
-- Penalties info
im.Text(string.format("Total Penalties: %d", #self.penalties))
if self.timeSinceLastPenalty < self.penaltyRateLimit then
if self.timeSinceLastPenalty < self.penaltyRateLimit then
im.Text(string.format("Time Until Penalty Ready: %.1f sec", self.penaltyRateLimit - self.timeSinceLastPenalty))
else
local lastPenalty = self.penalties[#self.penalties]
im.Text(string.format("Last Penalty: %.1f kph avg (%.1f%% prob)",
lastPenalty.averageSpeed, lastPenalty.probability * 100))
-- Sampling info
im.Text(string.format("Sample Rate: %.1f sec", self.sampleRate))
im.Text(string.format("Time Until Next Sample: %.2f sec", self.sampleRate - self.timeSinceLastSample))
im.Text(string.format("Sample Rate: %.1f sec", self.sampleRate))
im.Text(string.format("Time Until Next Sample: %.2f sec", self.sampleRate - self.timeSinceLastSample))
local color = (self.currentLimitKph and sample > self.currentLimitKph) and {1, 0.3, 0.3, 1} or {1, 1, 1, 1}
im.TextColored(im.ImVec4(color[1], color[2], color[3], color[4]), string.format(" [%d] %.1f kph", i + 1, sample))
end
@/lua/vehicle/controller/pneumatics/actuators.lua
-- Create an implicit cross-flow group, as this group did not reference an explicitly-defined one
log("W", "actuators", ("Creating implicit cross-flow group %q for beam group %q"):format(g.crossFlowTag, g.name))
crossFlowGroup = {
if g.enableDebug then
log("W", "actuators", ("[%s] starting increasing sound, fr = %f"):format(g.name, flowRate))
end
if g.enableDebug then
log("W", "actuators", ("[%s] starting decreasing sound, fr = %f"):format(g.name, flowRate))
end
if g.enableDebug and (g.isPlayingIncrease or g.isPlayingDecrease) then
log("W", "actuators", ("[%s] stopping all sound, fr = %f"):format(g.name, flowRate))
end
--log("D", "actuators.init", ("beam %q volume: %f"):format(name, beamVolume))
@/lua/ge/extensions/editor/assemblySpline/splineMgr.lua
local folderNameId = Engine.generateUUID()
newFolder:registerObject(string.format("%s - %s", uniqueName, folderNameId))
scenetree.MissionGroup:addObject(newFolder)
-- Ensure we have a unique assembly spline name.
local baseName = string.format(toolPrefixStr .. " %d", #assemblySplines + 1)
local uniqueName = util.generateUniqueName(baseName, toolPrefixStr)
local newFolder = createObject("SimGroup")
newFolder:registerObject(string.format("%s - %s", uniqueName, id))
scenetree.MissionGroup:addObject(newFolder)
else -- If kit loading failed, log a warning and set empty kit.
log('W', logTag, string.format('Failed to load default kit from path: %s', woodenFencePreset.kitFolderPath))
spline.meshKit = {}
-- Ensure we have a unique assembly spline name.
local baseName = string.format(toolPrefixStr .. " %d", #assemblySplines + 1)
local uniqueName = util.generateUniqueName(baseName, toolPrefixStr)
local newFolder = createObject("SimGroup")
newFolder:registerObject(string.format("%s - %s", uniqueName, spline.id))
scenetree.MissionGroup:addObject(newFolder)
end
log('I', logTag, string.format("Converted %d traced paths to assembly splines. %d paths were too small to import.", #paths, #paths - #assemblySplines))
end
@/lua/ge/extensions/career/modules/log.lua
local function addLog(message, origin, severity)
table.insert(logList, string.format("%d|%s|%s|%s", os.time(), severity or "I", origin or "", message))
end
addLog(string.format("Save game to %s", currentSavePath), "log")
local saveSlot, savePath = career_saveSystem.getCurrentSaveSlot()
addLog(string.format("Loaded game %s", savePath), "log")
end
@/lua/common/extensions/ui/flowgraph/editor.lua
elseif tpe == 'number' then
return (string.format("%0.2f", value))
elseif tpe == 'vec3' then
elseif tpe == 'vec3' then
return (string.format("{%0.1f, %0.1f, %0.1f}", value[1], value[2], value[3]))
elseif tpe == 'quat' then
elseif tpe == 'quat' then
return (string.format("{%0.1f, %0.1f, %0.1f, %0.1f}", value[1], value[2], value[3], value[4]))
elseif tpe == 'color' then
elseif tpe == 'color' then
return (string.format("{%0.1f, %0.1f, %0.1f, %0.1f}", value[1], value[2], value[3], value[4]))
end
elseif tpe == 'number' then
return (string.format("%f", value))
elseif tpe == 'vec3' then
elseif tpe == 'vec3' then
return (string.format("{%f, %f, %f}", value[1], value[2], value[3]))
elseif tpe == 'quat' then
elseif tpe == 'quat' then
return (string.format("{%f, %f, %f, %f}", value[1], value[2], value[3], value[4]))
elseif tpe == 'color' then
elseif tpe == 'color' then
return (string.format("{%f, %f, %f, %f}", value[1], value[2], value[3], value[4]))
end
@/lua/ge/extensions/tech/sensors.lua
}
local serializedData = string.format("extensions.tech_advancedIMU.create(%q)", lpack.encode(data))
be:queueObjectLua(vid, serializedData)
local data = { sensorId = sensorId, isUsingGravity = isUsingGravity }
local serialisedData = string.format("extensions.tech_advancedIMU.setIsUsingGravity(%q)", lpack.encode(data))
be:queueObjectLua(scenetree.findObject(vid):getID(), serialisedData)
local data = { sensorId = sensorId, isVisualised = isVisualised }
local serialisedData = string.format("extensions.tech_advancedIMU.setIsVisualised(%q)", lpack.encode(data))
be:queueObjectLua(scenetree.findObject(vid):getID(), serialisedData)
}
local serializedData = string.format("extensions.tech_GPS.create(%q)", lpack.encode(data))
be:queueObjectLua(vid, serializedData)
local data = { sensorId = sensorId, isVisualised = isVisualised }
local serialisedData = string.format("extensions.tech_GPS.setIsVisualised(%q)", lpack.encode(data))
be:queueObjectLua(scenetree.findObject(vid):getID(), serialisedData)
local data = { sensorId = sensorId, GFXUpdateTime = args.GFXUpdateTime, physicsUpdateTime = args.physicsUpdateTime }
local serializedData = string.format("extensions.tech_powertrainSensor.create(%q)", lpack.encode(data))
be:queueObjectLua(vid, serializedData)
local data = { sensorId = sensorId, GFXUpdateTime = args.GFXUpdateTime, physicsUpdateTime = args.physicsUpdateTime }
local serializedData = string.format("extensions.tech_idealRADARSensor.create(%q)", lpack.encode(data))
be:queueObjectLua(vid, serializedData)
local data = { sensorId = sensorId, GFXUpdateTime = args.GFXUpdateTime, physicsUpdateTime = args.physicsUpdateTime }
local serializedData = string.format("extensions.tech_roadsSensor.create(%q)", lpack.encode(data))
be:queueObjectLua(vid, serializedData)
local data = { sensorId = sensorId, GFXUpdateTime = args.GFXUpdateTime }
local serializedData = string.format("extensions.tech_mesh.create(%q)", lpack.encode(data))
be:queueObjectLua(vid, serializedData)
}
local serializedData = string.format("extensions.tech_validation.create(%q)", lpack.encode(data))
be:queueObjectLua(vid, serializedData)
}
local serializedData = string.format("extensions.tech_tyreBarrier.create(%q)", lpack.encode(data))
be:queueObjectLua(vid, serializedData)
@/lua/ge/extensions/gameplay/rally/tools/rallyToolbox.lua
local txt = '['..waypointTypes.shortenWaypointType(self.selectedPacenoteWaypoint.waypointType)..']'
im.Text(string.format("Selected PacenoteWaypoint: %s%s", self.selectedPacenote.name, txt))
else
local distStr = string.format("%s %.2fkm | veh->%.1fm", pnType, distKm, distToSplit)
-- local distStr = string.format("split %.8f", distFromStart)
local distStr = string.format("%s %.2fkm | veh->%.1fm", pnType, distKm, distToSplit)
-- local distStr = string.format("split %.8f", distFromStart)
debugDrawer:drawTextAdvanced(point.pos, distStr, ColorF(0,0,0,1), true, false, ColorI(255,128,0,255), false, false)
debugDrawer:drawSquarePrism(from.pos, to.pos, Point2F(2,4), Point2F(0,0), ColorF(segClr[1],segClr[2],segClr[3],alpha))
debugDrawer:drawTextAdvanced(from.pos, String(string.format("%s [%s FROM]", fromName, seg.name)), textFg, true, false, ColorI(segClr[1]*255,segClr[2]*255,segClr[3]*255,255))
debugDrawer:drawTextAdvanced(to.pos, String(string.format("%s [%s TO]", toName, seg.name)), textFg, true, false, ColorI(segClr[1]*255,segClr[2]*255,segClr[3]*255,255))
debugDrawer:drawTextAdvanced(from.pos, String(string.format("%s [%s FROM]", fromName, seg.name)), textFg, true, false, ColorI(segClr[1]*255,segClr[2]*255,segClr[3]*255,255))
debugDrawer:drawTextAdvanced(to.pos, String(string.format("%s [%s TO]", toName, seg.name)), textFg, true, false, ColorI(segClr[1]*255,segClr[2]*255,segClr[3]*255,255))
debugDrawer:drawTextAdvanced(projPos,
String(string.format("minSqDist to segment: %.2fm^2", self.lineSegState.minDistSq)),
ColorF(0,0,0,1), true, false,
debugDrawer:drawTextAdvanced(item,
String(string.format("closest route point to wp %.2fm", dist)),
ColorF(0,0,0,1), true, false,
local clrIBg = ColorI(clr[1] * 255, clr[2] * 255, clr[3] * 255, 255)
debugDrawer:drawTextAdvanced(txtPos, String(string.format("%s[%s]%s", pacenoteName, wpType, pacenoteText)), clrFg, true, false, clrIBg)
end
debugDrawer:drawTextAdvanced(item,
String(string.format("closest wp to veh %.2fm", self.kdStatePacenoteWaypoints.dist)),
ColorF(1,1,1,1), true, false,
debugDrawer:drawTextAdvanced(item.pos,
String(string.format("closest route point to veh %.2fm", self.kdStateDrivelineRoute.dist)),
ColorF(0,0,0,1), true, false,
debugDrawer:drawTextAdvanced(wpRp.pos,
String(string.format("next pacenoteWP: %s[%s]", pnName, wpType)),
ColorF(0,0,0,1), true, false,
debugDrawer:drawTextAdvanced(pos,
String(string.format("%0.1f mph", speed * 2.23694)), -- convert m/s to mph
ColorF(1,1,1,1), true, false,
-- debugDrawer:drawTextAdvanced(point.pos,
-- String(string.format("pre_%d", i)),
-- ColorF(i < 10 and 1 or 0, i < 10 and 1 or 0, i < 10 and 1 or 0, 1), true, false,
debugDrawer:drawTextAdvanced(wpRp.pos,
String(string.format("driveline.nextPacenoteWpFromRecalc: %s[%s]", pnName, wpType)),
ColorF(0,0,0,1), true, false,
debugDrawer:drawTextAdvanced(pos,
String(string.format("driveline.lastRecalculateVehiclePos")),
ColorF(0,0,0,1), true, false,
debugDrawer:drawTextAdvanced(point.pos,
String(string.format("driveline.debugNearestRecalcPoint")),
ColorF(0,0,0,1), true, false,
debugDrawer:drawTextAdvanced(wpRp.pos,
String(string.format("driveline.nextRacePathnodeFromRecalc: %s", dr.nextRacePathnodeFromRecalc.name)),
ColorF(0,0,0,1), true, false,
-- debugDrawer:drawTextAdvanced(pos,
-- String(string.format("%dm", completionData.distM)),
-- ColorF(1,1,1,1), true, false, ColorI(0,0,0,255))
-- ColorF(1,1,1,1), true, false, ColorI(0,0,0,255))
local dataStr = string.format("%.3fkm | %.1f%%", completionData.distM / 1000, completionData.distPct * 100)
debugDrawer:drawTextAdvanced(pos,
-- debugDrawer:drawTextAdvanced(point.pos + vec3(0,0,2),
-- String(string.format("recce_driveline_point_%d", i)),
-- ColorF(1,1,1,1), true, false, ColorI(0,0,0,255))
-- debugDrawer:drawTextAdvanced(point.pos + vec3(0,0,2),
-- String(string.format("finalPreRouteInput_%d", i)),
-- ColorF(1,1,1,1), true, false, ColorI(128,0,128,255))
-- debugDrawer:drawTextAdvanced(debugFixStartEnd_p.pos,
-- String(string.format("xnorm: %.2f", debugFixStartEnd_xnorm)),
-- ColorF(0,0,0,1), true, false, ColorI(255,255,0,255))
@/lua/ge/extensions/flowgraph/pin.lua
if type == 'number' then
return string.format('%g', val)
elseif type == 'vec3' then
elseif type == 'vec3' then
return string.format('{%g, %g, %g}', val[1], val[2], val[3])
elseif type == 'color' then
elseif type == 'color' then
return string.format('{%g, %g, %g, %g}', val[1], val[2], val[3], val[4])
elseif type == 'quat' then
elseif type == 'quat' then
return string.format('{%g, %g, %g, %g}', val[1], val[2], val[3], val[4])
elseif type == 'table' then
@/lua/ge/extensions/core/metrics.lua
if M.currentMode == 1 then
lineText = string.format("FPS: %5.1f [Avg %5.1f | Min %5.1f | Max %5.1f%s]", getConsoleNumber("fps::instantaneous"), getConsoleNumber("fps::avg"), getConsoleNumber("fps::min"), getConsoleNumber("fps::max"), rnd == 0 and "" or ", randomness "..rnd.."%")
im.TextUnformatted(lineText)
im.TableNextColumn()
columnText = string.format("FPS:")
if not imguiVisible then table.insert(lineTexts, columnText) end
im.TableNextColumn()
columnText = string.format("%5.1f fps [Unmanaged: %5.1f fps]", getConsoleNumber("fps::instantaneous"), getConsoleNumber("fps::instantaneousUncap"))
if not imguiVisible then table.insert(lineTexts, columnText) end
im.TableNextColumn()
columnText = string.format("Avg")
if not imguiVisible then table.insert(lineTexts, columnText) end
im.TableNextColumn()
columnText = string.format("%5.1f fps", getConsoleNumber("fps::avg"))
if not imguiVisible then table.insert(lineTexts, columnText) end
im.TableNextColumn()
columnText = string.format("10%% Below")
if not imguiVisible then table.insert(lineTexts, columnText) end
im.TableNextColumn()
columnText = string.format("%5.1f fps",getConsoleNumber("fps::p90"))
if not imguiVisible then table.insert(lineTexts, columnText) end
im.TableNextColumn()
columnText = string.format("5%% Below")
if not imguiVisible then table.insert(lineTexts, columnText) end
im.TableNextColumn()
columnText = string.format("%5.1f fps", getConsoleNumber("fps::p95"))
if not imguiVisible then table.insert(lineTexts, columnText) end
im.TableNextColumn()
columnText = string.format("1%% Below")
if not imguiVisible then table.insert(lineTexts, columnText) end
im.TableNextColumn()
columnText = string.format("%5.1f fps", getConsoleNumber("fps::p99"))
if not imguiVisible then table.insert(lineTexts, columnText) end
im.TableNextColumn()
columnText = string.format("Min")
if not imguiVisible then table.insert(lineTexts, columnText) end
im.TableNextColumn()
columnText = string.format("%5.1f fps", getConsoleNumber("fps::min"))
if not imguiVisible then table.insert(lineTexts, columnText) end
im.TableNextColumn()
columnText = string.format("Max")
if not imguiVisible then table.insert(lineTexts, columnText) end
im.TableNextColumn()
columnText = string.format("%5.1f fps", getConsoleNumber("fps::max"))
if not imguiVisible then table.insert(lineTexts, columnText) end
im.TableNextColumn()
columnText = string.format("DT:")
if not imguiVisible then table.insert(lineTexts, columnText) end
im.TableNextColumn()
columnText = string.format("%5.2f ms [Unmanaged: %5.1f ms]", 1000 / getConsoleNumber("fps::instantaneous"), 1000 / getConsoleNumber("fps::instantaneousUncap"))
if not imguiVisible then table.insert(lineTexts, columnText) end
im.TableNextColumn()
columnText = string.format("%5.2f ms", 1000 / (getConsoleNumber("fps::avg")))
if not imguiVisible then table.insert(lineTexts, columnText) end
im.TableNextColumn()
columnText = string.format("%5.2f ms", 1000 / (getConsoleNumber("fps::p90")))
if not imguiVisible then table.insert(lineTexts, columnText) end
im.TableNextColumn()
columnText = string.format("%5.2f ms", 1000 / (getConsoleNumber("fps::p95")))
if not imguiVisible then table.insert(lineTexts, columnText) end
im.TableNextColumn()
columnText = string.format("%5.2f ms", 1000 / (getConsoleNumber("fps::p99")))
if not imguiVisible then table.insert(lineTexts, columnText) end
im.TableNextColumn()
columnText = string.format("%5.2f ms", 1000 / (getConsoleNumber("fps::min")))
if not imguiVisible then table.insert(lineTexts, columnText) end
im.TableNextColumn()
columnText = string.format("%5.2f ms", 1000 / (getConsoleNumber("fps::max")))
if not imguiVisible then table.insert(lineTexts, columnText) end
lineText = string.format("WaitforGPU: %4.2f ms%s", getConsoleNumber("fps::waitForGPU"), rnd == 0 and "" or ", WARNING: RANDOMNESS="..rnd.."%")
local managers = {}
if M.currentMode > 2 then
lineText = string.format("GFX: PolyCount: %d DrawCalls: %d StateChanges: %d RTChanges: %d",
getConsoleNumber("$GFXDeviceStatistics::polyCount"), getConsoleNumber("$GFXDeviceStatistics::drawCalls"), getConsoleNumber("$GFXDeviceStatistics::drawStateChanges"), getConsoleNumber("$GFXDeviceStatistics::renderTargetChanges"))
lineText = string.format("Terrain: Cells: %d Override Cells: %d DrawCalls: %d",
getConsoleNumber("$TerrainBlock::cellsRendered"), getConsoleNumber("$TerrainBlock::overrideCells"), getConsoleNumber("$TerrainBlock::drawCalls"))
lineText = string.format("GroundCover: Cells: %d Billboards: %d Batches: %d Shapes: %d",
getConsoleNumber("$GroundCover::renderedCells"), getConsoleNumber("$GroundCover::renderedBillboards"), getConsoleNumber("$GroundCover::renderedBatches"), getConsoleNumber("GroundCover::renderedShapes"))
lineText = string.format("Forest: Cells: %d Cells Meshed: %d Cells Billboarded: %d Meshes: %d Billboards: %d",
getConsoleNumber("$Forest::totalCells"), getConsoleNumber("$Forest::cellsRendered"), getConsoleNumber("$Forest::cellsBatched"), getConsoleNumber("$Forest::cellItemsRendered"), getConsoleNumber("$Forest::cellItemsBatched"))
lineText = string.format("Shadow: Active: %d Updated: %d PolyCount: %d DrawCalls: %d StateChanges: %d RTChanges: %d",
getConsoleNumber("$ShadowStats::activeMaps"), getConsoleNumber("$ShadowStats::updatedMaps"), getConsoleNumber("$ShadowStats::polyCount"), getConsoleNumber("$ShadowStats::drawCalls"), getConsoleNumber("$ShadowStats::drawStateChanges"), getConsoleNumber("$ShadowStats::rtChanges"))
lineText = string.format("LightManager: Active: %d Updated: %d Elapsed Ms: %5.2f",
getConsoleNumber("$BasicLightManagerStats::activePlugins"), getConsoleNumber("$BasicLightManagerStats::shadowsUpdated"), getConsoleNumber("$BasicLightManagerStats::elapsedUpdateTime") * 1000)
lineText = string.format("Deferred Lights: Active: %d Culled: %d",
getConsoleNumber("$lightMetrics::activeLights"), getConsoleNumber("$lightMetrics::culledLights"))
@/lua/vehicle/extensions/tech/CANBus/ProjectBavariaShifter.lua
end
--print(string.format("Lever: %s, Park: %s", leverStateLookup[leverState], parkButtonLookup[parkButtonState]))
lastLeverState = leverState
@/lua/ge/extensions/editor/missionEditor.lua
local function getMissionDateOrNone(mission) return mission.date and os.date('%Y-%m-%d', mission.date) or "No Date Set!" end
local function getMissionBranchOrNone(mission) return string.format("%s", mission.careerSetup.skill or "No Skill") end
local function groupMissionsByFunction(missions, propertyFunction)
local id = string.format("%s/%s/%03d-%s", level, newMissionData.type, sameTypeLevelCount, name)
newMissionData.id = im.ArrayChar(1024, id)
for _, elem in ipairs(translation) do
table.insert(translationStrings,string.format(' "%s": "%s"', elem.key, elem.value))
end
local missionType = mission.missionType
dump(string.format("%s - %s", mission.careerSetup.skill, mission.id))
if mission.careerSetup.showInCareer and validSkills[mission.careerSetup.skill] then
if mission.careerSetup.showInCareer and validSkills[mission.careerSetup.skill] then
dump(string.format("%s - %s", mission.name, mission.id))
mission.startTrigger = {}
if validXP == "(none)" then
print(string.format(" > Skipped mission %s: invalid XP via %s", shortId, mission.careerSetup.skill))
else
if validXP ~= reward.attributeKey then
print(string.format("For mission %s: removed %s (only allowed XP is %s via %s)", shortId, reward.attributeKey, validXP, mission.careerSetup.skill))
mission._dirty = true
else
print(string.format("For mission %s: removed %s (duplicate)", shortId, reward.attributeKey))
mission._dirty = true
else
print(string.format("For mission %s: removed %s", shortId, reward.attributeKey))
mission._dirty = true
if not hasAddedValidXP and invalidXP then
print(string.format(" ! For mission %s: Fixing To %s (from %s)", shortId, validXP, invalidXP.attributeKey))
invalidXP.attributeKey = validXP
for _, elem in ipairs(finalList) do
table.insert(translationStrings,string.format('"%s": "%s"', elem.key, elem.value))
translationJson[elem.key] = elem.value
copyPastaLength = 100000,
translationKeyPtr = im.ArrayChar(1000,string.format("missions.%s.%s.%s",clickedMission.missionType, level, shortId)),
translationKeyLength = 1000
end
translationData.translationKeyPtr = im.ArrayChar(1000,string.format("missions.%s.%s.%s",level, clickedMission.missionType, shortId))
end
@/lua/vehicle/input.lua
long = long or string.match(wheelName, "^([FR]+)")
--print(string.format("/ Splitting '%10s' into long: '%5s', side: '%5s' .", wheelName, long, side))
long = long and long:sub(1, 1) or long
side = side and side:sub(1, 1) or side
--print(string.format("\\_ Splitting '%10s' into long: '%5s', side: '%5s' .", wheelName, long, side))
return long, side
if debug then
print(string.format("----- '%s' = %s, %s", wd1.name, long1, side1))
end
if debug then
print(string.format(" * '%s' = %s, %s", wd2.name, long2, side2))
end
if debug then
print(string.format(" - '%s' = %s, %s", wd2.name, long2, side2))
end
end
print(string.format("front wheel '%s' has these rear wheels: %s", namef, dumps(namesr)))
end
if filter ~= M.lastFilterType then
obj:queueGameEngineLua(string.format('extensions.telemetry_core.startActivity("controlsUsed", {method = "%s"})', FILTER_NAME[filter]))
M.lastFilterType = filter
@/inspector/Views/JSONResourceContentView.js
} catch (e) {
this.showMessage(WI.UIString("Unable to parse as JSON: %s").format(e.message));
return;
if (error || wasThrown) {
this.showMessage(WI.UIString("Unable to parse as JSON: %s").format(result.description));
return;
@/lua/ge/extensions/gameplay/traffic/trafficUtils.lua
if M.debugMode then
log('I', logTag, string.format('Spawn search params: minDist = %d, maxDist = %d, targetDist = %d', minDist, maxDist, targetDist))
end
if M.debugMode then
log('I', logTag, string.format('Spawn point found at distance: %d', math.floor(spawnData.pos:distance(startPos))))
end
if M.debugMode then
log('I', logTag, string.format('Spawn search params: minDist = %d, maxDist = %d, targetDist = %d', minDist, maxDist, targetDist))
end
if M.debugMode then
log('I', logTag, string.format('Spawn point found at distance: %d', math.floor(spawnData.pos:distance(startPos))))
end
if M.debugMode then
log('I', logTag, string.format('Spawn search params: minDist = %d, maxDist = %d, targetDist = %d', minDist, maxDist, targetDist))
end
if route.path[1] then
log('I', logTag, string.format('Spawn search route length: %0.2f', route.path[1].distToTarget))
else
if M.debugMode then
log('I', logTag, string.format('Spawn point found at distance: %d', math.floor(spawnData.pos:distance(startPos))))
end
@/lua/ge/extensions/freeroam/dragRace.lua
-- Three decimal points for time
for num in string.gmatch(string.format("%.3f", finishTime), "%d") do
table.insert(timeDisplayValue, num)
-- Two decimal points for speed
for num in string.gmatch(string.format("%.2f", finishSpeed), "%d") do
table.insert(speedDisplayValue, num)
@/lua/ge/extensions/gameplay/rally/snaproad/geoPacenotes.lua
prefix = prefix or ""
local arcLengthText = string.format("Length: %.0fm", arcLength)
if diameter and fitQuality and angleDegrees then
if diameter and fitQuality and angleDegrees then
arcLengthText = string.format("%sLength: %.0fm | Diameter: %.0fm | Angle: %.0f° | Fit: %.3f", prefix, arcLength, diameter, angleDegrees, fitQuality)
elseif diameter and angleDegrees then
elseif diameter and angleDegrees then
arcLengthText = string.format("%sLength: %.0fm | Diameter: %.0fm | Angle: %.0f°", prefix, arcLength, diameter, angleDegrees)
elseif diameter and fitQuality then
elseif diameter and fitQuality then
arcLengthText = string.format("%sLength: %.0fm | Diameter: %.0fm | Fit: %.3f", prefix, arcLength, diameter, fitQuality)
elseif diameter then
elseif diameter then
arcLengthText = string.format("%sLength: %.0fm | Diameter: %.0fm", prefix, arcLength, diameter)
elseif fitQuality then
elseif fitQuality then
arcLengthText = string.format("%sLength: %.0fm | Fit: %.3f", prefix, arcLength, fitQuality)
else
else
arcLengthText = string.format("%sLength: %.0fm", prefix, arcLength)
end
-- Draw radius text at center point
-- local radiusText = string.format("Diameter: %.0fm", diameter)
-- local textPos = vec3(center.x, center.y, center.z)
@/lua/common/libs/luasocket/socket/mime.lua
local function format(chunk)
if chunk then
@/lua/ge/extensions/editor/assemblySpline/molecule.lua
else
log('W', logtag, string.format("Anchor point [%s] not found in mesh: [%s]", anchorName, meshPath))
end
else
log('W', logtag, string.format("Invalid point type [%s] in anchor: [%s]", pointType, anchorName))
end
else
log('W', logtag, string.format("Invalid anchor point format: [%s]", anchorName))
end
else
log('W', logtag, string.format("Nail and aux vectors are collinear in join [%s] in mesh: [%s]", joinName, meshPath))
end
else
log('W', logtag, string.format("Invalid vectors in three-point join [%s] in mesh: [%s]", joinName, meshPath))
end
else
log('W', logtag, string.format("Three-point join [%s] missing 'head' anchor in mesh: [%s]", joinName, meshPath))
end
else
log('W', logtag, string.format("Nail vector too short in join [%s] in mesh: [%s]", joinName, meshPath))
end
else
log('W', logtag, string.format("Join [%s] missing required 'point' anchor in mesh: [%s]", joinName, meshPath))
end
if sourceMatchCtr ~= targetMatchCtr then -- Validation of source and target matches.
log('W', logtag, string.format("Bridge [%s] has different number of source and target matches: [%d] vs [%d]",
bridge.mesh.fileName, sourceMatchCtr, targetMatchCtr))
@/lua/vehicle/controller/gauges/customModules/navigationData.lua
gaugeHTMLTexture = htmlTexture
obj:queueGameEngineLua(string.format('extensions.ui_uiNavi.requestVehicleDashboardMap(%q, "initMap", %d)', gaugeHTMLTexture.webViewTag, obj:getID()))
end
@/lua/ge/extensions/scenario/speedGoal.lua
if minutes > 0 then
timeStr = string.format("%02.0f:%05.2f", minutes, seconds)
else
else
timeStr = string.format("%0.2f", seconds) .. 's'
end
@/lua/ge/extensions/ui/apps/minimap/additionalInfo.lua
oldDistToTarget = distToTarget
additionalInfo.distToTarget = string.format("%.1f %s", distToTarget, unit)
hasNewAdditionalInfo = true
@/lua/ge/extensions/editor/vizHelper.lua
im.Separator()
im.Text("object: " .. tostring(mouseHit.object:getId() .. ' in ' .. string.format('%0.2f', mouseHit.distance) .. 'm'))
@/lua/vehicle/extensions/escCalibration.lua
for _, v in pairs(testResults) do
filePivot:write(string.format("%s,%s,%s,%s,%s,%s,%s,%s\r\n", v.speed, v.angle, v.stiffnessFront, v.stiffnessRear, v.stiffnessFront / v.stiffnessRear, v.gForce, v.floatAngle, v.test))
end
@/lua/ge/extensions/editor/rallyEditor/pacenotes.lua
-- local styleData = recce.settings:getCornerCallStyle()
-- log('D', logTag, string.format('_loadSnaproadRoute missionId=%s missionDir=%s missionName=%s', missionId, missionDir, missionName))
-- local rallyManager = RallyManager(missionDir, missionId)
log('D', logTag, string.format('generateElevationProfile missionId=%s missionDir=%s', missionId, missionDir))
if elevationProfile and #elevationProfile > 0 then
log('I', logTag, string.format('generated elevation profile with %d points', #elevationProfile))
else
@/lua/vehicle/powertrain/combustionEngine.lua
obj:queueGameEngineLua(string.format("core_sounds.initEngineSound(%d,%d,%q,%s,%f,%f)", objectId, soundID, samplePath, serialize(engineNodeIDs), offLoadGain, onLoadGain))
end
obj:queueGameEngineLua(string.format("core_sounds.initExhaustSound(%d,%d,%q,%s,%f,%f)", objectId, soundID, samplePath, serialize(exhaustNodeIDPairs), offLoadGain, onLoadGain))
end
obj:queueGameEngineLua(string.format("core_sounds.setExhaustSoundNodes(%d,%d,%s)", objectId, soundID, serialize(exhaustNodeIDPairs)))
end
params[paramName] = paramValue
obj:queueGameEngineLua(string.format("core_sounds.setEngineSoundParameter(%d,%d,%q,%f)", objectId, soundID, paramName, paramValue))
end
device.soundConfiguration[reference].soundID = soundID
obj:queueGameEngineLua(string.format("core_sounds.setEngineSoundParameterList(%d,%d,%s)", objectId, soundID, serialize(params)))
-- Audio Debug (engine)
-- print (string.format(" ENGINE idleRPM = %4.0f / maxRPM = %5.0f", jbeamData.idleRPM, jbeamData.maxRPM))
-- print (string.format(" ENGINE idleRPM = %4.0f / limiterRPM = %5.0f / maxRPM = %5.0f", jbeamData.idleRPM, jbeamData.revLimiterRPM, jbeamData.maxRPM))
-- print (string.format(" ENGINE idleRPM = %4.0f / maxRPM = %5.0f", jbeamData.idleRPM, jbeamData.maxRPM))
-- print (string.format(" ENGINE idleRPM = %4.0f / limiterRPM = %5.0f / maxRPM = %5.0f", jbeamData.idleRPM, jbeamData.revLimiterRPM, jbeamData.maxRPM))
-- print (string.format("%s / maingain %4.2fdB / Muffling %.2f / onLoadGain %.2f / offLoadGain %.2f / lowShelf %.0f %4.2fdB / highShelf %4.0f %.2fdB / eqLow %.0f %.2fdB/ eqHigh %4.0f %.2fdB / eqFundamental %.2fdB", sampleName, main_gain, intakeMuffling, onLoadGain, offLoadGain, eq_a_freq, eq_a_gain, eq_b_freq, eq_b_gain, eq_c_freq, eq_c_gain, eq_d_freq, eq_d_gain, eq_e_gain))
-- print (string.format(" ENGINE idleRPM = %4.0f / limiterRPM = %5.0f / maxRPM = %5.0f", jbeamData.idleRPM, jbeamData.revLimiterRPM, jbeamData.maxRPM))
-- print (string.format("%s / maingain %4.2fdB / Muffling %.2f / onLoadGain %.2f / offLoadGain %.2f / lowShelf %.0f %4.2fdB / highShelf %4.0f %.2fdB / eqLow %.0f %.2fdB/ eqHigh %4.0f %.2fdB / eqFundamental %.2fdB", sampleName, main_gain, intakeMuffling, onLoadGain, offLoadGain, eq_a_freq, eq_a_gain, eq_b_freq, eq_b_gain, eq_c_freq, eq_c_gain, eq_d_freq, eq_d_gain, eq_e_gain))
-- Audio Debug (exhaust)
-- print (string.format("%s / maingain %4.2fdB / Muffling %.2f / onLoadGain %.2f / offLoadGain %.2f / lowShelf %.0fhz %4.2fdB / highShelf %4.0fhz %.2fdB / eqLow %.0fhz %.2fdB/ eqHigh %4.0fhz %.2fdB / eqFundamental %.2fdB ",sampleName, main_gain, exhaustMuffling, onLoadGain, offLoadGain, eq_a_freq, eq_a_gain, eq_b_freq, eq_b_gain, eq_c_freq, eq_c_gain, eq_d_freq, eq_d_gain, eq_e_gain))
table.insert(rawBasePoints, {v.rpm, v.torque})
-- print (string.format("RPM = %5.0f, TORQUE = %4.0f", v.rpm, v.torque))
end
--local command = "obj:queueGameEngineLua(string.format('scenarios.getScenario().wheelDataCallback(%s)', serialize({wheels.wheels[0].absActive, wheels.wheels[0].angularVelocity, wheels.wheels[0].angularVelocityBrakeCouple}))"
@/lua/vehicle/extensions/tech/advancedIMU.lua
local rawReadingsData = { sensorId = sensorId, reading = data.rawReadings }
obj:queueGameEngineLua(string.format("tech_sensors.updateAdvancedIMULastReadings(%q)", lpack.encode(rawReadingsData)))
local adHocData = { requestId = adHocRequestId, reading = data.rawReadings }
obj:queueGameEngineLua(string.format("tech_sensors.updateAdvancedIMUAdHocRequest(%q)", lpack.encode(adHocData)))
end
@/lua/ge/extensions/tech/techCore.lua
if filename:find('/scenarios/') and filename:find('.json') then
log('D', logTag, string.format('Scenario file \'%s\' changed, refreshing scenario cache.', v.filename))
refreshScenarioList()
if request.protocolVersion ~= tcom.protocolVersion then
log('E', logTag, string.format([[Mismatching BeamNGpy protocol versions. Please ensure both BeamNG.tech and BeamNGpy are using the desired versions. BeamNGpy's is: %s, BeamNG.tech's is: %s]],
tostring(request.protocolVersion), tostring(tcom.protocolVersion)))
]]
veh:queueLuaCommand(string.format(command, lpack.encode(tech_techCapture.export())))
end
local skipServer = server == nil
command = string.format('tech_techCore.startConnection(\'%s\', %s)', tcomParams.ip, tostring(skipServer))
veh:queueLuaCommand(command)
if scenario == nil then
request:sendBNGValueError(string.format('Scenario \'%s\' not found.', sourceFile))
return false
sensors[sensorType][sensorName] = sensorId
log('D', logTag, string.format('Created sensor %d of type \'%s\' with name \'%s\'', sensorId, sensorType, sensorName))
end
sensorsOfType[name] = nil
log('D', logTag, string.format('Removed sensor %d of type \'%s\' with name \'%s\'', sensorId, sensorType, name))
return
@/lua/ge/simTimeAuthority.lua
if times < 2 and times ~= rounded then
times = string.format("%.2f", 1/speed)
else
pauseCounter = pauseCounter + 1
log("D","simTimeAuthority", string.format("pushPauseRequest id: %s, pauseCounter: %d", id, pauseCounter))
pause(true)
pauseCounter = math.max(0, pauseCounter - 1)
log("D","simTimeAuthority", string.format("popPauseRequest id: %s, pauseCounter: %d", id, pauseCounter))
if pauseCounter == 0 and not wasPausedBeforePushRequest then
@/lua/ge/extensions/flowgraph/states.lua
for _, t in ipairs(self.queuedTransitions) do
log("D","",string.format("Resolving %d -> %s", t.sourceStateId or -1, t.transitionName or ""))
local sourceState = self.states[t.sourceStateId]
@/lua/ge/extensions/c2/panelPlugins/tileManager.lua
local function getCachedTileData(tx, ty)
local key = string.format("%d_%d", tx, ty)
if not activeTileCache[key] then
debugDrawer:drawTextAdvanced(vec3(worldX+tileSize/2, worldY+tileSize/2, z),
String(string.format("Tile %d,%d\nObj: %d\nDec: %d\nMrk: %d\nFor: %d\nAI: %d",
tx, ty, #data.objects, #data.decals, #data.roadMarkings, #data.forestItems, #data.aiNodes)),
local tx, ty = getTileIndices(pos.x, pos.y, tileIndexMeta.tileSize)
local tileSizeText = string.format("%dm", tileIndexMeta.tileSize)
im.Text(string.format("Current Tile: %d, %d (Size: %s)", tx, ty, tileSizeText))
local tileSizeText = string.format("%dm", tileIndexMeta.tileSize)
im.Text(string.format("Current Tile: %d, %d (Size: %s)", tx, ty, tileSizeText))
im.TableNextColumn() im.Text(tostring(#data.aiNodes))
im.TableNextColumn() im.Text(string.format("%.1f", data.metadata.sizeKB or 0))
@/lua/vehicle/controller/beamNavigator.lua
htmlTexture.create(screenMaterialName, htmlFilePath, textureWidth, textureHeight, textureFPS, "automatic")
obj:queueGameEngineLua(string.format("extensions.ui_uinavi.requestVehicleDashboardMap(%q, nil, %d)", screenMaterialName, obj:getID()))
if jbeamData.bootscreenImage then
@/lua/ge/extensions/editor/vehicleEditor/liveEditor/vePropTransformer.lua
local text = string.format("mesh: %s | func: %s | node: %s | partPath: %s", prop.mesh, prop.func, node.name or node.cid, prop.partPath)
local color = state.propSelectorIdx == id and textRedColor or textWhiteColor
local text = string.format("mesh: %s | func: %s | node: %s | partPath: %s", prop.mesh, prop.func, propRefNode.name or propRefNode.cid, prop.partPath)
local btgX, btgY, btgZ, btgRx, btgRy, btgRz = baseTransformGlobalDataNoNodeTransformData.x, baseTransformGlobalDataNoNodeTransformData.y, baseTransformGlobalDataNoNodeTransformData.z, baseTransformGlobalDataNoNodeTransformData.rx, baseTransformGlobalDataNoNodeTransformData.ry, baseTransformGlobalDataNoNodeTransformData.rz
im.Text(string.format("(%0.3f, %0.3f, %0.3f) baseTranslationGlobal W/O nodeRotate/Offset/Move", btgX, btgY, btgZ))
im.SameLine()
if im.Button("Copy to Clipboard") then
local copyText = string.format('"x":%0.3f, "y":%0.3f, "z":%0.3f', btgX, btgY, btgZ)
im.SetClipboardText(copyText)
end
im.Text(string.format("(%0.3f, %0.3f, %0.3f) baseRotationGlobal W/O nodeRotate", btgRx * 180.0 / math.pi, btgRy * 180.0 / math.pi, btgRz * 180.0 / math.pi))
im.SameLine()
if im.Button("Copy to Clipboard") then
local copyText = string.format('"x":%0.3f, "y":%0.3f, "z":%0.3f', btgRx * 180.0 / math.pi, btgRy * 180.0 / math.pi, btgRz * 180.0 / math.pi)
im.SetClipboardText(copyText)
@/lua/ge/extensions/editor/drivePathEditor/record.lua
local spline = splines[#splines]
spline.name = string.format("Recorded_%s", recordingVehicleName)
@/lua/vehicle/controller/braking/compressionBrake.lua
compressionBrakeCoef = clamp(coef, 0, 1)
guihooks.message(string.format("Compression Brake: %d%%", compressionBrakeCoef * 100), 5, "vehicle.compressionBrake." .. controlledEngine.name)
end
--TODO fix
log("E", "compressionBrake.init", string.format("Can't find requested engine with name: %q, compression brake controls won't work!", engineName))
M.updateGFX = nop
@/lua/ge/extensions/ui/vehicleSelector/tileClustering.lua
return {
key = string.format("%s_%s_%s", group.key, model.model.key .. (subModel or ""), previewConfig or ""),
name = name,
return {
key = string.format("%s_%s_%s", group.key, model.model.key, previewConfig or ""),
name = name,
@/lua/ge/extensions/editor/dynamicDecals/notification.lua
if im.CollapsingHeader1(string.format("%s##NotificationSection", sectionName), im.TreeNodeFlags_DefaultOpen) then
for k, notification in ipairs(sectionData) do
for k, notification in ipairs(sectionData) do
if editor.uiIconImageButton(editor.icons.delete, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, string.format("%s_%d", sectionName, k)) then
table.remove(notifications[sectionName], k)
if msgtype == 'string' then
im.TextColored(colors[notification.level].Value, string.format("%s - %s", notification.title, notification.msg))
elseif msgtype == 'function' then
@/lua/ge/extensions/gameplay/rallyLoop.lua
-- create:
-- local veh = be:getPlayerVehicle(0); if veh then local pos = veh:getPosition(); local rot = veh:getRotation(); print(string.format("be:getPlayerVehicle(0):setPositionRotation(%f, %f, %f, %f, %f, %f, %f)", pos.x, pos.y, pos.z, rot.x, rot.y, rot.z, rot.w)) end
local mgr = rallyLoopManager
log('D', logTag, string.format('rallyLoop onAnyMissionWillChange mgr=%s, state=%s, mission=%s, abandoned=%s', tostring(not not mgr), state, mission and mission.id or 'nil', tostring(abandoned)))
if mgr then
@/lua/ge/suspensionFrequencyTester.lua
if imgui.BeginTable("CategoryTable_"..node.name, 3, imgui.TableFlags_Borders + imgui.TableFlags_SizingFixedFit) then
imgui.TableSetupColumn(string.format("%s Suspension", node.name), imgui.TableColumnFlags_WidthFixed, 160)
imgui.TableSetupColumn("Freq", imgui.TableColumnFlags_WidthFixed, 60)
imgui.TableNextColumn()
imgui.Text(string.format("%.1f Hz", entry[2]))
imgui.TableNextColumn()
local b = 0.4
imgui.TextColored(imgui.ImVec4(r, g, b, 1), string.format("%i m/Hz", sumPerHz))
end
local color = (i % 2 == 0) and imgui.ImVec4(1, 1, 1, 1) or imgui.ImVec4(0.6, 0.6, 0.6, 1)
imgui.TextColored(color, string.format("%.2fHz", freq))
end
@/lua/vehicle/controller/pneumatics/airbrakes.lua
local brakeTorque = wd.brakeTorque * brakeCoef
--log("D", "airbrakes.updateWheelBrake", string.format("returning %.2fNm/%.2fNm for wheel %q with service: %.2f and park: %.2f", brakeTorque, wd.brakeTorque, wd.name, brakeTorqueCoef, springTorqueCoef))
return brakeTorque
local brakeTorque = wd.brakeTorque * brakeCoef
--log("D", "airbrakes.updateWheelBrake", string.format("returning %.2fNm/%.2fNm for wheel %q with service: %.2f and park: %.2f", brakeTorque, wd.brakeTorque, wd.name, brakeTorqueCoef, springTorqueCoef))
return brakeTorque
@/lua/ge/extensions/editor/assetDeduplicator.lua
im.SameLine()
im.Text(("Selected: %d"):format(countSelected()))
elseif compareFilesJob and compareFilesJob.finished and compareFilesJob.matchCount and compareFilesJob.matchSize and compareFilesJob.matches then
im.Text("It's possible to remove "..compareFilesJob.matchCount.." files.\nThis will reduce level file size by "..string.format("%.2f MB", (tonumber(compareFilesJob.matchSize) or 0)/1048576)..".")
local popupData = {}
@/lua/ge/client/postFx/lightRay.lua
local resolutionScale = TorqueScriptLua.getVar("$LightRayPostFX::resolutionScale")
local targetScale = string.format("%s %s", resolutionScale, resolutionScale)
lightRayPostFX:setField("targetScale", 0, targetScale)
@/lua/ge/extensions/gameplay/rally/util.lua
local function getCompositorFile(compositorVoice, basename)
local path = string.format('/lua/ge/extensions/gameplay/rally/compositors/%s/%s', compositorVoice, basename)
return path
if includeTenths then
timeStr = string.format("%02d:%02d:%02d.%d", hours24, minutes, seconds, tenths)
else
else
timeStr = string.format("%02d:%02d:%02d", hours24, minutes, seconds)
end
else
timeStr = string.format("%02d:%02d", hours24, minutes)
end
if includeTenths then
timeStr = string.format("%02d:%02d:%02d.%d", hours12, minutes, seconds, tenths)
else
else
timeStr = string.format("%02d:%02d:%02d", hours12, minutes, seconds)
end
else
timeStr = string.format("%02d:%02d", hours12, minutes)
end
@/lua/ge/extensions/gameplay/parking.lua
if M.debugLevel > 0 then
log("I", logTag, string.format("Teleported vehId %d to parking spot %d", vehId, parkingSpot.id))
end
if M.debugLevel > 0 then
log("I", logTag, string.format("Found and validated %d parking spots in area", #psList))
end
if M.debugLevel > 0 then
log("I", logTag, string.format("Filtered and accepted %d / %d parking spots", #psList, psCount))
end
local amount, activeAmount = getParkedCarsAmount(), getParkedCarsAmount(true)
log('I', logTag, string.format('Parking system started with %d active / %d total vehicles', activeAmount, amount))
end
@/lua/ge/extensions/gameplay/crawl/boundary.lua
log('D', logTag, string.format('Built quadtree with %d objects, bounds: %.1f x %.1f',
#boundaryObjects, maxX - minX, maxY - minY))
obj:setScale(vec3(currentScale, currentScale, currentScale))
obj:setField('instanceColor', 0, string.format('1 1 1 %.2f', currentAlpha))
end
obj:setField('instanceColor', 0, string.format('1 1 1 %.2f', currentAlpha))
end
log('D', logTag, string.format('Spawned %d boundary markers along crawl boundary', #points))
return spawnedBoundaryMarkersId
crawlerExitPoints[crawler.id] = vec3(vehPos)
log('D', logTag, string.format('Crawler %s exited boundary at %f, %f, %f', crawler.id, vehPos.x, vehPos.y, vehPos.z))
else
crawlerDNFApplied[crawler.id] = true
log('D', logTag, string.format('Applied DNF penalty for crawler %s - center point %f meters from exit point', crawler.id, distanceFromExit))
end
crawlerExitPoints[crawler.id] = vec3(corner)
log('D', logTag, string.format('Crawler %s exited boundary at corner %f, %f, %f', crawler.id, corner.x, corner.y, corner.z))
else
crawlerDNFApplied[crawler.id] = true
log('D', logTag, string.format('Applied DNF penalty for crawler %s - all %d wheels outside and %f meters from exit point', crawler.id, totalCorners, maxDistanceFromExit))
end
gameplay_crawl_utils.onBoundaryViolation(crawler.id)
log('D', logTag, string.format('Boundary violation penalty for crawler %s - %d/%d corners outside', crawler.id, outsideCorners, totalCorners))
end
crawlerDNFApplied[crawlerId] = nil
log('D', logTag, string.format('Cleared exit point and DNF flag for crawler %s', crawlerId))
end
visibilityRadius = radius or 200
log('D', logTag, string.format('Set boundary markers visibility radius to %d meters', visibilityRadius))
end
log('D', logTag, string.format('Set animation timing: duration=%.1fs, fadeIn=%.1fs, fadeOut=%.1fs, scaleUp=%.1fs',
animationDuration, fadeInDuration, fadeOutDuration, scaleUpDuration))
@/lua/ge/extensions/gameplay/crawl/general.lua
local poi = {
id = string.format("crawl##%s", trail._fileName or "trail"),
data = { type = "crawl", trailId = trail._filePath },
if trailStats and trailStats.bestPenaltyPoints < math.huge then
poi.markerInfo.bigmapMarker.description = poi.markerInfo.bigmapMarker.description .. "\n" .. string.format("Best Penalty Points: %d", trailStats.bestPenaltyPoints)
end
keyLabel = "Distance",
valueLabel = string.format("%.1f m", pathStats.totalDistance)
})
keyLabel = "Elevation Gain",
valueLabel = string.format("%.1f m", pathStats.elevationGain)
})
keyLabel = "Elevation Loss",
valueLabel = string.format("%.1f m", pathStats.elevationLoss)
})
keyLabel = "Best Penalty Points",
valueLabel = string.format("%d", trailStats.bestPenaltyPoints)
})
keyLabel = "Best Time",
valueLabel = string.format("%.2fs", trailStats.bestTime)
})
@/lua/ge/extensions/gameplay/missions/poiTest.lua
for _, ps in ipairs(gameplay_sites_sitesManager.loadSites("gameplay/parkingSpotTests.sites.json").parkingSpots.sorted) do
local id = string.format("Test-PS-%d", ps.id)
table.insert(elements, {
@/lua/ge/extensions/editor/mainToolbar.lua
if im.Button("New Set") then
local newSetName = string.format("Edit Mode Set %d", #editModeSets + 1)
addEditModeSet(newSetName)
@/inspector/Views/HeapSnapshotInstanceDataGridNode.js
node.shortestGCRootPath((gcRootPath) => {
let text = WI.UIString("Heap Snapshot Object (%s)").format("@" + node.id);
let addSpecialUserLogClass = !gcRootPath.length;
title.classList.add("title");
let localizedString = WI.UIString("Shortest property path to %s").format("@@@");
let [before, after] = localizedString.split(/\s*@@@\s*/);
@/lua/ge/extensions/editor/flowgraph/properties.lua
local viewPos = im.ImVecPtrDeref(graph.viewPos)
im.Text(string.format("%0.1f / 0.1f", viewPos.x, viewPos.y))
im.NextColumn()
im.NextColumn()
im.Text(string.format("%0.1f", graph.viewZoom[0]))
im.NextColumn()
@/inspector/Views/TimelineRecordTreeElement.js
if (timelineRecord.details.repeating)
alternateSubtitle.textContent = WI.UIString("%s interval").format(timeoutString);
else
else
alternateSubtitle.textContent = WI.UIString("%s delay").format(timeoutString);
}
@/lua/ge/extensions/util/screenshotCreator.lua
im.PushStyleColor2(im.Col_Text, imVec4Yellow)
im.TextWrapped(string.format("Correct size for vehicles thumbnails are 500 * 281 and you have chosen %i * %i", getCurrentResolution()[1], getCurrentResolution()[2]))
im.PopStyleColor()
im.TextUnformatted('Final resolution: ' .. tostring(x) .. ' x ' .. tostring(y))
im.TextUnformatted('Megapixel = ' .. string.format('%0.2f', x * y / 1000000))
local rawSize = x * y * 3 -- RGB = 3 byte
end
im.tooltip(string.format("Click to set camera to '%s' config's camera", configData.key))
else
@/lua/ge/extensions/editor/decalSpline/populate.lua
local newFolder = createObject("SimGroup")
newFolder:registerObject(string.format("%s - %s", uniqueName, folderNameId))
scenetree.MissionGroup:addObject(newFolder)
@/lua/ge/extensions/editor/assetBrowser.lua
end
return string.format((index > 1) and "%0.1f %s" or "%0.0f %s", filesize, var.fileSizeAbbreviations[index])
end
newObj.useInstanceRenderData = true
newObj:setField('instanceColor', 0, string.format("%g %g %g %g", 1, 1, 1, 1))
newObj:setField('collisionType', 0, "Collision Mesh")
var.dragDropMesh.useInstanceRenderData = true
var.dragDropMesh:setField('instanceColor', 0, string.format("%g %g %g %g", 1, 1, 1, 1))
var.dragDropMesh:setField('collisionType', 0, "Collision Mesh")
var.dragDropRotation = var.dragDropRotation + (var.io.MouseWheel * var.options.dragDropRotationMultiplier)
var.dragDropMesh:setField('rotation', '0', string.format( "%f %f %f %f", 0, 0, 1, var.dragDropRotation))
end
im.TextUnformatted("Loading assets (" .. tostring(var.assetsProcessed) .. "/" .. tostring(var.numberOfAllAssetsAndDirs) ..")")
im.TextUnformatted(string.format("%0.2f",(var.assetsProcessed/var.numberOfAllAssetsAndDirs)*100) .. '%')
end
-- Displayed text and their width
local numberOfDirsText = string.format('Folders: %d', var.filteredDirsCount)
local numberOfDirsTextWidth = im.CalcTextSize(string.format('Folders: %d', var.filteredDirsCount)).x
local numberOfDirsText = string.format('Folders: %d', var.filteredDirsCount)
local numberOfDirsTextWidth = im.CalcTextSize(string.format('Folders: %d', var.filteredDirsCount)).x
local numberOfDirsTextTruncated = string.format('F: %d', var.filteredDirsCount)
local numberOfDirsTextWidth = im.CalcTextSize(string.format('Folders: %d', var.filteredDirsCount)).x
local numberOfDirsTextTruncated = string.format('F: %d', var.filteredDirsCount)
local numberOfDirsTextTruncatedWidth = im.CalcTextSize(string.format('F: %d', var.filteredDirsCount)).x
local numberOfDirsTextTruncated = string.format('F: %d', var.filteredDirsCount)
local numberOfDirsTextTruncatedWidth = im.CalcTextSize(string.format('F: %d', var.filteredDirsCount)).x
local numberOfAssetsText = string.format('Assets: %d', var.filteredAssetsCount)
local numberOfAssetsTextWidth = im.CalcTextSize(string.format('Assets: %d', var.filteredAssetsCount)).x
local numberOfAssetsText = string.format('Assets: %d', var.filteredAssetsCount)
local numberOfAssetsTextWidth = im.CalcTextSize(string.format('Assets: %d', var.filteredAssetsCount)).x
local numberOfAssetsTextTruncated = string.format('A: %d', var.filteredAssetsCount)
local numberOfAssetsTextWidth = im.CalcTextSize(string.format('Assets: %d', var.filteredAssetsCount)).x
local numberOfAssetsTextTruncated = string.format('A: %d', var.filteredAssetsCount)
local numberOfAssetsTextTruncatedWidth = im.CalcTextSize(string.format('A: %d', var.filteredAssetsCount)).x
local numberOfAssetsTextTruncated = string.format('A: %d', var.filteredAssetsCount)
local numberOfAssetsTextTruncatedWidth = im.CalcTextSize(string.format('A: %d', var.filteredAssetsCount)).x
local numberOfTextureSetsText = string.format('Sets: %d', var.filteredTextureSetsCount)
local numberOfTextureSetsTextWidth = im.CalcTextSize(string.format('Sets: %d', var.filteredTextureSetsCount)).x
local numberOfTextureSetsText = string.format('Sets: %d', var.filteredTextureSetsCount)
local numberOfTextureSetsTextWidth = im.CalcTextSize(string.format('Sets: %d', var.filteredTextureSetsCount)).x
local numberOfTextureSetsTextTruncated = string.format('S: %d', var.filteredTextureSetsCount)
local numberOfTextureSetsTextWidth = im.CalcTextSize(string.format('Sets: %d', var.filteredTextureSetsCount)).x
local numberOfTextureSetsTextTruncated = string.format('S: %d', var.filteredTextureSetsCount)
local numberOfTextureSetsTextTruncatedWidth = im.CalcTextSize(string.format('S: %d', var.filteredTextureSetsCount)).x
local numberOfTextureSetsTextTruncated = string.format('S: %d', var.filteredTextureSetsCount)
local numberOfTextureSetsTextTruncatedWidth = im.CalcTextSize(string.format('S: %d', var.filteredTextureSetsCount)).x
im.NextColumn()
im.TextUnformatted(string.format("%0.0fkb", inspector_selectedAsset.filesize/1024))
im.NextColumn()
@/lua/ge/extensions/gameplay/drift/scoreboard.lua
order = 1,
value = string.format("%.3f", rawPerformanceStats.driftPerformanceFactors.total / rawPerformanceStats.driftPerformanceFactors.count)
}
order = 2,
value = string.format("%i %s", translateVelocity(rawPerformanceStats.driftSpeeds.total / rawPerformanceStats.driftSpeeds.count / 3.6, true))
}
order = 3,
value = string.format("%i °", rawPerformanceStats.driftAngles.total / rawPerformanceStats.driftAngles.count)
}
order = 4,
value = string.format("%i °", rawPerformanceStats.maxDriftAngle)
}
order = 6,
value = string.format("%i %s", translateDistance(rawPerformanceStats.totalDriftDist, false))
}
order = 8,
value = string.format("%s", formatTime(rawPerformanceStats.totalDriftDuration))
}
@/lua/ge/client/postFx/dof.lua
local function setLerpDist(dof, d0, d1, d2)
dof.lerpScale = string.format("%f %f %f %f", -1.0/d0, -1.0/d1, -1.0/d2, 1.0/d2)
dof.lerpBias = string.format("1.0 %f %f %f", (1.0 - d2)/d1, 1.0 / d2, (d2 - 1.0) / d2)
dof.lerpScale = string.format("%f %f %f %f", -1.0/d0, -1.0/d1, -1.0/d2, 1.0/d2)
dof.lerpBias = string.format("1.0 %f %f %f", (1.0 - d2)/d1, 1.0 / d2, (d2 - 1.0) / d2)
end
local b = 0.0 - nsl * ned
local eqNear = string.format("%f %f 0.0", nsl, b)
b = 0.0 - fsl * fsd
local eqFar = string.format("%f %f 1.0", fsl, b)
@/lua/ge/extensions/gameplay/crawl/utils.lua
if not points then
log('E', logTag, string.format('Unknown penalty/infraction type: %s', penaltyType))
return
@/lua/ge/extensions/util/procTrack.lua
end
--log("I",logTag,"Total length of track is " ..string.format("%.2f", length).." meters.")
--log("I",logTag,"Track has "..#nodes .. " keypoints: " .. straights .. " straights ("..gates.." gates), " .. (lefts+rights) .. " curves ("..lefts.." left, ".. rights.. " right), of which "..loops .. " are looped.")
@/lua/vehicle/powertrain/multiShaft.lua
if (cumulativeGearRatio and cumulativeGearRatio ~= device.children[i].cumulativeGearRatio) or (maxCumulativeGearRatio and maxCumulativeGearRatio ~= device.children[i].maxCumulativeGearRatio) then
log("W", "multiShaft.calculateInertia", string.format("Found non-matching gear ratios for multishaft outputs: A: '%.4f', B: '%.4f', A(max): '%.4f', B(max): '%.4f'", cumulativeGearRatio, device.children[i].cumulativeGearRatio, maxCumulativeGearRatio, device.children[i].maxCumulativeGearRatio))
else
@/lua/vehicle/extensions/tech/OBDEmulator.lua
local function sendOBDData(dt)
writeSerialPort(string.format("ATSET 010C=%d", clamp((electrics.values.rpm or 0), 0, 16000)))
writeSerialPort(string.format("ATSET 010D=%d", clamp((electrics.values.wheelspeed or 0) * 3.6, 0, 255)))
writeSerialPort(string.format("ATSET 010C=%d", clamp((electrics.values.rpm or 0), 0, 16000)))
writeSerialPort(string.format("ATSET 010D=%d", clamp((electrics.values.wheelspeed or 0) * 3.6, 0, 255)))
writeSerialPort(string.format("ATSET 0105=%d", clamp((electrics.values.watertemp or 0), 0, 215)))
writeSerialPort(string.format("ATSET 010D=%d", clamp((electrics.values.wheelspeed or 0) * 3.6, 0, 255)))
writeSerialPort(string.format("ATSET 0105=%d", clamp((electrics.values.watertemp or 0), 0, 215)))
writeSerialPort(string.format("ATSET 015C=%d", clamp((electrics.values.oiltemp or 0), 0, 210)))
writeSerialPort(string.format("ATSET 0105=%d", clamp((electrics.values.watertemp or 0), 0, 215)))
writeSerialPort(string.format("ATSET 015C=%d", clamp((electrics.values.oiltemp or 0), 0, 210)))
writeSerialPort(string.format("ATSET 0104=%d", clamp((electrics.values.engineLoad or 0) * 100, 0, 100))) --todo
writeSerialPort(string.format("ATSET 015C=%d", clamp((electrics.values.oiltemp or 0), 0, 210)))
writeSerialPort(string.format("ATSET 0104=%d", clamp((electrics.values.engineLoad or 0) * 100, 0, 100))) --todo
writeSerialPort(string.format("ATSET 0146=%d", clamp(powertrain.currentEnvTemperatureCelsius, -40, 215)))
writeSerialPort(string.format("ATSET 0104=%d", clamp((electrics.values.engineLoad or 0) * 100, 0, 100))) --todo
writeSerialPort(string.format("ATSET 0146=%d", clamp(powertrain.currentEnvTemperatureCelsius, -40, 215)))
writeSerialPort(string.format("ATSET 0111=%d", clamp((electrics.values.throttle or 0) * 100, 0, 100)))
writeSerialPort(string.format("ATSET 0146=%d", clamp(powertrain.currentEnvTemperatureCelsius, -40, 215)))
writeSerialPort(string.format("ATSET 0111=%d", clamp((electrics.values.throttle or 0) * 100, 0, 100)))
writeSerialPort(string.format("ATSET 0133=%d", clamp(powertrain.currentEnvPressure * 0.001, 0, 255)))
writeSerialPort(string.format("ATSET 0111=%d", clamp((electrics.values.throttle or 0) * 100, 0, 100)))
writeSerialPort(string.format("ATSET 0133=%d", clamp(powertrain.currentEnvPressure * 0.001, 0, 255)))
writeSerialPort(string.format("ATSET 010B=%d", clamp((electrics.values.turboBoost or 0) * 6.89476 + powertrain.currentEnvPressure * 0.001, 0, 255)))
writeSerialPort(string.format("ATSET 0133=%d", clamp(powertrain.currentEnvPressure * 0.001, 0, 255)))
writeSerialPort(string.format("ATSET 010B=%d", clamp((electrics.values.turboBoost or 0) * 6.89476 + powertrain.currentEnvPressure * 0.001, 0, 255)))
end
writeSerialPort(string.format("ATSET 0163=%d", clamp(torque, 0, 65000)))
end
@/lua/common/libs/lunajson/lunajson/encoder.lua
if tiny < n and n < huge then
local s = format("%.17g", n)
if radixordelim then
__index = function(_, c)
return format('\\u00%02X', byte(c))
end
@/lua/ge/extensions/gameplay/rally/notebook/pacenoteGenerator.lua
local function simplifyCorners(corners, params)
log("I", logTag, string.format("Simplifying %d corners:", #corners))
log("I", logTag, string.format(" - Phase %d: %d corners (%d nodes reassigned)", i, #corners, n))
log("I", logTag, string.format("Detected %d corners from %d driveline points", #results, #pointList))
@/lua/common/libs/lua-websockets/websocket/sync.lua
local msg = 'Websocket Handshake failed: Invalid Sec-Websocket-Accept (expected %s got %s)'
return nil,msg:format(expected_accept,headers['sec-websocket-accept'] or 'nil'),headers
end
@/lua/ge/extensions/editor/particleEditor.lua
if im.BeginTabItem("Emitter", nil, flags) then
if im.BeginCombo("##emitter", string.format("%s (%s)", currentEmitter:getName(), currentEmitter:getField("particles", ""))) then
for _, emitter in ipairs(particleEmitters) do
for _, emitter in ipairs(particleEmitters) do
if im.Selectable1(string.format("%s (%s)", emitter:getName(), emitter:getField("particles", ""))) then
selectEmitterFromMenu(Sim.upcast(emitter))
@/lua/ge/extensions/core/lapTimes.lua
local millis = math.floor((timeInSeconds - minutes * 60 - secondsWhole) * 1000 + 0.5)
return string.format("%.2d:%.2d.%.3d", minutes, secondsWhole, millis)
end
@/lua/vehicle/energyStorage/pressureTank.lua
local airEnergyIn = abs(pressureDiff) * airVolumeIn
--print(string.format("Supply: %.2f, local: %.2f, diff: %.2f", supplyPressure, storage.currentPressure, pressureDiff))
storage.storedEnergy = max(0, storage.storedEnergy + airEnergyIn)
@/lua/ge/extensions/core/vehiclePaints.lua
if debugConfigKey == nil or debugConfigKey == "4x4_carrier_petrol" then
log("I","", string.format("%s %s: %s", debugModelKey and debugModelKey .. " " or "", debugConfigKey and "config " .. debugConfigKey or "", message))
end
end
log("I","",string.format("Found %d paints, %d paint collections, %d multiPaintSetups in %d paint libraries, %d same-name paint names", #tableKeys(paintsByIdCache), #tableKeys(paintCollectionsByIdCache), #tableKeys(multiPaintSetupsByIdCache), #tableKeys(core_vehicles.getPaintFiles()), multiNames))
end
end
--log("I","",string.format("Selected for model %s, config %s: %s %s %s", model, config, paints.paintName1, paints.paintName2, paints.paintName3))
return {paints.paintName1, paints.paintName2, paints.paintName3} -- returns as an array so that the function setVehicleColorsNames can use it
local paintResult = getRandomPaints(model_key, config_key)
local name = string.format("%s: %s %s %s", paintResult.type, paintResult.paintName1, paintResult.paintName2, paintResult.paintName3)
resultsByName[name] = (resultsByName[name] or 0) + 1
local percentage = (result.count / amount) * 100
log("I", "vehicles", string.format("%5d | %6.1f%% | %s", result.count, percentage, result.name))
end
@/lua/ge/extensions/gameplay/drift/stallingSystem.lua
if im.Begin("Drift stalling system") then
im.Text(string.format("Current stalling value : %0.2f", stallingValue))
if im.Checkbox('Manual debug', manualDebug) then
for i = #history, 1, -1 do
im.Text(string.format("%s %i", history[i].type, history[i].stuntId))
end
@/lua/ge/extensions/editor/vehicleEditor/liveEditor/veFlexbodyDebug.lua
--debugDrawer:drawTextAdvanced(chosenVertPos, chosenVertID, textColor, true, false, textBackgroundColor)
debugDrawer:drawTextAdvanced(chosenVertPos, string.format("pos: (%.2f, %.2f, %.2f)", vertPosLocal.x, vertPosLocal.y, vertPosLocal.z), textColor, true, false, textBackgroundColor)
end
local locCoords = vertLoc.coords
local coords = string.format("(%.2f, %.2f, %.2f)", locCoords.x, locCoords.y, locCoords.z)
im.Text("Potential Spiking Vertices Count: " .. string.format("%d / %d", state.verticesOOBCoordsData.count, totalVertices))
im.Text("Problematic Locators Count (NX,NY,NZ): " .. dumps(state.verticesOOBCoordsData.countVec))
local locCoords = vertData.locCoords
local text = string.format("%d: (%.2f, %.2f, %.2f)", vertID, locCoords.x, locCoords.y, locCoords.z)
im.Text("Problematic Vertices Count: " .. string.format("%d / %d", state.verticesLackingNodesData.count, totalVertices))
im.Separator()
@/inspector/Views/ResourceDetailsSidebarPanel.js
else if (!isNaN(this._resource.networkEncodedSize))
this._compressionRow.value = this._resource.networkEncodedSize ? WI.UIString("%.2f\u00d7").format(this._resource.size / this._resource.networkEncodedSize) : emDash;
else
else
this._compressionRow.value = this._resource.estimatedNetworkEncodedSize ? WI.UIString("%.2f\u00d7").format(this._resource.size / this._resource.estimatedNetworkEncodedSize) : emDash;
} else {
if (size) {
this._imageWidthRow.value = WI.UIString("%dpx").format(size.width);
this._imageHeightRow.value = WI.UIString("%dpx").format(size.height);
this._imageWidthRow.value = WI.UIString("%dpx").format(size.width);
this._imageHeightRow.value = WI.UIString("%dpx").format(size.height);
} else
@/lua/ge/server/server.lua
ldgCtx.tileTransform = mat
log('I', string.format('### Global level offset set to (%.2f, %.2f, %.2f)', x, y, z))
i = i + 4 -- Skip the consumed arguments
local timeTotal = timerFunc:stopAndReset() / 1000
log('I', 'levelLoading', string.format("Level loaded in %.3fs: init %.3fs + datablocks %.3fs + materials %.3fs + objects %.3fs + ai.map %.3fs + decals %.3fs + physics %.3fs + cam %.3fs + player %.3fs + fade %.3fs", timeTotal, timeInit, timeDatablocks, timeMat, timeObjects, timeAIMap, timeDecals, timePhysics, timeCam, timePlayer, timeFade))
end
extensions.hook("onLoadingScreenFadeout")
log('I', 'levelLoading', 'Loading screen disabled after ' .. string.format('%5.3fs', timer2:stopAndReset() / 1000))
--Engine.Profiler.stopCapture()
@/lua/vehicle/sounds.lua
if nodeImpactPlasticEvent then
--print(string.format("%d: Impact Plastic (%.2f) -> %q", objectId, volImpact, nodeImpactPlasticEvent))
-- print (string.format(" PLASTIC IMPACT / mat1=%.2d / mat2=%.2d / impactEnergy=%9.2f / breakEnergy=%9.2f / volImpact=%.3f ", mat1, mat2, impactEnergy, breakEnergy, volImpact))
--print(string.format("%d: Impact Plastic (%.2f) -> %q", objectId, volImpact, nodeImpactPlasticEvent))
-- print (string.format(" PLASTIC IMPACT / mat1=%.2d / mat2=%.2d / impactEnergy=%9.2f / breakEnergy=%9.2f / volImpact=%.3f ", mat1, mat2, impactEnergy, breakEnergy, volImpact))
sounds.playSoundOnceFollowNode(nodeImpactPlasticEvent, breakNode, volImpact)
if nodeImpactMetalEvent then
--print(string.format("%d: Impact Metal (%.2f) -> %q", objectId, volImpact, nodeImpactMetalEvent))
--print (string.format(" PART IMPACT / mat1=%.2d / mat2=%.2d / impactEnergy=%9.2f / breakEnergy=%9.2f / / volImpact=%.3f ", mat1, mat2, impactEnergy, breakEnergy, volImpact))
--print(string.format("%d: Impact Metal (%.2f) -> %q", objectId, volImpact, nodeImpactMetalEvent))
--print (string.format(" PART IMPACT / mat1=%.2d / mat2=%.2d / impactEnergy=%9.2f / breakEnergy=%9.2f / / volImpact=%.3f ", mat1, mat2, impactEnergy, breakEnergy, volImpact))
sounds.playSoundOnceFollowNode(nodeImpactMetalEvent, breakNode, volImpact)
if nodeImpactGenericEvent then
--print(string.format("%d: Impact Generic (%.2f) -> %q", objectId, volImpact, nodeImpactGenericEvent))
-- print (string.format(" GENERIC IMPACT / mat1=%.2d / mat2=%.2d / impactEnergy=%9.2f / breakEnergy=%9.2f / / volImpact=%.3f ", mat1, mat2, impactEnergy, breakEnergy, volImpact))
--print(string.format("%d: Impact Generic (%.2f) -> %q", objectId, volImpact, nodeImpactGenericEvent))
-- print (string.format(" GENERIC IMPACT / mat1=%.2d / mat2=%.2d / impactEnergy=%9.2f / breakEnergy=%9.2f / / volImpact=%.3f ", mat1, mat2, impactEnergy, breakEnergy, volImpact))
sounds.playSoundOnceFollowNode(nodeImpactGenericEvent, breakNode, volImpact)
if nodeBreakPlasticEvent then
--print(string.format("%d: Break Plastic (%.2f) -> %q", objectId, volBreak, nodeBreakPlasticEvent))
sounds.playSoundOnceFollowNode(nodeBreakPlasticEvent, breakNode, volBreak)
if nodeBreakGenericEvent then
--print(string.format("%d: Break Generic (%.2f) -> %q", objectId, volBreak, nodeBreakGenericEvent))
sounds.playSoundOnceFollowNode(nodeBreakGenericEvent, breakNode, volBreak)
end
-- print (string.format(" PART BREAK / mat1=%.2d / mat2=%.2d / impactEnergy=%9.2f / breakEnergy=%9.2f / / / volBreak=%.3f ", mat1, mat2, impactEnergy, breakEnergy, volBreak))
end
-- streams.drawGraph('w'..bi, {value = -smoothStress, min = 0, max = 1})
-- if volume >= 0.01 then print (string.format(" Suspension%.0f currentStress %.2f x smoothStress %.2f x volumeFactor %.2f = Volume=%.2f Impulse=%.2f Pitch=%.2f colorFactor=%.2f beamResetTimer=%.2f", bi, currentStress, smoothStress, snd.volumeFactor, volume, impulse, pitch, snd.colorFactor, beamResetTimer)); end
end
-- print (string.format("WINDSPEED KPH=%.0f MPH=%.0f Wind vol=%.2f pitch=%.2f", (speed*3.657), (speed*2.285), vol, pitch))
end
-- if wd.name == "RR" then print(string.format("RR skids = slip %6.3f / slipEnergy %6.3f / sideSlip %6.3f / lastSlip %0.3f", slip, wd.slipEnergy * 0.000005, sideSlip, wd.lastSlip * 0.0125)); end
-- print (string.format(" wd.downf=%6.3d : tirePressure=%5.2f : wd.lastSlip*0.01=%7.3f : slip=%7.3f ; absWhlSpd=%6.1f/MPH%3.0f : c_tirePropVol=%6.3f, c_tirePropPit=%6.3f", wd.downForce, tirePressure, wd.lastSlip * 0.01, slip, absWheelSpeed, (absWheelSpeed*2.285), wheelSound.tirePropertiesVolRoll, wheelSound.tirePropertiesPitch).." "..wd.name)
-- print (string.format("tireVolumePitch=%7.3f : wd.tireVolume=%7.3f : material=%2.0f : wd.contactDepth=%0.2f", wheelSound.tireVolumePitch, wd.tireVolume, mat, wd.contactDepth).." "..wd.name)
-- print (string.format(" wd.downf=%6.3d : tirePressure=%5.2f : wd.lastSlip*0.01=%7.3f : slip=%7.3f ; absWhlSpd=%6.1f/MPH%3.0f : c_tirePropVol=%6.3f, c_tirePropPit=%6.3f", wd.downForce, tirePressure, wd.lastSlip * 0.01, slip, absWheelSpeed, (absWheelSpeed*2.285), wheelSound.tirePropertiesVolRoll, wheelSound.tirePropertiesPitch).." "..wd.name)
-- print (string.format("tireVolumePitch=%7.3f : wd.tireVolume=%7.3f : material=%2.0f : wd.contactDepth=%0.2f", wheelSound.tireVolumePitch, wd.tireVolume, mat, wd.contactDepth).." "..wd.name)
-- if wd.name == "RR" then
-- if rigidRollVolume > 0.01 then print (string.format("ASPHAT KPH=%3.0f MPH=%3.0f / absWhlSpeed %5.1f / rollVolume %4.2f / RollPitch %4.2f / tirePressure%6.2f / Contact %.1f", (absWheelSpeed*3.656), (absWheelSpeed*2.285), absWheelSpeed, rigidRollVolume, rigidRollPitch, tirePressure, asphaltContactSmooth).." "..wd.name); end
-- if rigidSkidVolume > 0.01 then print (string.format(" "..wd.name.." ".."Skid Volume %.2f : Pitch %.2f : Color(+0.5) %.2f : tirePressure %.2f : Slip %6.2f : wd.lastSlip %6.2f : wd.slipEnergy %6.0f", rigidSkidVolume, rigidSkidPitch, rigidSkidSlip + 0.5, tirePressure, slip, wd.lastSlip, wd.slipEnergy)); end
-- if rigidRollVolume > 0.01 then print (string.format("ASPHAT KPH=%3.0f MPH=%3.0f / absWhlSpeed %5.1f / rollVolume %4.2f / RollPitch %4.2f / tirePressure%6.2f / Contact %.1f", (absWheelSpeed*3.656), (absWheelSpeed*2.285), absWheelSpeed, rigidRollVolume, rigidRollPitch, tirePressure, asphaltContactSmooth).." "..wd.name); end
-- if rigidSkidVolume > 0.01 then print (string.format(" "..wd.name.." ".."Skid Volume %.2f : Pitch %.2f : Color(+0.5) %.2f : tirePressure %.2f : Slip %6.2f : wd.lastSlip %6.2f : wd.slipEnergy %6.0f", rigidSkidVolume, rigidSkidPitch, rigidSkidSlip + 0.5, tirePressure, slip, wd.lastSlip, wd.slipEnergy)); end
-- end
wheelSound.looseSurfaceKickupLimit = randomGauss3() * 8 / wheelSound.tirePropertiesKickup
-- print(string.format("KICKUP ASPHALT Vol=%.2f : Pitch=%.2f : Color=%.2f : tirePropertiesKickup=%.2f", kickupVolume, wheelSound.tirePropertiesVolRoll, wheelSound.tirePropertiesPitch, wheelSound.tirePropertiesKickup) .. " " .. wd.name)
-- streams.drawGraph(wd.name.." kickupVolume", {value = kickupVolume, min = 0, max = 1})
rigidSkidSlip = vehicleWheelSpeedDiffSlip * wheelSound.tirePropertiesSlip
-- if rigidSkidVolume > 0.01 then print (string.format(" ASPHALT WET SKID / rigidSkidVolume %.2f / rigidSkidPitch %.2f / rigidSkidColor(+0.5) %.2f", rigidSkidVolume, rigidSkidPitch, rigidSkidColor + 0.5).." "..wd.name); end
end
-- if rigidSkidVolume > 0.01 then print (string.format(" COBBLE SKID / rigidSkidVolume %.2f / rigidSkidPitch %.2f / rigidSkidSlip(+0.5) %.2f", rigidSkidVolume, rigidSkidPitch, rigidSkidSlip + 0.5).." "..wd.name); end
-- if rigidSkidVolume > 0.01 then print (string.format(" COBBLE SKID / slip %.2f / sideSlip %.2f / absWheelSpeed %.2f / aeroSpeed %.2f", slip, sideSlip * 0.0125, absWheelSpeed, aeroSpeed).." "..wd.name); end
-- if rigidSkidVolume > 0.01 then print (string.format(" COBBLE SKID / rigidSkidVolume %.2f / rigidSkidPitch %.2f / rigidSkidSlip(+0.5) %.2f", rigidSkidVolume, rigidSkidPitch, rigidSkidSlip + 0.5).." "..wd.name); end
-- if rigidSkidVolume > 0.01 then print (string.format(" COBBLE SKID / slip %.2f / sideSlip %.2f / absWheelSpeed %.2f / aeroSpeed %.2f", slip, sideSlip * 0.0125, absWheelSpeed, aeroSpeed).." "..wd.name); end
end
rigidSkidSlip = vehicleWheelSpeedDiffSlip * wheelSound.tirePropertiesSlip
-- if rigidSkidVolume > 0.01 then print (string.format(" ICE SKID / rigidSkidVolume %.2f / rigidSkidPitch %.2f / rigidSkidSlip(+0.5) %.2f", rigidSkidVolume, rigidSkidPitch, rigidSkidSlip + 0.5).." "..wd.name); end
end
rigidSkidSlip = vehicleWheelSpeedDiffSlip * wheelSound.tirePropertiesSlip
-- if rigidSkidVolume > 0.01 then print (string.format(" METAL SKID / rigidSkidVolume %.2f / rigidSkidPitch %.2f / rigidSkidSlip(+0.5) %.2f", rigidSkidVolume, rigidSkidPitch, rigidSkidSlip + 0.5).." "..wd.name); end
end
rigidSkidSlip = vehicleWheelSpeedDiffSlip * wheelSound.tirePropertiesSlip
-- if rigidSkidVolume > 0.01 then print (string.format(" WOOD SKID / rigidSkidVolume %.2f / rigidSkidPitch %.2f / rigidSkidSlip(+0.5) %.2f", rigidSkidVolume, rigidSkidPitch, rigidSkidSlip + 0.5).." "..wd.name); end
end
if dirtContactSmooth > maxContact then
-- if wd.name == "RL" and wd.contactDepth > 0 then print (string.format(" DIRT depth=%.2f", wd.contactDepth).." "..wd.name);end
maxContact = dirtContactSmooth
looseSkidDepth = wd.contactDepth
-- if looseRollVolume > 0.001 then print (string.format(" DIRT ROLL Vol=%.2f : Pitch=%.2f : Depth=%.2f : Texture=%.2f", looseRollVolume, looseRollPitch, looseRollDepth, looseSurfaceType).." "..wd.name); end
-- if looseSkidVolume > 0.001 then print (string.format(" DIRT SKID Vol=%.2f : Pitch=%.2f : Depth=%.2f : Texture=%.2f", looseSkidVolume, looseSkidPitch, looseSkidDepth, looseSurfaceType).." "..wd.name); end
-- if looseRollVolume > 0.001 then print (string.format(" DIRT ROLL Vol=%.2f : Pitch=%.2f : Depth=%.2f : Texture=%.2f", looseRollVolume, looseRollPitch, looseRollDepth, looseSurfaceType).." "..wd.name); end
-- if looseSkidVolume > 0.001 then print (string.format(" DIRT SKID Vol=%.2f : Pitch=%.2f : Depth=%.2f : Texture=%.2f", looseSkidVolume, looseSkidPitch, looseSkidDepth, looseSurfaceType).." "..wd.name); end
-- streams.drawGraph(wd.name.." looseSkidVolume", {value = looseSkidVolume, min = 0, max = 1})
wheelSound.looseSurfaceKickupLimit = randomGauss3() * 8 / wheelSound.tirePropertiesKickup
-- print(string.format("KICKUP DIRT Vol=%.2f : Pitch=%.2f : Color=%.2f : tirePropertiesKickup=%.2f", kickupVolume, wheelSound.tirePropertiesVolRoll, wheelSound.tirePropertiesPitch, wheelSound.tirePropertiesKickup) .. " " .. wd.name)
-- streams.drawGraph(wd.name.." kickupVolume", {value = kickupVolume, min = 0, max = 1})
if dirtdustyContactSmooth > maxContact then
-- if wd.name == "RL" and wd.contactDepth > 0 then print (string.format(" DIRT depth=%.2f", wd.contactDepth).." "..wd.name);end
maxContact = dirtdustyContactSmooth
looseSkidDepth = wd.contactDepth
-- if looseRollVolume > 0.001 then print (string.format(" DUSTY ROLL Vol=%.2f : Pitch=%.2f : Depth=%.2f : Texture=%.2f", looseRollVolume, looseRollPitch, looseRollDepth, looseSurfaceType).." "..wd.name); end
-- if looseSkidVolume > 0.001 then print (string.format(" DUSTY SKID Vol=%.2f : Pitch=%.2f : Depth=%.2f : Texture=%.2f", looseSkidVolume, looseSkidPitch, looseSkidDepth, looseSurfaceType).." "..wd.name); end
-- if looseRollVolume > 0.001 then print (string.format(" DUSTY ROLL Vol=%.2f : Pitch=%.2f : Depth=%.2f : Texture=%.2f", looseRollVolume, looseRollPitch, looseRollDepth, looseSurfaceType).." "..wd.name); end
-- if looseSkidVolume > 0.001 then print (string.format(" DUSTY SKID Vol=%.2f : Pitch=%.2f : Depth=%.2f : Texture=%.2f", looseSkidVolume, looseSkidPitch, looseSkidDepth, looseSurfaceType).." "..wd.name); end
-- streams.drawGraph(wd.name.." looseSkidVolume", {value = looseSkidVolume, min = 0, max = 1})
wheelSound.looseSurfaceKickupLimit = wheelSound.looseSurfaceKickupLimit + randomGauss3() * 20 / wheelSound.tirePropertiesKickup
-- print(string.format("KICKUP DUST Vol=%.2f : Pitch=%.2f : Color=%.2f : tirePropertiesKickup=%.2f", kickupVolume, wheelSound.tirePropertiesVolRoll, wheelSound.tirePropertiesPitch, wheelSound.tirePropertiesKickup) .. " " .. wd.name)
-- streams.drawGraph(wd.name.." kickupVolume", {value = kickupVolume, min = 0, max = 1})
if grassContactSmooth > maxContact then
-- if wd.name == "RL" and wd.contactDepth > 0 then print (string.format(" GRASS depth=%.2f", wd.contactDepth).." "..wd.name);end
maxContact = grassContactSmooth
looseSkidDepth = wd.contactDepth
-- if looseRollVolume > 0.001 then print (string.format(" GRASS ROLL Vol=%.2f : Pitch=%.2f : Depth=%.2f : Texture=%.2f", looseRollVolume, looseRollPitch, looseRollDepth, looseSurfaceType).." "..wd.name); end
-- if looseSkidVolume > 0.001 then print (string.format(" GRASS SKID Vol=%.2f : Pitch=%.2f : Depth=%.2f : Texture=%.2f", looseSkidVolume, looseSkidPitch, looseSkidDepth, looseSurfaceType).." "..wd.name); end
-- if looseRollVolume > 0.001 then print (string.format(" GRASS ROLL Vol=%.2f : Pitch=%.2f : Depth=%.2f : Texture=%.2f", looseRollVolume, looseRollPitch, looseRollDepth, looseSurfaceType).." "..wd.name); end
-- if looseSkidVolume > 0.001 then print (string.format(" GRASS SKID Vol=%.2f : Pitch=%.2f : Depth=%.2f : Texture=%.2f", looseSkidVolume, looseSkidPitch, looseSkidDepth, looseSurfaceType).." "..wd.name); end
-- streams.drawGraph(wd.name.." looseSkidVolume", {value = looseSkidVolume, min = 0, max = 1})
wheelSound.looseSurfaceKickupLimit = randomGauss3() * 12 / wheelSound.tirePropertiesKickup
-- print (string.format("KICKUP GRASS Vol=%.2f : Pitch=%.2f : Color=%.2f : tirePropertiesKickup=%.2f", kickupVolume, wheelSound.tirePropertiesVolRoll, wheelSound.tirePropertiesPitch, wheelSound.tirePropertiesKickup).." "..wd.name)
-- streams.drawGraph(wd.name.." kickupVolume", {value = kickupVolume, min = 0, max = 1})
if gravelContactSmooth > maxContact then
-- if wd.name == "RL" and wd.contactDepth > 0 then print (string.format("GRAVEL depth=%.2f", wd.contactDepth).." "..wd.name);end
maxContact = gravelContactSmooth
looseSkidDepth = wd.contactDepth
-- if looseRollVolume > 0.001 then print (string.format("GRAVEL ROLL Vol=%.2f : Pitch=%.2f : Depth=%.2f : Texture=%.2f", looseRollVolume, looseRollPitch, looseRollDepth, looseSurfaceType).." "..wd.name); end
-- if looseSkidVolume > 0.001 then print (string.format("GRAVEL SKID Vol=%.2f : Pitch=%.2f : Depth=%.2f : Texture=%.2f : tirePropertiesSlip=%.2f", looseSkidVolume, looseSkidPitch, looseSkidDepth, looseSurfaceType, wheelSound.tirePropertiesSlip).." "..wd.name); end
-- if looseRollVolume > 0.001 then print (string.format("GRAVEL ROLL Vol=%.2f : Pitch=%.2f : Depth=%.2f : Texture=%.2f", looseRollVolume, looseRollPitch, looseRollDepth, looseSurfaceType).." "..wd.name); end
-- if looseSkidVolume > 0.001 then print (string.format("GRAVEL SKID Vol=%.2f : Pitch=%.2f : Depth=%.2f : Texture=%.2f : tirePropertiesSlip=%.2f", looseSkidVolume, looseSkidPitch, looseSkidDepth, looseSurfaceType, wheelSound.tirePropertiesSlip).." "..wd.name); end
-- streams.drawGraph(wd.name.." looseSkidVolume", {value = looseSkidVolume, min = 0, max = 1})
wheelSound.looseSurfaceKickupLimit = wheelSound.looseSurfaceKickupLimit + randomGauss3() * 16 / wheelSound.tirePropertiesKickup
-- print (string.format("KICKUP Slip=%.2f : Slip*Properties=%.2f", slip * 12, slip * wheelSound.tirePropertiesKickup * 12).." "..wd.name)
-- print (string.format("KICKUP GRAVEL Vol=%.2f : Pitch=%.2f : Color=%.2f : tirePropertiesKickup=%.2f", kickupVolume, wheelSound.tirePropertiesVolRoll, wheelSound.tirePropertiesPitch, wheelSound.tirePropertiesKickup).." "..wd.name)
-- print (string.format("KICKUP Slip=%.2f : Slip*Properties=%.2f", slip * 12, slip * wheelSound.tirePropertiesKickup * 12).." "..wd.name)
-- print (string.format("KICKUP GRAVEL Vol=%.2f : Pitch=%.2f : Color=%.2f : tirePropertiesKickup=%.2f", kickupVolume, wheelSound.tirePropertiesVolRoll, wheelSound.tirePropertiesPitch, wheelSound.tirePropertiesKickup).." "..wd.name)
-- streams.drawGraph(wd.name.." kickupVolume", {value = kickupVolume, min = 0, max = 1})
if mudContactSmooth > maxContact then
-- if wd.name == "RL" and wd.contactDepth > 0 then print (string.format(" MUD depth=%.2f", wd.contactDepth).." "..wd.name);end
maxContact = mudContactSmooth
looseSkidDepth = wd.contactDepth
-- if looseRollVolume > 0.001 then print (string.format(" MUD ROLL Vol=%.2f : Pitch=%.2f : Depth=%.2f : Texture=%.2f", looseRollVolume, looseRollPitch, looseRollDepth, looseSurfaceType).." "..wd.name); end
-- if looseSkidVolume > 0.001 then print (string.format(" MUD SKID Vol=%.2f : Pitch=%.2f : Depth=%.2f : Texture=%.2f", looseSkidVolume, looseSkidPitch, looseSkidDepth, looseSurfaceType).." "..wd.name); end
-- if looseRollVolume > 0.001 then print (string.format(" MUD ROLL Vol=%.2f : Pitch=%.2f : Depth=%.2f : Texture=%.2f", looseRollVolume, looseRollPitch, looseRollDepth, looseSurfaceType).." "..wd.name); end
-- if looseSkidVolume > 0.001 then print (string.format(" MUD SKID Vol=%.2f : Pitch=%.2f : Depth=%.2f : Texture=%.2f", looseSkidVolume, looseSkidPitch, looseSkidDepth, looseSurfaceType).." "..wd.name); end
-- streams.drawGraph(wd.name.." looseSkidVolume", {value = looseSkidVolume, min = 0, max = 1})
wheelSound.looseSurfaceKickupLimit = randomGauss3() * 8 / wheelSound.tirePropertiesKickup
-- print (string.format("KICKUP MUD Vol=%.2f : Pitch=%.2f : Color=%.2f : tirePropertiesKickup=%.2f", kickupVolume, wheelSound.tirePropertiesVolRoll, wheelSound.tirePropertiesPitch, wheelSound.tirePropertiesKickup).." "..wd.name)
-- streams.drawGraph(wd.name.." kickupVolume", {value = kickupVolume, min = 0, max = 1})
looseSkidDepth = wd.contactDepth
-- if looseRollVolume > 0.001 then print (string.format(" ROCK ROLL Vol=%.2f : Pitch=%.2f : Depth=%.2f : Texture=%.2f", looseRollVolume, looseRollPitch, looseRollDepth, looseSurfaceType).." "..wd.name); end
-- if looseSkidVolume > 0.001 then print (string.format(" ROCK SKID Vol=%.2f : Pitch=%.2f : Depth=%.2f : Texture=%.2f", looseSkidVolume, looseSkidPitch, looseSkidDepth, looseSurfaceType).." "..wd.name); end
-- if looseRollVolume > 0.001 then print (string.format(" ROCK ROLL Vol=%.2f : Pitch=%.2f : Depth=%.2f : Texture=%.2f", looseRollVolume, looseRollPitch, looseRollDepth, looseSurfaceType).." "..wd.name); end
-- if looseSkidVolume > 0.001 then print (string.format(" ROCK SKID Vol=%.2f : Pitch=%.2f : Depth=%.2f : Texture=%.2f", looseSkidVolume, looseSkidPitch, looseSkidDepth, looseSurfaceType).." "..wd.name); end
-- streams.drawGraph(wd.name.." looseSkidVolume", {value = looseSkidVolume, min = 0, max = 1})
wheelSound.looseSurfaceKickupLimit = randomGauss3() * 8 / wheelSound.tirePropertiesKickup
-- print (string.format("KICKUP ROCK Vol=%.2f : Pitch=%.2f : Color=%.2f : tirePropertiesKickup=%.2f", kickupVolume, wheelSound.tirePropertiesVolRoll, wheelSound.tirePropertiesPitch, wheelSound.tirePropertiesKickup).." "..wd.name)
-- streams.drawGraph(wd.name.." kickupVolume", {value = kickupVolume, min = 0, max = 1})
if sandContactSmooth > maxContact then
-- if wd.name == "RL" and wd.contactDepth > 0 then print (string.format(" SAND depth=%.2f", wd.contactDepth).." "..wd.name);end
maxContact = sandContactSmooth
looseSkidDepth = wd.contactDepth
-- if looseRollVolume > 0.001 then print (string.format(" SAND ROLL Vol=%.2f : Pitch=%.2f : Depth=%.2f : Texture=%.2f", looseRollVolume, looseRollPitch, looseRollDepth, looseSurfaceType).." "..wd.name); end
-- if looseSkidVolume > 0.001 then print (string.format(" SAND SKID Vol=%.2f : Pitch=%.2f : Depth=%.2f : Texture=%.2f", looseSkidVolume, looseSkidPitch, looseSkidDepth, looseSurfaceType).." "..wd.name); end
-- if looseRollVolume > 0.001 then print (string.format(" SAND ROLL Vol=%.2f : Pitch=%.2f : Depth=%.2f : Texture=%.2f", looseRollVolume, looseRollPitch, looseRollDepth, looseSurfaceType).." "..wd.name); end
-- if looseSkidVolume > 0.001 then print (string.format(" SAND SKID Vol=%.2f : Pitch=%.2f : Depth=%.2f : Texture=%.2f", looseSkidVolume, looseSkidPitch, looseSkidDepth, looseSurfaceType).." "..wd.name); end
-- if wd.name == "FL" then streams.drawGraph(wd.name.." looseSkidVolume", {value = looseSkidVolume}); end
wheelSound.looseSurfaceKickupLimit = randomGauss3() * 4 / wheelSound.tirePropertiesKickup
-- print (string.format("KICKUP SAND Vol=%.2f : Pitch=%.2f : Color=%.2f : tirePropertiesKickup=%.2f", kickupVolume, wheelSound.tirePropertiesVolRoll, wheelSound.tirePropertiesPitch, wheelSound.tirePropertiesKickup).." "..wd.name)
-- streams.drawGraph(wd.name.." kickupVolume", {value = kickupVolume, min = 0, max = 1})
-- streams.drawGraph(wd.name.." looseSkidDepth", {value = looseSkidDepth, min = 0, max = 0.3})
-- if looseRollDepth > 0 then print (string.format("looseSurfaceType = %0.3f / looseRollDepth = %0.2f", looseSurfaceType, looseRollDepth)); end
rigidSurfaceType = 0.35
-- if wd.name == "FL" then print (string.format("peakForce=%6.0f / wd.obj:getPeakPeriod()=%0.2f / vehicleSpeed=%0.3f", peakForce, wd.obj:getPeakPeriod(), vehicleSpeed)); end
local volume = min(1, peakForce * vehicleSpeed * 0.000002 / wheelSound.tireContactPatchCoef - 0.01)
-- print (string.format("(Tread) %.2f * (LinearRadius) %.2f * (tireLinearWidth) = %.2f = Total = %.2f", wd.treadCoef, tireLinearScaleRadius, tireVolWidthCoef, wd.treadCoef * tireLinearScaleRadius * tireVolWidthCoef))
-- print ((tireContactPatchCoef + 0.5) * tireKickSoftCoef)
-- Print wheel sizes
-- print (string.format("Size = %.0f/%.0f R%.0f : Actual Values - wd.radius=%.3f - wd.hubRadius=%.3f - wd.tireWidth=%.3f - contactPatch=%.3f : Tread=%.2f : Softness=%.2f", (wd.radius *2) * 100, ((wd.hubRadius * 2) / 2.54) * 100, wd.tireWidth * 1000, wd.radius, wd.hubRadius, wd.tireWidth, (wd.radius * wd.radius * wd.tireWidth), wd.treadCoef, wd.softnessCoef).." "..wd.name)
-- tireProperties
--print ((string.format("TRUE TIRE PHYSICS - ContactPatch=%0.3f = Width=%0.3f * wd.radius=%0.3f : wd.hubRadius=%0.3f : tireRadius=%0.3f : AirVolume=%0.3f : Soft=%0.3f : wd.treadCoef=%0.2f : tirePropertiesSizeTread=%0.2f", (wd.radius * wd.tireWidth), wd.tireWidth, wd.radius, wd.hubRadius, (wd.radius - wd.hubRadius), wd.tireVolume, wd.softnessCoef, wd.treadCoef, wh.tirePropertiesSizeTread)).." "..wd.name)
-- TIRE SLIP PROPERTIES
-- print ((string.format("Tire Slip TRUE/NORMALISED - ContactPatch=%0.3f/%0.3f * Soft=%0.3f/%0.3f * Tread=%0.3f/%0.3f = PropSlip=%0.3f ", (wd.radius * wd.tireWidth), tireContactPatchReverseNormalCoef, wd.softnessCoef, tireSlipSoftCoef, wd.treadCoef, tireSlipTreadCoef, tireContactPatchReverseNormalCoef * tireSlipSoftCoef * tireSlipTreadCoef )).." "..wd.name); print (" ")
-- TIRE ROLL VOLUME PROPERTIES (left value = true value, right value = normalised Coef value)
-- print ((string.format("ROLL Vol=wd.radi=%0.2f : wd.hubR=%0.2f : VolProfile=%0.2f/%0.2f : Width=%0.2f/%0.2f : ContPat=%0.2f/%0.2f : Tread=%0.2f/%0.2f : Soft=%0.2f/%0.2f : AirVol=%0.2f/%0.2f : PropVolRoll=%0.2f : PropVolSkid=%0.2f : PropPitch=%0.2f", wd.radius, wd.hubRadius, (wd.radius - wd.hubRadius), tireVolProfileCoef, wd.tireWidth, tireVolWidthCoef, (wd.radius * wd.radius * wd.tireWidth), tireContactPatchCoef, wd.treadCoef, tireVolTreadCoef, wd.softnessCoef, tireVolRollSoftCoef, wd.tireVolume, tireVolAirCoef, wh.tirePropertiesVolRoll, wh.tirePropertiesVolSkid, wh.tirePropertiesPitch)).." "..wd.name); print (" ")
-- TIRE SKID VOLUME PROPERTIES (left value = true value, right value = normalised game value)
-- print ((string.format("SKID Vol=wd.radi=%0.2f : wd.hubR=%0.2f : VolProfile=%0.2f/%0.2f : Width=%0.2f/%0.2f : ContPat=%0.2f/%0.2f : Tread=%0.2f/%0.2f : Soft=%0.2f/%0.2f : AirVol=%0.2f/%0.2f : PropVolRoll=%0.2f : PropSlip=%0.2f : PropVolSkid=%0.2f : PropPitch=%0.2f", wd.radius, wd.hubRadius, (wd.radius - wd.hubRadius), tireVolProfileCoef, wd.tireWidth, tireVolWidthCoef, (wd.radius * wd.radius * wd.tireWidth), tireContactPatchCoef, wd.treadCoef, tireVolTreadCoef, wd.softnessCoef, tireVolSkidSoftCoef, wd.tireVolume, tireVolAirCoef, wh.tirePropertiesVolRoll, wh.tirePropertiesSlip, wh.tirePropertiesVolSkid, wh.tirePropertiesPitch)).." "..wd.name); print (" ")
-- TIRE PITCH PROPERTIES (left value = true value, right value = normalised game value)
-- print ((string.format("SKID PITCH=RubberRadius=%0.2f/%0.2f : Width=%0.2f/%0.2f : ContPat=%0.3f/%0.2f : Tread=%0.2f/%0.2f : Soft=%0.2f/%0.2f : AirVol=%0.2f/%0.2f : PropVolRoll=%0.2f : PropVolSkid=%0.2f : PropPitch=%0.2f : PropPitchOld=%0.2f", (wd.radius - wd.hubRadius), tirePitchRadiusCoef, wd.tireWidth, tirePitchWidthCoef, (wd.radius * wd.radius * wd.tireWidth), tireContactPatchCoef, wd.treadCoef, tirePitchTreadCoef, wd.softnessCoef, tirePitchSoftCoef, wd.tireVolume, tirePitchAirCoef, wh.tirePropertiesVolRoll, wh.tirePropertiesVolSkid, wh.tirePropertiesPitch, wh.tirePropertiesPitch_old)).." "..wd.name); print (" ")
-- TIRE KICKUP PROPERTIES
-- print ((string.format("KICKUP tireContactPatchCoef+0.5=%.2f : tireKickSoftCoef=%.2f : tirePropertiesKickup=%.2f",tireContactPatchCoef + 0.5, tireKickSoftCoef, wh.tirePropertiesKickup)).." "..wd.name)
-- tirePropertiesVolRoll
-- print ((string.format("tirePropertiesVolRoll - (tireContactPatchCoef=%0.3f * tireVolTreadCoef=%0.3f) * (tireVolAirCoef=%0.3f * tireVolProfileCoef%0.3f) = %0.3f", tireContactPatchCoef, tireVolTreadCoef, tireVolAirCoef, tireVolProfileCoef, (tireContactPatchCoef * tireVolTreadCoef) * (tireVolAirCoef * tireVolProfileCoef))).." "..wd.name)
-- tirePropertiesVolSkid
-- print ((string.format("tirePropertiesVolSkid - (tireContactPatchCoef=%0.3f * tireVolTreadCoef=%0.3f) * (tireVolAirCoef=%0.3f * tireVolProfileCoef%0.3f) = %0.3f", tireContactPatchCoef, tireVolTreadCoef, tireVolAirCoef, tireVolProfileCoef, (tireContactPatchCoef * tireVolTreadCoef) * (tireVolAirCoef * tireVolProfileCoef))).." "..wd.name)
--Static RTPC'st
-- print ((string.format("wh.tirePropertiesVolRoll = %0.3f / wh.tirePropertiesPitch = %0.3f / wh.tirePropertiesSizeTread = %0.3f / wh.tirePropertiesVolSkid = %0.3f / wh.softnessCoef = %0.3f", wh.tirePropertiesVolRoll, wh.tirePropertiesPitch, wh.tirePropertiesSizeTread, wh.tirePropertiesVolSkid, wd.softnessCoef)).." "..wd.name)
local function updateCabinFilter()
obj:queueGameEngineLua(string.format("core_sounds.setCabinFilterStrength(%d, %f)", obj:getID(), clamp(cabinFilterCoef, 0, 1)))
-- print(string.format("%d: Setting Cabin Filter -> %f", objectId, clamp(cabinFilterCoef, 0, 1)))
obj:queueGameEngineLua(string.format("core_sounds.setCabinFilterStrength(%d, %f)", obj:getID(), clamp(cabinFilterCoef, 0, 1)))
-- print(string.format("%d: Setting Cabin Filter -> %f", objectId, clamp(cabinFilterCoef, 0, 1)))
end
-- Audio debug - display the current suspension setup from jbeam
-- print (string.format("Suspension : %s color=%.2f attack=%.0f volume=%.2f decay=%.0f pitch=%.2f maxStress=%.0f", bm.soundFile, bm.colorFactor, bm.attackFactor, bm.volumeFactor, bm.decayFactor, bm.pitchFactor, bm.maxStress))
-- print (string.format("Suspension : %s color=%s attack=%s volume=%s decay=%s pitch=%s maxStress=%s", dumps(bm.soundFile), dumps(bm.colorFactor), dumps(bm.attackFactor), dumps(bm.volumeFactor), dumps(bm.decayFactor), dumps(bm.pitchFactor), dumps(bm.maxStress)))
-- print (string.format("Suspension : %s color=%.2f attack=%.0f volume=%.2f decay=%.0f pitch=%.2f maxStress=%.0f", bm.soundFile, bm.colorFactor, bm.attackFactor, bm.volumeFactor, bm.decayFactor, bm.pitchFactor, bm.maxStress))
-- print (string.format("Suspension : %s color=%s attack=%s volume=%s decay=%s pitch=%s maxStress=%s", dumps(bm.soundFile), dumps(bm.colorFactor), dumps(bm.attackFactor), dumps(bm.volumeFactor), dumps(bm.decayFactor), dumps(bm.pitchFactor), dumps(bm.maxStress)))
local blendFileName = data.blendFile:match("^.+/(.+)$")
local configName = string.format("%s (%s) -> %s", name, engine.name, blendFileName)
engineSoundData[count] = {
@/lua/ge/extensions/util/export.lua
log('D', logTag, 'Buffers are to be stored externally.')
local binaryFilename = string.format(bufferPathPattern, bufferID, name)
writeFile(binaryFilename, dataString:get())
for i = 1, 100 do
fn = playerVehicle:getPath() .. 'export_' .. string.format('%03d', i)
if M.gltfBinaryFormat then
@/lua/common/controlSystems.lua
function PIDParallel:dump()
print(string.format("PID Parallel: kP: %.2f, kI: %.2f, kD: %.2f, Min: %.2f, Max: %.2f, Min Integral %.2f, Max Integral: %.2f", self.kP, self.kI, self.kD, self.minOutput, self.maxOutput, self.minIntegral, self.maxIntegral))
end
function PIDStandard:dump()
print(string.format("PID Standard: kP: %.2f, kI: %.2f, kD: %.2f, Min: %.2f, Max: %.2f, Min Integral %.2f, Max Integral: %.2f", self.kP, self.kI, self.kD, self.minOutput, self.maxOutput, self.minIntegral, self.maxIntegral))
end
@/lua/ge/extensions/scenario/positionGoal.lua
if minutes > 0 then
timeStr = string.format("%02.0f:%05.2f", minutes, seconds)
else
else
timeStr = string.format("%0.2f", seconds) .. 's'
end
@/inspector/Views/ProfileDataGridNode.js
let disableChargeToCaller = this._tree.callingContextTree.type === WI.CallingContextTree.Type.BottomUp;
contextMenu.appendItem(WI.UIString("Charge \u201C%s\u201D to Callers").format(this.displayName()), () => {
this._tree.addModifier({type: WI.ProfileDataGridTree.ModifierType.ChargeToCaller, source: this._node});
@/inspector/Views/NetworkTableContentView.js
this._harExportNavigationItem.buttonStyle = WI.ButtonNavigationItem.Style.ImageAndText;
this._harExportNavigationItem.tooltip = WI.UIString("HAR Export (%s)").format(WI.saveKeyboardShortcut.displayName);
this._harExportNavigationItem.addEventListener(WI.ButtonNavigationItem.Event.Clicked, () => {
this._clearNetworkItemsNavigationItem = new WI.ButtonNavigationItem("clear-network-items", WI.UIString("Clear Network Items (%s)").format(WI.clearKeyboardShortcut.displayName), "Images/NavigationItemTrash.svg", 15, 15);
this._clearNetworkItemsNavigationItem.addEventListener(WI.ButtonNavigationItem.Event.Clicked, () => {
rangeElement.classList.add("range");
rangeElement.textContent = WI.UIString("Byte Range %s\u2013%s").format(range.start, range.end);
}
if (originator)
fullscreenElement.title = WI.UIString("Full-Screen from \u201C%s\u201D").format(originator.displayName);
else
let displayName = WI.UIString("Imported - %s").format(result.filename);
this._addCollectionPathComponent(importedCollection, displayName, "network-har-icon");
@/lua/ge/extensions/editor/engineAudioDebug.lua
names = serialize(names);
obj:queueGameEngineLua(string.format('editor_engineAudioDebug.engine.engineSoundData = %s; editor_engineAudioDebug.engine.engineNameStrings = %s', data, names))]])
end
names = serialize(names);
obj:queueGameEngineLua(string.format('editor_engineAudioDebug.engine.engineSoundData = %s; editor_engineAudioDebug.engine.engineNameStrings = %s', data, names))]])
veh:showEngineDirection(selectedEngineData.data.soundID, showExhaustDirection[0])
@/ui/ui-vue/src/services/watchdog.js
const format = obj => Object.entries(obj).sort((a, b) => b[1] - a[1]).map(([key, value]) => `${key}: ${value}`.replace("\\", "\\\\")).join("\n")
console.log("Types:\n" + format(stats.types))
console.log("Files:\n" + format(stats.files))
console.log("Types:\n" + format(stats.types))
console.log("Files:\n" + format(stats.files))
},
@/lua/vehicle/controller/couplings/kingpin.lua
local data = {nodeId = kingpinNodeCid, nodePosition = position + nodePosition}
local fifthwheelCmd = string.format([[
controller.getControllerSafe(%q).kingpinDataCallback(%d, %s)
@/lua/ge/extensions/util/inputSystemUtils.lua
-- helper for natural sorting, enables sorting 1, 11, 2 to 1, 2, 11 by fake-padding the number before comparing it
local function padnum(d) return ("%012d"):format(d) end
local function naturalSortHelper(a, b) return tostring(a):gsub("%d+",padnum) < tostring(b):gsub("%d+", padnum) end
@/lua/ge/extensions/editor/trafficManager.lua
im.TextColored(imColors.inactive, string.format("%0.2f %s", convertSpeed(aiData.speed, speedUnits[1]), speedUnits[1]))
im.SameLine()
im.SameLine()
im.TextColored(imColors.inactive, string.format("%0.2f %s", convertSpeed(aiData.speed, speedUnits[2]), speedUnits[2]))
end
local speed = mapVehData.vel and mapVehData.vel:length() or 0
im.TextUnformatted(string.format("%0.2f", convertSpeed(speed, speedUnits[options.speedUnits[0]])))
im.SameLine()
im.NextColumn()
im.TextUnformatted(string.format("%0.2f", convertDistance(sessionData.stats.distance, distanceUnits[options.distanceUnits[0]])))
im.SameLine()
im.NextColumn()
im.TextUnformatted(string.format("%0.2f G", sessionData.stats.gForce))
im.NextColumn()
im.NextColumn()
im.TextUnformatted(string.format("%0.1f", sessionData.stats.timer))
im.NextColumn()
im.NextColumn()
im.TextUnformatted(string.format("%0.2f %s", convertSpeed(sessionData.stats.avgSpeed, speedUnits[options.speedUnits[0]]), speedUnits[options.speedUnits[0]]))
im.NextColumn()
im.NextColumn()
im.TextUnformatted(string.format("%0.2f %s", convertSpeed(sessionData.stats.maxSpeed, speedUnits[options.speedUnits[0]]), speedUnits[options.speedUnits[0]]))
im.NextColumn()
local seqDesc = seq.description or "(Custom)"
currInstance.description = string.format("Sequence %s %s / Phase %s %s", seqStr, seqDesc, ctrlStr, ctrlDesc)
end
local seqDesc = seq.description or "(Custom)"
local description = string.format("Sequence %s %s / Phase %s %s", seqStr, seqDesc, ctrlStr, ctrlDesc)
im.TextColored(imColors.inactive, string.format("Phase Duration: %0.2f s", currController.totalDuration))
im.TextColored(imColors.inactive, string.format("Sequence Duration: %0.2f s", currSequence.totalDuration))
im.TextColored(imColors.inactive, string.format("Phase Duration: %0.2f s", currController.totalDuration))
im.TextColored(imColors.inactive, string.format("Sequence Duration: %0.2f s", currSequence.totalDuration))
@/lua/common/jit/p.lua
if not prof_raw then
out:write(format("%s%2d%% %s\n", indent, pct, k))
elseif prof_raw == "r" then
elseif prof_raw == "r" then
out:write(format("%s%5d %s\n", indent, v, k))
else
else
out:write(format("%s %d\n", k, v))
end
if f0 == 40 or f0 == 91 then
out:write(format("\n====== %s ======\n[Cannot annotate non-file]\n", file))
break
if not fp then
out:write(format("====== ERROR: %s: %s\n", file, err))
break
end
out:write(format("\n====== %s ======\n", file))
local fl = files[file]
show = n+ann
out:write(format("@@ %d @@\n", n))
end
if v then
out:write(format(fmtv, v, line))
else
else
out:write(format(fmtn, line))
end
@/lua/ge/extensions/editor/dynamicDecals/vehicleColorPalette.lua
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiSliderFloat(string.format("##VehicleColorPalette%d_Metallic_%s", id, guiId), editor.getTempFloat_NumberNumber(tonumber(metallicPaintData[1])), 0.0, 1.0, "%.2f") then
local val = string.format("%f %s %s %s", editor.getTempFloat_NumberNumber(), metallicPaintData[2], metallicPaintData[3], metallicPaintData[4])
if editor.uiSliderFloat(string.format("##VehicleColorPalette%d_Metallic_%s", id, guiId), editor.getTempFloat_NumberNumber(tonumber(metallicPaintData[1])), 0.0, 1.0, "%.2f") then
local val = string.format("%f %s %s %s", editor.getTempFloat_NumberNumber(), metallicPaintData[2], metallicPaintData[3], metallicPaintData[4])
vehicleObj:setField('metallicPaintData', id, val)
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiSliderFloat(string.format("##VehicleColorPalette%d_Roughness_%s", id, guiId), editor.getTempFloat_NumberNumber(tonumber(metallicPaintData[2])), 0.0, 1.0, "%.2f") then
local val = string.format("%s %f %s %s", metallicPaintData[1], editor.getTempFloat_NumberNumber(), metallicPaintData[3], metallicPaintData[4])
if editor.uiSliderFloat(string.format("##VehicleColorPalette%d_Roughness_%s", id, guiId), editor.getTempFloat_NumberNumber(tonumber(metallicPaintData[2])), 0.0, 1.0, "%.2f") then
local val = string.format("%s %f %s %s", metallicPaintData[1], editor.getTempFloat_NumberNumber(), metallicPaintData[3], metallicPaintData[4])
vehicleObj:setField('metallicPaintData', id, val)
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiSliderFloat(string.format("##VehicleColorPalette%d_ClearCoat_%s", id, guiId), editor.getTempFloat_NumberNumber(tonumber(metallicPaintData[3])), 0.0, 1.0, "%.2f") then
local val = string.format("%s %s %f %s", metallicPaintData[1], metallicPaintData[2], editor.getTempFloat_NumberNumber(), metallicPaintData[4])
if editor.uiSliderFloat(string.format("##VehicleColorPalette%d_ClearCoat_%s", id, guiId), editor.getTempFloat_NumberNumber(tonumber(metallicPaintData[3])), 0.0, 1.0, "%.2f") then
local val = string.format("%s %s %f %s", metallicPaintData[1], metallicPaintData[2], editor.getTempFloat_NumberNumber(), metallicPaintData[4])
vehicleObj:setField('metallicPaintData', id, val)
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiSliderFloat(string.format("##VehicleColorPalette%d_ClearCoatRoughness_%s", id, guiId), editor.getTempFloat_NumberNumber(tonumber(metallicPaintData[4])), 0.0, 1.0, "%.2f") then
local val = string.format("%s %s %s %f", metallicPaintData[1], metallicPaintData[2], metallicPaintData[3], editor.getTempFloat_NumberNumber())
if editor.uiSliderFloat(string.format("##VehicleColorPalette%d_ClearCoatRoughness_%s", id, guiId), editor.getTempFloat_NumberNumber(tonumber(metallicPaintData[4])), 0.0, 1.0, "%.2f") then
local val = string.format("%s %s %s %f", metallicPaintData[1], metallicPaintData[2], metallicPaintData[3], editor.getTempFloat_NumberNumber())
vehicleObj:setField('metallicPaintData', id, val)
if im.Button(string.format("Randomize all colors##vehicleColorPalette%s", guiId)) then
local colors = deepcopy(editor.getPreference("dynamicDecalsTool.colorPresets.presets"))
editor.log(string.format("%s: Randomized color palettes\nColor palette 1 set to '%s'\nColor palette 2 set to '%s'\nColor palette 3 set to '%s'", logTag, c1.name, c2.name, c3.name))
end
if im.BeginPopup("SaveVehicleColorPalette_" .. guiId) then
if im.InputText(string.format("##saveVehicleColorPalette_InputWidget_%s", guiId), editor.getTempCharPtr(colorPaletteName), nil, im.InputTextFlags_AutoSelectAll) then
colorPaletteName = editor.getTempCharPtr()
if #colorPaletteName == 0 then im.BeginDisabled() end
if im.Button(string.format("Save##VehicleColorPalette_SaveButton_%s", guiId)) then
local palettes = editor.getPreference("dynamicDecalsTool.vehicleColorPalette.palettes")
end
if im.Button(string.format("Cancel##VehicleColorPalette_Save_CancelButton_%s", guiId)) then
im.CloseCurrentPopup()
im.SameLine()
if im.Button(string.format("Save##vehicleColorPalette", guiId)) then
im.OpenPopup("SaveVehicleColorPalette_" .. guiId)
for k, palette in ipairs(palettes) do
if im.Button(string.format("Load##VehicleColorPalette_LoadButton_%d%s", k, guiId)) then
vehicleObj.color = Point4F(palette.values[1][1], palette.values[1][2], palette.values[1][3], vehicleObj.color.w)
im.SameLine()
if editor.uiIconImageButton(editor.icons.delete, tool.getIconSizeVec2(), nil, nil, nil, string.format("##vehicleColorPalette_Load_deleteButton_%d%s", k, guiId)) then
table.remove(palettes, k)
im.SameLine()
im.ColorButton(string.format("LoadVehicleColorPalette_color1_%d%s", k, guiId), editor.getTempImVec4_TableTable({palette.values[1][1], palette.values[1][2], palette.values[1][3], 1.0}))
im.SameLine()
im.SameLine()
im.ColorButton(string.format("LoadVehicleColorPalette_color2_%d%s", k, guiId), editor.getTempImVec4_TableTable({palette.values[2][1], palette.values[2][2], palette.values[2][3], 1.0}))
im.SameLine()
im.SameLine()
im.ColorButton(string.format("LoadVehicleColorPalette_color3_%d%s", k, guiId), editor.getTempImVec4_TableTable({palette.values[3][1], palette.values[3][2], palette.values[3][3], 1.0}))
im.SameLine()
im.SameLine()
if editor.uiInputText(string.format("##LoadVehicleColorPalette_paletteName_InputWidget_%d%s", k, guiId), editor.getTempCharPtr(palette.name), nil, im.InputTextFlags_AutoSelectAll, nil, nil, editor.getTempBool_BoolBool(false)) then
palette.name = editor.getTempCharPtr()
im.Separator()
if im.Button(string.format("Close##VehicleColorPalette_Load_CloseButton_%s", guiId)) then
im.CloseCurrentPopup()
im.SameLine()
if im.Button(string.format("Load##vehicleColorPalette", guiId)) then
im.OpenPopup("LoadVehicleColorPalette_" .. guiId)
vehicleObj.color = Point4F(col.value[1], col.value[2], col.value[3], vehicleObj.color.w)
editor.log(string.format("%s: Randomized color; Color palette 1 set to '%s'", logTag, col.name))
end
vehicleObj.colorPalette0 = Point4F(col.value[1], col.value[2], col.value[3], vehicleObj.color.w)
editor.log(string.format("%s: Randomized color; Color palette 2 set to '%s'", logTag, col.name))
end
vehicleObj.colorPalette1 = Point4F(col.value[1], col.value[2], col.value[3], vehicleObj.color.w)
editor.log(string.format("%s: Randomized color; Color palette 3 set to '%s'", logTag, col.name))
end
if editor.getPreference("dynamicDecalsTool.general.debug") then
if im.Button(string.format("Dump##LoadVehicleColorPalette_dumpButton_%d%s", k, guiId)) then
print(dumps(palette))
end
if im.Button(string.format("Load##VehicleColorPalette_LoadButton_%d%s", k, guiId)) then
vehicleObj.color = Point4F(palette.values[1][1], palette.values[1][2], palette.values[1][3], vehicleObj.color.w)
im.SameLine()
if editor.uiIconImageButton(editor.icons.delete, tool.getIconSizeVec2(), nil, nil, nil, string.format("##vehicleColorPalette_Load_deleteButton_%d%s", k, guiId)) then
table.remove(palettes, k)
im.SameLine()
im.ColorButton(string.format("LoadVehicleColorPalette_color1_%d%s", k, guiId), editor.getTempImVec4_TableTable({palette.values[1][1], palette.values[1][2], palette.values[1][3], 1.0}))
im.SameLine()
im.SameLine()
im.ColorButton(string.format("LoadVehicleColorPalette_color2_%d%s", k, guiId), editor.getTempImVec4_TableTable({palette.values[2][1], palette.values[2][2], palette.values[2][3], 1.0}))
im.SameLine()
im.SameLine()
im.ColorButton(string.format("LoadVehicleColorPalette_color3_%d%s", k, guiId), editor.getTempImVec4_TableTable({palette.values[3][1], palette.values[3][2], palette.values[3][3], 1.0}))
im.SameLine()
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiInputText(string.format("##LoadVehicleColorPalette_paletteName_InputWidget_%d%s", k, guiId), editor.getTempCharPtr(palette.name), nil, im.InputTextFlags_AutoSelectAll, nil, nil, editor.getTempBool_BoolBool(false)) then
palette.name = editor.getTempCharPtr()
else
editor.logWarn(string.format("%s: Can't restore vehicle color palette", logTag))
-- restoreColors.timer = 1
@/lua/ge/extensions/util/precompileVehicles.lua
local v = vehicles[vehicleToLoad]
log('I', logTag, string.format('Loading vehicle %s (%d/%d).', v, vehicleToLoad, #vehicles))
core_vehicles.replaceVehicle(v, {})
log('I', logTag, string.format('Will precompile data for %d vehicles.', #vehicles))
freeroam_freeroam.startFreeroam(path.getPathLevelMain('smallgrid'))
@/lua/vehicle/bdebugImpl.lua
local beam = v.data.beams[id]
log("I", "bdebug.beamBroken", string.format("beam %d broke: %s [%d] -> %s [%d]", id, (v.data.nodes[beam.id1].name or "unnamed"), beam.id1, (v.data.nodes[beam.id2].name or "unnamed"), beam.id2))
guihooks.message({txt = "vehicle.beamstate.beamBroke", context = {id = id, id1 = beam.id1, id2 = beam.id2, id1name = v.data.nodes[beam.id1].name, id2name = v.data.nodes[beam.id2].name}})
local beam = v.data.beams[id]
log("I", "bdebug.beamDeformed", string.format("beam %d deformed: %s [%d] -> %s [%d]", id, (v.data.nodes[beam.id1].name or "unnamed"), beam.id1, (v.data.nodes[beam.id2].name or "unnamed"), beam.id2))
end
local beam = v.data.beams[beamID]
log("I", "bdebug.beamDeformed", string.format("deformgroup triggered: %s beam %d, %s [%d] -> %s [%d]", deformGroup, beamID, (v.data.nodes[beam.id1].name or "unnamed"), beam.id1, (v.data.nodes[beam.id2].name or "unnamed"), beam.id2))
end
obj.debugDrawProxy:drawNodeSphere(wd.node2, 0.04, ironbowColor((wheelCoreTemp - baseTemp) * 0.004))
obj.debugDrawProxy:drawNodeText(wd.node1, ironbowColor((wheelCoreTemp - baseTemp) * 0.004), string.format("%s%.1f %s%.1f %s%.1f", "tT:", wheelAvgTemp - 273.15, "tC:", wheelCoreTemp - 273.15, "psi:", wheelAirPressure*0.000145038-14.5), 0)
-- TODO: temporary solution to draw from GE Lua side
obj:queueGameEngineLua(string.format('debugDrawer:drawLine(%s,%s,ColorF(1,0,0,1),false)', -dir * lineLen * 0.5 + midPos, dir * lineLen * 0.5 + midPos))
obj.debugDrawProxy:drawCylinder(-dir * lineLen * 0.5 + midPos, dir * lineLen * 0.5 + midPos, 0.01, color(255, 0, 0, 255))
obj.debugDrawProxy:drawSphere(0.1, p, color(255, 0, 0, 255))
obj.debugDrawProxy:drawText(p + vec3(0, 0, 0.3), color(255, 0, 0, 255), string.format("COG (%0.3f, %0.3f, %0.3f)", relCOGPos.x, relCOGPos.y, relCOGPos.z))
if playerInfo.firstPlayerSeated then
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 100, 0), color(0, 0, 0, 255), "COG distance above ground: " .. string.format("%0.3f m", obj:getDistanceFromTerrainPoint(p)))
end
local nodeWeight = obj:getNodeMass(node.cid)
local nodeText = getNodeText(node, string.format("%.2fkg", nodeWeight))
text = k ~= tblSize and text .. nodeText .. ', ' or text .. nodeText
if playerInfo.firstPlayerSeated then
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 60, 0), color(0, 0, 0, 255), "Weight: " .. string.format("%.2f kg", totalWeight))
end
local nodeText = getNodeText(node, string.format("%0.1f N", frc_length))
text = k ~= tblSize and text .. nodeText .. ', ' or text .. nodeText
end
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 60, 0), color(0, 0, 0, 255), "Average force: " .. string.format("%0.1f N", textNodeForceAvg))
textNodeForceAvg = forcesSum / (currNodesCount + 1e-30)
tempVec2:setAdd(initRefNodePos)
local nodeText = getNodeText(node, string.format("(%0.3f, %0.3f, %0.3f)", tempVec2.x, tempVec2.y, tempVec2.z))
text = k ~= tblSize and text .. nodeText .. ', ' or text .. nodeText
tempVec2:setAdd2(tempVec, obj:getNodePosition(node.cid))
local nodeText = getNodeText(node, string.format("(%0.3f, %0.3f, %0.3f)", tempVec2.x, tempVec2.y, tempVec2.z))
text = k ~= tblSize and text .. nodeText .. ', ' or text .. nodeText
local beam = v.data.beams[i]
local beamText = string.format("%d: %.3f m", beam.cid, obj:getBeamRefLength(beam.cid))
text = k ~= tblSize and text .. beamText .. ', ' or text .. beamText
local beam = v.data.beams[i]
local beamText = string.format("%d: %.3f m", beam.cid, obj:getBeamLength(beam.cid))
text = k ~= tblSize and text .. beamText .. ', ' or text .. beamText
-- TODO: temporary solution to draw from GE Lua side
--obj:queueGameEngineLua(string.format('debugDrawer:drawCylinder(%s,%s,%f,ColorF(%f,%f,%f,%f),false)', -dir * len * 0.5 + midPos, dir * len * 0.5 + midPos, radius * 0.5, r/255,g/255,b/255,a/255))
obj.debugDrawProxy:drawCylinder(-dir * len * 0.5 + midPos, dir * len * 0.5 + midPos, radius, col)
obj.debugDrawProxy:drawBeam3d(beam.cid, radius, col)
-- obj:queueGameEngineLua(string.format('debugDrawer:drawCylinder(%s,%s,%f,ColorF(%f,%f,%f,%f),false)', node1Pos, node2Pos, radius, r/255,g/255,b/255,a/255))
-- obj.debugDrawProxy:drawCylinder(node1Pos, node2Pos, radius, col)
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 120, 0), color(0, 0, 255, 255), "Extension")
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 140, 0), color(255, 255, 255, 255), string.format("Range Min: %.2f", rangeMin))
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 160, 0), color(255, 255, 255, 255), string.format("Range Max: %.2f", rangeMax))
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 140, 0), color(255, 255, 255, 255), string.format("Range Min: %.2f", rangeMin))
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 160, 0), color(255, 255, 255, 255), string.format("Range Max: %.2f", rangeMax))
end
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 120, 0), color(0, 0, 255, 255), "Extension")
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 140, 0), color(255, 255, 255, 255), string.format("Range Min: %.2f", rangeMin))
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 160, 0), color(255, 255, 255, 255), string.format("Range Max: %.2f", rangeMax))
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 140, 0), color(255, 255, 255, 255), string.format("Range Min: %.2f", rangeMin))
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 160, 0), color(255, 255, 255, 255), string.format("Range Max: %.2f", rangeMax))
end
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 120, 0), color(0, 0, 255, 255), "Extension")
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 140, 0), color(255, 255, 255, 255), string.format("Range Min: %.2f", rangeMin))
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 160, 0), color(255, 255, 255, 255), string.format("Range Max: %.2f", rangeMax))
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 140, 0), color(255, 255, 255, 255), string.format("Range Min: %.2f", rangeMin))
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 160, 0), color(255, 255, 255, 255), string.format("Range Max: %.2f", rangeMax))
end
if playerInfo.firstPlayerSeated then
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 100, 0), color(0, 0, 0, 255), string.format("%.2f Hz", freq))
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 120, 0), color(0, 0, 0, 255), string.format("Max Amplitude: %.2f m", ampMax))
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 100, 0), color(0, 0, 0, 255), string.format("%.2f Hz", freq))
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 120, 0), color(0, 0, 0, 255), string.format("Max Amplitude: %.2f m", ampMax))
end
if playerInfo.firstPlayerSeated then
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 100, 0), color(255, 255, 255, 255), string.format("Range Min: %.2f", rangeMin))
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 120, 0), color(255, 0, 0, 255), string.format("Range Max: %.2f", rangeMax))
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 100, 0), color(255, 255, 255, 255), string.format("Range Min: %.2f", rangeMin))
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 120, 0), color(255, 0, 0, 255), string.format("Range Max: %.2f", rangeMax))
if mode.showInfinity then
if playerInfo.firstPlayerSeated then
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 100, 0), color(255, 255, 255, 255), string.format("Range Min: %.2f", rangeMin))
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 120, 0), color(255, 0, 0, 255), string.format("Range Max: %.2f", rangeMax))
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 100, 0), color(255, 255, 255, 255), string.format("Range Min: %.2f", rangeMin))
obj.debugDrawProxy:drawText2D(vec3(viewportSizeX - 450 - 40, 120, 0), color(255, 0, 0, 255), string.format("Range Max: %.2f", rangeMax))
if mode.showInfinity then
-- INTENTIONALLY CALLING FROM GAME ENGINE LUA TO WORKAROUND A BUG
obj:queueGameEngineLua(string.format("guihooks.trigger('BdebugUpdate',%s,%s)", serialize(M.state), serialize(M.stateNoReset)))
-- This is fine though
obj:queueGameEngineLua(string.format("extensions.hook('onBDebugUpdate',%s,%s)", serialize(M.state), serialize(M.stateNoReset)))
end
if not beamsBroken[id] and obj:beamIsBroken(id) then
log("I", "bdebug.beamBroken", string.format("beam %d broke: %s [%d] -> %s [%d]", id, (v.data.nodes[beam.id1].name or "unnamed"), beam.id1, (v.data.nodes[beam.id2].name or "unnamed"), beam.id2))
guihooks.message({txt = "vehicle.beamstate.beamBroke", context = {id = id, id1 = beam.id1, id2 = beam.id2, id1name = v.data.nodes[beam.id1].name, id2name = v.data.nodes[beam.id2].name}})
if not M.state then return
log('E', 'bdebugImpl.setNodeDebugText', string.format('bdebugImpl.setNodeDebugText(%s, %d, %s) not successful because bdebugImpl.lua is not fully initialized!', type, nodeCID, text))
end
@/inspector/Views/CanvasContentView.js
let formatString = this.representedObject.recordingFrameCount === 1 ? WI.UIString("%d Frame") : WI.UIString("%d Frames");
title = formatString.format(this.representedObject.recordingFrameCount);
} else
@/lua/ge/extensions/career/modules/tuning.lua
if isOnBlackList(varData) then
shoppingCart.items[varName] = {name = varName, title = string.format("%s %s %s", varData.category, varData.subCategory, varData.title)}
varPrice = 0
@/gameplay/missionTypes/rallyLoop/editor.lua
local translatedName = translateLanguage(mission.name, mission.name, true)
local displayName = string.format("%s (%s)", translatedName, mission.id)
table.insert(missionIds, displayName)
@/lua/ge/extensions/editor/masterSpline/splineMgr.lua
-- Ensure we have a unique name.
local baseName = name or string.format(toolPrefixStr .. " %d", #masterSplines + 1)
local uniqueName = util.generateUniqueName(baseName, toolPrefixStr)
end
log('I', logTag, string.format("Converted %d traced paths to Master Splines. %d paths were too small to import.", #paths, #paths - #masterSplines))
end
@/lua/ge/extensions/editor/drivePathEditor/playback.lua
local n = nodes[i]
table.insert(scriptParts, string.format(
"{ x = %f, y = %f, z = %f, r = %f, v = %f, vl = %f }",
-- Create the command for vLua, then execute it.
local command = string.format(
[[
-- Create the command for vlua, then execute it.
local luaCmd = string.format(
[[
@/lua/ge/extensions/editor/missionEditor/progressSingle.lua
if self.formattedSaveData.unlockedStars and not self.formattedSaveData.unlockedStars.disabled then
im.Text(string.format("Default Stars unlocked: %d / 3",self.formattedSaveData.unlockedStars.defaultUnlockedStarCount))
im.Text(string.format("Total Stars unlocked: %d / %d",self.formattedSaveData.unlockedStars.totalUnlockedStarCount, self.formattedSaveData.unlockedStars.totalStars))
im.Text(string.format("Default Stars unlocked: %d / 3",self.formattedSaveData.unlockedStars.defaultUnlockedStarCount))
im.Text(string.format("Total Stars unlocked: %d / %d",self.formattedSaveData.unlockedStars.totalUnlockedStarCount, self.formattedSaveData.unlockedStars.totalStars))
for _, star in ipairs(self.formattedSaveData.unlockedStars.stars) do
@/lua/ge/extensions/career/modules/fuel.lua
if career_modules_inventory.getVehicles()[career_modules_inventory.getCurrentVehicle()].loanType == "work" then
ui_message(string.format("Fuel paid for by the company"), 6, "refueling")
else
imgui.Text("Tank " .. index)
imgui.Text(string.format("Fuel Type: %s", tankData.energyType))
local unit = readableUnit[tankData.energyType]
local unit = readableUnit[tankData.energyType]
imgui.Text(string.format("Energy: %.2f %s / %.2f %s", jouleToReadableUnit(tankData.currentEnergy, tankData.energyType), unit, jouleToReadableUnit(tankData.maxEnergy, tankData.energyType), unit))
imgui.Text(string.format("Fueled Energy: %.2f %s", jouleToReadableUnit(fuelingData[index].fueledEnergy, tankData.energyType) or 0, unit))
imgui.Text(string.format("Energy: %.2f %s / %.2f %s", jouleToReadableUnit(tankData.currentEnergy, tankData.energyType), unit, jouleToReadableUnit(tankData.maxEnergy, tankData.energyType), unit))
imgui.Text(string.format("Fueled Energy: %.2f %s", jouleToReadableUnit(fuelingData[index].fueledEnergy, tankData.energyType) or 0, unit))
for i, energyType in ipairs(energyTypes) do
if imgui.Button(string.format("Start Fueling %s ##%d", energyType, i)) then
uiButtonStartFueling(energyType)
imgui.SameLine()
if imgui.Button(string.format("Stop Fueling %s ##%d", energyType, i)) then
uiButtonStopFueling(energyType)
imgui.Text(string.format("Overall Price: %.2f $", overallPrice))
if overallPrice <= career_modules_playerAttributes.getAttributeValue("money") then
if overallPrice <= career_modules_playerAttributes.getAttributeValue("money") then
if imgui.Button(string.format("Pay")) then
payPrice()
@/lua/ge/extensions/gameplay/rally/tools/devTools.lua
if not self.selectedCompositor then return '' end
return string.format('/temp/rally/enumerated_%s.json', self.selectedCompositor)
end
log('I', logTag, string.format('stored elevation profile: %d points, elevation range %.1f-%.1fm',
self.pacenotesTools.elevationProfileInfo.pointCount, minZ, maxZ))
local timestamp = os.date("%Y%m%d_%H%M%S")
local filename = string.format('/temp/rally/elevation_profile_%s.json', timestamp)
local distKm = (point.distFromStart or 0) / 1000.0
local text = string.format("%.3fkm | z:%.1fm", distKm, point.z)
if self.pacenotesTools.drivelinePoints then
im.Text(string.format("Driveline Points: %d", #self.pacenotesTools.drivelinePoints))
if self.pacenotesTools.corners then
im.Text(string.format("Detected Corners: %d", #self.pacenotesTools.corners))
end
im.Text("Elevation Profile Data:")
im.Text(string.format("Points: %d", self.pacenotesTools.elevationProfileInfo.pointCount))
im.Text(string.format("Min Elevation: %.1fm", self.pacenotesTools.elevationProfileInfo.minElevation))
im.Text(string.format("Points: %d", self.pacenotesTools.elevationProfileInfo.pointCount))
im.Text(string.format("Min Elevation: %.1fm", self.pacenotesTools.elevationProfileInfo.minElevation))
im.Text(string.format("Max Elevation: %.1fm", self.pacenotesTools.elevationProfileInfo.maxElevation))
im.Text(string.format("Min Elevation: %.1fm", self.pacenotesTools.elevationProfileInfo.minElevation))
im.Text(string.format("Max Elevation: %.1fm", self.pacenotesTools.elevationProfileInfo.maxElevation))
im.Text(string.format("Elevation Change: %.1fm", self.pacenotesTools.elevationProfileInfo.elevationChange))
im.Text(string.format("Max Elevation: %.1fm", self.pacenotesTools.elevationProfileInfo.maxElevation))
im.Text(string.format("Elevation Change: %.1fm", self.pacenotesTools.elevationProfileInfo.elevationChange))
im.Text(string.format("Total Distance: %.1fm", self.pacenotesTools.elevationProfileInfo.totalDistance))
im.Text(string.format("Elevation Change: %.1fm", self.pacenotesTools.elevationProfileInfo.elevationChange))
im.Text(string.format("Total Distance: %.1fm", self.pacenotesTools.elevationProfileInfo.totalDistance))
im.Text(string.format("Route Distance: %.1f - %.1fm",
im.Text(string.format("Total Distance: %.1fm", self.pacenotesTools.elevationProfileInfo.totalDistance))
im.Text(string.format("Route Distance: %.1f - %.1fm",
self.pacenotesTools.elevationProfileInfo.startDistance, self.pacenotesTools.elevationProfileInfo.endDistance))
self.pacenotesTools.elevationProfileInfo.startDistance, self.pacenotesTools.elevationProfileInfo.endDistance))
im.Text(string.format("Split Points: %d", self.pacenotesTools.elevationProfileInfo.splitCount))
im.Text(string.format("Race Pathnodes: %d", self.pacenotesTools.elevationProfileInfo.racePathnodeCount))
im.Text(string.format("Split Points: %d", self.pacenotesTools.elevationProfileInfo.splitCount))
im.Text(string.format("Race Pathnodes: %d", self.pacenotesTools.elevationProfileInfo.racePathnodeCount))
-- if self.drivelineRoute then
-- im.Text(string.format("Next Pacenote Idx: %d", self.drivelineRoute.nextPacenoteIdx))
-- if nextPacenote then
-- im.Text(string.format("Next Pacenote: %s(%d) length=%0.1f", nextPacenote.name, nextPacenote.id, nextPacenote:getCachedLength() or 0.0))
-- else
@/lua/ge/extensions/ui/vehiclePaint.lua
local function dataToString(data)
return string.format("%s %s %s %s", data[1], data[2], data[3], data[4])
end
@/lua/vehicle/electricsCustomValueParser.lua
customElectricsEnv.logValue = function(value, label)
print(string.format("Custom Electric: %s = %s", label or "", tostring(value)))
return value
else
log("D", "electricsCustomValueParser.compileCustomValueUpdates", string.format("No default value for custom electrics value: %s", customValue.electricsName))
end
if #customValueUpdateStrings[i + 1] > 0 then
table.insert(customValueUpdates, string.format("electrics.%s = %s", customValueUpdateStrings[i], customValueUpdateStrings[i + 1]))
end
@/lua/ge/extensions/editor/dynamicDecals/colorPresets.lua
if im.ColorEdit4(string.format("##colorPresetColorWidget_%s_%d", guiId, k), editor.getTempFloatArray4_TableTable(color.value), im.flags(im.ColorEditFlags_NoInputs, im.ColorEditFlags_AlphaPreview)) then
data[k].value = editor.getTempFloatArray4_TableTable()
im.SameLine()
if editor.uiInputText(string.format("##colorPresetColorNameWidget_%s_%d", guiId, k), editor.getTempCharPtr(color.name or ""), nil, nil, nil, nil, editor.getTempBool_BoolBool(false)) then
color.name = editor.getTempCharPtr()
im.SameLine()
if editor.uiIconImageButton(editor.icons.delete, im.ImVec2(uiIconSize, uiIconSize), nil, nil, nil, string.format("remove##ColorPreset_%s_%d", guiId, k)) then
table.remove(data, k)
im.SameLine()
if editor.uiIconImageButton(editor.icons.border_color, im.ImVec2(uiIconSize, uiIconSize), nil, nil, nil, string.format("setAsDecalColorIconButton##ColorPreset_%s_%d", guiId, k)) then
api.setDecalColor(Point4F(color.value[1], color.value[2], color.value[3], color.value[4]))
im.SameLine()
if editor.uiIconImageButton(editor.icons.format_color_fill, im.ImVec2(uiIconSize, uiIconSize), nil, nil, nil, string.format("setAsFillColorIconButton##ColorPreset_%s_%d", guiId, k)) then
api.setFillLayerColor(Point4F(color.value[1], color.value[2], color.value[3], color.value[4]))
if im.Button(string.format("Add color preset##colorPreset_%s", guiId), im.ImVec2(im.GetContentRegionAvailWidth(), 0)) then
table.insert(data, {value = newPreset.value})
-- if im.ColorPicker4(string.format("##NewPresetColor"), editor.getTempFloatArray4_TableTable(newPreset.value), nil, nil) then
-- newPreset.value = editor.getTempFloatArray4_TableTable()
-- if im.Button(string.format("Add color preset##colorPreset_%s", guiId), im.ImVec2(im.GetContentRegionAvailWidth(), 0)) then
-- table.insert(data, {value = newPreset.value})
@/lua/ge/extensions/editor/api/dynamicDecals/textures.lua
-- for k, v in pairs(tagsWithRefs) do
-- print(string.format("%s : %d", k, #v))
-- end
@/lua/ge/extensions/flowgraph/nodes/input/blacklistActionFilter.lua
im.SameLine()
im.Text(string.format("(%d actions)", #self.actionTemplates[key]))
im.EndDisabled()
@/lua/ge/extensions/gameplay/util/damageAssessment.lua
debugDrawer:drawText(worldPos, string.format("%i|%i", sectionDamageInfo.sectionBeamDamage, sectionDamageInfo.sectionCollisionDamage), magentaColor)
end
@/lua/ge/ge_utils.lua
local function colorTableToRoundedColorString(color, metallicData)
return string.format( "%f %f %f %f %f %f %f %f", -- TS sequence
round(color.x*100)*0.01, round(color.y*100)*0.01, round(color.z*100)*0.01, round(color.w*100)*0.01,
if asString then
return string.format("%02.f", hours) .. ":" .. string.format("%02.f", mins) .. ":" .. string.format("%02.f", secs)
else
if asString then
return string.format("%02.f", hours) .. ":" .. string.format("%02.f", mins) .. ":" .. string.format("%02.f", secs)
else
if asString then
return string.format("%02.f", hours) .. ":" .. string.format("%02.f", mins) .. ":" .. string.format("%02.f", secs)
else
local geluaCommand = string.format('local args = %s; %s(unpack(args, 1, table.maxn(args)))', 'deserialize(%q)', geluaFunctionName)
local cmd = string.format('obj:queueGameEngineLua(string.format(%q, serialize({%s, unpack(%s)})))', geluaCommand, vluaCommand, serialize({...}))
local geluaCommand = string.format('local args = %s; %s(unpack(args, 1, table.maxn(args)))', 'deserialize(%q)', geluaFunctionName)
local cmd = string.format('obj:queueGameEngineLua(string.format(%q, serialize({%s, unpack(%s)})))', geluaCommand, vluaCommand, serialize({...}))
veh:queueLuaCommand(cmd)
local geluaCommand = string.format('local args = %s; %s(unpack(args, 1, table.maxn(args)))', 'deserialize(%q)', geluaFunctionName)
local cmd = string.format('obj:queueGameEngineLua(string.format(%q, serialize({%s, unpack(%s)})))', geluaCommand, vluaCommand, serialize({...}))
veh:queueLuaCommand(cmd)
function vehicleMetallicPaintString(metallic, roughness, clearcoat, clearcoatRoughness)
local metallicPaintData = string.format("%s %s %s %s", metallic, roughness, clearcoat, clearcoatRoughness)
return metallicPaintData
local components = string.split(validatedColor)
validatedColor = string.format("%0.2f %0.2f %0.2f %0.2f", tonumber(components[1]), tonumber(components[2]), tonumber(components[3]), tonumber(components[4]))
elseif type(color) == 'table' then
elseif type(color) == 'table' then
validatedColor = string.format("%0.2f %0.2f %0.2f %0.2f", color[1] or 1, color[2] or 1, color[3] or 1, color[4] or 1)
end
vehicleData.licenseText = vehicle:getDynDataFieldbyName("licenseText", 0)
vehicleData.color = string.format("%0.2f %0.2f %0.2f %0.2f", vehicle.color.x, vehicle.color.y, vehicle.color.z, vehicle.color.w)
vehicleData.model = vehicle.JBeam
local t = socket.gettime()
return os.date("!%Y-%m-%dT%H:%M:%S", t) .. string.format(".%03dZ", (t * 1000) % 1000)
end
@/lua/ge/extensions/editor/tech/roadArchitect/decals.lua
dRoad:setField("material", 0, road.overlayMat or lightTreadMaterial)
dRoad:setField('startEndFade', 0, string.format("%f %f", 5.0, 5.0))
dRoad:registerObject("")
layerDecal:setField("textureLength", 0, layer.texLen[0])
layerDecal:setField('startEndFade', 0, string.format("%f %f", layer.fadeS[0], layer.fadeE[0]))
layerDecal:setField("material", 0, layer.mat)
layerDecal:setField("textureLength", 0, layer.texLen[0])
layerDecal:setField('startEndFade', 0, string.format("%f %f", layer.fadeS[0], layer.fadeE[0]))
layerDecal:setField("material", 0, layer.mat)
@/lua/ge/extensions/editor/util/editorElementHelper.lua
-- Check for old vehicleFilters format (array of vehicle configs) that should be cleaned up
local function vehicleFilterCheckContainer(e, ctd, c)
if ctd[e.fieldName] and type(ctd[e.fieldName]) == "table" and #ctd[e.fieldName] > 0 then
-- Check if it's the old format (array with model/config) or new format (object with baseFilter)
local first = ctd[e.fieldName][1]
if ctd[e.fieldName] and type(ctd[e.fieldName]) == "table" and #ctd[e.fieldName] > 0 then
-- Check if it's the old format (array with model/config) or new format (object with baseFilter)
local first = ctd[e.fieldName][1]
if ctd[val.fieldName] ~= nil and val.value ~= nil and (type(ctd[val.fieldName]) ~= type(val.value)) then
table.insert(issues, {label = 'Mismatched '.. self.typeDataFieldName .. ' Value: ' .. val.fieldName .. string.format(" (%s, should be %s)", type(ctd[val.fieldName]), type(val.value)), data=val, severity='error', fixable=true})
end
im.BeginDisabled()
im.Text(string.format("%0.2f m/s = %0.2f %s",e.ptr[0],translateVelocity(e.ptr[0], true)))
im.EndDisabled()
im.BeginDisabled()
im.Text(string.format("%0.2f m = %0.2f %s",e.ptr[0],translateDistance(e.ptr[0], true)))
im.EndDisabled()
local t = e.ptr[0]
im.Text(string.format("%0.2f s = %d:%02d.%02d mm:ss.mmm",t,(t-(t%60))/60, math.floor(t%60), 100*(t%1)))
im.EndDisabled()
field.type = ui_flowgraph_editor.getAutoTypeFromName(field.label)
--print(string.format("%s (%s) from %s", field.fieldName, field.type, field.elemLabel))
end
@/lua/ge/extensions/editor/dynamicDecals/docs.lua
if im.Selectable1(string.format("%s##%s", section.name, id), selected) then
currentSection = section
for k, v in pairs(section.children) do
checkSection(v, string.format("%s/%s", id, k))
end
helper.textUnformattedCentered("Welcome to the world of skin customization in BeamNG!")
helper.textUnformattedCentered(string.format("v %d.%d.%d", tool.version[1], tool.version[2], tool.version[2]))
@/lua/ge/extensions/ui/apps/minimap/minimap.lua
lastSize = size
print(string.format("Size: %d, %d", size.x, size.y))
print(string.format("TexSize: %d, %d", texSize.x, texSize.y))
print(string.format("Size: %d, %d", size.x, size.y))
print(string.format("TexSize: %d, %d", texSize.x, texSize.y))
lastTexSize = texSize
td:ImGui_Image(lastTexSize.x, lastTexSize.y)
--im.Text(string.format("Window Size: %d, %d", windowSize.x, windowSize.y))
--im.Text(string.format("Tex Size: %d, %d", lastTexSize.x, lastTexSize.y))
--im.Text(string.format("Window Size: %d, %d", windowSize.x, windowSize.y))
--im.Text(string.format("Tex Size: %d, %d", lastTexSize.x, lastTexSize.y))
end
for _, key in ipairs(tableKeysSorted(stats)) do
im.Text(string.format("%s: %d", key, stats[key]))
end
for _, transform in pairs(occlusionTransforms) do
--im.Text(string.format("Pixel: %d, %d, %d, %d", pixel[1], pixel[2], pixel[3], pixel[4]))
local left, right, h = transform[5]+5, transform[7]-5, transform[8]-transform[6]
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]))
local left, right, h = transform[5]+5, transform[7]-5, transform[8]-transform[6]
im.Text(string.format("Buffers: %d, %d, %d, %d", bufferLeft, bufferRight, bufferTop, bufferBottom))
im.Text(string.format("Width: %d, Height: %d", width, height))
im.Text(string.format("Buffers: %d, %d, %d, %d", bufferLeft, bufferRight, bufferTop, bufferBottom))
im.Text(string.format("Width: %d, Height: %d", width, height))
im.Text(string.format("TexWidth: %d, TexHeight: %d", texWidth, texHeight))
im.Text(string.format("Width: %d, Height: %d", width, height))
im.Text(string.format("TexWidth: %d, TexHeight: %d", texWidth, texHeight))
if x < 0 or x > 1 or y < 0 or y > 1 or width < 0 or width > 1 or height < 0 or height > 1 then
log("W","",string.format("Invalid minimap transform: %0.5f, %0.5f, %0.5f, %0.5f", x, y, width, height))
M.hide()
drawTransform = {x, y, width, height}
log("I","",string.format("Setting minimap transform to: %0.5f, %0.5f, %0.5f, %0.5f", x, y, width, height))
if M.onUpdate == nil then
if x > 1 or x < 0 or y > 1 or y < 0 or width > 1 or width < 0 or height > 1 or height < 0 then
log("W","",string.format("Invalid minimap occlusion transform: %0.5f, %0.5f, %0.5f, %0.5f", x, y, width, height))
occlusionTransforms[id] = nil
@/lua/vehicle/controller/powertrainControl/combustionEngineGovenor.lua
if not controlledEngine then
log("E", "powertrainControl.throttleGovenor", string.format("Engine '%s' not found, govenor not active.", controlledEngineName))
return
@/lua/ge/extensions/career/modules/delivery/general.lua
if loadData.general and loadData.general.osTime then
log("I","",string.format("Save data age: %ds",os.time() - loadData.general.osTime))
-- delete save data if the save is older than an hour
if os.time() - loadData.general.osTime > 3600 then
log("I","",string.format("Save data is older than 3600s (%d), wiping cargo and facility timers",os.time() - loadData.general.osTime))
loadData.cargo = {}
--log("I","",string.format("Loaded save data for logistics: %d cargo", #loadData.cargo))
end
end
log("I","",string.format("%0.2fs delay after adjusting weights for cargo.", maxDelay))
end
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))
end
if anyValue then
guihooks.trigger("toastrMsg", {type="warning", title="Cargo abandoned", msg=string.format("Cargo from last save was abandoned. Penalty: %0.2f$", -loadData.penalty.money or 0)})
career_modules_playerAttributes.addAttributes(loadData.penalty, {tags={"gameplay", "delivery","fine"}, label="Penalty for abandoning cargo."})
local ps = ap.ps
local id = string.format("delivery-parking-%s-%s", fac.id, ps:getPath())
local loc = {type = "facilityParkingspot", facId = fac.id, psPath = ps:getPath()}
}
--print(string.format("including: %s-%s (%s). visible: %s, target: %s",
-- fac.id, ps.id,
if next(interactiveParkingSpots[ps:getPath()].dropOffs) then
table.insert(tasks, string.format("Deliver %d cargo items here.", #interactiveParkingSpots[ps:getPath()].dropOffs))
end
if next(interactiveParkingSpots[ps:getPath()].pickUps) then
table.insert(tasks, string.format("Pick up %d cargo items here.", #interactiveParkingSpots[ps:getPath()].pickUps))
end
if next(interactiveParkingSpots[ps:getPath()].vehicles) then
table.insert(tasks, string.format("Deliver %d vehicles here.", #interactiveParkingSpots[ps:getPath()].vehicles))
end
if interactiveParkingSpots[ps:getPath()] or ap.isInspectSpot or dCargoScreen.isCargoScreenOpen() then
--dump(string.format("%s -> %s", fac.name, name))
--dumpz(ap, 1)
local id = string.format("delivery-parking-%s-%s", fac.id, ps:getPath())
local loc = {type = "facilityParkingspot", facId = fac.id, psPath = ps:getPath()}
if dProgress.isFacilityUnlocked(fac.id) and next(fac.logisticTypesProvided) then
local id = string.format("logisticsFacility-%s", fac.id)
local elems = {}
walkingMarker = next(elems) and elems[1].markerInfo.walkingMarker or nil,
bigmapMarker = {pos = pos, name = fac.name, description = string.format("%s\n\n%d Item%s available here.",fac.description, totalCargoCount, totalCargoCount ~= 1 and "s" or ""), icon="poi_delivery_round", previews = {fac.preview}, thumbnail = fac.preview,} or nil
}
icon = "checkmark",
keyLabel = string.format("%sParcel%s dropoff", dropOffableCargoByCargoType.parcel > 1 and ((dropOffableCargoByCargoType.parcel).." ") or "", dropOffableCargoByCargoType.parcel > 1 and "s" or "")
})
icon = "checkmark",
keyLabel = string.format("%dL fluid dropoff", dropOffableCargoByCargoType.fluid)
})
icon = "checkmark",
keyLabel = string.format("%dL dry bulk dropoff", dropOffableCargoByCargoType.dryBulk)
})
icon = "checkmark",
keyLabel = string.format("%sParcel%s pickup", pickUpAbleCargoByCargoType.parcel > 1 and ((pickUpAbleCargoByCargoType.parcel).." ") or "", pickUpAbleCargoByCargoType.parcel > 1 and "s" or "")
})
icon = "checkmark",
keyLabel = string.format("%dL fluid pickup", pickUpAbleCargoByCargoType.fluid)
})
icon = "checkmark",
keyLabel = string.format("%dL dry bulk pickup", pickUpAbleCargoByCargoType.dryBulk)
})
icon = "checkmark",
keyLabel = string.format("%d parcel%s available", availableCargoCountByCargoType.parcel, availableCargoCountByCargoType.parcel ~= 1 and "s" or "")
})
icon = "checkmark",
keyLabel = string.format("%dL of fluid available", availableCargoCountByCargoType.fluid)
})
icon = "checkmark",
keyLabel = string.format("%dL of dry bulk available", availableCargoCountByCargoType.dryBulk)
})
icon = "checkmark",
keyLabel = string.format("%d vehicle transport%s available", #vehOffers, #vehOffers ~= 1 and "s" or "")
})
icon = "checkmark",
keyLabel = string.format("%d trailer transport%s available", #trailerOffers, #trailerOffers ~= 1 and "s" or "")
})
if tag == "vehicleModification" then
return string.format("Modifying a vehicle will end Delivery Mode (Penalty: %0.2f$)", penalty)
elseif tag == "vehicleSelling" then
elseif tag == "vehicleSelling" then
return string.format("Selling a vehicle will end Delivery Mode (Penalty: %0.2f$)", penalty)
elseif tag == "vehicleStorage" then
elseif tag == "vehicleStorage" then
return string.format("Storing a vehicle will end Delivery Mode (Penalty: %0.2f$)", penalty)
elseif tag == "vehicleRepair" then
elseif tag == "vehicleRepair" then
return string.format("Repairing a vehicle will end Delivery Mode (Penalty: %0.2f$)", penalty)
elseif tag == "interactMission" then
elseif tag == "interactMission" then
return string.format("Starting a Mission will end Delivery Mode (Penalty: %0.2f$)", penalty)
elseif tag == "recoveryTowToGarage" then
elseif tag == "recoveryTowToGarage" then
return string.format("Towing to garage will end Delivery Mode (Penalty: %0.2f$)", penalty)
elseif tag == "vehicleShopping" then
if penalty.money < 0 then
guihooks.trigger("toastrMsg", {type="warning", title="Cargo abandoned", msg=string.format("Cargo was thrown away because delivery mode ended. Penalty: %0.2f$", -penalty.money)})
log("I","",string.format("Penalty for abandoning cargo: %0.2f$", -penalty.money))
guihooks.trigger("toastrMsg", {type="warning", title="Cargo abandoned", msg=string.format("Cargo was thrown away because delivery mode ended. Penalty: %0.2f$", -penalty.money)})
log("I","",string.format("Penalty for abandoning cargo: %0.2f$", -penalty.money))
career_modules_playerAttributes.addAttributes(penalty, {tags={"gameplay", "delivery","fine"}, label="Penalty for abandoning cargo."})
if penalty.money < 0 then
guihooks.trigger("toastrMsg", {type="warning", title="Cargo abandoned", msg=string.format("Cargo was thrown away because vehicle was put into storage. Penalty: %0.2f$", -penalty.money)})
log("I","",string.format("Penalty for abandoning cargo: %0.2f$", -penalty.money))
guihooks.trigger("toastrMsg", {type="warning", title="Cargo abandoned", msg=string.format("Cargo was thrown away because vehicle was put into storage. Penalty: %0.2f$", -penalty.money)})
log("I","",string.format("Penalty for abandoning cargo: %0.2f$", -penalty.money))
career_modules_playerAttributes.addAttributes(penalty, {tags={"gameplay", "delivery","fine"}, label="Penalty for abandoning cargo."})
@/ui/lib/ext/angular-ui-router.min.js
*/
"undefined"!=typeof module&&"undefined"!=typeof exports&&module.exports===exports&&(module.exports="ui.router"),function(a,b,c){"use strict";function d(a,b){return S(new(S(function(){},{prototype:a})),b)}function e(a){return R(arguments,function(b){b!==a&&R(b,function(b,c){a.hasOwnProperty(c)||(a[c]=b)})}),a}function f(a,b){var c=[];for(var d in a.path){if(a.path[d]!==b.path[d])break;c.push(a.path[d])}return c}function g(a){if(Object.keys)return Object.keys(a);var b=[];return R(a,function(a,c){b.push(c)}),b}function h(a,b){if(Array.prototype.indexOf)return a.indexOf(b,Number(arguments[2])||0);var c=a.length>>>0,d=Number(arguments[2])||0;for(d=d<0?Math.ceil(d):Math.floor(d),d<0&&(d+=c);d=0||(k.push(e[m]),j[e[m]]=a[e[m]]);return S({},j,b)}function j(a,b,c){if(!c){c=[];for(var d in a)c.push(d)}for(var e=0;e "));if(s[c]=d,O(a))q.push(c,[function(){return b.get(a)}],j);else{var e=b.annotate(a);R(e,function(a){a!==c&&i.hasOwnProperty(a)&&n(i[a],a)}),q.push(c,a,e)}r.pop(),s[c]=f}}function o(a){return P(a)&&a.then&&a.$$promises}if(!P(i))throw new Error("'invocables' must be an object");var p=g(i||{}),q=[],r=[],s={};return R(i,n),i=r=s=null,function(d,f,g){function h(){--u||(v||e(t,f.$$values),r.$$values=t,r.$$promises=r.$$promises||!0,delete r.$$inheritedValues,n.resolve(t))}function i(a){r.$$failure=a,n.reject(a)}function j(c,e,f){function j(a){l.reject(a),i(a)}function k(){if(!M(r.$$failure))try{l.resolve(b.invoke(e,g,t)),l.promise.then(function(a){t[c]=a,h()},j)}catch(a){j(a)}}var l=a.defer(),m=0;R(f,function(a){s.hasOwnProperty(a)&&!d.hasOwnProperty(a)&&(m++,s[a].then(function(b){t[a]=b,--m||k()},j))}),m||k(),s[c]=l.promise}if(o(d)&&g===c&&(g=f,f=d,d=null),d){if(!P(d))throw new Error("'locals' must be an object")}else d=k;if(f){if(!o(f))throw new Error("'parent' must be a promise returned by $resolve.resolve()")}else f=l;var n=a.defer(),r=n.promise,s=r.$$promises={},t=S({},d),u=1+q.length/3,v=!1;if(M(f.$$failure))return i(f.$$failure),r;f.$$inheritedValues&&e(t,m(f.$$inheritedValues,p)),S(s,f.$$promises),f.$$values?(v=e(t,m(f.$$values,p)),r.$$inheritedValues=m(f.$$values,p),h()):(f.$$inheritedValues&&(r.$$inheritedValues=m(f.$$inheritedValues,p)),f.then(h,i));for(var w=0,x=q.length;w=0));)s=f(r.id,r.type,r.cfg,"path"),l+=g(r.segment,s.type.pattern.source,s.squash,s.isOptional),n.push(r.segment),m=j.lastIndex;t=a.substring(m);var u=t.indexOf("?");if(u>=0){var v=this.sourceSearch=t.substring(u);if(t=t.substring(0,u),this.sourcePath=a.substring(0,m+u),v.length>0)for(m=0;i=k.exec(v);)r=h(i,!0),s=f(r.id,r.type,r.cfg,"search"),m=j.lastIndex}else this.sourcePath=a,this.sourceSearch="";l+=g(t)+(b.strict===!1?"/?":"")+"$",n.push(t),this.regexp=new RegExp(l,b.caseInsensitive?"i":c),this.prefix=n[0],this.$$paramNames=q}function t(a){S(this,a)}function u(){function a(a){return null!=a?a.toString().replace(/(~|\/)/g,function(a){return{"~":"~~","/":"~2F"}[a]}):a}function e(a){return null!=a?a.toString().replace(/(~~|~2F)/g,function(a){return{"~~":"~","~2F":"/"}[a]}):a}function f(){return{strict:p,caseInsensitive:m}}function i(a){return N(a)||Q(a)&&N(a[a.length-1])}function j(){for(;w.length;){var a=w.shift();if(a.pattern)throw new Error("You cannot override a type's .pattern at runtime.");b.extend(r[a.name],l.invoke(a.def))}}function k(a){S(this,a||{})}V=this;var l,m=!1,p=!0,q=!1,r={},v=!0,w=[],x={string:{encode:a,decode:e,is:function(a){return null==a||!M(a)||"string"==typeof a},pattern:/[^\/]*/},int:{encode:a,decode:function(a){return parseInt(a,10)},is:function(a){return M(a)&&this.decode(a.toString())===a},pattern:/\d+/},bool:{encode:function(a){return a?1:0},decode:function(a){return 0!==parseInt(a,10)},is:function(a){return a===!0||a===!1},pattern:/0|1/},date:{encode:function(a){return this.is(a)?[a.getFullYear(),("0"+(a.getMonth()+1)).slice(-2),("0"+a.getDate()).slice(-2)].join("-"):c},decode:function(a){if(this.is(a))return a;var b=this.capture.exec(a);return b?new Date(b[1],b[2]-1,b[3]):c},is:function(a){return a instanceof Date&&!isNaN(a.valueOf())},equals:function(a,b){return this.is(a)&&this.is(b)&&a.toISOString()===b.toISOString()},pattern:/[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])/,capture:/([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/},json:{encode:b.toJson,decode:b.fromJson,is:b.isObject,equals:b.equals,pattern:/[^\/]*/},any:{encode:b.identity,decode:b.identity,equals:b.equals,pattern:/.*/}};u.$$getDefaultValue=function(a){if(!i(a.value))return a.value;if(!l)throw new Error("Injectable functions cannot be called at configuration time");return l.invoke(a.value)},this.caseInsensitive=function(a){return M(a)&&(m=a),m},this.strictMode=function(a){return M(a)&&(p=a),p},this.defaultSquashPolicy=function(a){if(!M(a))return q;if(a!==!0&&a!==!1&&!O(a))throw new Error("Invalid squash policy: "+a+". Valid policies: false, true, arbitrary-string");return q=a,a},this.compile=function(a,b){return new s(a,S(f(),b))},this.isMatcher=function(a){if(!P(a))return!1;var b=!0;return R(s.prototype,function(c,d){N(c)&&(b=b&&M(a[d])&&N(a[d]))}),b},this.type=function(a,b,c){if(!M(b))return r[a];if(r.hasOwnProperty(a))throw new Error("A type named '"+a+"' has already been defined.");return r[a]=new t(S({name:a},b)),c&&(w.push({name:a,def:c}),v||j()),this},R(x,function(a,b){r[b]=new t(S({name:b},a))}),r=d(r,{}),this.$get=["$injector",function(a){return l=a,v=!1,j(),R(x,function(a,b){r[b]||(r[b]=new t(a))}),this}],this.Param=function(a,d,e,f){function j(a){var b=P(a)?g(a):[],c=h(b,"value")===-1&&h(b,"type")===-1&&h(b,"squash")===-1&&h(b,"array")===-1;return c&&(a={value:a}),a.$$fn=i(a.value)?a.value:function(){return a.value},a}function k(c,d,e){if(c.type&&d)throw new Error("Param '"+a+"' has two type configurations.");return d?d:c.type?b.isString(c.type)?r[c.type]:c.type instanceof t?c.type:new t(c.type):"config"===e?r.any:r.string}function m(){var b={array:"search"===f&&"auto"},c=a.match(/\[\]$/)?{array:!0}:{};return S(b,c,e).array}function p(a,b){var c=a.squash;if(!b||c===!1)return!1;if(!M(c)||null==c)return q;if(c===!0||O(c))return c;throw new Error("Invalid squash policy: '"+c+"'. Valid policies: false, true, or arbitrary string")}function s(a,b,d,e){var f,g,i=[{from:"",to:d||b?c:""},{from:null,to:d||b?c:""}];return f=Q(a.replace)?a.replace:[],O(e)&&f.push({from:e,to:c}),g=o(f,function(a){return a.from}),n(i,function(a){return h(g,a.from)===-1}).concat(f)}function u(){if(!l)throw new Error("Injectable functions cannot be called at configuration time");var a=l.invoke(e.$$fn);if(null!==a&&a!==c&&!x.type.is(a))throw new Error("Default value ("+a+") for parameter '"+x.id+"' is not an instance of Type ("+x.type.name+")");return a}function v(a){function b(a){return function(b){return b.from===a}}function c(a){var c=o(n(x.replace,b(a)),function(a){return a.to});return c.length?c[0]:a}return a=c(a),M(a)?x.type.$normalize(a):u()}function w(){return"{Param:"+a+" "+d+" squash: '"+A+"' optional: "+z+"}"}var x=this;e=j(e),d=k(e,d,f);var y=m();d=y?d.$asArray(y,"search"===f):d,"string"!==d.name||y||"path"!==f||e.value!==c||(e.value="");var z=e.value!==c,A=p(e,z),B=s(e,y,z,A);S(this,{id:a,type:d,location:f,array:y,squash:A,replace:B,isOptional:z,value:v,dynamic:c,config:e,toString:w})},k.prototype={$$new:function(){return d(this,S(new k,{$$parent:this}))},$$keys:function(){for(var a=[],b=[],c=this,d=g(k.prototype);c;)b.push(c),c=c.$$parent;return b.reverse(),R(b,function(b){R(g(b),function(b){h(a,b)===-1&&h(d,b)===-1&&a.push(b)})}),a},$$values:function(a){var b={},c=this;return R(c.$$keys(),function(d){b[d]=c[d].value(a&&a[d])}),b},$$equals:function(a,b){var c=!0,d=this;return R(d.$$keys(),function(e){var f=a&&a[e],g=b&&b[e];d[e].type.equals(f,g)||(c=!1)}),c},$$validates:function(a){var d,e,f,g,h,i=this.$$keys();for(d=0;d=0)throw new Error("State must have a valid name");if(A.hasOwnProperty(c))throw new Error("State '"+c+"' is already defined");var e=c.indexOf(".")!==-1?c.substring(0,c.lastIndexOf(".")):O(b.parent)?b.parent:P(b.parent)&&O(b.parent.name)?b.parent.name:"";if(e&&!A[e])return n(e,b.self);for(var f in D)N(D[f])&&(b[f]=D[f](b,D.$delegates[f]));return A[c]=b,!b[C]&&b.url&&a.when(b.url,["$match","$stateParams",function(a,c){z.$current.navigable==b&&j(a,c)||z.transitionTo(b,a,{inherit:!0,location:!1})}]),q(c),b}function s(a){return a.indexOf("*")>-1}function t(a){for(var b=a.split("."),c=z.$current.name.split("."),d=0,e=b.length;d=A;d--)g=o[d],g.self.onExit&&h.invoke(g.self.onExit,g.self,g.locals.globals),g.locals=null;for(d=A;d2?k.enter(a,null,c).then(d):k.enter(a,null,c,d)},leave:function(a,c){b.version.minor>2?k.leave(a).then(c):k.leave(a,c)}};if(j){var e=j&&j(c,a);return{enter:function(a,b,c){e.enter(a,null,b),c()},leave:function(a,b){e.leave(a),b()}}}return d()}var i=g(),j=i("$animator"),k=i("$animate"),l={restrict:"ECA",terminal:!0,priority:400,transclude:"element",compile:function(c,g,i){return function(c,g,j){function k(){if(m&&(m.remove(),m=null),o&&(o.$destroy(),o=null),n){var a=n.data("$uiViewAnim");s.leave(n,function(){a.$$animLeave.resolve(),m=null}),m=n,n=null}}function l(h){var l,m=B(c,j,g,e),t=m&&a.$current&&a.$current.locals[m];if(h||t!==p){l=c.$new(),p=a.$current.locals[m],l.$emit("$viewContentLoading",m);var u=i(l,function(a){var e=f.defer(),h=f.defer(),i={$animEnter:e.promise,$animLeave:h.promise,$$animLeave:h};a.data("$uiViewAnim",i),s.enter(a,g,function(){e.resolve(),o&&o.$emit("$viewContentAnimationEnded"),(b.isDefined(r)&&!r||c.$eval(r))&&d(a)}),k()});n=u,o=l,o.$emit("$viewContentLoaded",m),o.$eval(q)}}var m,n,o,p,q=j.onload||"",r=j.autoscroll,s=h(j,c);g.inheritedData("$uiView");c.$on("$stateChangeSuccess",function(){l(!1)}),l(!0)}}};return l}function A(a,c,d,e){return{restrict:"ECA",priority:-400,compile:function(f){var g=f.html();return function(f,h,i){var j=d.$current,k=B(f,i,h,e),l=j&&j.locals[k];if(l){h.data("$uiView",{name:k,state:l.$$state}),h.html(l.$template?l.$template:g);var m=b.extend({},l);f[l.$$resolveAs]=m;var n=a(h.contents());if(l.$$controller){l.$scope=f,l.$element=h;var o=c(l.$$controller,l);l.$$controllerAs&&(f[l.$$controllerAs]=o,f[l.$$controllerAs][l.$$resolveAs]=m),N(o.$onInit)&&o.$onInit(),h.data("$ngControllerController",o),h.children().data("$ngControllerController",o)}n(f)}}}}}function B(a,b,c,d){var e=d(b.uiView||b.name||"")(a),f=c.inheritedData("$uiView");return e.indexOf("@")>=0?e:e+"@"+(f?f.state.name:"")}function C(a,b){var c,d=a.match(/^\s*({[^}]*})\s*$/);if(d&&(a=b+"("+d[1]+")"),c=a.replace(/\n/g," ").match(/^([^(]+?)\s*(\((.*)\))?$/),!c||4!==c.length)throw new Error("Invalid state ref '"+a+"'");return{state:c[1],paramExpr:c[3]||null}}function D(a){var b=a.parent().inheritedData("$uiView");if(b&&b.state&&b.state.name)return b.state}function E(a){var b="[object SVGAnimatedString]"===Object.prototype.toString.call(a.prop("href")),c="FORM"===a[0].nodeName;return{attr:c?"action":b?"xlink:href":"href",isAnchor:"A"===a.prop("tagName").toUpperCase(),clickable:!c}}function F(a,b,c,d,e){return function(f){var g=f.which||f.button,h=e();if(!(g>1||f.ctrlKey||f.metaKey||f.shiftKey||a.attr("target"))){var i=c(function(){b.go(h.state,h.params,h.options)});f.preventDefault();var j=d.isAnchor&&!h.href?1:0;f.preventDefault=function(){j--<=0&&c.cancel(i)}}}}function G(a,b){return{relative:D(a)||b.$current,inherit:!0}}function H(a,c){return{restrict:"A",require:["?^uiSrefActive","?^uiSrefActiveEq"],link:function(d,e,f,g){var h,i=C(f.uiSref,a.current.name),j={state:i.state,href:null,params:null},k=E(e),l=g[1]||g[0],m=null;j.options=S(G(e,a),f.uiSrefOpts?d.$eval(f.uiSrefOpts):{});var n=function(c){c&&(j.params=b.copy(c)),j.href=a.href(i.state,j.params,j.options),m&&m(),l&&(m=l.$$addStateInfo(i.state,j.params)),null!==j.href&&f.$set(k.attr,j.href)};i.paramExpr&&(d.$watch(i.paramExpr,function(a){a!==j.params&&n(a)},!0),j.params=b.copy(d.$eval(i.paramExpr))),n(),k.clickable&&(h=F(e,a,c,k,function(){return j}),e[e.on?"on":"bind"]("click",h),d.$on("$destroy",function(){e[e.off?"off":"unbind"]("click",h)}))}}}function I(a,b){return{restrict:"A",require:["?^uiSrefActive","?^uiSrefActiveEq"],link:function(c,d,e,f){function g(b){m.state=b[0],m.params=b[1],m.options=b[2],m.href=a.href(m.state,m.params,m.options),n&&n(),j&&(n=j.$$addStateInfo(m.state,m.params)),m.href&&e.$set(i.attr,m.href)}var h,i=E(d),j=f[1]||f[0],k=[e.uiState,e.uiStateParams||null,e.uiStateOpts||null],l="["+k.map(function(a){return a||"null"}).join(", ")+"]",m={state:null,params:null,options:null,href:null},n=null;c.$watch(l,g,!0),g(c.$eval(l)),i.clickable&&(h=F(d,a,b,i,function(){return m}),d[d.on?"on":"bind"]("click",h),c.$on("$destroy",function(){d[d.off?"off":"unbind"]("click",h)}))}}}function J(a,b,c){return{restrict:"A",controller:["$scope","$element","$attrs","$timeout",function(b,d,e,f){function g(b,c,e){var f=a.get(b,D(d)),g=h(b,c),i={state:f||{name:b},params:c,hash:g};return p.push(i),q[g]=e,function(){var a=p.indexOf(i);a!==-1&&p.splice(a,1)}}function h(a,c){if(!O(a))throw new Error("state should be a string");return P(c)?a+U(c):(c=b.$eval(c),P(c)?a+U(c):a)}function i(){for(var a=0;a0)){var c=g(a,b,o);return i(),c}},b.$on("$stateChangeSuccess",i),i()}]}}function K(a){var b=function(b,c){return a.is(b,c)};return b.$stateful=!0,b}function L(a){var b=function(b,c,d){return a.includes(b,c,d)};return b.$stateful=!0,b}var M=b.isDefined,N=b.isFunction,O=b.isString,P=b.isObject,Q=b.isArray,R=b.forEach,S=b.extend,T=b.copy,U=b.toJson;b.module("ui.router.util",["ng"]),b.module("ui.router.router",["ui.router.util"]),b.module("ui.router.state",["ui.router.router","ui.router.util"]),b.module("ui.router",["ui.router.state"]),b.module("ui.router.compat",["ui.router"]),q.$inject=["$q","$injector"],b.module("ui.router.util").service("$resolve",q),r.$inject=["$http","$templateCache","$injector"],b.module("ui.router.util").service("$templateFactory",r);var V;s.prototype.concat=function(a,b){var c={caseInsensitive:V.caseInsensitive(),strict:V.strictMode(),squash:V.defaultSquashPolicy()};return new s(this.sourcePath+a+this.sourceSearch,S(c,b),this)},s.prototype.toString=function(){return this.source},s.prototype.exec=function(a,b){function c(a){function b(a){return a.split("").reverse().join("")}function c(a){return a.replace(/\\-/g,"-")}var d=b(a).split(/-(?!\\)/),e=o(d,b);return o(e,c).reverse()}var d=this.regexp.exec(a);if(!d)return null;b=b||{};var e,f,g,h=this.parameters(),i=h.length,j=this.segments.length-1,k={};if(j!==d.length-1)throw new Error("Unbalanced capture group in route '"+this.source+"'");var l,m;for(e=0;e
*/
"undefined"!=typeof module&&"undefined"!=typeof exports&&module.exports===exports&&(module.exports="ui.router"),function(a,b,c){"use strict";function d(a,b){return S(new(S(function(){},{prototype:a})),b)}function e(a){return R(arguments,function(b){b!==a&&R(b,function(b,c){a.hasOwnProperty(c)||(a[c]=b)})}),a}function f(a,b){var c=[];for(var d in a.path){if(a.path[d]!==b.path[d])break;c.push(a.path[d])}return c}function g(a){if(Object.keys)return Object.keys(a);var b=[];return R(a,function(a,c){b.push(c)}),b}function h(a,b){if(Array.prototype.indexOf)return a.indexOf(b,Number(arguments[2])||0);var c=a.length>>>0,d=Number(arguments[2])||0;for(d=d<0?Math.ceil(d):Math.floor(d),d<0&&(d+=c);d=0||(k.push(e[m]),j[e[m]]=a[e[m]]);return S({},j,b)}function j(a,b,c){if(!c){c=[];for(var d in a)c.push(d)}for(var e=0;e "));if(s[c]=d,O(a))q.push(c,[function(){return b.get(a)}],j);else{var e=b.annotate(a);R(e,function(a){a!==c&&i.hasOwnProperty(a)&&n(i[a],a)}),q.push(c,a,e)}r.pop(),s[c]=f}}function o(a){return P(a)&&a.then&&a.$$promises}if(!P(i))throw new Error("'invocables' must be an object");var p=g(i||{}),q=[],r=[],s={};return R(i,n),i=r=s=null,function(d,f,g){function h(){--u||(v||e(t,f.$$values),r.$$values=t,r.$$promises=r.$$promises||!0,delete r.$$inheritedValues,n.resolve(t))}function i(a){r.$$failure=a,n.reject(a)}function j(c,e,f){function j(a){l.reject(a),i(a)}function k(){if(!M(r.$$failure))try{l.resolve(b.invoke(e,g,t)),l.promise.then(function(a){t[c]=a,h()},j)}catch(a){j(a)}}var l=a.defer(),m=0;R(f,function(a){s.hasOwnProperty(a)&&!d.hasOwnProperty(a)&&(m++,s[a].then(function(b){t[a]=b,--m||k()},j))}),m||k(),s[c]=l.promise}if(o(d)&&g===c&&(g=f,f=d,d=null),d){if(!P(d))throw new Error("'locals' must be an object")}else d=k;if(f){if(!o(f))throw new Error("'parent' must be a promise returned by $resolve.resolve()")}else f=l;var n=a.defer(),r=n.promise,s=r.$$promises={},t=S({},d),u=1+q.length/3,v=!1;if(M(f.$$failure))return i(f.$$failure),r;f.$$inheritedValues&&e(t,m(f.$$inheritedValues,p)),S(s,f.$$promises),f.$$values?(v=e(t,m(f.$$values,p)),r.$$inheritedValues=m(f.$$values,p),h()):(f.$$inheritedValues&&(r.$$inheritedValues=m(f.$$inheritedValues,p)),f.then(h,i));for(var w=0,x=q.length;w=0));)s=f(r.id,r.type,r.cfg,"path"),l+=g(r.segment,s.type.pattern.source,s.squash,s.isOptional),n.push(r.segment),m=j.lastIndex;t=a.substring(m);var u=t.indexOf("?");if(u>=0){var v=this.sourceSearch=t.substring(u);if(t=t.substring(0,u),this.sourcePath=a.substring(0,m+u),v.length>0)for(m=0;i=k.exec(v);)r=h(i,!0),s=f(r.id,r.type,r.cfg,"search"),m=j.lastIndex}else this.sourcePath=a,this.sourceSearch="";l+=g(t)+(b.strict===!1?"/?":"")+"$",n.push(t),this.regexp=new RegExp(l,b.caseInsensitive?"i":c),this.prefix=n[0],this.$$paramNames=q}function t(a){S(this,a)}function u(){function a(a){return null!=a?a.toString().replace(/(~|\/)/g,function(a){return{"~":"~~","/":"~2F"}[a]}):a}function e(a){return null!=a?a.toString().replace(/(~~|~2F)/g,function(a){return{"~~":"~","~2F":"/"}[a]}):a}function f(){return{strict:p,caseInsensitive:m}}function i(a){return N(a)||Q(a)&&N(a[a.length-1])}function j(){for(;w.length;){var a=w.shift();if(a.pattern)throw new Error("You cannot override a type's .pattern at runtime.");b.extend(r[a.name],l.invoke(a.def))}}function k(a){S(this,a||{})}V=this;var l,m=!1,p=!0,q=!1,r={},v=!0,w=[],x={string:{encode:a,decode:e,is:function(a){return null==a||!M(a)||"string"==typeof a},pattern:/[^\/]*/},int:{encode:a,decode:function(a){return parseInt(a,10)},is:function(a){return M(a)&&this.decode(a.toString())===a},pattern:/\d+/},bool:{encode:function(a){return a?1:0},decode:function(a){return 0!==parseInt(a,10)},is:function(a){return a===!0||a===!1},pattern:/0|1/},date:{encode:function(a){return this.is(a)?[a.getFullYear(),("0"+(a.getMonth()+1)).slice(-2),("0"+a.getDate()).slice(-2)].join("-"):c},decode:function(a){if(this.is(a))return a;var b=this.capture.exec(a);return b?new Date(b[1],b[2]-1,b[3]):c},is:function(a){return a instanceof Date&&!isNaN(a.valueOf())},equals:function(a,b){return this.is(a)&&this.is(b)&&a.toISOString()===b.toISOString()},pattern:/[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])/,capture:/([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/},json:{encode:b.toJson,decode:b.fromJson,is:b.isObject,equals:b.equals,pattern:/[^\/]*/},any:{encode:b.identity,decode:b.identity,equals:b.equals,pattern:/.*/}};u.$$getDefaultValue=function(a){if(!i(a.value))return a.value;if(!l)throw new Error("Injectable functions cannot be called at configuration time");return l.invoke(a.value)},this.caseInsensitive=function(a){return M(a)&&(m=a),m},this.strictMode=function(a){return M(a)&&(p=a),p},this.defaultSquashPolicy=function(a){if(!M(a))return q;if(a!==!0&&a!==!1&&!O(a))throw new Error("Invalid squash policy: "+a+". Valid policies: false, true, arbitrary-string");return q=a,a},this.compile=function(a,b){return new s(a,S(f(),b))},this.isMatcher=function(a){if(!P(a))return!1;var b=!0;return R(s.prototype,function(c,d){N(c)&&(b=b&&M(a[d])&&N(a[d]))}),b},this.type=function(a,b,c){if(!M(b))return r[a];if(r.hasOwnProperty(a))throw new Error("A type named '"+a+"' has already been defined.");return r[a]=new t(S({name:a},b)),c&&(w.push({name:a,def:c}),v||j()),this},R(x,function(a,b){r[b]=new t(S({name:b},a))}),r=d(r,{}),this.$get=["$injector",function(a){return l=a,v=!1,j(),R(x,function(a,b){r[b]||(r[b]=new t(a))}),this}],this.Param=function(a,d,e,f){function j(a){var b=P(a)?g(a):[],c=h(b,"value")===-1&&h(b,"type")===-1&&h(b,"squash")===-1&&h(b,"array")===-1;return c&&(a={value:a}),a.$$fn=i(a.value)?a.value:function(){return a.value},a}function k(c,d,e){if(c.type&&d)throw new Error("Param '"+a+"' has two type configurations.");return d?d:c.type?b.isString(c.type)?r[c.type]:c.type instanceof t?c.type:new t(c.type):"config"===e?r.any:r.string}function m(){var b={array:"search"===f&&"auto"},c=a.match(/\[\]$/)?{array:!0}:{};return S(b,c,e).array}function p(a,b){var c=a.squash;if(!b||c===!1)return!1;if(!M(c)||null==c)return q;if(c===!0||O(c))return c;throw new Error("Invalid squash policy: '"+c+"'. Valid policies: false, true, or arbitrary string")}function s(a,b,d,e){var f,g,i=[{from:"",to:d||b?c:""},{from:null,to:d||b?c:""}];return f=Q(a.replace)?a.replace:[],O(e)&&f.push({from:e,to:c}),g=o(f,function(a){return a.from}),n(i,function(a){return h(g,a.from)===-1}).concat(f)}function u(){if(!l)throw new Error("Injectable functions cannot be called at configuration time");var a=l.invoke(e.$$fn);if(null!==a&&a!==c&&!x.type.is(a))throw new Error("Default value ("+a+") for parameter '"+x.id+"' is not an instance of Type ("+x.type.name+")");return a}function v(a){function b(a){return function(b){return b.from===a}}function c(a){var c=o(n(x.replace,b(a)),function(a){return a.to});return c.length?c[0]:a}return a=c(a),M(a)?x.type.$normalize(a):u()}function w(){return"{Param:"+a+" "+d+" squash: '"+A+"' optional: "+z+"}"}var x=this;e=j(e),d=k(e,d,f);var y=m();d=y?d.$asArray(y,"search"===f):d,"string"!==d.name||y||"path"!==f||e.value!==c||(e.value="");var z=e.value!==c,A=p(e,z),B=s(e,y,z,A);S(this,{id:a,type:d,location:f,array:y,squash:A,replace:B,isOptional:z,value:v,dynamic:c,config:e,toString:w})},k.prototype={$$new:function(){return d(this,S(new k,{$$parent:this}))},$$keys:function(){for(var a=[],b=[],c=this,d=g(k.prototype);c;)b.push(c),c=c.$$parent;return b.reverse(),R(b,function(b){R(g(b),function(b){h(a,b)===-1&&h(d,b)===-1&&a.push(b)})}),a},$$values:function(a){var b={},c=this;return R(c.$$keys(),function(d){b[d]=c[d].value(a&&a[d])}),b},$$equals:function(a,b){var c=!0,d=this;return R(d.$$keys(),function(e){var f=a&&a[e],g=b&&b[e];d[e].type.equals(f,g)||(c=!1)}),c},$$validates:function(a){var d,e,f,g,h,i=this.$$keys();for(d=0;d=0)throw new Error("State must have a valid name");if(A.hasOwnProperty(c))throw new Error("State '"+c+"' is already defined");var e=c.indexOf(".")!==-1?c.substring(0,c.lastIndexOf(".")):O(b.parent)?b.parent:P(b.parent)&&O(b.parent.name)?b.parent.name:"";if(e&&!A[e])return n(e,b.self);for(var f in D)N(D[f])&&(b[f]=D[f](b,D.$delegates[f]));return A[c]=b,!b[C]&&b.url&&a.when(b.url,["$match","$stateParams",function(a,c){z.$current.navigable==b&&j(a,c)||z.transitionTo(b,a,{inherit:!0,location:!1})}]),q(c),b}function s(a){return a.indexOf("*")>-1}function t(a){for(var b=a.split("."),c=z.$current.name.split("."),d=0,e=b.length;d=A;d--)g=o[d],g.self.onExit&&h.invoke(g.self.onExit,g.self,g.locals.globals),g.locals=null;for(d=A;d2?k.enter(a,null,c).then(d):k.enter(a,null,c,d)},leave:function(a,c){b.version.minor>2?k.leave(a).then(c):k.leave(a,c)}};if(j){var e=j&&j(c,a);return{enter:function(a,b,c){e.enter(a,null,b),c()},leave:function(a,b){e.leave(a),b()}}}return d()}var i=g(),j=i("$animator"),k=i("$animate"),l={restrict:"ECA",terminal:!0,priority:400,transclude:"element",compile:function(c,g,i){return function(c,g,j){function k(){if(m&&(m.remove(),m=null),o&&(o.$destroy(),o=null),n){var a=n.data("$uiViewAnim");s.leave(n,function(){a.$$animLeave.resolve(),m=null}),m=n,n=null}}function l(h){var l,m=B(c,j,g,e),t=m&&a.$current&&a.$current.locals[m];if(h||t!==p){l=c.$new(),p=a.$current.locals[m],l.$emit("$viewContentLoading",m);var u=i(l,function(a){var e=f.defer(),h=f.defer(),i={$animEnter:e.promise,$animLeave:h.promise,$$animLeave:h};a.data("$uiViewAnim",i),s.enter(a,g,function(){e.resolve(),o&&o.$emit("$viewContentAnimationEnded"),(b.isDefined(r)&&!r||c.$eval(r))&&d(a)}),k()});n=u,o=l,o.$emit("$viewContentLoaded",m),o.$eval(q)}}var m,n,o,p,q=j.onload||"",r=j.autoscroll,s=h(j,c);g.inheritedData("$uiView");c.$on("$stateChangeSuccess",function(){l(!1)}),l(!0)}}};return l}function A(a,c,d,e){return{restrict:"ECA",priority:-400,compile:function(f){var g=f.html();return function(f,h,i){var j=d.$current,k=B(f,i,h,e),l=j&&j.locals[k];if(l){h.data("$uiView",{name:k,state:l.$$state}),h.html(l.$template?l.$template:g);var m=b.extend({},l);f[l.$$resolveAs]=m;var n=a(h.contents());if(l.$$controller){l.$scope=f,l.$element=h;var o=c(l.$$controller,l);l.$$controllerAs&&(f[l.$$controllerAs]=o,f[l.$$controllerAs][l.$$resolveAs]=m),N(o.$onInit)&&o.$onInit(),h.data("$ngControllerController",o),h.children().data("$ngControllerController",o)}n(f)}}}}}function B(a,b,c,d){var e=d(b.uiView||b.name||"")(a),f=c.inheritedData("$uiView");return e.indexOf("@")>=0?e:e+"@"+(f?f.state.name:"")}function C(a,b){var c,d=a.match(/^\s*({[^}]*})\s*$/);if(d&&(a=b+"("+d[1]+")"),c=a.replace(/\n/g," ").match(/^([^(]+?)\s*(\((.*)\))?$/),!c||4!==c.length)throw new Error("Invalid state ref '"+a+"'");return{state:c[1],paramExpr:c[3]||null}}function D(a){var b=a.parent().inheritedData("$uiView");if(b&&b.state&&b.state.name)return b.state}function E(a){var b="[object SVGAnimatedString]"===Object.prototype.toString.call(a.prop("href")),c="FORM"===a[0].nodeName;return{attr:c?"action":b?"xlink:href":"href",isAnchor:"A"===a.prop("tagName").toUpperCase(),clickable:!c}}function F(a,b,c,d,e){return function(f){var g=f.which||f.button,h=e();if(!(g>1||f.ctrlKey||f.metaKey||f.shiftKey||a.attr("target"))){var i=c(function(){b.go(h.state,h.params,h.options)});f.preventDefault();var j=d.isAnchor&&!h.href?1:0;f.preventDefault=function(){j--<=0&&c.cancel(i)}}}}function G(a,b){return{relative:D(a)||b.$current,inherit:!0}}function H(a,c){return{restrict:"A",require:["?^uiSrefActive","?^uiSrefActiveEq"],link:function(d,e,f,g){var h,i=C(f.uiSref,a.current.name),j={state:i.state,href:null,params:null},k=E(e),l=g[1]||g[0],m=null;j.options=S(G(e,a),f.uiSrefOpts?d.$eval(f.uiSrefOpts):{});var n=function(c){c&&(j.params=b.copy(c)),j.href=a.href(i.state,j.params,j.options),m&&m(),l&&(m=l.$$addStateInfo(i.state,j.params)),null!==j.href&&f.$set(k.attr,j.href)};i.paramExpr&&(d.$watch(i.paramExpr,function(a){a!==j.params&&n(a)},!0),j.params=b.copy(d.$eval(i.paramExpr))),n(),k.clickable&&(h=F(e,a,c,k,function(){return j}),e[e.on?"on":"bind"]("click",h),d.$on("$destroy",function(){e[e.off?"off":"unbind"]("click",h)}))}}}function I(a,b){return{restrict:"A",require:["?^uiSrefActive","?^uiSrefActiveEq"],link:function(c,d,e,f){function g(b){m.state=b[0],m.params=b[1],m.options=b[2],m.href=a.href(m.state,m.params,m.options),n&&n(),j&&(n=j.$$addStateInfo(m.state,m.params)),m.href&&e.$set(i.attr,m.href)}var h,i=E(d),j=f[1]||f[0],k=[e.uiState,e.uiStateParams||null,e.uiStateOpts||null],l="["+k.map(function(a){return a||"null"}).join(", ")+"]",m={state:null,params:null,options:null,href:null},n=null;c.$watch(l,g,!0),g(c.$eval(l)),i.clickable&&(h=F(d,a,b,i,function(){return m}),d[d.on?"on":"bind"]("click",h),c.$on("$destroy",function(){d[d.off?"off":"unbind"]("click",h)}))}}}function J(a,b,c){return{restrict:"A",controller:["$scope","$element","$attrs","$timeout",function(b,d,e,f){function g(b,c,e){var f=a.get(b,D(d)),g=h(b,c),i={state:f||{name:b},params:c,hash:g};return p.push(i),q[g]=e,function(){var a=p.indexOf(i);a!==-1&&p.splice(a,1)}}function h(a,c){if(!O(a))throw new Error("state should be a string");return P(c)?a+U(c):(c=b.$eval(c),P(c)?a+U(c):a)}function i(){for(var a=0;a0)){var c=g(a,b,o);return i(),c}},b.$on("$stateChangeSuccess",i),i()}]}}function K(a){var b=function(b,c){return a.is(b,c)};return b.$stateful=!0,b}function L(a){var b=function(b,c,d){return a.includes(b,c,d)};return b.$stateful=!0,b}var M=b.isDefined,N=b.isFunction,O=b.isString,P=b.isObject,Q=b.isArray,R=b.forEach,S=b.extend,T=b.copy,U=b.toJson;b.module("ui.router.util",["ng"]),b.module("ui.router.router",["ui.router.util"]),b.module("ui.router.state",["ui.router.router","ui.router.util"]),b.module("ui.router",["ui.router.state"]),b.module("ui.router.compat",["ui.router"]),q.$inject=["$q","$injector"],b.module("ui.router.util").service("$resolve",q),r.$inject=["$http","$templateCache","$injector"],b.module("ui.router.util").service("$templateFactory",r);var V;s.prototype.concat=function(a,b){var c={caseInsensitive:V.caseInsensitive(),strict:V.strictMode(),squash:V.defaultSquashPolicy()};return new s(this.sourcePath+a+this.sourceSearch,S(c,b),this)},s.prototype.toString=function(){return this.source},s.prototype.exec=function(a,b){function c(a){function b(a){return a.split("").reverse().join("")}function c(a){return a.replace(/\\-/g,"-")}var d=b(a).split(/-(?!\\)/),e=o(d,b);return o(e,c).reverse()}var d=this.regexp.exec(a);if(!d)return null;b=b||{};var e,f,g,h=this.parameters(),i=h.length,j=this.segments.length-1,k={};if(j!==d.length-1)throw new Error("Unbalanced capture group in route '"+this.source+"'");var l,m;for(e=0;e
*/
"undefined"!=typeof module&&"undefined"!=typeof exports&&module.exports===exports&&(module.exports="ui.router"),function(a,b,c){"use strict";function d(a,b){return S(new(S(function(){},{prototype:a})),b)}function e(a){return R(arguments,function(b){b!==a&&R(b,function(b,c){a.hasOwnProperty(c)||(a[c]=b)})}),a}function f(a,b){var c=[];for(var d in a.path){if(a.path[d]!==b.path[d])break;c.push(a.path[d])}return c}function g(a){if(Object.keys)return Object.keys(a);var b=[];return R(a,function(a,c){b.push(c)}),b}function h(a,b){if(Array.prototype.indexOf)return a.indexOf(b,Number(arguments[2])||0);var c=a.length>>>0,d=Number(arguments[2])||0;for(d=d<0?Math.ceil(d):Math.floor(d),d<0&&(d+=c);d=0||(k.push(e[m]),j[e[m]]=a[e[m]]);return S({},j,b)}function j(a,b,c){if(!c){c=[];for(var d in a)c.push(d)}for(var e=0;e "));if(s[c]=d,O(a))q.push(c,[function(){return b.get(a)}],j);else{var e=b.annotate(a);R(e,function(a){a!==c&&i.hasOwnProperty(a)&&n(i[a],a)}),q.push(c,a,e)}r.pop(),s[c]=f}}function o(a){return P(a)&&a.then&&a.$$promises}if(!P(i))throw new Error("'invocables' must be an object");var p=g(i||{}),q=[],r=[],s={};return R(i,n),i=r=s=null,function(d,f,g){function h(){--u||(v||e(t,f.$$values),r.$$values=t,r.$$promises=r.$$promises||!0,delete r.$$inheritedValues,n.resolve(t))}function i(a){r.$$failure=a,n.reject(a)}function j(c,e,f){function j(a){l.reject(a),i(a)}function k(){if(!M(r.$$failure))try{l.resolve(b.invoke(e,g,t)),l.promise.then(function(a){t[c]=a,h()},j)}catch(a){j(a)}}var l=a.defer(),m=0;R(f,function(a){s.hasOwnProperty(a)&&!d.hasOwnProperty(a)&&(m++,s[a].then(function(b){t[a]=b,--m||k()},j))}),m||k(),s[c]=l.promise}if(o(d)&&g===c&&(g=f,f=d,d=null),d){if(!P(d))throw new Error("'locals' must be an object")}else d=k;if(f){if(!o(f))throw new Error("'parent' must be a promise returned by $resolve.resolve()")}else f=l;var n=a.defer(),r=n.promise,s=r.$$promises={},t=S({},d),u=1+q.length/3,v=!1;if(M(f.$$failure))return i(f.$$failure),r;f.$$inheritedValues&&e(t,m(f.$$inheritedValues,p)),S(s,f.$$promises),f.$$values?(v=e(t,m(f.$$values,p)),r.$$inheritedValues=m(f.$$values,p),h()):(f.$$inheritedValues&&(r.$$inheritedValues=m(f.$$inheritedValues,p)),f.then(h,i));for(var w=0,x=q.length;w=0));)s=f(r.id,r.type,r.cfg,"path"),l+=g(r.segment,s.type.pattern.source,s.squash,s.isOptional),n.push(r.segment),m=j.lastIndex;t=a.substring(m);var u=t.indexOf("?");if(u>=0){var v=this.sourceSearch=t.substring(u);if(t=t.substring(0,u),this.sourcePath=a.substring(0,m+u),v.length>0)for(m=0;i=k.exec(v);)r=h(i,!0),s=f(r.id,r.type,r.cfg,"search"),m=j.lastIndex}else this.sourcePath=a,this.sourceSearch="";l+=g(t)+(b.strict===!1?"/?":"")+"$",n.push(t),this.regexp=new RegExp(l,b.caseInsensitive?"i":c),this.prefix=n[0],this.$$paramNames=q}function t(a){S(this,a)}function u(){function a(a){return null!=a?a.toString().replace(/(~|\/)/g,function(a){return{"~":"~~","/":"~2F"}[a]}):a}function e(a){return null!=a?a.toString().replace(/(~~|~2F)/g,function(a){return{"~~":"~","~2F":"/"}[a]}):a}function f(){return{strict:p,caseInsensitive:m}}function i(a){return N(a)||Q(a)&&N(a[a.length-1])}function j(){for(;w.length;){var a=w.shift();if(a.pattern)throw new Error("You cannot override a type's .pattern at runtime.");b.extend(r[a.name],l.invoke(a.def))}}function k(a){S(this,a||{})}V=this;var l,m=!1,p=!0,q=!1,r={},v=!0,w=[],x={string:{encode:a,decode:e,is:function(a){return null==a||!M(a)||"string"==typeof a},pattern:/[^\/]*/},int:{encode:a,decode:function(a){return parseInt(a,10)},is:function(a){return M(a)&&this.decode(a.toString())===a},pattern:/\d+/},bool:{encode:function(a){return a?1:0},decode:function(a){return 0!==parseInt(a,10)},is:function(a){return a===!0||a===!1},pattern:/0|1/},date:{encode:function(a){return this.is(a)?[a.getFullYear(),("0"+(a.getMonth()+1)).slice(-2),("0"+a.getDate()).slice(-2)].join("-"):c},decode:function(a){if(this.is(a))return a;var b=this.capture.exec(a);return b?new Date(b[1],b[2]-1,b[3]):c},is:function(a){return a instanceof Date&&!isNaN(a.valueOf())},equals:function(a,b){return this.is(a)&&this.is(b)&&a.toISOString()===b.toISOString()},pattern:/[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])/,capture:/([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/},json:{encode:b.toJson,decode:b.fromJson,is:b.isObject,equals:b.equals,pattern:/[^\/]*/},any:{encode:b.identity,decode:b.identity,equals:b.equals,pattern:/.*/}};u.$$getDefaultValue=function(a){if(!i(a.value))return a.value;if(!l)throw new Error("Injectable functions cannot be called at configuration time");return l.invoke(a.value)},this.caseInsensitive=function(a){return M(a)&&(m=a),m},this.strictMode=function(a){return M(a)&&(p=a),p},this.defaultSquashPolicy=function(a){if(!M(a))return q;if(a!==!0&&a!==!1&&!O(a))throw new Error("Invalid squash policy: "+a+". Valid policies: false, true, arbitrary-string");return q=a,a},this.compile=function(a,b){return new s(a,S(f(),b))},this.isMatcher=function(a){if(!P(a))return!1;var b=!0;return R(s.prototype,function(c,d){N(c)&&(b=b&&M(a[d])&&N(a[d]))}),b},this.type=function(a,b,c){if(!M(b))return r[a];if(r.hasOwnProperty(a))throw new Error("A type named '"+a+"' has already been defined.");return r[a]=new t(S({name:a},b)),c&&(w.push({name:a,def:c}),v||j()),this},R(x,function(a,b){r[b]=new t(S({name:b},a))}),r=d(r,{}),this.$get=["$injector",function(a){return l=a,v=!1,j(),R(x,function(a,b){r[b]||(r[b]=new t(a))}),this}],this.Param=function(a,d,e,f){function j(a){var b=P(a)?g(a):[],c=h(b,"value")===-1&&h(b,"type")===-1&&h(b,"squash")===-1&&h(b,"array")===-1;return c&&(a={value:a}),a.$$fn=i(a.value)?a.value:function(){return a.value},a}function k(c,d,e){if(c.type&&d)throw new Error("Param '"+a+"' has two type configurations.");return d?d:c.type?b.isString(c.type)?r[c.type]:c.type instanceof t?c.type:new t(c.type):"config"===e?r.any:r.string}function m(){var b={array:"search"===f&&"auto"},c=a.match(/\[\]$/)?{array:!0}:{};return S(b,c,e).array}function p(a,b){var c=a.squash;if(!b||c===!1)return!1;if(!M(c)||null==c)return q;if(c===!0||O(c))return c;throw new Error("Invalid squash policy: '"+c+"'. Valid policies: false, true, or arbitrary string")}function s(a,b,d,e){var f,g,i=[{from:"",to:d||b?c:""},{from:null,to:d||b?c:""}];return f=Q(a.replace)?a.replace:[],O(e)&&f.push({from:e,to:c}),g=o(f,function(a){return a.from}),n(i,function(a){return h(g,a.from)===-1}).concat(f)}function u(){if(!l)throw new Error("Injectable functions cannot be called at configuration time");var a=l.invoke(e.$$fn);if(null!==a&&a!==c&&!x.type.is(a))throw new Error("Default value ("+a+") for parameter '"+x.id+"' is not an instance of Type ("+x.type.name+")");return a}function v(a){function b(a){return function(b){return b.from===a}}function c(a){var c=o(n(x.replace,b(a)),function(a){return a.to});return c.length?c[0]:a}return a=c(a),M(a)?x.type.$normalize(a):u()}function w(){return"{Param:"+a+" "+d+" squash: '"+A+"' optional: "+z+"}"}var x=this;e=j(e),d=k(e,d,f);var y=m();d=y?d.$asArray(y,"search"===f):d,"string"!==d.name||y||"path"!==f||e.value!==c||(e.value="");var z=e.value!==c,A=p(e,z),B=s(e,y,z,A);S(this,{id:a,type:d,location:f,array:y,squash:A,replace:B,isOptional:z,value:v,dynamic:c,config:e,toString:w})},k.prototype={$$new:function(){return d(this,S(new k,{$$parent:this}))},$$keys:function(){for(var a=[],b=[],c=this,d=g(k.prototype);c;)b.push(c),c=c.$$parent;return b.reverse(),R(b,function(b){R(g(b),function(b){h(a,b)===-1&&h(d,b)===-1&&a.push(b)})}),a},$$values:function(a){var b={},c=this;return R(c.$$keys(),function(d){b[d]=c[d].value(a&&a[d])}),b},$$equals:function(a,b){var c=!0,d=this;return R(d.$$keys(),function(e){var f=a&&a[e],g=b&&b[e];d[e].type.equals(f,g)||(c=!1)}),c},$$validates:function(a){var d,e,f,g,h,i=this.$$keys();for(d=0;d=0)throw new Error("State must have a valid name");if(A.hasOwnProperty(c))throw new Error("State '"+c+"' is already defined");var e=c.indexOf(".")!==-1?c.substring(0,c.lastIndexOf(".")):O(b.parent)?b.parent:P(b.parent)&&O(b.parent.name)?b.parent.name:"";if(e&&!A[e])return n(e,b.self);for(var f in D)N(D[f])&&(b[f]=D[f](b,D.$delegates[f]));return A[c]=b,!b[C]&&b.url&&a.when(b.url,["$match","$stateParams",function(a,c){z.$current.navigable==b&&j(a,c)||z.transitionTo(b,a,{inherit:!0,location:!1})}]),q(c),b}function s(a){return a.indexOf("*")>-1}function t(a){for(var b=a.split("."),c=z.$current.name.split("."),d=0,e=b.length;d=A;d--)g=o[d],g.self.onExit&&h.invoke(g.self.onExit,g.self,g.locals.globals),g.locals=null;for(d=A;d2?k.enter(a,null,c).then(d):k.enter(a,null,c,d)},leave:function(a,c){b.version.minor>2?k.leave(a).then(c):k.leave(a,c)}};if(j){var e=j&&j(c,a);return{enter:function(a,b,c){e.enter(a,null,b),c()},leave:function(a,b){e.leave(a),b()}}}return d()}var i=g(),j=i("$animator"),k=i("$animate"),l={restrict:"ECA",terminal:!0,priority:400,transclude:"element",compile:function(c,g,i){return function(c,g,j){function k(){if(m&&(m.remove(),m=null),o&&(o.$destroy(),o=null),n){var a=n.data("$uiViewAnim");s.leave(n,function(){a.$$animLeave.resolve(),m=null}),m=n,n=null}}function l(h){var l,m=B(c,j,g,e),t=m&&a.$current&&a.$current.locals[m];if(h||t!==p){l=c.$new(),p=a.$current.locals[m],l.$emit("$viewContentLoading",m);var u=i(l,function(a){var e=f.defer(),h=f.defer(),i={$animEnter:e.promise,$animLeave:h.promise,$$animLeave:h};a.data("$uiViewAnim",i),s.enter(a,g,function(){e.resolve(),o&&o.$emit("$viewContentAnimationEnded"),(b.isDefined(r)&&!r||c.$eval(r))&&d(a)}),k()});n=u,o=l,o.$emit("$viewContentLoaded",m),o.$eval(q)}}var m,n,o,p,q=j.onload||"",r=j.autoscroll,s=h(j,c);g.inheritedData("$uiView");c.$on("$stateChangeSuccess",function(){l(!1)}),l(!0)}}};return l}function A(a,c,d,e){return{restrict:"ECA",priority:-400,compile:function(f){var g=f.html();return function(f,h,i){var j=d.$current,k=B(f,i,h,e),l=j&&j.locals[k];if(l){h.data("$uiView",{name:k,state:l.$$state}),h.html(l.$template?l.$template:g);var m=b.extend({},l);f[l.$$resolveAs]=m;var n=a(h.contents());if(l.$$controller){l.$scope=f,l.$element=h;var o=c(l.$$controller,l);l.$$controllerAs&&(f[l.$$controllerAs]=o,f[l.$$controllerAs][l.$$resolveAs]=m),N(o.$onInit)&&o.$onInit(),h.data("$ngControllerController",o),h.children().data("$ngControllerController",o)}n(f)}}}}}function B(a,b,c,d){var e=d(b.uiView||b.name||"")(a),f=c.inheritedData("$uiView");return e.indexOf("@")>=0?e:e+"@"+(f?f.state.name:"")}function C(a,b){var c,d=a.match(/^\s*({[^}]*})\s*$/);if(d&&(a=b+"("+d[1]+")"),c=a.replace(/\n/g," ").match(/^([^(]+?)\s*(\((.*)\))?$/),!c||4!==c.length)throw new Error("Invalid state ref '"+a+"'");return{state:c[1],paramExpr:c[3]||null}}function D(a){var b=a.parent().inheritedData("$uiView");if(b&&b.state&&b.state.name)return b.state}function E(a){var b="[object SVGAnimatedString]"===Object.prototype.toString.call(a.prop("href")),c="FORM"===a[0].nodeName;return{attr:c?"action":b?"xlink:href":"href",isAnchor:"A"===a.prop("tagName").toUpperCase(),clickable:!c}}function F(a,b,c,d,e){return function(f){var g=f.which||f.button,h=e();if(!(g>1||f.ctrlKey||f.metaKey||f.shiftKey||a.attr("target"))){var i=c(function(){b.go(h.state,h.params,h.options)});f.preventDefault();var j=d.isAnchor&&!h.href?1:0;f.preventDefault=function(){j--<=0&&c.cancel(i)}}}}function G(a,b){return{relative:D(a)||b.$current,inherit:!0}}function H(a,c){return{restrict:"A",require:["?^uiSrefActive","?^uiSrefActiveEq"],link:function(d,e,f,g){var h,i=C(f.uiSref,a.current.name),j={state:i.state,href:null,params:null},k=E(e),l=g[1]||g[0],m=null;j.options=S(G(e,a),f.uiSrefOpts?d.$eval(f.uiSrefOpts):{});var n=function(c){c&&(j.params=b.copy(c)),j.href=a.href(i.state,j.params,j.options),m&&m(),l&&(m=l.$$addStateInfo(i.state,j.params)),null!==j.href&&f.$set(k.attr,j.href)};i.paramExpr&&(d.$watch(i.paramExpr,function(a){a!==j.params&&n(a)},!0),j.params=b.copy(d.$eval(i.paramExpr))),n(),k.clickable&&(h=F(e,a,c,k,function(){return j}),e[e.on?"on":"bind"]("click",h),d.$on("$destroy",function(){e[e.off?"off":"unbind"]("click",h)}))}}}function I(a,b){return{restrict:"A",require:["?^uiSrefActive","?^uiSrefActiveEq"],link:function(c,d,e,f){function g(b){m.state=b[0],m.params=b[1],m.options=b[2],m.href=a.href(m.state,m.params,m.options),n&&n(),j&&(n=j.$$addStateInfo(m.state,m.params)),m.href&&e.$set(i.attr,m.href)}var h,i=E(d),j=f[1]||f[0],k=[e.uiState,e.uiStateParams||null,e.uiStateOpts||null],l="["+k.map(function(a){return a||"null"}).join(", ")+"]",m={state:null,params:null,options:null,href:null},n=null;c.$watch(l,g,!0),g(c.$eval(l)),i.clickable&&(h=F(d,a,b,i,function(){return m}),d[d.on?"on":"bind"]("click",h),c.$on("$destroy",function(){d[d.off?"off":"unbind"]("click",h)}))}}}function J(a,b,c){return{restrict:"A",controller:["$scope","$element","$attrs","$timeout",function(b,d,e,f){function g(b,c,e){var f=a.get(b,D(d)),g=h(b,c),i={state:f||{name:b},params:c,hash:g};return p.push(i),q[g]=e,function(){var a=p.indexOf(i);a!==-1&&p.splice(a,1)}}function h(a,c){if(!O(a))throw new Error("state should be a string");return P(c)?a+U(c):(c=b.$eval(c),P(c)?a+U(c):a)}function i(){for(var a=0;a0)){var c=g(a,b,o);return i(),c}},b.$on("$stateChangeSuccess",i),i()}]}}function K(a){var b=function(b,c){return a.is(b,c)};return b.$stateful=!0,b}function L(a){var b=function(b,c,d){return a.includes(b,c,d)};return b.$stateful=!0,b}var M=b.isDefined,N=b.isFunction,O=b.isString,P=b.isObject,Q=b.isArray,R=b.forEach,S=b.extend,T=b.copy,U=b.toJson;b.module("ui.router.util",["ng"]),b.module("ui.router.router",["ui.router.util"]),b.module("ui.router.state",["ui.router.router","ui.router.util"]),b.module("ui.router",["ui.router.state"]),b.module("ui.router.compat",["ui.router"]),q.$inject=["$q","$injector"],b.module("ui.router.util").service("$resolve",q),r.$inject=["$http","$templateCache","$injector"],b.module("ui.router.util").service("$templateFactory",r);var V;s.prototype.concat=function(a,b){var c={caseInsensitive:V.caseInsensitive(),strict:V.strictMode(),squash:V.defaultSquashPolicy()};return new s(this.sourcePath+a+this.sourceSearch,S(c,b),this)},s.prototype.toString=function(){return this.source},s.prototype.exec=function(a,b){function c(a){function b(a){return a.split("").reverse().join("")}function c(a){return a.replace(/\\-/g,"-")}var d=b(a).split(/-(?!\\)/),e=o(d,b);return o(e,c).reverse()}var d=this.regexp.exec(a);if(!d)return null;b=b||{};var e,f,g,h=this.parameters(),i=h.length,j=this.segments.length-1,k={};if(j!==d.length-1)throw new Error("Unbalanced capture group in route '"+this.source+"'");var l,m;for(e=0;e
@/lua/ge/extensions/editor/roadSpline/layerMgr.lua
decalRoad:setField("overObjects", 0, tostring(layer.isOverObjects))
decalRoad:setField('startEndFade', 0, string.format("%f %f", startFade, endFade)) -- Apply fade parameters for this chunk.
dRoad:setField("overObjects", 0, tostring(layer.isOverObjects))
dRoad:setField('startEndFade', 0, string.format("%f %f", layer.fadeIn, layer.fadeOut))
group.layers[#group.layers + 1] = {
name = string.format("New Layer %d", #group.layers + 1),
id = Engine.generateUUID(),
group.layers[#group.layers + 1] = {
name = string.format("%s - Left %d", searchString, i),
id = Engine.generateUUID(),
group.layers[#group.layers + 1] = {
name = string.format("%s - Right %d", searchString, i),
id = Engine.generateUUID(),
group.layers[#group.layers + 1] = {
name = string.format("%s - Left %d", roadLaneLineStr, i),
id = Engine.generateUUID(),
group.layers[#group.layers + 1] = {
name = string.format("%s - Right %d", roadLaneLineStr, i),
id = Engine.generateUUID(),
@/lua/ge/extensions/flowgraph/nodes/environment/randomTimeOfDay.lua
if use24Hour then
return string.format("%02d:%02d", hour, minute)
else
local ampm = hour < 12 and "AM" or "PM"
return string.format("%d:%02d %s", hour12, minute, ampm)
end
@/lua/ge/extensions/editor/dynamicDecals/fonts.lua
for i = header["first_char"], header["first_char"] + header["glyph_count"] - 1, 1 do
table.insert(tblx, string.format("%d : %s", i, string.char(i)))
end
if fontAtlasDataMap[fontName] then return end
fontAtlasDataMap[fontName] = jsonReadFile(string.format("%s%s/%s%s", destinationDirectory, fontName, fontName, fontAtlasJsonExtension))
end
for _, fontName in ipairs(generatedFontAtlases) do
if im.TreeNode1(string.format("%s##browserTabGui", fontName)) then
readFontAtlasData(fontName)
if fontData and fontData.header and fontData.glyphs then
local fontAtlasTexObj = editor.getTempTextureObj(string.format("%s%s/%s%s", destinationDirectory, fontName, fontName, "_monospaced.png"))
local header = fontData.header
else
table.insert(fontGenNotifications, {msg=string.format("Not able to create font atlas for '%s'", path), time = 5, color = editor.color.error.Value})
editor.logWarn(string.format("%s - Not able to create font atlas for '%s'", logTag, path))
table.insert(fontGenNotifications, {msg=string.format("Not able to create font atlas for '%s'", path), time = 5, color = editor.color.error.Value})
editor.logWarn(string.format("%s - Not able to create font atlas for '%s'", logTag, path))
notification.add("Fonts", "Font Atlas creation failed", "Font Atlas creation failed. Check logs for more info.", notification.levels.error)
im.TableNextColumn()
im.TextUnformatted(string.format("[%d, %d]", header.atlas_width, header.atlas_height))
im.TableNextColumn()
im.TextUnformatted(string.format("[%d, %d]", header.atlas_monospaced_width, header.atlas_monospaced_height))
im.TableNextColumn()
im.TextUnformatted(string.format("%.1f", header.glyph_pixel_height))
im.TableNextColumn()
im.TextUnformatted(string.format("%.1f", header.sdf.pixel_dist_scale))
end
im.BeginChild1("FontPreviewAtlasChild")
helper.imageWidget(string.format("%s%s/%s%s", destinationDirectory, getSelectedFontAtlasName(), getSelectedFontAtlasName(), "_monospaced.png"), im.GetContentRegionAvailWidth() - 2 * im.GetStyle().FramePadding.x)
im.EndChild()
local glyphPreviewSize = editor.getPreference("dynamicDecalsTool.fonts.glyphPreviewSizeInPreviewWindow")
local textureObject = editor.getTempTextureObj(string.format("%s%s/%s%s", destinationDirectory, getSelectedFontAtlasName(), getSelectedFontAtlasName(), "_monospaced.png"))
for i = header.first_char, (header.first_char + header.glyph_count - 1), 1 do
)
im.tooltip(string.format("%d : %s\nxadvance: %f", i, i == 32 and "space" or string.char(i), char.xadvance))
im.SameLine()
im.BeginChild1("FontPreviewSDFAtlasChild")
helper.imageWidget(string.format("%s%s/%s%s", destinationDirectory, getSelectedFontAtlasName(), getSelectedFontAtlasName(), "_sdf_monospaced.png"), im.GetContentRegionAvailWidth() - 2 * im.GetStyle().FramePadding.x)
im.EndChild()
local glyphPreviewSize = editor.getPreference("dynamicDecalsTool.fonts.glyphPreviewSizeInPreviewWindow")
local textureObject = editor.getTempTextureObj(string.format("%s%s/%s%s", destinationDirectory, getSelectedFontAtlasName(), getSelectedFontAtlasName(), "_sdf_monospaced.png"))
for i = header.first_char, (header.first_char + header.glyph_count - 1), 1 do
)
im.tooltip(string.format("%d : %s\nxadvance: %f", i, i == 32 and "space" or string.char(i), char.xadvance))
im.SameLine()
if #generatedFontAtlases > 0 and fontAtlasData then
helper.imageTooltip(string.format("%s%s/%s%s", destinationDirectory, getSelectedFontAtlasName(), getSelectedFontAtlasName(), "_monospaced.png"), 512)
im.Image(
editor.getTempTextureObj(string.format("%s%s/%s%s", destinationDirectory, getSelectedFontAtlasName(), getSelectedFontAtlasName(), "_monospaced.png")).texId,
im.ImVec2(glyphPreviewSize, glyphPreviewSize),
@/lua/ge/extensions/editor/createObjectTool.lua
if hiddenClasses[result.name] and string.len(hiddenClasses[result.name]) > 0 then
imgui.SetTooltip(string.format("Use %s for this class", hiddenClasses[result.name]))
elseif string.len(result.name) >= tooltipLongTextLength then
@/lua/ge/extensions/editor/aiViz.lua
local linkTextFunctions = {
drivability = function(data) if data.drivability == nil then return "-" else return string.format("%g", data.drivability) end end,
type = function(data) return data.type or "-" end,
type = function(data) return data.type or "-" end,
speedLimit = function(data) if data.speedLimit == nil then return "-" else return string.format("%g m/s", data.speedLimit) end end,
hiddenInNavi = function(data) return data.hiddenInNavi and "Hidden" or "Visible" end
@/lua/ge/extensions/editor/toolUtilities/skeleton.lua
log('I', logTag, string.format("bitmapToMask() complete. Range: [%g, %g], threshold: %.3f", minVal, maxVal, threshold))
return mask
@/lua/common/json-ast.lua
end
res = res .. string.format('%' .. precision .. '.' .. precision .. 'f', num)
if node.addPostfixDot then
if not testFile(filename, writeAST) then
log('E', '', string.format('File %04d/%04d ERROR: %s', i, fileCount, tostring(filename)))
--return
if reportOK then
log('I', '', string.format('File %04d/%04d OK: %s', i, fileCount, tostring(filename)))
end
@/lua/ge/extensions/editor/gen/network.lua
road:setField("material", 0, mat)
road:setField('distanceFade', 0, string.format("%f %f", 0, 200))
groupEdit:add(road)
road:setField("material", 0, mat)
road:setField('distanceFade', 0, string.format("%f %f", 0, 200))
groupEdit:add(road)
@/lua/ge/extensions/tech/openStreetMapExporter.lua
local time = os.date("*t")
return string.format("%02d/%02d/%04d %02d:%02d:%02d",
time.day, time.month, time.year,
local function writeOsmFile(fileName, nodesData, ways)
-- Write the road network data to .osm format (xml).
local fullFileName = fileName .. ".osm"
f:write('\n')
f:write(string.format('\t\n',
tostring(nodesData.minlat), tostring(nodesData.minlon),
f:write(string.format('\t\n',
nodeId, lat, lon, ele, dateTime))
local wayId = i -- the OpenStreetMap Id numbers start at 1 not 0.
f:write(string.format('\t\n', wayId))
local nodeId = seg[j] + 1
f:write(string.format('\t\t\n', nodeId))
end
@/lua/common/luaBinding.lua
if not mt then
--log('E', '', string.format("property '%s.%s' is not found", origmt.___type, k))
return
if not mt then
--log('E', '', string.format("property '%s.%s' is not found", origmt.___type, k))
return
if not mt then
--log('E', '', string.format("property '%s.%s' is not found or not writable: %s", getmetatable(t).___type, k, debug.traceback()))
return
if not mt then
--log('E', '', string.format("property '%s.%s' is not found or not writable: %s", getmetatable(t).___type, k, debug.traceback()))
return
@/lua/ge/spawn.lua
if pos then
log('I', logTag, string.format("spawning %s at initial position (%f,%f,%f)", model, pos.x, pos.y, pos.z))
else
else
log('I', logTag, string.format("spawning %s with no initial position", model))
end
if core_vehicles.couplerTagsOptions[couplerTag] == "autoCouple" then
veh:queueLuaCommand(string.format('beamstate.activateAutoCoupling("%s")', couplerTag))
end
@/lua/ge/extensions/career/modules/testDrive.lua
local logBookLabel = "Didn't return the test drive vehicle."
local label = string.format("Fee for not returning the test drive vehicle : -%i$", testDriveInfo.abandonFees)
ui_message(label, 5, 'test1')
if testDriveInfo == nil or not active or not testDriveInfo.endParkingSpot or not testDriveInfo.endParkingSpotCreated then return end
id = string.format("testDrive-%s-%s-parkingEnd",testDriveInfo.dealershipName, testDriveInfo.route)
local eps = testDriveInfo.endParkingSpot
@/lua/ge/extensions/util/groundModelDebug.lua
im.PushItemWidth(120)
if im.SliderInt("Render area", colDensityTileCount, 3, 100, string.format("%d x %d (%d tiles)", colDensityTileCount[0], colDensityTileCount[0], colDensityTileCount[0]*colDensityTileCount[0])) then
serializeSettings()
-- -- then the text on top and the other columns
-- im.Text(string.format("%d (%0.2f%%%%)", body.tris, (body.tris / c.worlds[1].tris) * 100))
-- im.NextColumn()
@/lua/ge/extensions/editor/raceEditor.lua
if string.match(pn.name, "^Pathnode ") then
pn.name = string.format("Pathnode %d", i)
end
local pn2ShortName = string.match(pn2.name, "(%d+)$")
seg.name = string.format("Segment %s->%s", pn1ShortName or pn1.name, pn2ShortName or pn2.name)
else
else
seg.name = string.format("Segment %d", i)
end
local distKm = cachedRaceDistance / 1000
return string.format("Distance: %.2fkm", distKm)
end
@/lua/vehicle/controller/drivingDynamics/actuators/electronicSplitShaftLock.lua
if not relevantSplitShaft then
log("E", "electronicSplitShaftLock.initSecondStage", string.format("Can't find configured splitShaft (%q), disabling system...", splitShaftName))
return
@/lua/console/bananabench-async.lua
local function formatRes(res)
return lpad(string.format("%0.3f", res.beamspersec), 8, ' ') .. ' | ' .. lpad(string.format("%0.2f", res.percentRealtime), 8, ' ')
end
local function formatRes(res)
return lpad(string.format("%0.3f", res.beamspersec), 8, ' ') .. ' | ' .. lpad(string.format("%0.2f", res.percentRealtime), 8, ' ')
end
--local diff = t.res[2].beamspersec / t.res[1].beamspersec
t.msg = lpad(t.vehicles, 2, ' ') .. " | " .. formatRes(t.res[1]) .. ' | ' .. formatRes(t.res[2]) .. ' | ' -- .. lpad(string.format("%0.2f", diff * 100), 8, ' ')
table.insert(test.tests, t)
print("Max Mbeams/s: " .. string.format("%0.3f", test.maxMbeams) .. " Mbeams/s")
res.tests[vehicle] = test
@/lua/ge/extensions/flowgraph/nodes/string/format.lua
if self.count == 1 then
self.pinOut.value.value = string.format(self.data.pattern, self.pinIn.value_1.value)
elseif self.count == 2 then
elseif self.count == 2 then
self.pinOut.value.value = string.format(self.data.pattern, self.pinIn.value_1.value, self.pinIn.value_2.value)
elseif self.count == 3 then
elseif self.count == 3 then
self.pinOut.value.value = string.format(self.data.pattern, self.pinIn.value_1.value, self.pinIn.value_2.value,
self.pinIn.value_3.value)
elseif self.count == 4 then
self.pinOut.value.value = string.format(self.data.pattern, self.pinIn.value_1.value, self.pinIn.value_2.value,
self.pinIn.value_3.value, self.pinIn.value_4.value)
elseif self.count == 5 then
self.pinOut.value.value = string.format(self.data.pattern, self.pinIn.value_1.value, self.pinIn.value_2.value,
self.pinIn.value_3.value, self.pinIn.value_4.value, self.pinIn.value_5.value)
elseif self.count == 6 then
self.pinOut.value.value = string.format(self.data.pattern, self.pinIn.value_1.value, self.pinIn.value_2.value,
self.pinIn.value_3.value, self.pinIn.value_4.value, self.pinIn.value_5.value, self.pinIn.value_6.value)
elseif self.count == 7 then
self.pinOut.value.value = string.format(self.data.pattern, self.pinIn.value_1.value, self.pinIn.value_2.value,
self.pinIn.value_3.value, self.pinIn.value_4.value, self.pinIn.value_5.value, self.pinIn.value_6.value,
elseif self.count == 8 then
self.pinOut.value.value = string.format(self.data.pattern, self.pinIn.value_1.value, self.pinIn.value_2.value,
self.pinIn.value_3.value, self.pinIn.value_4.value, self.pinIn.value_5.value, self.pinIn.value_6.value,
elseif self.count == 9 then
self.pinOut.value.value = string.format(self.data.pattern, self.pinIn.value_1.value, self.pinIn.value_2.value,
self.pinIn.value_3.value, self.pinIn.value_4.value, self.pinIn.value_5.value, self.pinIn.value_6.value,
elseif self.count == 10 then
self.pinOut.value.value = string.format(self.data.pattern, self.pinIn.value_1.value, self.pinIn.value_2.value,
self.pinIn.value_3.value, self.pinIn.value_4.value, self.pinIn.value_5.value, self.pinIn.value_6.value,
elseif self.count == 11 then
self.pinOut.value.value = string.format(self.data.pattern, self.pinIn.value_1.value, self.pinIn.value_2.value,
self.pinIn.value_3.value, self.pinIn.value_4.value, self.pinIn.value_5.value, self.pinIn.value_6.value,
elseif self.count == 12 then
self.pinOut.value.value = string.format(self.data.pattern, self.pinIn.value_1.value, self.pinIn.value_2.value,
self.pinIn.value_3.value, self.pinIn.value_4.value, self.pinIn.value_5.value, self.pinIn.value_6.value,
elseif self.count == 13 then
self.pinOut.value.value = string.format(self.data.pattern, self.pinIn.value_1.value, self.pinIn.value_2.value,
self.pinIn.value_3.value, self.pinIn.value_4.value, self.pinIn.value_5.value, self.pinIn.value_6.value,
elseif self.count == 14 then
self.pinOut.value.value = string.format(self.data.pattern, self.pinIn.value_1.value, self.pinIn.value_2.value,
self.pinIn.value_3.value, self.pinIn.value_4.value, self.pinIn.value_5.value, self.pinIn.value_6.value,
elseif self.count == 15 then
self.pinOut.value.value = string.format(self.data.pattern, self.pinIn.value_1.value, self.pinIn.value_2.value,
self.pinIn.value_3.value, self.pinIn.value_4.value, self.pinIn.value_5.value, self.pinIn.value_6.value,
elseif self.count == 16 then
self.pinOut.value.value = string.format(self.data.pattern, self.pinIn.value_1.value, self.pinIn.value_2.value,
self.pinIn.value_3.value, self.pinIn.value_4.value, self.pinIn.value_5.value, self.pinIn.value_6.value,
@/lua/vehicle/extensions/tech/platooning.lua
local vehiclesData = {leaderID = leaderID, vehicleID = vid}
obj:queueGameEngineLua(string.format("tech_platoonFunctions.removeVehicleFromPlatoon(%q)", lpack.encode(vehiclesData)))
ai.setMode('manual')
@/lua/ge/extensions/gameplay/drag/utils.lua
phase.started = true
print(string.format("Racer: %d started phase: RACE", racer.vehId, phase.name))
extensions.hook("dragRaceStarted", racer.vehId)
@/inspector/Models/Canvas.js
if (this._cssCanvasName)
return WI.UIString("CSS canvas \u201C%s\u201D").format(this._cssCanvasName);
if (idSelector)
return WI.UIString("Canvas %s").format(idSelector);
}
this._uniqueDisplayNameNumber = this.constructor._nextUniqueDisplayNameNumber++;
return WI.UIString("Canvas %d").format(this._uniqueDisplayNameNumber);
}
@/lua/ge/extensions/flowgraph/nodes/ui/genericMissionDataText.lua
if self.pinIn.style.value == "time" then
data.txt = string.format("%02d:%02d", math.floor(self.pinIn.txt.value / 60), math.floor(self.pinIn.txt.value % 60))
data.minutes = string.format("%02d", math.floor(self.pinIn.txt.value / 60))
data.txt = string.format("%02d:%02d", math.floor(self.pinIn.txt.value / 60), math.floor(self.pinIn.txt.value % 60))
data.minutes = string.format("%02d", math.floor(self.pinIn.txt.value / 60))
data.seconds = string.format("%02d", math.floor(self.pinIn.txt.value % 60))
data.minutes = string.format("%02d", math.floor(self.pinIn.txt.value / 60))
data.seconds = string.format("%02d", math.floor(self.pinIn.txt.value % 60))
data.style = "text"
elseif self.pinIn.style.value == "timemillis" then
data.txt = string.format("%02d:%02d.%03d", math.floor(self.pinIn.txt.value / 60), math.floor(self.pinIn.txt.value % 60), math.floor((self.pinIn.txt.value % 1) * 1000))
data.minutes = string.format("%02d", math.floor(self.pinIn.txt.value / 60))
data.txt = string.format("%02d:%02d.%03d", math.floor(self.pinIn.txt.value / 60), math.floor(self.pinIn.txt.value % 60), math.floor((self.pinIn.txt.value % 1) * 1000))
data.minutes = string.format("%02d", math.floor(self.pinIn.txt.value / 60))
data.seconds = string.format("%02d", math.floor(self.pinIn.txt.value % 60))
data.minutes = string.format("%02d", math.floor(self.pinIn.txt.value / 60))
data.seconds = string.format("%02d", math.floor(self.pinIn.txt.value % 60))
data.milliseconds = string.format("%03d", math.floor((self.pinIn.txt.value % 1) * 1000))
data.seconds = string.format("%02d", math.floor(self.pinIn.txt.value % 60))
data.milliseconds = string.format("%03d", math.floor((self.pinIn.txt.value % 1) * 1000))
data.style = "text"
@/lua/ge/extensions/core/trafficSignals.lua
str = string.format('%s / %s / %s', self.name, ctrl.name or "(Null controller)", seq.name or "(Null Sequence)")
end
if self._invalid then
debugDrawer:drawText(self.pos, string.format('%s (ERROR)', self.name), debugColors.textError)
else
if showText then
debugDrawer:drawText(debugPos, string.format('state: %s', stateName or 'none'), debugColors.textMain)
end
if not self._invalid then
log('E', logTag, string.format('Map node could not be set for signal instance: %s', self.name))
end
if not self._invalid then
log('E', logTag, string.format('Controller is missing from signal instance: %s', self.name))
end
else
log('E', logTag, string.format('Controller definition state not found: %s', state))
end
else
log('E', logTag, string.format('Controller definition type not found: %s', key))
end
if self.totalDuration == 0 then -- if duration is still zero, then ignore this sequence
log('W', logTag, string.format('Sequence has zero duration, now ignoring timeline: %s', self.name))
return
setupSignals(data)
log('I', logTag, string.format('Traffic signals loaded (%d instances, %d controllers, %d sequences)', #data.instances, #data.controllers, #data.sequences))
@/lua/common/libs/lua-MessagePack/MessagePack.lua
local function hexadump(s)
return (s:gsub('.', function (c) return format('%02X ', c:byte()) end))
end
else
return function() error("unpack '" .. format('%#x', k) .. "' is unimplemented") end
end
@/inspector/Views/FrameTreeElement.js
if (this.resource.parentFrame.name)
return WI.UIString("%s (%s)").format(this.resource.parentFrame.name, super.mainTitleText);
return super.mainTitleText;
@/lua/vehicle/controller/drivingDynamics/actuators/activeDiffLock.lua
if not relevantDifferential then
log("E", "activeDiffLock.initSecondStage", string.format("Can't find configured differential (%q), disabling system...", diffName))
return
@/lua/ge/extensions/gameplay/missions/missionTypes/editorHelper.lua
if not foundFile then
return {{label = string.format('File does not exist: %s - fieldName %s does not exist: %s', e.fieldName, dumps(file)), severity = 'error'}}
end
if mtd[val.fieldName] ~= nil and element.defaultValue ~= nil and (type(mtd[val.fieldName]) ~= type(element.defaultValue)) then
table.insert(issues, {label = 'Mismatched Missiontype Value: ' .. val.fieldName .. string.format(" (%s, should be %s)", type(mtd[val.fieldName]), type(element.defaultValue)), data=val, severity='error', fixable=true})
end
im.BeginDisabled()
im.Text(string.format("%0.2f m/s = %0.2f %s",e.ptr[0],translateVelocity(e.ptr[0], true)))
im.EndDisabled()
im.BeginDisabled()
im.Text(string.format("%0.2f m = %0.2f %s",e.ptr[0],translateDistance(e.ptr[0], true)))
im.EndDisabled()
local t = e.ptr[0]
im.Text(string.format("%0.2f s = %d:%02d.%02d mm:ss.mmm",t,(t-(t%60))/60, math.floor(t%60), 100*(t%1)))
im.EndDisabled()
--local budgets = career_career.getBudgets(e.ptr[0])
--im.TextDisabled(string.format("%0.2f Reward = %0.2f B$ and %d Reputation", e.ptr[0], budgets.moneyBudget, budgets.reputationBudget))
return ret
editEnded[0] = false
--im.Text(string.format("%d - %s", index, dumps(element.hidden)))
if not element.hidden and (drawFunctions[element.type] or nop)(element, self.mission.missionTypeData, self.mission, self.mouseInfo) then
field.type = ui_flowgraph_editor.getAutoTypeFromName(field.label)
--print(string.format("%s (%s) from %s", field.fieldName, field.type, field.elemLabel))
end
@/inspector/Models/ScriptTimelineRecord.js
var eventDisplayName = WI.ScriptTimelineRecord._eventDisplayNames.get(details) || details.capitalize();
return WI.UIString("%s Event Dispatched").format(eventDisplayName);
}
if (details && (details instanceof String || typeof details === "string"))
return WI.UIString("\u201C%s\u201D Profile Recorded").format(details);
return WI.UIString("Console Profile Recorded");
if (details && includeDetailsInMainTitle)
return WI.UIString("Timer %d Fired").format(details);
return WI.UIString("Timer Fired");
if (details && includeDetailsInMainTitle)
return WI.UIString("Timer %d Installed").format(details.timerId);
return WI.UIString("Timer Installed");
if (details && includeDetailsInMainTitle)
return WI.UIString("Timer %d Removed").format(details);
return WI.UIString("Timer Removed");
if (details && includeDetailsInMainTitle)
return WI.UIString("Animation Frame %d Fired").format(details);
return WI.UIString("Animation Frame Fired");
if (details && (details instanceof String || typeof details === "string"))
return WI.UIString("%s Callback").format(details);
return WI.UIString("Observer Callback");
if (details && includeDetailsInMainTitle)
return WI.UIString("Animation Frame %d Requested").format(details);
return WI.UIString("Animation Frame Requested");
if (details && includeDetailsInMainTitle)
return WI.UIString("Animation Frame %d Canceled").format(details);
return WI.UIString("Animation Frame Canceled");
@/lua/ge/extensions/gameplay/rally/driveline/drivelineV3.lua
local reductionPercent = 100.0 * (1.0 - simplifiedCount / originalPointCount)
log('I', logTag, string.format('Simplified %d driveline points to %d spline nodes (%.1f%% reduction)',
originalPointCount, simplifiedCount, reductionPercent))
@/lua/ge/extensions/gameplay/drag/display.lua
-- Three decimal points for time
for num in string.gmatch(string.format("%.3f", timeVal), "%d") do
table.insert(timeDisplayValue, num)
-- Two decimal points for speed
for num in string.gmatch(string.format("%.2f", velVal), "%d") do
table.insert(speedDisplayValue, num)
@/lua/vehicle/hydros.lua
if type(input.lowspeedCoefFFB) == "boolean" then
log("I", "", string.format("This vehicle's steering hydro has specified a custom lowspeedCoefFFB setting. Overriding the binding setting lowspeedCoef=%s with the hydro setting lowspeedCoef=%s", dumps(ffbParams.lowspeedCoef), dumps(input.lowspeedCoefFFB)))
ffbParams.lowspeedCoef = input.lowspeedCoefFFB
FFBperiod = M.enableFFBflood and 0 or (1 / math.floor(finalFrequency + 0.5)) -- allow unlimited update in case flood debugging
log("D", "hydros.init", string.format("FFB update rate heuristics: potentially supported freq: %5.1f, clamped freq: %5.1f, safe freq: %5.1f", detectedFrequency, clampedFrequency, safeFrequency))
log("D", "hydros.init", string.format("FFB settings: requested freq: %5.3f, rate selection mode: %s, final used frequency: %5.3f", frequency, automaticRate and "auto" or "manual", finalFrequency))
log("D", "hydros.init", string.format("FFB update rate heuristics: potentially supported freq: %5.1f, clamped freq: %5.1f, safe freq: %5.1f", detectedFrequency, clampedFrequency, safeFrequency))
log("D", "hydros.init", string.format("FFB settings: requested freq: %5.3f, rate selection mode: %s, final used frequency: %5.3f", frequency, automaticRate and "auto" or "manual", finalFrequency))
log("D", "hydros.init", string.format("FFB summary: vehicle: %s (id %s), type: '%s', strength: %5.3f, smoothing: %5.3f", dumps(v.data.vehicleDirectory), dumps(obj:getId()), "steering", M.wheelFFBForceCoef, wheelFFBSmoothing))
log("D", "hydros.init", string.format("FFB settings: requested freq: %5.3f, rate selection mode: %s, final used frequency: %5.3f", frequency, automaticRate and "auto" or "manual", finalFrequency))
log("D", "hydros.init", string.format("FFB summary: vehicle: %s (id %s), type: '%s', strength: %5.3f, smoothing: %5.3f", dumps(v.data.vehicleDirectory), dumps(obj:getId()), "steering", M.wheelFFBForceCoef, wheelFFBSmoothing))
turnOffFFBInterfaces()
@/lua/ge/extensions/editor/resourceChecker/resourceUtil.lua
for _,v in pairs(shapesprepare) do
local sizeS = string.format("%.2f", v[2] / 1048576)
local cachesize = string.format("%.2f", v[3] / 1048576)
local sizeS = string.format("%.2f", v[2] / 1048576)
local cachesize = string.format("%.2f", v[3] / 1048576)
table.insert(shapes, v[1].." Collada size: "..sizeS.." MB. Cache size: "..cachesize.." MB")
isDone = 1
size = string.format("%.2f", size/1048576)
sizecache = string.format("%.2f", sizecache/1048576)
size = string.format("%.2f", size/1048576)
sizecache = string.format("%.2f", sizecache/1048576)
local data = {type, countduplicate, countScene, shapes, isDone, size, sizecache}
for _,v in pairs(shapesprepare) do
local sizeS = string.format("%.2f", v[2] / 1048576)
local cachesize = string.format("%.2f", v[3] / 1048576)
local sizeS = string.format("%.2f", v[2] / 1048576)
local cachesize = string.format("%.2f", v[3] / 1048576)
table.insert(shapes, v[1].." Collada size: "..sizeS.." MB. Cache size: "..cachesize.." MB")
isDone = 1
size = string.format("%.2f", size/1048576)
sizecache = string.format("%.2f", sizecache/1048576)
size = string.format("%.2f", size/1048576)
sizecache = string.format("%.2f", sizecache/1048576)
local data = {type, countduplicate, "dummy", shapes, isDone, size, sizecache}
isDone = 1
size = string.format("%.2f", size/1048576)
local data = {type, countduplicate, size, shapes, isDone}
job.yield()
table.insert(shapes, {k.." used: "..tostring(v[2]).." times. Textures memory usage: "..string.format("%.2f", v[1]/1048576).." MB", v[1]})
countduplicate = countduplicate + 1
end
sizeTotal = string.format("%.2f", sizeTotal/1048576)
for k,v in pairs(matsInObjects) do
isDone = 1
size = string.format("%.2f", size/1048576)
end
isDone = 1
size = string.format("%.2f", size/1048576)
end
isDone = 1
size = string.format("%.2f", size/1048576)
end
@/lua/vehicle/extensions/escMeasurement.lua
--print(string.format("%.2f -> %.2f, %.3f -> %.2f", bsa, speedPoint, wheelAnglePoint, yawRatePoint))
--dump(measurementsSTM)
-- for _, v in pairs(data[10] or {}) do
-- filePivot:write(string.format("%.0f,%.0f,%.0f\r\n", v.frontWheelAngle * 1000, v.measuredYawAV * 1000, v.measuredBodySlipAngle * 1000))
-- end
config_key = configName
log("I", logTag, string.format(" *** testing car: %s->%s ***", model_key, config_key))
@/lua/ge/extensions/gameplay/missions/missionTypes/flowMission.lua
if veh:isReady() then
veh:queueLuaCommand("obj:setWind("..string.format('%2f, %2f, %2f', wind.x, wind.y, wind.z)..")")
end
@/lua/ge/extensions/flowgraph/nodes/gameplay/rally/countdownSynced.lua
self.testEnvironmentStartTimeSecs = adjustedHours * 3600 -- Convert to seconds
log('D', logTag, string.format('Test mode: environment start time: %.0f seconds', self.testEnvironmentStartTimeSecs))
else
log('D', logTag, string.format('Test mode: scheduled event at epoch %.2f (wall clock %.2f, in %.2f seconds)',
self.data.testScheduledEventTime, targetWallClockSecs, self.data.testScheduledEventTime - self.testEpoch))
return string.format("%02d:%02d:%02d", hours24, minutes, seconds)
end
log('D', logTag, string.format('Countdown will sync to event at %.2f, starting countdown at %.2f (duration: %.2f)',
scheduledEventTime, self.targetStartTime, self.duration))
local timeUntilEvent = scheduledEventTime - currentEpochTime
im.Text(string.format("Epoch: %.1fs", currentEpochTime))
im.Text("Event at: " .. scheduledWallClockStr)
im.Text(string.format("Event in: %.1fs", timeUntilEvent))
end
self.pinOut.warningSeconds.value = warningTime
-- log('D', logTag, string.format('Warning triggered: %d seconds until event', warningTime))
-- Visual display for warning
local warningMsg = string.format('%d seconds', warningTime)
if self:shouldShowVisualCountdown() or self.data.useMessages or self.data.useImgui then
self.pinOut.waiting.value = false -- Explicitly clear waiting pin
log('D', logTag, string.format('Starting countdown at epoch time %.2f (target was %.2f)',
currentEpochTime, self.targetStartTime))
local avail = im.GetContentRegionAvail()
local txt = string.format("Waiting: %.1fs", timeUntilStart)
local tWidth = im.CalcTextSize(txt)
self.countdownMsg = self.pinIn.countdownMsg.value or "%d"
local countdownMsg = string.format(self.countdownMsg, old)
local bigMsg = self.countdownMsg == "%d"
@/inspector/Views/IndexedDatabaseObjectStoreContentView.js
var columnInfo = {
primaryKey: {title: displayPrimaryKeyPath ? WI.UIString("Primary Key \u2014 %s").format(displayPrimaryKeyPath) : WI.UIString("Primary Key")},
key: {},
var displayIndexKeyPath = displayKeyPath(this._objectStoreIndex.keyPath);
columnInfo.key.title = WI.UIString("Index Key \u2014 %s").format(displayIndexKeyPath);
} else {
@/lua/vehicle/powertrain/differential.lua
}
extensions.ui_simplePowertrainControl.setButton("powertrain_device_mode_shortcut_" .. device.name, device.uiName, modeIconLookup[device.mode], nil, nil, string.format("powertrain.toggleDeviceMode(%q)", device.name))
end
--guihooks.message("Caution: Mismatched final drive ratios! ".. grA.. " vs ".. grB, 5)
log("D", "differential.calculateInertia", string.format("%s: Found non-matching gear ratios for differential outputs: A: '%.4f', B: '%.4f', A(max): '%.4f', B(max): '%.4f'", device.name, grA, grB, maxGRA, maxGRB))
else
@/lua/ge/extensions/editor/dynamicDecals/layerTypes/fill.lua
local function inspectLayerGui(layer, guiId)
local widgetId = string.format("%s_%s", layer.uid, guiId)
end
im.ColorButton(string.format("Color##fillLayer_vehicleColorPalette_colorButton_%s", guiId), editor.getTempImVec4_TableTable(paletteColor), nil, im.ImVec2(colorButtonHeight, colorButtonHeight))
end
im.ColorButton(string.format("Color##fillLayer_vehicleColorPalette_colorButton_%s", guiId), editor.getTempImVec4_TableTable(paletteColor), nil, im.ImVec2(colorButtonHeight, colorButtonHeight))
@/lua/ge/extensions/gameplay/crashTest/scenarioManager.lua
}
data.txt = string.format("%d:%02d", math.floor(currentStepTimeLeft / 60), math.floor(currentStepTimeLeft % 60))
data.minutes = string.format("%02d", math.floor(currentStepTimeLeft / 60))
data.txt = string.format("%d:%02d", math.floor(currentStepTimeLeft / 60), math.floor(currentStepTimeLeft % 60))
data.minutes = string.format("%02d", math.floor(currentStepTimeLeft / 60))
data.seconds = string.format("%02d", math.floor(currentStepTimeLeft % 60))
data.minutes = string.format("%02d", math.floor(currentStepTimeLeft / 60))
data.seconds = string.format("%02d", math.floor(currentStepTimeLeft % 60))
data.style = "text"
@/lua/ge/extensions/editor/vehicleEditor/liveEditor/veGeneralData.lua
local formatStringZ = (sign(z) ~= -1 and " " or "") .. "%.4f"
return string.format(formatStringX .. ", " .. formatStringY .. ", " .. formatStringZ, x, y, z)
end
im.Separator()
imguiUtils.cell("Speed (m/s)", string.format("%.4f", vel:length()))
im.Separator()
im.Separator()
imguiUtils.cell('Airspeed (m/s)', string.format("%.4f", vEditor.generalData.airflowSpeed))
im.Separator()
im.Separator()
imguiUtils.cell('Groundspeed (m/s)', string.format("%.4f", vEditor.generalData.groundSpeed))
im.Separator()
im.Separator()
imguiUtils.cell('Air Temp (C)', string.format("%.4f", vEditor.generalData.envTemperature - 273.15))
im.Separator()
im.Separator()
imguiUtils.cell('Air Pressure (kPa)', string.format("%.4f", vEditor.generalData.envPressure * 0.001))
im.Separator()
im.Separator()
imguiUtils.cell('Air Density (kg/m^3)', string.format("%.4f", vEditor.generalData.airDensity))
im.Separator()
im.Separator()
imguiUtils.cell("Vehicle Damage ($)" ,string.format("%.2f", vEditor.generalData.damage))
im.Columns(1)
@/inspector/Base/FileUtilities.js
];
return WI.UIString("Screen Shot %s-%s-%s at %s.%s.%s").format(...values);
}
@/lua/common/libs/luasocket/socket/url.lua
return (string.gsub(s, "([^A-Za-z0-9_])", function(c)
return string.format("%%%02x", string.byte(c))
end))
if segment_set[c] then return c
else return string.format("%%%02x", string.byte(c)) end
end)
@/lua/common/libs/ezSVG/EzSVG.lua
local pre = string.format("<%s ", tbl["__tag"])
local post = "/>"
if tbl["__content"] then
post = string.format(">%s%s>", tbl["__content"]:__generate(run), tbl["__tag"])
end
if v ~= "" and v ~= nil then
ret = string.format("%s%s=%q ", ret, k, tostring(v))
end
if v ~= "" and v ~= nil and tbl[k] == nil then
ret = string.format("%s%s=%q ", ret, k, tostring(v))
end
if tbl["__lastRunID"] ~= run["id"] and tbl["__id"] then
ret = string.format("%sid=%q", ret, tbl["__id"])
end
for i, vv in pairs(v) do
if i == 1 then func = string.format("%s%s(", func, vv)
elseif i == 2 then func = func .. vv
elseif i == 2 then func = func .. vv
else func = string.format("%s, %s", func, vv) end
end
end
ret = string.format("%s%s%s)", ret, seperator, func)
seperator = " "
function EzSVG.rgb(r, g, b)
return string.format("rgb(%d, %d, %d)", math.floor(r), math.floor(g), math.floor(b))
end
@/lua/ge/extensions/core/cameraModes/unicycle.lua
--local rotVec = vec3(math.deg(rotEuler.x), 180+math.deg(rotEuler.y), math.deg(rotEuler.z))
--dump(string.format("%5.3f, %5.3f, %5.3f", rotVec.x, rotVec.y, rotVec.z))
return rotVec
@/lua/ge/extensions/flowgraph/nodes/environment/planet.lua
debugDrawer:drawSphere(center, self.pinIn.radius.value or 0, ColorF(0,0,1,0.1))
debugDrawer:drawText(center, String("Mass: " .. string.format('%0.2E', self.pinIn.mass.value or 0)), ColorF(0,0,0,1))
local grav = C.gConst * (self.pinIn.mass.value / (h*h))
debugDrawer:drawText(veh:getPosition(), String("Force: " .. string.format('%0.2E', grav).." | Dist: "..string.format('%0.2E', center:distance(vehPos)) ), ColorF(0,0,0,1))
end
local grav = C.gConst * (self.pinIn.mass.value / (h*h))
debugDrawer:drawText(veh:getPosition(), String("Force: " .. string.format('%0.2E', grav).." | Dist: "..string.format('%0.2E', center:distance(vehPos)) ), ColorF(0,0,0,1))
end
@/lua/ge/extensions/gameplay/drift/destination.lua
else
im.Text(string.format("Dist. remaining before fail : %i m", maxWrongWayDist - currWrongWayDist))
im.Text("Going the wrong way : " .. tostring(goingWrongWay))
im.Text("Reversed race path : " .. tostring(reversedFlag))
im.Text(string.format("Dist to intended road : %i m", distToIntendedRoad))
end
@/lua/ge/extensions/core/quickAccess.lua
if not iconTagsWarned[icon] then
log("W", "", string.format("Using outdated icon %s, please update to %s for %s", icon, iconTags[icon], title))
iconTagsWarned[icon] = true
local mins = math.floor(seconds / 60 - (hours * 60))
local timeStr = string.format("%02d:%02d", hours, mins)
--local item = categoryActions[oldestIndex]
--log('I', 'quickaccess', 'Removed oldest non-pinned action in category ' .. category ..": " .. string.format("%s %s (%d) (%s)", item.level, item.uniqueID, item.timestamp - Engine.Platform.getSystemTimeMS(), actionInfo and actionInfo.title or "MISSING"))
-- replace the oldest action with the new one
local actionInfo = getActionInfo(item.level, item.uniqueID)
dump(string.format("recent[%d] = %s %s (%d) (%s)", i, item.level, item.uniqueID, item.timestamp - Engine.Platform.getSystemTimeMS(), actionInfo and actionInfo.title or "MISSING"))
end
@/lua/ge/extensions/tech/cameraPreview.lua
if cam == nil then
log('E', logTag, string.format('Camera with id %d not found.', sensorId))
return
if cam == nil then
log('E', logTag, string.format('Camera with id %d not found.', sensorId))
return
@/lua/ge/extensions/editor/terrainMaterialsEditor.lua
local function widgetTexture(map, property, widgetName)
local propertyName = string.format(property, map)
im.TextUnformatted(widgetName)
local function widgetTextureSize(map, property, widgetName, tooltip)
local propertyName = string.format(property, map)
im.TextUnformatted(widgetName)
for k,v in ipairs(v1MaterialTextureSetMaps) do
table.insert(properties, string.format(property, v.mapIdentifier))
end
for k, map in ipairs(v1MaterialTextureSetMaps) do
terrainMtlProxy.material:setField(string.format("%sBaseTex", map.mapIdentifier), 0, terrainMtlCopyProxy.material:getField(string.format("%sBaseTex", map.mapIdentifier), 0))
terrainMtlProxy.material:setField(string.format("%sBaseTexSize", map.mapIdentifier), 0, terrainMtlCopyProxy.material:getField(string.format("%sBaseTexSize", map.mapIdentifier), 0))
for k, map in ipairs(v1MaterialTextureSetMaps) do
terrainMtlProxy.material:setField(string.format("%sBaseTex", map.mapIdentifier), 0, terrainMtlCopyProxy.material:getField(string.format("%sBaseTex", map.mapIdentifier), 0))
terrainMtlProxy.material:setField(string.format("%sBaseTexSize", map.mapIdentifier), 0, terrainMtlCopyProxy.material:getField(string.format("%sBaseTexSize", map.mapIdentifier), 0))
terrainMtlProxy.material:setField(string.format("%sBaseTex", map.mapIdentifier), 0, terrainMtlCopyProxy.material:getField(string.format("%sBaseTex", map.mapIdentifier), 0))
terrainMtlProxy.material:setField(string.format("%sBaseTexSize", map.mapIdentifier), 0, terrainMtlCopyProxy.material:getField(string.format("%sBaseTexSize", map.mapIdentifier), 0))
terrainMtlProxy.material:setField(string.format("%sBaseTex", map.mapIdentifier), 0, terrainMtlCopyProxy.material:getField(string.format("%sBaseTex", map.mapIdentifier), 0))
terrainMtlProxy.material:setField(string.format("%sBaseTexSize", map.mapIdentifier), 0, terrainMtlCopyProxy.material:getField(string.format("%sBaseTexSize", map.mapIdentifier), 0))
terrainMtlProxy.material:setField(string.format("%sMacroTex", map.mapIdentifier), 0, terrainMtlCopyProxy.material:getField(string.format("%sMacroTex", map.mapIdentifier), 0))
terrainMtlProxy.material:setField(string.format("%sMacroTexSize", map.mapIdentifier), 0, terrainMtlCopyProxy.material:getField(string.format("%sMacroTexSize", map.mapIdentifier), 0))
terrainMtlProxy.material:setField(string.format("%sMacroTex", map.mapIdentifier), 0, terrainMtlCopyProxy.material:getField(string.format("%sMacroTex", map.mapIdentifier), 0))
terrainMtlProxy.material:setField(string.format("%sMacroTexSize", map.mapIdentifier), 0, terrainMtlCopyProxy.material:getField(string.format("%sMacroTexSize", map.mapIdentifier), 0))
terrainMtlProxy.material:setField(string.format("%sMacroTex", map.mapIdentifier), 0, terrainMtlCopyProxy.material:getField(string.format("%sMacroTex", map.mapIdentifier), 0))
terrainMtlProxy.material:setField(string.format("%sMacroTexSize", map.mapIdentifier), 0, terrainMtlCopyProxy.material:getField(string.format("%sMacroTexSize", map.mapIdentifier), 0))
terrainMtlProxy.material:setField(string.format("%sMacroStrength", map.mapIdentifier), 0, terrainMtlCopyProxy.material:getField(string.format("%sMacroStrength", map.mapIdentifier), 0))
terrainMtlProxy.material:setField(string.format("%sMacroTex", map.mapIdentifier), 0, terrainMtlCopyProxy.material:getField(string.format("%sMacroTex", map.mapIdentifier), 0))
terrainMtlProxy.material:setField(string.format("%sMacroTexSize", map.mapIdentifier), 0, terrainMtlCopyProxy.material:getField(string.format("%sMacroTexSize", map.mapIdentifier), 0))
terrainMtlProxy.material:setField(string.format("%sMacroStrength", map.mapIdentifier), 0, terrainMtlCopyProxy.material:getField(string.format("%sMacroStrength", map.mapIdentifier), 0))
terrainMtlProxy.material:setField(string.format("%sMacroTexSize", map.mapIdentifier), 0, terrainMtlCopyProxy.material:getField(string.format("%sMacroTexSize", map.mapIdentifier), 0))
terrainMtlProxy.material:setField(string.format("%sMacroStrength", map.mapIdentifier), 0, terrainMtlCopyProxy.material:getField(string.format("%sMacroStrength", map.mapIdentifier), 0))
terrainMtlProxy.material:setField(string.format("%sMacroTexSize", map.mapIdentifier), 0, terrainMtlCopyProxy.material:getField(string.format("%sMacroTexSize", map.mapIdentifier), 0))
terrainMtlProxy.material:setField(string.format("%sMacroStrength", map.mapIdentifier), 0, terrainMtlCopyProxy.material:getField(string.format("%sMacroStrength", map.mapIdentifier), 0))
terrainMtlProxy.material:setField(string.format("%sDetailTex", map.mapIdentifier), 0, terrainMtlCopyProxy.material:getField(string.format("%sDetailTex", map.mapIdentifier), 0))
terrainMtlProxy.material:setField(string.format("%sDetailTexSize", map.mapIdentifier), 0, terrainMtlCopyProxy.material:getField(string.format("%sDetailTexSize", map.mapIdentifier), 0))
terrainMtlProxy.material:setField(string.format("%sDetailTex", map.mapIdentifier), 0, terrainMtlCopyProxy.material:getField(string.format("%sDetailTex", map.mapIdentifier), 0))
terrainMtlProxy.material:setField(string.format("%sDetailTexSize", map.mapIdentifier), 0, terrainMtlCopyProxy.material:getField(string.format("%sDetailTexSize", map.mapIdentifier), 0))
terrainMtlProxy.material:setField(string.format("%sDetailTex", map.mapIdentifier), 0, terrainMtlCopyProxy.material:getField(string.format("%sDetailTex", map.mapIdentifier), 0))
terrainMtlProxy.material:setField(string.format("%sDetailTexSize", map.mapIdentifier), 0, terrainMtlCopyProxy.material:getField(string.format("%sDetailTexSize", map.mapIdentifier), 0))
terrainMtlProxy.material:setField(string.format("%sDetailStrength", map.mapIdentifier), 0, terrainMtlCopyProxy.material:getField(string.format("%sDetailStrength", map.mapIdentifier), 0))
terrainMtlProxy.material:setField(string.format("%sDetailTex", map.mapIdentifier), 0, terrainMtlCopyProxy.material:getField(string.format("%sDetailTex", map.mapIdentifier), 0))
terrainMtlProxy.material:setField(string.format("%sDetailTexSize", map.mapIdentifier), 0, terrainMtlCopyProxy.material:getField(string.format("%sDetailTexSize", map.mapIdentifier), 0))
terrainMtlProxy.material:setField(string.format("%sDetailStrength", map.mapIdentifier), 0, terrainMtlCopyProxy.material:getField(string.format("%sDetailStrength", map.mapIdentifier), 0))
terrainMtlProxy.material:setField(string.format("%sDetailTexSize", map.mapIdentifier), 0, terrainMtlCopyProxy.material:getField(string.format("%sDetailTexSize", map.mapIdentifier), 0))
terrainMtlProxy.material:setField(string.format("%sDetailStrength", map.mapIdentifier), 0, terrainMtlCopyProxy.material:getField(string.format("%sDetailStrength", map.mapIdentifier), 0))
end
terrainMtlProxy.material:setField(string.format("%sDetailTexSize", map.mapIdentifier), 0, terrainMtlCopyProxy.material:getField(string.format("%sDetailTexSize", map.mapIdentifier), 0))
terrainMtlProxy.material:setField(string.format("%sDetailStrength", map.mapIdentifier), 0, terrainMtlCopyProxy.material:getField(string.format("%sDetailStrength", map.mapIdentifier), 0))
end
end
terrainMtlProxy.material:setField(string.format("macroDistAtten", map.mapIdentifier), 0, terrainMtlCopyProxy.material:getField(string.format("macroDistAtten", map.mapIdentifier), 0))
terrainMtlProxy.material:setField(string.format("detailDistAtten", map.mapIdentifier), 0, terrainMtlCopyProxy.material:getField(string.format("detailDistAtten", map.mapIdentifier), 0))
end
terrainMtlProxy.material:setField(string.format("macroDistAtten", map.mapIdentifier), 0, terrainMtlCopyProxy.material:getField(string.format("macroDistAtten", map.mapIdentifier), 0))
terrainMtlProxy.material:setField(string.format("detailDistAtten", map.mapIdentifier), 0, terrainMtlCopyProxy.material:getField(string.format("detailDistAtten", map.mapIdentifier), 0))
terrainMtlProxy.material:setField(string.format("macroDistAtten", map.mapIdentifier), 0, terrainMtlCopyProxy.material:getField(string.format("macroDistAtten", map.mapIdentifier), 0))
terrainMtlProxy.material:setField(string.format("detailDistAtten", map.mapIdentifier), 0, terrainMtlCopyProxy.material:getField(string.format("detailDistAtten", map.mapIdentifier), 0))
terrainMtlProxy.material:setField(string.format("macroDistAtten", map.mapIdentifier), 0, terrainMtlCopyProxy.material:getField(string.format("macroDistAtten", map.mapIdentifier), 0))
terrainMtlProxy.material:setField(string.format("detailDistAtten", map.mapIdentifier), 0, terrainMtlCopyProxy.material:getField(string.format("detailDistAtten", map.mapIdentifier), 0))
widgetTextureSize(textureMap, "%sMacroTexSize", "Macro Mapping Scale", "Size (in meters) of the Macro Texture in the world.")
widgetFloat2(string.format("%sMacroStrength", textureMap), "Macro Strength", nil, nil, "Strength of the macro texture influence (0.0 - 1.0)")
im.Separator()
widgetTextureSize(textureMap, "%sDetailTexSize", "Detail Mapping Scale", "Size (in meters) of the Detail Texture in the world.")
widgetFloat2(string.format("%sDetailStrength", textureMap), "Detail Strength", nil, nil, "Strength of the detail texture influence (0.0 - 1.0)")
end
if map == "b" then
table.insert(properties, string.format(bulkChange.property, "baseColor"))
table.insert(values, asset.file)
if map == "nm" then
table.insert(properties, string.format(bulkChange.property, "normal"))
table.insert(values, asset.file)
if map == "r" then
table.insert(properties, string.format(bulkChange.property, "roughness"))
table.insert(values, asset.file)
if map == "ao" then
table.insert(properties, string.format(bulkChange.property, "ao"))
table.insert(values, asset.file)
if map == "h" then
table.insert(properties, string.format(bulkChange.property, "height"))
table.insert(values, asset.file)
@/lua/vehicle/extensions/tech/dumpPlayerInput.lua
timer = timer + dt
f:write(string.format("%f,%f,%f,%f\r\n", timer, input.throttle, input.brake, input.steering))
end
@/lua/ge/extensions/editor/dragRaceEditor/facilities.lua
local isSelected = i == selectedFacilityIndex
local label = string.format("%s (%d strips)", facility.id or "unnamed", #facility.stripIds or 0)
if im.IsItemHovered() then
im.tooltip(string.format("Name: %s\nDescription: %s", facility.name or "N/A", facility.description or "N/A"))
end
@/lua/ge/extensions/ui/vehicleSelector/tiles.lua
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))
if data.displayData.sortMode == 'Automatic' or group.isRecentGroup then
-- GENERIC: Sort tiles
--print(string.format("sorting group %s with mode %s %s (in handleAllModelsPath)", group.key, data.displayData.sortMode, data.displayData.groupMode))
if data.displayData.sortMode == 'Automatic' or group.isRecentGroup then
@/lua/common/testFramework/TestManager.lua
local func = tests[name]
local displayName = string.format("%-60s", name:gsub('_shouldFail$', ''))
@/lua/ge/extensions/gameplay/missions/missions.lua
end
log(severityToLog[mission._issueList.highestSeverity] or 'I', "", string.format("Mission %s has %d issues:", mission.id, #(mission._issueList.list or {})))
for _, i in ipairs(mission._issueList.list or {}) do
@/lua/vehicle/controller/twoStepLaunch.lua
local function displayState()
guihooks.message(string.format("Two-Step: %s (%d RPM)", (twoStepState ~= "deactivated" and "Active" or "Inactive"), tempRevLimiterRPM), 2, "vehicle.twoStep.status")
end
@/lua/ge/extensions/editor/roadTemplateEditor.lua
-- Load a template as a set of temporary decal roads
im.PushID1(string.format('template_%d', i))
if im.ImageButton("##selectionDialogButton", editor_roadUtils.getMaterials()[i].texId, im.ImVec2(128, 128), im.ImVec2Zero, im.ImVec2One,
im.PushTextWrapPos(im.GetFontSize() * 35.0)
im.TextUnformatted(string.format("%d x %d", editor_roadUtils.getMaterials()[i].size.x, editor_roadUtils.getMaterials()[i].size.y))
im.TextUnformatted(string.format("%s", editor_roadUtils.getRoadTemplateFiles()[i]))
im.TextUnformatted(string.format("%d x %d", editor_roadUtils.getMaterials()[i].size.x, editor_roadUtils.getMaterials()[i].size.y))
im.TextUnformatted(string.format("%s", editor_roadUtils.getRoadTemplateFiles()[i]))
im.PopTextWrapPos()
@/inspector/Views/HeapAllocationsTimelineView.js
let secondSnapshotIdentifier = this._heapSnapshotDiff.snapshot2.identifier;
let diffComponent = new WI.HierarchicalPathComponent(WI.UIString("Snapshot Comparison (%d and %d)").format(firstSnapshotIdentifier, secondSnapshotIdentifier), "snapshot-diff-icon", "snapshot-diff");
components.push(diffComponent);
@/lua/ge/extensions/editor/roadSpline/groupMgr.lua
-- Ensure we have a unique group name.
local baseName = group.name or string.format(toolPrefixStr .. " %d", #groups + 1)
local uniqueName = util.generateUniqueName(baseName, toolPrefixStr)
local folderNameId = Engine.generateUUID()
newFolder:registerObject(string.format("%s - %s", uniqueName, folderNameId))
scenetree.MissionGroup:addObject(newFolder)
-- Ensure we have a unique group name.
local baseName = name or string.format(toolPrefixStr .. " %d", #groups + 1)
local uniqueName = util.generateUniqueName(baseName, toolPrefixStr)
local newFolder = createObject("SimGroup")
newFolder:registerObject(string.format("%s - %s", uniqueName, id))
scenetree.MissionGroup:addObject(newFolder)
end
log('I', logTag, string.format("Converted %d traced paths to Road Splines. %d paths were too small to import.", #paths, #paths - #groups))
end
local newFolder = createObject("SimGroup")
newFolder:registerObject(string.format("%s - %s", group.name, group.id))
newFolder.cansave = true
@/lua/vehicle/controller/drivingDynamics/actuators/electronicDiffLock.lua
if not relevantDifferential then
log("E", "electronicDiffLock.initSecondStage", string.format("Can't find configured differential (%q), disabling system...", diffName))
return
@/lua/ge/extensions/editor/dynamicDecals/widgets.lua
if property.lockRatio ~= nil then
if editor.uiIconImageButton(editor.icons.lock, tool.getIconSizeVec2(), property.lockRatio and editor.color.beamng.Value or nil, nil, nil, string.format("LockRatioButton_%s", widgetId)) then
property.lockRatio = not property.lockRatio
if baseProp.default ~= nil then
if editor.uiIconImageButton(editor.icons.refresh, tool.getIconSizeVec2(), nil, nil, nil, string.format("%s_resetButton", widgetId)) then
property.value = baseProp.default
end
im.tooltip(string.format("Reset to default: %s", dumps(baseProp.default)))
im.SameLine()
local function defaultButton(widgetId, cbFunc, tooltipMsg)
if editor.uiIconImageButton(editor.icons.refresh, tool.getIconSizeVec2(), nil, nil, nil, string.format("%s_resetButton", widgetId)) then
cbFunc()
if baseProp.default then
if editor.uiIconImageButton(editor.icons.refresh, tool.getIconSizeVec2(), nil, nil, nil, string.format("%s_resetButton", widgetId)) then
property.value = baseProp.default
if baseProp.options then
im.tooltip(string.format("Reset to default: %d (%s)", baseProp.default, baseProp.options[baseProp.default + 1]))
else
else
im.tooltip(string.format("Reset to default: %s", dumps(baseProp.default)))
end
if baseProp.default then
if editor.uiIconImageButton(editor.icons.refresh, tool.getIconSizeVec2(), nil, nil, nil, string.format("%s_resetButton", widgetId)) then
property.value = baseProp.default
if baseProp.options then
im.tooltip(string.format("Reset to default: %d (%s)", baseProp.default, baseProp.options[baseProp.default + 1]))
else
else
im.tooltip(string.format("Reset to default: %s", dumps(baseProp.default)))
end
if baseProp.default then
if editor.uiIconImageButton(editor.icons.refresh, tool.getIconSizeVec2(), nil, nil, nil, string.format("%s_resetButton", widgetId)) then
property.value = baseProp.default
if baseProp.options then
im.tooltip(string.format("Reset to default: %d (%s)", baseProp.default, baseProp.options[baseProp.default + 1]))
else
else
im.tooltip(string.format("Reset to default: %s", dumps(baseProp.default)))
end
if baseProp.default then
if editor.uiIconImageButton(editor.icons.refresh, tool.getIconSizeVec2(), nil, nil, nil, string.format("%s_resetButton", widgetId)) then
property.value = baseProp.default
if baseProp.options then
im.tooltip(string.format("Reset to default: %d (%s)", baseProp.default, baseProp.options[baseProp.default + 1]))
else
else
im.tooltip(string.format("Reset to default: %s", dumps(baseProp.default)))
end
if baseProp.default then
if editor.uiIconImageButton(editor.icons.refresh, tool.getIconSizeVec2(), nil, nil, nil, string.format("%s_resetButton", widgetId)) then
property.value = baseProp.default
end
im.tooltip(string.format("Reset to default: %s", dumps(baseProp.default)))
im.SameLine()
if baseProp.default then
if editor.uiIconImageButton(editor.icons.refresh, tool.getIconSizeVec2(), nil, nil, nil, string.format("%s_resetButton", widgetId)) then
property.value = baseProp.default
end
im.tooltip(string.format("Reset to default: %s", dumps(baseProp.default)))
im.SameLine()
if baseProp.default then
if editor.uiIconImageButton(editor.icons.refresh, tool.getIconSizeVec2(), nil, nil, nil, string.format("%s_resetButton", widgetId)) then
property.value = baseProp.default
end
im.tooltip(string.format("Reset to default: %s", dumps(baseProp.default)))
im.SameLine()
if baseProp.default then
if editor.uiIconImageButton(editor.icons.refresh, tool.getIconSizeVec2(), nil, nil, nil, string.format("%s_resetButton", widgetId)) then
property.value = shallowcopy(baseProp.default)
end
im.tooltip(string.format("Reset to default: %s", dumps(baseProp.default)))
im.SameLine()
im.PushItemWidth(width)
if im.InputFloat(string.format("%s_x", widgetId), editor.getTempFloat_NumberNumber(baseProp.getMod and baseProp.getMod(value[1]) or value[1]), 1, 10, baseProp.format) then
local newVal = editor.getTempFloat_NumberNumber()
if editor.getPreference("dynamicDecalsTool.general.debug") then
im.tooltip(string.format("%s_x", widgetId))
end
im.PushItemWidth(width)
if im.InputFloat(string.format("%s_y", widgetId), editor.getTempFloat_NumberNumber(baseProp.getMod and baseProp.getMod(value[2]) or value[2]), 1, 10, baseProp.format) then
local newVal = editor.getTempFloat_NumberNumber()
if editor.getPreference("dynamicDecalsTool.general.debug") then
im.tooltip(string.format("%s_y", widgetId))
end
if baseProp.default then
if editor.uiIconImageButton(editor.icons.refresh, tool.getIconSizeVec2(), nil, nil, nil, string.format("%s_resetButton", widgetId)) then
property.value = shallowcopy(baseProp.default)
end
im.tooltip(string.format("Reset to default: %s", dumps(baseProp.default)))
im.SameLine()
im.PushItemWidth(width)
if im.SliderFloat(string.format("%s_x", widgetId), editor.getTempFloat_NumberNumber(baseProp.getMod and baseProp.getMod(value[1]) or value[1]), baseProp.min and baseProp.min[1] or nil, baseProp.max and baseProp.max[1] or nil, baseProp.format) then
local newVal = editor.getTempFloat_NumberNumber()
if editor.getPreference("dynamicDecalsTool.general.debug") then
im.tooltip(string.format("%s_x", widgetId))
end
im.PushItemWidth(width)
if im.SliderFloat(string.format("%s_y", widgetId), editor.getTempFloat_NumberNumber(baseProp.getMod and baseProp.getMod(value[2]) or value[2]), baseProp.min and baseProp.min[2] or nil, baseProp.max and baseProp.max[2] or nil, baseProp.format) then
local newVal = editor.getTempFloat_NumberNumber()
if editor.getPreference("dynamicDecalsTool.general.debug") then
im.tooltip(string.format("%s_y", widgetId))
end
if baseProp.default then
if editor.uiIconImageButton(editor.icons.refresh, tool.getIconSizeVec2(), nil, nil, nil, string.format("%s_resetButton", widgetId)) then
property.value = shallowcopy(baseProp.default)
end
im.tooltip(string.format("Reset to default: %s", dumps(baseProp.default)))
im.SameLine()
im.PushItemWidth(width)
if im.DragFloat(string.format("%s_x", widgetId), editor.getTempFloat_NumberNumber(baseProp.getMod and baseProp.getMod(value[1]) or value[1]), baseProp.dragSpeed, baseProp.min[1], baseProp.max[1], baseProp.format) then
local newVal = editor.getTempFloat_NumberNumber()
if editor.getPreference("dynamicDecalsTool.general.debug") then
im.tooltip(string.format("%s_x", widgetId))
end
im.PushItemWidth(width)
if im.DragFloat(string.format("%s_y", widgetId), editor.getTempFloat_NumberNumber(baseProp.getMod and baseProp.getMod(value[2]) or value[2]), baseProp.dragSpeed, baseProp.min[2], baseProp.max[2], baseProp.format) then
local newVal = editor.getTempFloat_NumberNumber()
if editor.getPreference("dynamicDecalsTool.general.debug") then
im.tooltip(string.format("%s_y", widgetId))
end
if baseProp.default then
if editor.uiIconImageButton(editor.icons.refresh, tool.getIconSizeVec2(), nil, nil, nil, string.format("%s_resetButton", widgetId)) then
property.value = shallowcopy(baseProp.default)
end
im.tooltip(string.format("Reset to default: %s", dumps(baseProp.default)))
im.SameLine()
im.PushItemWidth(width)
if im.SliderFloat(string.format("%s_x", widgetId), editor.getTempFloat_NumberNumber(baseProp.getMod and baseProp.getMod(value[1]) or value[1]), baseProp.min and baseProp.min[1] or nil, baseProp.max and baseProp.max[1] or nil, baseProp.format) then
local newVal = editor.getTempFloat_NumberNumber()
if editor.getPreference("dynamicDecalsTool.general.debug") then
im.tooltip(string.format("%s_x", widgetId))
end
im.PushItemWidth(width)
if im.SliderFloat(string.format("%s_y", widgetId), editor.getTempFloat_NumberNumber(baseProp.getMod and baseProp.getMod(value[2]) or value[2]), baseProp.min and baseProp.min[2] or nil, baseProp.max and baseProp.max[2] or nil, baseProp.format) then
local newVal = editor.getTempFloat_NumberNumber()
if editor.getPreference("dynamicDecalsTool.general.debug") then
im.tooltip(string.format("%s_y", widgetId))
end
im.PushItemWidth(width)
if im.SliderFloat(string.format("%s_z", widgetId), editor.getTempFloat_NumberNumber(baseProp.getMod and baseProp.getMod(value[3]) or value[3]), baseProp.min and baseProp.min[3] or nil, baseProp.max and baseProp.max[3] or nil, baseProp.format) then
local newVal = editor.getTempFloat_NumberNumber()
if editor.getPreference("dynamicDecalsTool.general.debug") then
im.tooltip(string.format("%s_z", widgetId))
end
if baseProp.default then
if editor.uiIconImageButton(editor.icons.refresh, tool.getIconSizeVec2(), nil, nil, nil, string.format("%s_resetButton", widgetId)) then
property.value = shallowcopy(baseProp.default)
end
im.tooltip(string.format("Reset to default: %s", dumps(baseProp.default)))
im.SameLine()
if baseProp.default then
if editor.uiIconImageButton(editor.icons.refresh, tool.getIconSizeVec2(), nil, nil, nil, string.format("%s_resetButton", widgetId)) then
property.value = shallowcopy(baseProp.default)
end
im.tooltip(string.format("Reset to default: %s", dumps(baseProp.default)))
im.SameLine()
im.PushItemWidth(width)
if im.SliderFloat(string.format("%s_x", widgetId), editor.getTempFloat_NumberNumber(baseProp.getMod and baseProp.getMod(value[1]) or value[1]), baseProp.min and baseProp.min[1] or nil, baseProp.max and baseProp.max[1] or nil, baseProp.format) then
local newVal = editor.getTempFloat_NumberNumber()
if editor.getPreference("dynamicDecalsTool.general.debug") then
im.tooltip(string.format("%s_x", widgetId))
end
im.PushItemWidth(width)
if im.SliderFloat(string.format("%s_y", widgetId), editor.getTempFloat_NumberNumber(baseProp.getMod and baseProp.getMod(value[2]) or value[2]), baseProp.min and baseProp.min[2] or nil, baseProp.max and baseProp.max[2] or nil, baseProp.format) then
local newVal = editor.getTempFloat_NumberNumber()
if editor.getPreference("dynamicDecalsTool.general.debug") then
im.tooltip(string.format("%s_y", widgetId))
end
im.PushItemWidth(width)
if im.SliderFloat(string.format("%s_z", widgetId), editor.getTempFloat_NumberNumber(baseProp.getMod and baseProp.getMod(value[3]) or value[3]), baseProp.min and baseProp.min[3] or nil, baseProp.max and baseProp.max[3] or nil, baseProp.format) then
local newVal = editor.getTempFloat_NumberNumber()
if editor.getPreference("dynamicDecalsTool.general.debug") then
im.tooltip(string.format("%s_z", widgetId))
end
im.PushItemWidth(width)
if im.SliderFloat(string.format("%s_w", widgetId), editor.getTempFloat_NumberNumber(baseProp.getMod and baseProp.getMod(value[4]) or value[4]), baseProp.min and baseProp.min[4] or nil, baseProp.max and baseProp.max[4] or nil, baseProp.format) then
local newVal = editor.getTempFloat_NumberNumber()
if editor.getPreference("dynamicDecalsTool.general.debug") then
im.tooltip(string.format("%s_w", widgetId))
end
if baseProp.default then
if editor.uiIconImageButton(editor.icons.refresh, tool.getIconSizeVec2(), nil, nil, nil, string.format("%s_resetButton", widgetId)) then
property.value = shallowcopy(baseProp.default)
end
im.tooltip(string.format("Reset to default: %s", dumps(baseProp.default)))
im.SameLine()
if baseProp.default then
if editor.uiIconImageButton(editor.icons.refresh, tool.getIconSizeVec2(), nil, nil, nil, string.format("%s_resetButton", widgetId)) then
property.value = shallowcopy(baseProp.default)
end
im.tooltip(string.format("Reset to default: %s", dumps(baseProp.default)))
im.SameLine()
if im.BeginPopup(string.format("%s_Point4FColorPopup", widgetId)) then
im.SetNextItemWidth(256)
im.SetNextItemWidth(256)
if im.ColorPicker4(string.format("%s_Point4FColorPicker", widgetId), editor.getTempFloatArray4_TableTable(value), nil, nil) then
value = editor.getTempFloatArray4_TableTable()
i = i + 1
if im.ColorButton(string.format("##pres_%s_%d", guiId, k), im.ImVec4(col[1],col[2],col[3],col[4]), nil, im.ImVec2(btnSize, btnSize)) then
value = shallowcopy(col)
if im.ColorButton(string.format("%s_openPopupColorButton", widgetId), im.ImVec4(value[1],value[2],value[3],value[4]), nil, nil) then
im.OpenPopup(string.format("%s_Point4FColorPopup", widgetId))
if im.ColorButton(string.format("%s_openPopupColorButton", widgetId), im.ImVec4(value[1],value[2],value[3],value[4]), nil, nil) then
im.OpenPopup(string.format("%s_Point4FColorPopup", widgetId))
end
if baseProp.default then
if editor.uiIconImageButton(editor.icons.refresh, tool.getIconSizeVec2(), nil, nil, nil, string.format("%s_resetButton", widgetId)) then
property.value = baseProp.default
end
im.tooltip(string.format("Reset to default: %s", dumps(baseProp.default)))
im.SameLine()
if baseProp.default then
if editor.uiIconImageButton(editor.icons.refresh, tool.getIconSizeVec2(), nil, nil, nil, string.format("%s_resetButton", widgetId)) then
property.value = baseProp.default
end
im.tooltip(string.format("Reset to default: %s", dumps(baseProp.default)))
im.SameLine()
if baseProp.default then
if editor.uiIconImageButton(editor.icons.refresh, tool.getIconSizeVec2(), nil, nil, nil, string.format("%s_resetButton", widgetId)) then
property.value = baseProp.default
end
im.tooltip(string.format("Reset to default: %s", dumps(baseProp.default)))
im.SameLine()
im.SameLine()
if editor.uiIconImageButton(editor.icons.folder, tool.getIconSizeVec2(), nil, nil, nil, string.format("%s_openFileDialogButton", widgetId)) then
local openPath = baseProp.defaultDir
if baseProp.default then
if editor.uiIconImageButton(editor.icons.refresh, tool.getIconSizeVec2(), nil, nil, nil, string.format("%s_resetButton", widgetId)) then
property.value = shallowcopy(baseProp.default)
end
im.tooltip(string.format("Reset to default: %s", dumps(baseProp.default)))
im.SameLine()
if baseProp.default then
if editor.uiIconImageButton(editor.icons.refresh, tool.getIconSizeVec2(), nil, nil, nil, string.format("%s_resetButton", widgetId)) then
property.value = baseProp.default
end
im.tooltip(string.format("Reset to default: %s", dumps(baseProp.default)))
im.SameLine()
im.SameLine()
if editor.uiIconImageButton(editor.icons.folder, tool.getIconSizeVec2(), nil, nil, nil, string.format("%s_openFileDialogButton", widgetId)) then
local openPath = baseProp.defaultDir
if baseProp.default then
if editor.uiIconImageButton(editor.icons.refresh, tool.getIconSizeVec2(), nil, nil, nil, string.format("%s_resetButton", widgetId)) then
property.value = baseProp.default
end
im.tooltip(string.format("Reset to default: %s", dumps(baseProp.default)))
im.SameLine()
if editor.uiIconImageButton(editor.icons.folder, tool.getIconSizeVec2(), nil, nil, nil, string.format("%s_openFileDialogButton", widgetId)) then
local openPath = baseProp.defaultDir
if im.ImageButton(string.format("%s_imageButton", widgetId), img.texId, im.ImVec2(imgWidth, imgHeight), im.ImVec2(0,0), im.ImVec2(1,1)) then
local openPath = baseProp.defaultDir
if baseProp.default then
if editor.uiIconImageButton(editor.icons.refresh, tool.getIconSizeVec2(), nil, nil, nil, string.format("%s_resetButton", widgetId)) then
property.value = baseProp.default
end
im.tooltip(string.format("Reset to default: %s", dumps(baseProp.default)))
im.SameLine()
im.SetCursorPos(im.ImVec2(cursorPos.x, cursorPos.y + size - 20))
if editor.uiColorEdit4(string.format("%s_gradientColorBottomLeft", widgetId), editor.getTempFloatArray4_TableTable(gradientColorBottomLeft), im.flags(im.ColorEditFlags_AlphaPreview, im.ColorEditFlags_NoInputs), editor.getTempBool_BoolBool(false)) then
local val = editor.getTempFloatArray4_TableTable()
im.SetCursorPos(cursorPos)
if editor.uiColorEdit4(string.format("%s_gradientColorTopLeft", widgetId), editor.getTempFloatArray4_TableTable(gradientColorTopLeft), im.flags(im.ColorEditFlags_AlphaPreview, im.ColorEditFlags_NoInputs), editor.getTempBool_BoolBool(false)) then
local val = editor.getTempFloatArray4_TableTable()
im.SetCursorPos(im.ImVec2(cursorPos.x, cursorPos.y + size - 20))
if editor.uiColorEdit4(string.format("%s_gradientColorBottomRight", widgetId), editor.getTempFloatArray4_TableTable(gradientColorBottomRight), im.flags(im.ColorEditFlags_AlphaPreview, im.ColorEditFlags_NoInputs), editor.getTempBool_BoolBool(false)) then
local val = editor.getTempFloatArray4_TableTable()
im.SetCursorPos(cursorPos)
if editor.uiColorEdit4(string.format("%s_gradientColorTopRight", widgetId), editor.getTempFloatArray4_TableTable(gradientColorTopRight), im.flags(im.ColorEditFlags_AlphaPreview, im.ColorEditFlags_NoInputs), editor.getTempBool_BoolBool(false)) then
local val = editor.getTempFloatArray4_TableTable()
M.draw = function(value, property, guiId, editEnded, widgetOptions)
local widgetId = string.format("##%s_%s", guiId, property.id)
local propType = property.type or api.propertiesMap[property.id].type
if #description > 0 then
im.tooltip(string.format("%s\n%s", widgetId, description))
else
if api.widgetTypes[propType] then
if im.BeginPopup(string.format("WidgetTypePopup_%s", widgetId)) then
for name, id in pairs(api.widgetTypes[propType]) do
if editor.uiIconImageButton(editor.icons.fg_type_diamond_2, tool.getIconSizeVec2(), nil, nil, nil, string.format("WidgetTypeOpenPopupButton_", widgetId)) then
im.OpenPopup(string.format("WidgetTypePopup_%s", widgetId))
if editor.uiIconImageButton(editor.icons.fg_type_diamond_2, tool.getIconSizeVec2(), nil, nil, nil, string.format("WidgetTypeOpenPopupButton_", widgetId)) then
im.OpenPopup(string.format("WidgetTypePopup_%s", widgetId))
end
@/lua/ge/extensions/career/modules/delivery/precisionParking.lua
if precisionData then
--log("I", "", string.format("Precision Parking Debug - Level: %s, Score: %d, Angle: %.1f° (Adj: %.1f°), Side: %.2fm, Forward: %.2fm",
-- precisionData.precisionLevel, precisionData.totalScore, precisionData.angle, precisionData.adjustedAngle, precisionData.sideDist, precisionData.forwardDist))
@/lua/ge/extensions/editor/vehicleEditor/liveEditor/veAeroDebug.lua
local formatStringZ = (sign(z) ~= -1 and " " or "") .. "%.2f"
return string.format(formatStringX .. ", " .. formatStringY .. ", " .. formatStringZ, x, y, z)
end
im.Separator()
imguiUtils.cell("Front Axle Downforce (N)", string.format("%.2f", frontDownForce))
im.Separator()
im.Separator()
imguiUtils.cell("Rear Axle Downforce (N)", string.format("%.2f", rearDownForce))
im.Separator()
im.Separator()
imguiUtils.cell('Front Axle Downforce (%%)', string.format("%.2f", percentFront))
im.Separator()
im.Separator()
imguiUtils.cell('Rear Axle Downforce (%%)', string.format("%.2f", percentRear))
im.Separator()
@/lua/ge/extensions/editor/vehicleEditor/liveEditor/veAdjustableTechCarTuner.lua
im.SetCursorPos(im.ImVec2(5, 50))
im.Text(string.format("Mouse Pos: %0.2f, %0.2f", im.GetMousePos().x - wndPos.x, im.GetMousePos().y - wndPos.y))
local x, y = im.GetMousePos().x - wndPos.x - viewToDebug.imgPos.x, im.GetMousePos().y - wndPos.y - viewToDebug.imgPos.y
local x, y = im.GetMousePos().x - wndPos.x - viewToDebug.imgPos.x, im.GetMousePos().y - wndPos.y - viewToDebug.imgPos.y
im.Text(string.format("Mouse Pos Rel Img: %0.3f, %0.3f", x / viewToDebug.imgSize.x, y / viewToDebug.imgSize.y))
end
@/lua/ge/extensions/career/modules/milestones/generalMilestones/statistic.lua
getLabel = function(step, current, target) return "Long Distance Driver" end,
getDescription = function(step, current, target) return string.format("Drive a total distance of %0.1fkm.", target/1000) end,
getProgressLabel = function(step, current, target) return string.format("%0.1fkm / %0.1fkm", current/1000, target/1000) end,
getDescription = function(step, current, target) return string.format("Drive a total distance of %0.1fkm.", target/1000) end,
getProgressLabel = function(step, current, target) return string.format("%0.1fkm / %0.1fkm", current/1000, target/1000) end,
getTarget = function(step) return step == 0 and 0 or ({10,20,35,60,90,145,215,300})[step]*1000 end,
getLabel = function(step, current, target) return "Play the Game" end,
getDescription = function(step, current, target) return string.format("Play the game for %dh.", target/3600) end,
getProgressLabel = function(step, current, target) return string.format("%dh %dm / %dh", math.floor(current / 3600),math.floor(((current % 3600) or 0) / 60),target/3600) end,
getDescription = function(step, current, target) return string.format("Play the game for %dh.", target/3600) end,
getProgressLabel = function(step, current, target) return string.format("%dh %dm / %dh", math.floor(current / 3600),math.floor(((current % 3600) or 0) / 60),target/3600) end,
getTarget = function(step) return step == 0 and 0 or math.max(1,(step)*5)*3600 end,
getValue = function() return (gameplay_statistic.metricGet("vehicle/rollover", true) or {value=0}).value end,
getLabel = function(step, current, target) return string.format('Rollovers') end,
getDescription = function(step, current, target) return string.format("Do %d rollovers in your vehicles.", target) end,
getLabel = function(step, current, target) return string.format('Rollovers') end,
getDescription = function(step, current, target) return string.format("Do %d rollovers in your vehicles.", target) end,
getProgressLabel = function(step, current, target) return string.format("%d / %d", current, target) end,
getDescription = function(step, current, target) return string.format("Do %d rollovers in your vehicles.", target) end,
getProgressLabel = function(step, current, target) return string.format("%d / %d", current, target) end,
getTarget = function(step) return step == 0 and 0 or math.max(1,math.floor(math.pow(step-1,1.5))*5) end,
getValue = function() return (gameplay_statistic.metricGet("vehicle/airtime.time", true) or {value=0}).value end,
getLabel = function(step, current, target) return string.format('Airtime') end,
getDescription = function(step, current, target) return string.format("Be airborne with your vehicle for %dm %ds.", target/60, target%60) end,
getLabel = function(step, current, target) return string.format('Airtime') end,
getDescription = function(step, current, target) return string.format("Be airborne with your vehicle for %dm %ds.", target/60, target%60) end,
getProgressLabel = function(step, current, target) return string.format("%dm %ds / %dm %ds", current/60, current%60, target/60, target%60) end,
getDescription = function(step, current, target) return string.format("Be airborne with your vehicle for %dm %ds.", target/60, target%60) end,
getProgressLabel = function(step, current, target) return string.format("%dm %ds / %dm %ds", current/60, current%60, target/60, target%60) end,
getTarget = function(step) return step == 0 and 0 or math.max(1,math.floor(math.pow(step,1.5)))*30 end,
local statCallback = function()
log("I","",string.format("Milestone Reached: %s %0.2f!", milestone.getLabel(step), milestone.getTarget(step)))
milestones.milestoneReached(milestone.getLabel(step))
@/lua/ge/extensions/gameplay/rally/geometry.lua
local levelName = core_levels.getLevelName(getMissionFilename())
return string.format("temp/rally_route_%s.json", level, map)
end
else
pacenote.name = string.format("%i", floor(0.5+pacenote.length/10)*10)
end
end
--pacenote.name = string.format("[%.1fs] %s", pacenote.time, pacenote.name)
end
local distanceThresholdStraight = 0.5
log("I", "", string.format("Simplifying %d pacenotes:", #pacenotes))
for i=1, 10 do
n = n + simplifyStraightsConsecutive(pacenotes)
log("I", "", string.format(" - Phase %d: %d pacenotes (%d nodes reassigned)", i, #pacenotes, n))
if n == 0 then break end -- nothing left to do
simplifyPacenotes(pacenotes)
log("I", "", string.format("Generated a rally route from '%s' with %d pacenotes", prevPacenoteSource, #pacenotes))
return pacenotes
--rlcolor = color
local txt = string.format("%.0fkmh, %.0fm, %.0fdeg, %.1fm/ss", vel, node.length, node.angle, node.accel or 0)
--local txt = string.format("%.0fkmh, %0.1fs", vel, node.time)
local txt = string.format("%.0fkmh, %.0fm, %.0fdeg, %.1fm/ss", vel, node.length, node.angle, node.accel or 0)
--local txt = string.format("%.0fkmh, %0.1fs", vel, node.time)
tagPos:set(node.pos)
local opens = slowestNode.severityId ~= straightId and (firstNode.vel / lastNode.vel < 1/tightensThreshold)
return string.format("%s%s%s%s%s%s" -- %.0fdeg"
,pacenote.name
prevPacenoteSource = 'groundMarkers'
log("I", "", string.format("Generating rally pacenotes from '%s'", prevPacenoteSource))
local waypoints = getWaypointsFromGroundMarkers()
prevPacenoteSource = 'fileCache'
log("I", "", string.format("Generating rally pacenotes from '%s'", prevPacenoteSource))
local route = lpack.decode(readFile(getRouteJsonPath()))
@/lua/vehicle/controller/tirePressureControl.lua
if activeGroups[groupName] == nil then
log("E", "tirePressureControl.setGroupState", string.format("Can't find group with name %q", (groupName or "nil")))
return
if activeGroups[groupName] == nil then
log("E", "tirePressureControl.toggleGroupState", string.format("Can't find group with name %q", (groupName or "nil")))
return
else
log("E", "tirePressureControl.initSecondStage", string.format("Can't find pressure group id for wheel %q", wheelName))
end
else
log("E", "tirePressureControl.initSecondStage", string.format("Can't find wheel id for wheel %q", wheelName))
end
@/lua/ge/extensions/editor/vehicleEditor/staticEditor/vePartTree.lua
beamCenterPos:setAdd(p1)
local text = string.format("%s - %s", node1.name or node1.cid, node2.name or node2.cid)
debugDrawer:drawTextAdvanced(beamCenterPos, text, textCol, true, false, textBgCol, false, false)
-- Highlight beam
local text = string.format("%s - %s", chosenBeamNode1.name or chosenBeamNode1.cid, chosenBeamNode2.name or chosenBeamNode2.cid)
@/inspector/Views/AuditTestGroupContentView.js
const format = WI.UIString("%s%%", "Percentage (of audits)", "The number of tests that passed expressed as a percentage, followed by a literal %.");
String.format(format, [this._percentageTextElement], String.standardFormatters, this._percentageContainer, (a, b) => {
a.append(b);
let label = (labelPlural && count !== 1) ? labelPlural : labelSingular;
let scopeBarItem = new WI.ScopeBarItem(level, label.format(count), {
className: level,
if (!this.placeholderElement || !this.placeholderElement.__placeholderRunning) {
this.placeholderElement = WI.createMessageTextView(WI.UIString("Running the \u201C%s\u201D audit").format(this.representedObject.name));
this.placeholderElement.__placeholderRunning = true;
@/lua/ge/extensions/editor/roadDecorations.lua
objName = objName[#objName]
objName = string.format('decoration.%s.%s.%s', roadName, objName, idx)
local groupName = string.format('decorations.%d', tostring(roadName))
local group = scenetree.findObject(groupName)
@/lua/ge/extensions/gameplay/markers/gasStationMarker.lua
end
local iconId = iconRendererObj:addIcon(string.format("%s-gsIcon-%d",cluster.clusterId, idx), playModeIconName, iconPos)
local iconInfo = iconRendererObj:getIconById(iconId)
@/inspector/Views/DebuggerDashboardView.js
var tooltip = WI.UIString("Continue script execution (%s or %s)").format(WI.pauseOrResumeKeyboardShortcut.displayName, WI.pauseOrResumeAlternateKeyboardShortcut.displayName);
this._debuggerResumeButtonItem = new WI.ActivateButtonNavigationItem("debugger-dashboard-pause", tooltip, tooltip, "Images/Resume.svg", 15, 15);
@/lua/vehicle/controller/tech/vehicleSystemsCoupling.lua
unanswered = math.ceil(pingTime / simulinkTime)
log('I', logTag, 'Ping time = ' .. pingTime .. ' , Simulink fixed step size = ' .. string.format("%.6g", (sendSkips + 1) * physicsDt))
@/inspector/Views/ContentBrowser.js
this._backNavigationItem = new WI.ButtonNavigationItem("back", WI.UIString("Back (%s)").format(this._backKeyboardShortcut.displayName), backButtonImage, 8, 13);
this._backNavigationItem.addEventListener(WI.ButtonNavigationItem.Event.Clicked, goBack);
this._forwardNavigationItem = new WI.ButtonNavigationItem("forward", WI.UIString("Forward (%s)").format(this._forwardKeyboardShortcut.displayName), forwardButtonImage, 8, 13);
this._forwardNavigationItem.addEventListener(WI.ButtonNavigationItem.Event.Clicked, goForward);
@/lua/ge/extensions/editor/flowgraph/events.lua
local function formatTime(time)
return string.format("%d:%02d:%03d",time/60, time%60, (time%1)*1000)
end
@/lua/ge/extensions/editor/dynamicDecals/loadSave.lua
end
im.tooltip(string.format("Overwrites %s", lastProjectFilePath))
if ext == "" then im.EndDisabled() end
@/lua/ge/extensions/editor/api/valueInspector.lua
if imgui.Button(string.format("Open in Asset Browser##%s", filenameContextMenu.fieldName)) then
extensions.editor_assetBrowser.selectFileByPath(filenameContextMenu.fieldValue)
if SimObject.isNameValid(val) == false then
local msg = "Cannot rename scene node to '" .. val .. "', bad format (cannot start with %, a digit 0-9 or /, cannot be a class name)"
editor.logError(msg)
@/lua/ge/extensions/core/funstuff.lua
local planetRadius = 5
local command = string.format('obj:setPlanets({%f, %f, %f, %d, %f})', worldPoint.x, worldPoint.y, worldPoint.z, planetRadius, mass * vehicleSizeFactor * 1)
@/lua/vehicle/extensions/test/ffbCalibration.lua
if safetyCountdown < 0 then
log("I", "", string.format(" >>> VLUA FFB calibration: finished due to safety timeout"))
data.FFB.endReason = "timeout"
speedMin = speedTarget * 0.6
log("W", "", string.format(" >>> VLUA FFB calibration: cruise control taking too long to reach speed. Falling back to reachable speeds: %5.1f kmh, %5.1f kmh", speedMin*3.6, speedTarget*3.6))
data.FFB.cruiseControlFailures = data.FFB.cruiseControlFailures + 1
if logCountdown < 0 then
log("I", "", string.format("VLUA FFB calibration: gradual turning in progress: %4.0f kmh (%i%%), %5.3f st (%i%%)", airspeed*3.6, math.min(1, airspeed / speedMin)*100, gradualInput, 100*clamp(gradualInput/lastSteeringInput, 0, 1)))
logCountdown = 0.5
-- turning finished progress
log("I", "", string.format(" >>> VLUA FFB calibration: finished gradual turning"))
logCountdown = 0
-- just started a gradual input to reach lastSteeringInput
log("I", "", string.format(" >>> VLUA FFB calibration: cruise control reached target speed. Beginning gradual turning"))
logCountdown = 0
if logCountdown < 0 then
log("I", "", string.format("VLUA FFB calibration: cruise control in progress: %4.0f kmh (%i%%, %i%%)", airspeed*3.6, math.min(1, airspeed / speedMin)*100, math.min(1, airspeed / speedTarget)*100))
logCountdown = 0.5
if logCountdown < 0 then
log("I", "", string.format("VLUA FFB calibration: data being logged: %4.0f kmh (%i%%), %5.3f st (%i%%), %7.3f ffb", airspeed*3.6, math.min(1, airspeed / speedMin)*100, lastSteeringInput, 100*lastSteeringInput, hydros.forceAtWheelNorm))
logCountdown = 0.5
-- we've lost too much speed
log("I", "", string.format(" >>> VLUA FFB calibration: cruise control has lost too much speed: %4.0f kmh (%i%%)", airspeed*3.6, math.min(1, airspeed / speedMin)*100))
logCountdown = 0
if safetyCountdown < 0 then
log("I", "", string.format(" >>> VLUA FFB calibration: finished succesfull"))
data.FFB.endReason = "noIssues"
if logCountdown < 0 then
log("I", "", string.format("VLUA FFB calibration: data being logged: %4.0f kmh (%i%%), %5.3f st (%i%%), %7.3f ffb", airspeed*3.6, math.min(1, airspeed / speedMin)*100, lastSteeringInput, 100*lastSteeringInput, hydros.forceAtWheelNorm))
logCountdown = 0.5
end
obj:queueGameEngineLua(string.format("test_ffbCalibration.onFFBCalibrationFinished(%q)", lpack.encode(data)))
data = nil
@/lua/ge/extensions/editor/flowgraph/missionVariableHelper.lua
log("D", logTag, string.format("Found %s mission variables to apply from Mission to Flowgraph", tableSize(missionTypeData)))
applied = applied + 1
log("D", logTag, string.format(" [+] %s -> set to %s", name, dumps(value, 2)))
else
else
log("W", logTag, string.format(" [!] %s -> failed to set", name))
end
notFound = notFound + 1
log("D", logTag, string.format(" [x] %s -> skipped since it doesn't exist in flowgraph", name))
end
injected = injected + 1
log("D", logTag, string.format(" [#] %s -> injected player vehicle ID = %s", varName, tostring(vehicleId)))
end
if applied > 0 or injected > 0 then
log("D", logTag, string.format("Successfully applied %s variables from mission: %s", applied, selectedMission.id))
if injected > 0 then
if injected > 0 then
log("D", logTag, string.format(" (+ %s vehicle ID variables injected)", injected))
end
if notFound > 0 then
log("D", logTag, string.format(" (%s variables skipped - not defined in flowgraph)", notFound))
end
else
log("D", logTag, string.format("No variables were applied (found %s undefined variables)", notFound))
return false
@/lua/ge/extensions/career/modules/delivery/pages.lua
fac.progress.itemsDeliveredFromHere.count > 0
and string.format("%d Items, %0.2f$",fac.progress.itemsDeliveredFromHere.count, fac.progress.itemsDeliveredFromHere.moneySum)
or "-",
fac.progress.itemsDeliveredToHere.count > 0
and string.format("%d Items, %0.2f$",fac.progress.itemsDeliveredToHere.count, fac.progress.itemsDeliveredToHere.moneySum)
or "-"
local facText = string.format('Below is an overview of all facilities you have delivered an item to or from.- You have unlocked %d/%d facilities that send out cargo. To unlock a facility and be able to deliver items for them, first deliver an item there.
- You delivered a total of %d items and earned a total of %0.2f$ with deliveries. You can see a more detailled list of delivered items in the Delivery History.
',unlockedCount, providingFacilitiesCount, progress.itemsDeliveredTotal or 0, progress.rewardFromAllDeliveries.money or 0 )
for _, key in ipairs(career_branches.orderAttributeKeysByBranchOrder(tableKeys(change.attributeChange))) do
changeText = changeText .. string.format('%s: %s%0.2f
', key, change.attributeChange[key] > 0 and "+" or "", change.attributeChange[key])
end
if not progress.timedFlag then
deliveriesText = deliveriesText .. string.format("Urgent Delivieries are still locked. Deliver %d items in total to unlock them. (%d / %d).", dProgress.getModifierRequirements().itemsDeliveredTotalToUnlockTimed, progress.itemsDeliveredTotal, dProgress.getModifierRequirements().itemsDeliveredTotalToUnlockTimed)
else
else
deliveriesText = deliveriesText .. string.format("You have delivered a total of %d Urgent Cargo items. Of those, %d were delivered on time, %d were delayed and %d were late.",progress.timedDeliveries, progress.onTimeDeliveries, progress.delayedDeliveries, progress.lateDeliveries)
end
if not progress.fragileFlag then
deliveriesText = deliveriesText .. string.format("Precious Cargo Deliveries are still locked. Deliver %d items with the Urgent Cargo modifier on time to unlock them. (%d / %d)", dProgress.getModifierRequirements().onTimeDeliveriesToUnlockFragile, progress.onTimeDeliveries, dProgress.getModifierRequirements().onTimeDeliveriesToUnlockFragile)
else
else
deliveriesText = deliveriesText .. string.format("You have delivered a total of %d Precious Cargo items. Of those, %d were delivered intact, %d were damaged and %d were destroyed.",progress.fragileDeliveries, progress.noDamageDeliveries, progress.damagedDeliveries, progress.brokenDeliveries)
end
if not progress.timedFragileFlag then
deliveriesText = deliveriesText .. string.format("Urgent and Precious Cargo Deliveries are still locked. Deliver %d items with the Precious Cargo modifier intact to unlock them. (%d / %d)", dProgress.getModifierRequirements().noDamageDeliveriesToUnlockTimedFragile, progress.noDamageDeliveries, dProgress.getModifierRequirements().noDamageDeliveriesToUnlockTimedFragile)
else
@/lua/ge/extensions/editor/dynamicDecals/layerTypes/textureFill.lua
local function inspectLayerGui(layer, guiId)
local widgetId = string.format("%s_%s", layer.uid, guiId)
end
im.ColorButton(string.format("Color##fillLayer_vehicleColorPalette_colorButton_%s", guiId), editor.getTempImVec4_TableTable(paletteColor), nil, im.ImVec2(colorButtonHeight, colorButtonHeight))
end
im.ColorButton(string.format("Color##fillLayer_vehicleColorPalette_colorButton_%s", guiId), editor.getTempImVec4_TableTable(paletteColor), nil, im.ImVec2(colorButtonHeight, colorButtonHeight))
@/lua/vehicle/powertrain/sequentialGearbox.lua
-- print(string.format("volIn - %0.2f / volOut - %0.2f / ptchIn - %0.2f / ptchOut - %0.2f / inLoad - %0.2f / outLoad - %0.2f", volumeInput, volumeOutput, pitchInput, pitchOutput, inputLoad, outputLoad))
end
@/lua/ge/extensions/gameplay/rally/recce/drivelineRecording.lua
log('I', logTag, 'loaded driveline in '.. string.format("%.3f", t_load)..'s with '..tostring(#rawPoints)..' points')
@/inspector/Views/TextEditor.js
let formatter = new WI.Formatter(this._codeMirror, builder);
formatter.format(start, end);
@/lua/ge/extensions/editor/cosimulationSignalEditor.lua
}
be:queueObjectLua(vid, string.format("controller.loadControllerExternal('tech/cosimulationCoupling', 'cosimulationCoupling', %s)", serialize(lpack.encode({cData}))))
-- applyModeSettings(currentMode[0])
-- log('I', logTag, string.format("Mode switched to %s", modes[j]))
-- end
@/lua/common/csvlib.lua
if filename:sub(-4, -4) ~= '.' then
filename = string.format("%s_%s.%s", filename, os.date("%Y-%m-%dT%H_%M_%S"), format)
end
@/gameplay/missionTypes/precisionParking/constructor.lua
{ name = "Time Available", value = ""..self.fgVariables.timeAvailable},
{ name = "Provided Vehicle", value = string.format("%s %s", self.missionTypeData.model, self.missionTypeData.config)},
}
@/lua/ge/extensions/util/nodeBeamExport.lua
local nextIdx = maxIdx + 1
return string.format('%sexport_%d.nbexport.json', dir, nextIdx)
end
@/lua/ge/extensions/ui/gameplaySelector/tiles.lua
--print(string.format("handleDetailGameplayPath: clusterMode: %s, clusterKey: %s, groupKey: %s, groupName: %s, pathKeys: %s", clusterMode, clusterKey, groupKey, groupName, pathKeys))
table.insert(groups, {
--label = string.format("%s (%s is %s)", clusterKey, groupKey, groupName),
tiles = filteredItems
@/lua/ge/extensions/career/modules/delivery/tasklist.lua
for _, cargo in ipairs(con.rawCargo) do
local gId = string.format("%s-%s", dParcelManager.getLocationLabelShort(cargo.destination),
#cargo.modifiers == 0 and "noMods"
#cargo.modifiers == 0 and "noMods"
or string.format("%s-%0.2f", cargo.groupId, cargo.loadedAtTimeStamp or -1)
)
for _, cargo in ipairs(con.transientCargo) do
local dId = string.format("%s", dParcelManager.getLocationLabelLong(cargo.location))
transientCount = transientCount +1
if cargoCount > 0 and vehicleTaskCount == 0 then
subtext = string.format("%d item%s loaded.", cargoCount, cargoCount > 1 and "s" or "")
else
else
subtext = string.format("%d ongoing task%s.", cargoCount + vehicleTaskCount + transientCount, (cargoCount + vehicleTaskCount + transientCount) > 1 and "s" or "")
end
elementsToClearById[elem.id] = true
--log("I","",string.format("Deleting %s - %s", elem.type, tasklistId))
end
if elem.update then
--log("I","",string.format("Updating %s - %s", elem.type, tasklistId))
anyUpdated = true
local first = dParcelManager.getCargoById(elem.cargoIds[1])
local modifierStrings = {string.format("%d Item%s", #elem.cargoIds, #elem.cargoIds~=1 and "s" or "")}
if expiredTime <= mod.timeUntilDelayed then
table.insert(modifierStrings, string.format("Time: %ds", mod.timeUntilDelayed - expiredTime))
elseif expiredTime <= mod.timeUntilLate then
elseif expiredTime <= mod.timeUntilLate then
table.insert(modifierStrings, string.format("Delayed: %ds", mod.timeUntilLate - expiredTime))
else
id = tasklistId,
label = string.format("Deliver to %s", dParcelManager.getLocationLabelShort(first.destination)),
subtext = table.concat(modifierStrings, ", "),
id = tasklistId,
label = string.format("Pick up %d items from %s", #elem.cargoIds, dParcelManager.getLocationLabelLong(first.location)),
active = true,
if task.type == "coupleTrailer" then
label = string.format("Couple the trailer.")
elseif task.type == "enterVehicle" then
elseif task.type == "enterVehicle" then
label = string.format("Enter the vehicle.")
elseif task.type == "bringToDestination" or task.type == "confirmDropOff" then
elseif task.type == "bringToDestination" or task.type == "confirmDropOff" then
label = string.format("Drop off %s at %s.",elem.type == "trailer" and "the trailer" or "the vehicle", dParcelManager.getLocationLabelShort(task.destination))
elseif task.type == "putIntoParkingSpot" then
if task.forwardOn == "exitVehicle" then forwardString = "exit the vehicle" end
label = string.format("Park Trailer in %s and %s.", dParcelManager.getLocationLabelShort(task.destination), forwardString)
--elseif task.type == "confirmDropOff" then
--elseif task.type == "confirmDropOff" then
--label = string.format("Confirm the dropoff at %s.", dParcelManager.getLocationLabelShort(task.destination))
end
end
local subtext = string.format("%s",elem.taskData.offer.vehicle.name)
if elem.type == "vehicle" then
if elem.type == "vehicle" then
subtext = string.format("%s %s",elem.taskData.offer.vehicle.brand, elem.taskData.offer.vehicle.name)
end
@/inspector/Views/CPUTimelineOverviewGraph.js
this._legendElement.hidden = false;
this._legendElement.textContent = WI.UIString("Maximum CPU Usage: %s").format(Number.percentageString(this._maxUsage / 100));
}
@/lua/ge/extensions/career/modules/milestones/generalMilestones/speedTraps.lua
getValue = function() return milestones.saveData.general[milestoneId].maxVelocityReachedByPlayer or 0 end,
getLabel = function(step, current, target) return string.format('Speeding in %s', name) end,
getDescription = function(step, current, target) return string.format("Trigger the speed trap %s by driving very fast in front of it. Watch for the flash!", name) end,
getLabel = function(step, current, target) return string.format('Speeding in %s', name) end,
getDescription = function(step, current, target) return string.format("Trigger the speed trap %s by driving very fast in front of it. Watch for the flash!", name) end,
getProgressLabel = function(step, current, target) return {txt="ui.career.milestones.speedTrapVelocity.progressLabel", context={current = current, target = target}} end,
end,
getLabel = function(step, current, target) return string.format("Speeding Menace") end,
getDescription = function(step, current, target) return string.format("Trigger %s different speed traps.", target) end,
getLabel = function(step, current, target) return string.format("Speeding Menace") end,
getDescription = function(step, current, target) return string.format("Trigger %s different speed traps.", target) end,
getProgressLabel = function(step, current, target) return string.format("%d / %d", current, target) end,
getDescription = function(step, current, target) return string.format("Trigger %s different speed traps.", target) end,
getProgressLabel = function(step, current, target) return string.format("%d / %d", current, target) end,
getTarget = function(step) return step == 0 and 0 or math.ceil(stepPercent[step]*numOfTraps) end,
getValue = function() return milestones.saveData.general[triggerCounterMilestoneId].triggerCount or 0 end,
getLabel = function(step, current, target) return string.format("Serial Speeder", step) end,
getDescription = function(step, current, target) return string.format("Trigger speed traps a certain amount of times.") end,
getLabel = function(step, current, target) return string.format("Serial Speeder", step) end,
getDescription = function(step, current, target) return string.format("Trigger speed traps a certain amount of times.") end,
getProgressLabel = function(step, current, target) return string.format("%d / %d", current, target) end,
getDescription = function(step, current, target) return string.format("Trigger speed traps a certain amount of times.") end,
getProgressLabel = function(step, current, target) return string.format("%d / %d", current, target) end,
getTarget = function(step) return (step) * 15 end,
@/lua/ge/extensions/ui/apps/minimap/topomap.lua
local function marchingSquares(d, ilb, iub, jlb, jub, x, y, nc, z, contourLevels)
log("I", "", string.format("Marching squares: grid %dx%d, levels: %d", iub-ilb, jub-jlb, nc))
log("I", "", string.format("X range: %.1f to %.1f", x[ilb], x[iub]))
log("I", "", string.format("Marching squares: grid %dx%d, levels: %d", iub-ilb, jub-jlb, nc))
log("I", "", string.format("X range: %.1f to %.1f", x[ilb], x[iub]))
log("I", "", string.format("Y range: %.1f to %.1f", y[jlb], y[jub]))
log("I", "", string.format("X range: %.1f to %.1f", x[ilb], x[iub]))
log("I", "", string.format("Y range: %.1f to %.1f", y[jlb], y[jub]))
local zc = contourLevels[levelIndex]
log("I", "", string.format("Processing contour level: %.1f", zc))
if i == ilb and j == jlb then
log("I", "", string.format("Sample cell [%d,%d]: heights %.1f,%.1f,%.1f,%.1f", i, j, d00, d10, d11, d01))
end
if i == ilb and j == jlb then
log("I", "", string.format("Bottom edge intersection: t=%.3f, pos=(%.1f,%.1f)", t, xc, yc))
end
if i == ilb and j == jlb then
log("I", "", string.format("Right edge intersection: t=%.3f, pos=(%.1f,%.1f)", t, xc, yc))
end
if i == ilb and j == jlb then
log("I", "", string.format("Top edge intersection: t=%.3f, pos=(%.1f,%.1f)", t, xc, yc))
end
if i == ilb and j == jlb then
log("I", "", string.format("Left edge intersection: t=%.3f, pos=(%.1f,%.1f)", t, xc, yc))
end
if i == ilb and j == jlb then
log("I", "", string.format("Created segment: level %.1f, (%.1f,%.1f) to (%.1f,%.1f)",
zc, points[1].x, points[1].y, points[2].x, points[2].y))
if #contourSegments <= 5 then
log("I", "", string.format("Segment %d: level %.1f, (%.1f,%.1f) to (%.1f,%.1f)",
#contourSegments, zc, points[1].x, points[1].y, points[2].x, points[2].y))
log("I", "", string.format("Topo map bounds: X[%.1f, %.1f], Y[%.1f, %.1f]",
heightmapBounds.minX, heightmapBounds.maxX, heightmapBounds.minY, heightmapBounds.maxY))
log("I", "", string.format("Scanning terrain heightmap: %dx%d grid (%.1fm resolution)",
gridWidth, gridHeight, heightmapResolution))
-- Test terrain height at origin and nearby points
log("I", "", string.format("Test heights: origin=%.1f, (100,0)=%.1f, (0,100)=%.1f",
core_terrain.getTerrainHeight(vec3(0,0,0)) or 0,
if x <= 2 and y <= 2 then
log("I", "", string.format("Height at [%d,%d] (%.1f,%.1f): %.1f", x, y, scanPos.x, scanPos.y, terrainHeight or 0))
end
log("I", "", string.format("Terrain heightmap scan complete: %dx%d samples", gridWidth + 1, gridHeight + 1))
return true
log("I", "", string.format("Generating contours from %.1f to %.1f (step %.1f)", minHeight, maxHeight, levelStep))
log("I", "", string.format("Preparing data: grid %dx%d, bounds (%.1f,%.1f) to (%.1f,%.1f)",
heightmapData.gridWidth, heightmapData.gridHeight,
-- Debug: log some sample data
log("I", "", string.format("Sample X coords: %.1f, %.1f, %.1f", x[0], x[1], x[2]))
log("I", "", string.format("Sample Y coords: %.1f, %.1f, %.1f", y[0], y[1], y[2]))
log("I", "", string.format("Sample X coords: %.1f, %.1f, %.1f", x[0], x[1], x[2]))
log("I", "", string.format("Sample Y coords: %.1f, %.1f, %.1f", y[0], y[1], y[2]))
log("I", "", string.format("Sample heights: %.1f, %.1f, %.1f", d[0][0], d[1][0], d[0][1]))
log("I", "", string.format("Sample Y coords: %.1f, %.1f, %.1f", y[0], y[1], y[2]))
log("I", "", string.format("Sample heights: %.1f, %.1f, %.1f", d[0][0], d[1][0], d[0][1]))
end
log("I", "", string.format("Non-zero heights: %d/%d, max height: %.1f",
nonZeroCount, (heightmapData.gridWidth + 1) * (heightmapData.gridHeight + 1), maxHeight))
log("I", "", string.format("Generated %d contour segments", #contourSegments))
@/lua/ge/extensions/flowgraph/nodes/mission/UpdateDisplayDragRace.lua
-- Three decimal points for time
for num in string.gmatch(string.format("%.3f", finishTime), "%d") do
table.insert(timeDisplayValue, num)
-- Two decimal points for speed
for num in string.gmatch(string.format("%.2f", finishSpeed), "%d") do
table.insert(speedDisplayValue, num)
@/inspector/Views/SpreadsheetCSSStyleDeclarationSection.js
let specificity = selector.specificity.map((number) => number.toLocaleString());
let tooltip = WI.UIString("Specificity: (%d, %d, %d)").format(...specificity);
if (selector.dynamic) {
@/lua/ge/extensions/core/flowgraphManager.lua
M.onFlowgraphSceneObjectAdd = function(id, name, fgPath)
dump(string.format("Added FGSO: %s, ID: %d, fgPath: %s ", name or '', id or 0, fgPath or ''))
end
M.onFlowgraphSceneObjectRemove = function(id, name, fgPath)
dump(string.format("Removed FGSO: %s, ID: %d, fgPath: %s ", name or '', id or 0, fgPath or ''))
end
M.onFlowgraphSceneObjectChanged = function(id, name, fgPath)
dump(string.format("Changed FGSO: %s, ID: %d, fgPath: %s ", name or '', id or 0, fgPath or ''))
end
@/lua/vehicle/extensions/tech/CANBus/CANBusPeak.lua
local function dumpsByteHex(b)
return string.format("0x%x", b)
end
end
return string.format("0x%x -> %s", msg.ID, dumps(data))
end
if sendResult ~= M.errorCodes.OK then
log("E", "CANBusPeak.sendCANMessage", string.format("Non-OK send result for %q: %q", tag, M.errorCodeLookup[sendResult]))
end
@/lua/common/utils/simpleProfiler/report.lua
date = os.date("%Y-%m-%d %H:%M:%S"),
totalTimeString = string.format("%.3f", root.stats.duration or 0),
profilerJSON = jsonEncode(root),
@/lua/ge/extensions/util/showroom.lua
local pos = getSuitablePosition()
prefab = spawnPrefab(Sim.getUniqueName("Showroom"),prefabPath,string.format("%d %d %d", pos.x, pos.y, pos.z) ,"0 0 1 0","1 1 1", true)
if not prefab then
@/lua/ge/extensions/gameplay/markers/bigmapMarker.lua
local smootherVal = self.bigMapMarkerAlphaSmoother:getWithRateUncapped(bigMapActive and 1 or 0, data.dt, markerAlphaRate)
--print(string.format("%0.2f - %s", smootherVal, self.id))
local bigMapMarkerAlpha = clamp(smootherVal,0,1)
local bigMapMarkerAlpha = clamp(smootherVal,0,1)
--simpleDebugText3d(string.format("%0.2f %s %s %0.2f %d",bigMapMarkerAlpha, self.visible and "V" or "I", data.bigmapTransitionActive and "T" or "N", data.dt, self.id), self.pos)
bigMapMarkerAlpha = 1-((1-bigMapMarkerAlpha)*(1-bigMapMarkerAlpha))
end
cluster.icon = string.format(prefix,math.min(count, 9))
end
@/lua/ge/extensions/editor/masterSpline.lua
end
im.tooltip(string.format('Switch AutoPilot preset to: [%s].', roadDesignPresetStrs[1]))
im.SameLine()
end
im.tooltip(string.format('Switch AutoPilot preset to: [%s].', roadDesignPresetStrs[2]))
im.SameLine()
end
im.tooltip(string.format('Switch AutoPilot preset to: [%s].', roadDesignPresetStrs[3]))
im.SameLine()
end
im.tooltip(string.format('Switch AutoPilot preset to: [%s].', roadDesignPresetStrs[4]))
im.SameLine()
end
im.tooltip(string.format('Switch AutoPilot preset to: [%s].', roadDesignPresetStrs[5]))
im.SameLine()
end
im.tooltip(string.format('Switch AutoPilot preset to: [%s].', roadDesignPresetStrs[6]))
im.NextColumn()
@/lua/ge/extensions/editor/dragRaceEditor/lanes.lua
local isSelected = i == selectedLaneIndex
local label = string.format("%s (%s)", lane.name or "Unnamed", lane.color or "unknown")
if im.IsItemHovered() then
im.tooltip(string.format("ID: %s\nShort Name: %s\nLong Name: %s\nOrder: %d",
lane.id or "N/A",
@/lua/ge/extensions/editor/crawlEditor/trails.lua
for i, prefabFileName in ipairs(trail.prefabs) do
im.Text(string.format("Prefab %d:", i))
im.SameLine()
@/ui/ui-vue/dist/index.js
Parent:`,parent$1,`
Child:`,prioNode),warnPrioNesting=!0)}let active=document.activeElement;(!active||!prioNode.contains(active))&&(rectNode=prioNode)}let rect=rectNode.getBoundingClientRect();if(rect.right<0||rect.bottom<0||rect.left>screen.width||rect.top>screen.height){node.classList.remove(MENU_NAVIGATION_CLASS);continue}node.classList.add(MENU_NAVIGATION_CLASS),node.tabIndex=0;let lnk={dom:node,rect};links.up&&links.up.push(lnk),links.down&&links.down.push(lnk),links.left&&links.left.push(lnk),links.right&&links.right.push(lnk)}return links.up&&links.up.sort((a$1,b)=>a$1.rect.top-b.rect.top),links.down&&links.down.sort((a$1,b)=>a$1.rect.bottom-b.rect.bottom),links.left&&links.left.sort((a$1,b)=>a$1.rect.left-b.rect.left),links.right&&links.right.sort((a$1,b)=>a$1.rect.right-b.rect.right),links}function isAvailable(node){if(!isVisibleFast(node))return!1;let style=document.defaultView.getComputedStyle(node,null);return style[`pointer-events`]===`none`||!isVisible(node,style)?!1:!isOccluded(node)}function isOccluded(node,dontIgnoreOffscreen=!1){let rects=node.getClientRects();for(let rect of rects)if(!isOccluded$1(node,rect,dontIgnoreOffscreen))return!1;return!0}function getDistanceFast(curr,goal,direction$1,usePerpendicular=!1){let dx=Math.min(goal.right,curr.right)-Math.max(goal.left,curr.left),dy=Math.min(goal.bottom,curr.bottom)-Math.max(goal.top,curr.top);dx===goal.right-goal.left&&(dx=curr.right-goal.left),dy===goal.bottom-goal.top&&(dy=curr.bottom-goal.top);let res=1/0;if(direction$1===DIR.DOWN&&goal.bottom>curr.bottom?res=Math.max(0,goal.bottom-curr.top)-dx:direction$1===DIR.UP&&goal.topcurr.right?res=Math.max(0,goal.left-curr.right)-dy:direction$1===DIR.LEFT&&goal.left{let firstLink=null,firstElementDistance=2**53-1;for(let link of links){let distance=link.rect.top*link.rect.top+link.rect.left*link.rect.left;distance>firstElementDistance||(firstElementDistance=distance,firstLink=link)}if(!firstLink){console.log(`Couldn't locate any button anywhere. Menu navigation won't work`);return}focusOnElement(firstLink.dom),scrollFix(firstLink,direction$1)}),!0;if(active.nodeName===`MD-SLIDER`&&(direction$1===DIR.LEFT||direction$1===DIR.RIGHT)||active.nodeName===`MD-OPTION`&&(direction$1===DIR.UP||direction$1===DIR.DOWN)||active.nodeName===`INPUT`&&active.type===`range`&&(direction$1===DIR.LEFT||direction$1===DIR.RIGHT))return fireKey(active,direction$1),!0;let{nearestLink,fixScroll}=findNext(links,direction$1,active);if(nearestLink)return focusOnElement(nearestLink.dom),fixScroll?.(),nearestLink.dom;if(links.length===0){let mdBackdrops=[...document.querySelectorAll(`md-backdrop, .md-scroll-mask`)];if(mdBackdrops.length>0){for(let el of mdBackdrops)try{el.parentNode.removeChild(el)}catch{}return navigateNext(links,direction$1,activeOverride)}}return!1}function findNext(links,direction$1,activeOverride=null){let active=activeOverride||document.activeElement,activeRect=active.getBoundingClientRect(),fixScroll=!0;if(isScrolling(direction$1)&&isOccluded(active,activeRect,!0)){let axis,boundsame,boundchange;switch(direction$1){case DIR.UP:case DIR.DOWN:axis=`vertical`,boundsame=[`left`,`right`],boundchange=[`top`,`bottom`];break;case DIR.LEFT:case DIR.RIGHT:axis=`horizontal`,boundsame=[`top`,`bottom`],boundchange=[`left`,`right`];break}if(navScrolling[axis].area){let bounds=navScrolling[axis].area.bounds,axisBound=activeRect[boundchange[1]]scrollFix(nearestLink,direction$1):null}}var navScrolling={running:!1,listening:{vertical:!1,horizontal:!1},dom:null,rect:null,vertical:{active:!1,amount:0,area:null},horizontal:{active:!1,amount:0,area:null},hint:{show:!1}};function drawScrollHint(){let show=isScrolling();if(navScrolling.hint.show===show)return;navScrolling.hint.show=show;let elem=document.getElementById(`xf_scroll`);elem&&(elem.style.display=show?``:`none`)}function navigateScroll(axis,amount){if(axis===AXIS_V&&(amount=-amount),navScrolling[axis].amount=amount*15,Math.abs(navScrolling[axis].amount)<1){navScrolling[axis].active=!1;return}navScrolling[axis].active=!0;let dom=document.activeElement;navScrolling.dom!==dom&&(navScrolling.dom=dom,navScrolling.rect=dom.getBoundingClientRect(),navScrolling[axis===AXIS_H?AXIS_V:AXIS_H].active=!1);let area=findScrollable(navScrolling,axis,!0);if(navScrolling[axis].area=area,!area){navScrolling[axis].active=!1;return}return navScrolling.running||window.requestAnimationFrame(function scrl(){let set={};for(let axis$1 of[AXIS_V,AXIS_H]){let cur=navScrolling[axis$1];if(!cur.active||!cur.area)continue;let pos=cur.area.parent[cur.area.readby]+navScrolling[axis$1].amount;pos>cur.area.fullsize?cur.active=!1:set[cur.area.moveby]=pos}navScrolling.running=Object.keys(set).length>0,navScrolling.running&&(area.parent.scrollTo({...set,behavior:`instant`}),document.dispatchEvent(new CustomEvent(`mdtooltiphide`)),window.requestAnimationFrame(scrl))}),!0}function scrollCatch(axis,enable){if(navScrolling.listening[axis]===enable)return;let cur=isScrolling();navScrolling.listening[axis]=enable,cur!==isScrolling()&&(bngApi.engineLua(`local o = scenetree.findObject("MenuScrollActionMap"); if o then o:${enable?`push`:`pop`}() end`),window.bngVue.uiNavTracker&&(enable?window.bngVue.uiNavTracker.addEvent(UI_SCROLL_ACTION_EVENTS[axis],TRACKER_ID):window.bngVue.uiNavTracker.removeEvent(UI_SCROLL_ACTION_EVENTS[axis],TRACKER_ID)))}function isScrolling(direction$1=void 0){let scrolling=!1;return direction$1?direction$1===DIR.UP||direction$1===DIR.DOWN?scrolling=navScrolling.listening.vertical:(direction$1===DIR.LEFT||direction$1===DIR.RIGHT)&&(scrolling=navScrolling.listening.horizontal):scrolling=navScrolling.listening.horizontal||navScrolling.listening.vertical,scrolling}function isScrollListening(axis=void 0){let listening=!1;return listening=axis?navScrolling.listening[axis]:navScrolling.listening.horizontal||navScrolling.listening.vertical,listening}function findScrollable(link,axis,thumbstick){axis!==AXIS_V&&axis!==AXIS_H&&(axis=AXIS_V);let opts=axis===AXIS_H?{moveby:`left`,readby:`scrollLeft`,size:`width`,scroll:`scrollWidth`,client:`clientWidth`,overflow:`overflow-x`}:{moveby:`top`,readby:`scrollTop`,size:`height`,scroll:`scrollHeight`,client:`clientHeight`,overflow:`overflow-y`},forced=!1,parent,fullsize,size$3,node=link.dom?.parentNode;function setParent(node$1){if(!node$1)return;if(thumbstick){let noNav=node$1.attributes.getNamedItem(SCROLL_ATTR);if(noNav&&noNav.value===`false`)return}let styles$1=document.defaultView.getComputedStyle(node$1,null);(styles$1[opts.overflow]===`auto`||styles$1[opts.overflow]===`scroll`)&&(fullsize=node$1[opts.scroll],size$3=node$1[opts.client],fullsize>size$3&&(parent=node$1))}for(;node&&node.isConnected&&node.nodeType===Node.ELEMENT_NODE&&!((!thumbstick||node.attributes.getNamedItem(`bng-nav-scroll`))&&(setParent(node),parent));)node=node.parentNode;if(!parent){let elems$2=document.querySelectorAll(`[${SCROLL_FORCE_ATTR}]`);for(let elem of elems$2)if(setParent(elem),parent){forced=!0;break}}if(scrollCatch(axis,!!parent),drawScrollHint(),!parent)return null;let start=0,styles=document.defaultView.getComputedStyle(parent,null);[`relative`,`absolute`,`static`,`fixed`].includes(styles.position)&&(start+=parent.getBoundingClientRect()[opts.moveby]);let pad=link.rect?Math.max(size$3/4,link.rect[opts.size]):size$3/4,bounds=[start+pad,start+size$3-pad];return{parent,moveby:opts.moveby,readby:opts.readby,bounds,fullsize,start:0,finish:fullsize-size$3,forced}}function scrollFix(link,direction$1){let area=findScrollable(link,direction$1===DIR.UP||direction$1===DIR.DOWN?AXIS_V:AXIS_H);if(!area){document.querySelector(`[bng-nav-scroll], [bng-nav-scroll-force]`)&&findScrollable(link,direction$1===DIR.LEFT||direction$1===DIR.RIGHT?AXIS_V:AXIS_H);return}if(area.forced)return;let mov=-1;direction$1===DIR.UP||direction$1===DIR.DOWN?link.rect.toparea.bounds[1]&&(mov=Math.min(area.parent.scrollTop-area.bounds[1]+link.rect.bottom,area.finish)):link.rect.leftarea.bounds[1]&&(mov=Math.min(area.parent.scrollLeft-area.bounds[1]+link.rect.right,area.finish)),mov>-1&&area.parent.scrollTo({[area.moveby]:mov,behavior:`instant`})}function fireKey(element,direction$1){let key=DIR_KEYS[direction$1];key&&dispatchKey(key,element)}function handleUINavEvent(e,restrictTo=void 0){let d=e.detail,handled=!1;if(d.name in UI_SCALAR_EVENT_ACTIONS){let axis=UI_SCALAR_EVENT_ACTIONS[d.name],value=d.value;if(value!==0&&THUMBSTICK_DEADZONE>0&&Math.abs(value)>THUMBSTICK_DEADZONE){let adjustedValue=(axis===AXIS_V?-value:value)>0?1:-1,direction$1=axis===AXIS_H?adjustedValue>0?DIR.RIGHT:DIR.LEFT:adjustedValue>0?DIR.DOWN:DIR.UP;lastScalarValue[axis]!==adjustedValue&&(lastScalarValue[axis]=adjustedValue,navigate(collectRects(direction$1,restrictTo),direction$1))}else lastScalarValue[axis]=0;handled=!0}if(d.name in UI_NAV_EVENT_ACTIONS){let action=UI_NAV_EVENT_ACTIONS[d.name];switch(action){case`up`:case`down`:case`left`:case`right`:d.value==1&&(navigate(collectRects(action,restrictTo),action),handled=!0);break;case`confirm`:if(d.value==1){let activeEl=document.activeElement;isNavigable$1(activeEl)&&(typeof activeEl.click==`function`?activeEl.click():activeEl.dispatchEvent(new CustomEvent(`click`))),handled=!0}break}}else if(d.name in UI_SCROLL_EVENT_ACTIONS){let axis=UI_SCROLL_EVENT_ACTIONS[d.name];navigateScroll(axis,d.value),handled=isScrollListening(axis)}handled&&e.preventDefault()}var SCOPED_NAV_ATTR$1=`bng-scoped-nav`,UI_NAV_ACTION_GROUP$1=`UINavActions`,GAME_UI_NAVIGATION_EVENT$1=`UINavigation`,GAME_UI_NAV_MAP_ENABLED_EVENT$1=`MenuActionMapEnabled`,DOM_UI_NAVIGATION_EVENT$1=`ui_nav`,UI_SCOPE_ATTR$3=`bng-ui-scope`,UI_EVENT_ATTR$1=`ui-nav-event`,ACTIONS_BY_UI_EVENT$1={focus_u:`menu_item_up`,focus_r:`menu_item_right`,focus_d:`menu_item_down`,focus_l:`menu_item_left`,menu:`toggleMenues`,back:`menu_item_back`,details:`cui_details`,advanced:`cui_advanced`,camera:`cui_camera`,logs:`cui_logs`,tab_l:`menu_tab_left`,tab_r:`menu_tab_right`,modifier:`cui_modifier`,action_4:`cui_action_4`,focus_ud:`menu_item_focus_ud`,focus_lr:`menu_item_focus_lr`,rotate_h_cam:`menu_item_radial_right_x`,rotate_v_cam:`menu_item_radial_right_y`,ok:`menu_item_select`,cancel:`cui_cancel`,action_2:`cui_action_2`,action_3:`cui_action_3`,gameplay_interact:`cui_gameplay_interact`,context:`cui_context`},UI_EVENTS_BY_ACTION$1=Object.assign({},...Object.entries(ACTIONS_BY_UI_EVENT$1).map(([k,v])=>({[v]:k}))),UI_EVENTS$1={focus_u:`focus_u`,focus_r:`focus_r`,focus_d:`focus_d`,focus_l:`focus_l`,pause:`pause`,menu:`menu`,back:`back`,details:`details`,advanced:`advanced`,camera:`camera`,logs:`logs`,tab_l:`tab_l`,tab_r:`tab_r`,modifier:`modifier`,zoom_out:`zoom_out`,zoom_in:`zoom_in`,subtab_l:`subtab_l`,subtab_r:`subtab_r`,center_cam:`center_cam`,action_4:`action_4`,move_ud:`move_ud`,move_lr:`move_lr`,focus_ud:`focus_ud`,focus_lr:`focus_lr`,rotate_h_cam:`rotate_h_cam`,rotate_v_cam:`rotate_v_cam`,ok:`ok`,cancel:`cancel`,action_2:`action_2`,action_3:`action_3`,gameplay_interact:`gameplay_interact`,context:`context`},UI_EVENT_GROUPS$1={focusMove:[UI_EVENTS$1.focus_u,UI_EVENTS$1.focus_d,UI_EVENTS$1.focus_l,UI_EVENTS$1.focus_r],focusMoveScalar:[UI_EVENTS$1.focus_ud,UI_EVENTS$1.focus_lr],moveScalar:[UI_EVENTS$1.move_ud,UI_EVENTS$1.move_lr],navigation:[UI_EVENTS$1.focus_u,UI_EVENTS$1.focus_d,UI_EVENTS$1.focus_l,UI_EVENTS$1.focus_r,UI_EVENTS$1.focus_ud,UI_EVENTS$1.focus_lr,UI_EVENTS$1.move_ud,UI_EVENTS$1.move_lr],allEvents:Object.keys(ACTIONS_BY_UI_EVENT$1)},setFilteredEvents=(...events$3)=>{clearFilteredEvents();let actionsToFilter=[...new Set(events$3.flat(1/0))].map(event=>ACTIONS_BY_UI_EVENT$1[event]);Lua_default.extensions.core_input_actionFilter.setGroup(UI_NAV_ACTION_GROUP$1,actionsToFilter),Lua_default.extensions.core_input_actionFilter.addAction(0,UI_NAV_ACTION_GROUP$1,!0)};setFilteredEvents.allExcept=(...events$3)=>{let eventsToNotFilter=[...new Set(events$3.flat(1/0))];setFilteredEvents(UI_EVENT_GROUPS$1.allEvents.filter(ev=>!eventsToNotFilter.includes(ev)))};var clearFilteredEvents=()=>{Lua_default.extensions.core_input_actionFilter.addAction(0,UI_NAV_ACTION_GROUP$1,!1),Lua_default.extensions.core_input_actionFilter.setGroup(UI_NAV_ACTION_GROUP$1,[])};const clamp=(val,min$1,max$1)=>Math.min(Math.max(val,min$1),max$1),round=(val,step=1)=>{if(val===void 0)throw Error(`The function at least needs a value`);return Math.round(val/step+2**-52)*step},roundDec=(val,dec=0)=>{if(val===void 0)throw Error(`The function at least needs a value`);if(dec>15)throw Error(`Floating point won't be precise after 15th decimal`);if(val===0)return 0;if(!Number.isInteger(dec))throw Error(`Decimal point must be an integer`);let pow=10**dec;return Math.round(val*pow+2**-52)/pow},roundDecSample=(val,sample=0)=>{let dec=getDecimalPlaces(sample);return dec===0?round(val):roundDec(val,dec)},getDecimalPlaces=num=>{if(Number.isInteger(num)||!Number.isFinite(num))return 0;let dec=0;for(;!Number.isInteger(num)&&Number.isFinite(num)&&(num*=10,dec++,!(dec>15)););return dec};var UIUnits_default=class{uiUnits={uiUnitLength:`metric`,uiUnitTemperature:`f`,uiUnitWeight:`lb`,uiUnitConsumptionRate:`imperial`,uiUnitTorque:`imperial`,uiUnitEnergy:`imperial`,uiUnitDate:`us`,uiUnitPower:`bhp`,uiUnitVolume:`gal`,uiUnitPressure:`psi`};mapping={length:`uiUnitLength`,speed:`uiUnitLength`,temperature:`uiUnitTemperature`,weight:`uiUnitWeight`,consumptionRate:`uiUnitConsumptionRate`,torque:`uiUnitTorque`,energy:`uiUnitEnergy`,date:`uiUnitDate`,power:`uiUnitPower`,volume:`uiUnitVolume`,pressure:`uiUnitPressure`,lengthMinor:`uiUnitLength`};userSettings={uiLanguage:`en-US`};eventBus={};api={};constructor(eventBus$1,api$1){this.eventBus=eventBus$1,this.api=api$1,this.beamBucks=this.beamBucks.bind(this),this.eventBus.on(`SettingsChanged`,data=>this.onSettingsChanged(data)),api$1.engineLua(`settings.notifyUI()`)}onSettingsChanged(data){for(let name in this.uiUnits)data.values[name]!==void 0&&(this.uiUnits[name]=data.values[name]);for(let name in this.userSettings)data.values[name]!==void 0&&(this.userSettings[name]=data.values[name].replace(/_/g,`-`))}buildString(func,val,numDecs,system){if([`division`,`buildString`,`date`].includes(func)||typeof this[func]!=`function`)throw Error(`Cannot use this function to build a string`);this.mapping[func]!==void 0&&system===void 0&&(system=this.uiUnits[this.mapping[func]]);let helper=this[func](val,system);return helper===null?``:typeof helper.val==`string`?helper.val:typeof helper.val==`number`?(helper.val<0&&helper.val>-(10**-numDecs)&&(helper.val=0),Intl.NumberFormat(this.userSettings.uiLanguage,{style:`decimal`,minimumFractionDigits:numDecs,maximumFractionDigits:numDecs}).format(helper.val)+` `+helper.unit):``}division(func1,func2,val1,val2,numDecs,system1,system2){let unsupported=[`division`,`weightPower`,`buildString`,`date`];if(unsupported.includes(func1)||typeof this[func1]!=`function`||unsupported.includes(func2)||typeof this[func2]!=`function`)throw Error(`Cannot use these functions`);let helper1=this[func1](val1,system1),helper2=this[func2](val2,system2);if(helper1!==null&&helper2!==null){let newVal=helper1.val/helper2.val;return{val:numDecs===void 0?newVal:roundDec(newVal,numDecs),unit:`${helper1.unit}/${helper2.unit}`}}else return console.error(`got null`,arguments),null}weightPower(x){let helper=this.division(`weight`,`power`,1,1);return helper===null?null:{val:helper.val*x,unit:helper.unit}}length(meters,system=this.uiUnits.uiUnitLength){if(system===`metric`)return meters<.01?{val:meters*1e3,unit:`mm`}:meters<1?{val:meters*100,unit:`cm`}:meters<1e3?{val:meters,unit:`m`}:{val:meters*.001,unit:`km`};if(system===`imperial`){let yd=meters*1.0936;return yd<1?{val:yd*36,unit:`in`}:yd<3?{val:yd*3,unit:`ft`}:{val:yd*568182e-9,unit:`mi`}}return null}distance=this.length;lengthMinor(meters,system=this.uiUnits.uiUnitLength){return system===`metric`?{val:meters*1,unit:`m`}:system===`imperial`?{val:meters*1.0936*3,unit:`ft`}:null}area(squareMeters,system=this.uiUnits.uiUnitLength){if(system===`metric`)return squareMeters<1e3?{val:squareMeters,unit:`sq m`}:{val:squareMeters*.001*.001,unit:`sq km`};if(system===`imperial`){let sqrYards=squareMeters*1.0936*1.0936;return sqrYards<1760?{val:sqrYards,unit:`sq yd`}:{val:sqrYards*568182e-9*568182e-9,unit:`sq mi`}}return null}temperature(x,system=this.uiUnits.uiUnitTemperature){switch(system){case`c`:return{val:x,unit:`°C`};case`f`:return{val:x*1.8+32,unit:`°F`};case`k`:return{val:x+273.15,unit:`K`};default:return null}}volume(x,system=this.uiUnits.uiUnitVolume){switch(system){case`l`:return{val:x,unit:`L`};case`gal`:return{val:x*.2642,unit:`gal`};default:return null}}pressure(x,system=this.uiUnits.uiUnitPressure){switch(system){case`inHg`:return{val:x*.2953,unit:`in.Hg`};case`bar`:return{val:x*.01,unit:`Bar`};case`psi`:return{val:x*.145038,unit:`PSI`};case`kPa`:return{val:x,unit:`kPa`};default:return null}}weight(x,system=this.uiUnits.uiUnitWeight){switch(system){case`kg`:return{val:x,unit:`kg`};case`lb`:return{val:2.20462262*x,unit:`lbs`};default:return null}}consumptionRate(x,system=this.uiUnits.uiUnitConsumptionRate){switch(system){case`metric`:return{val:1e5*x>5e4?`n/a`:1e5*x,unit:`L/100km`};case`imperial`:return{val:x===0?0:235*1e-5/x,unit:`MPG`};default:return null}}speed(x,system=this.uiUnits.uiUnitLength){switch(system){case`metric`:return{val:3.6*x,unit:`km/h`};case`imperial`:return{val:2.23693629*x,unit:`mph`};default:return null}}power(x,system=this.uiUnits.uiUnitPower){switch(system){case`kw`:return{val:.735499*x,unit:`kW`};case`hp`:return{val:x,unit:`PS`};case`bhp`:return{val:.98632*x,unit:`bhp`};default:return null}}torque(x,system=this.uiUnits.uiUnitTorque){switch(system===`metric`?system=`kg`:system===`imperial`&&(system=`lb`),system){case`kg`:return{val:x,unit:`Nm`};case`lb`:return{val:.7375621495*x,unit:`lb-ft`};default:return null}}energy(x,system=this.uiUnits.uiUnitEnergy){switch(system===`metric`?system=`j`:system===`imperial`&&(system=`ft lb`),system){case`j`:return{val:x,unit:`J`};case`ft lb`:return{val:.7375621495*x,unit:`ft lb`};default:return null}}date(x,system=this.uiUnits.uiUnitDate){switch(system){case`ger`:return x.toLocaleDateString(`de-DE`);case`uk`:return x.toLocaleDateString(`en-GB`);case`us`:return x.toLocaleDateString(`en-US`);default:return null}}beamBucks(x){return Intl.NumberFormat(this.userSettings.uiLanguage,{style:`decimal`,maximumFractionDigits:2,minimumFractionDigits:2}).format(+x)}},lite_default=class{constructor(){this.processing=!1,this.pending=0,this.finishCallback=null,this.angularRootScope=window.globalAngularRootScope,this.angularTimeout=null,this.angularTimeoutRetry=null,this.angularTimeoutWarned=!1,this.safetyTimeout=2e3,this.safetyTimer=null,this.warned=!1}setAngularRootScope(rootScope){this.angularRootScope=rootScope,this.angularTimeout=null,this.angularTimeoutRetry&&=(clearTimeout(this.angularTimeoutRetry),null)}getAngularTimeout(){if(this.angularTimeout!==null)return typeof this.angularTimeout==`function`?this.angularTimeout:null;let code;this.angularTimeoutRetry&&(code=`retry`,clearTimeout(this.angularTimeoutRetry));try{if(window.angular!==void 0&&window.angular.element){let injector=window.angular.element(document).injector();if(injector)return this.angularTimeout=injector.get(`$timeout`),this.angularTimeoutWarned&&console.log(`Stream Coordinator: Angular $timeout service resolved after retry`),this.angularTimeout;code=`no-injector`}else code=`no-angular`}catch{code=`error`}return this.angularTimeout=!1,this.angularTimeoutRetry||=setTimeout(()=>{this.angularTimeout||=null},5e3),console.warn(`Stream Coordinator: Angular $timeout service not available (${code})`),this.angularTimeoutWarned=!0,null}beforeBroadcast(){this.processing||(this.processing=!0,this.finishCallback=null,this.pending=0,this.safetyTimer&&clearTimeout(this.safetyTimer),this.safetyTimer=setTimeout(()=>{this.processing&&this.forceComplete()},this.safetyTimeout))}afterBroadcast(callback){if(callback&&typeof callback==`function`?this.finishCallback=()=>{this.finishCallback=void 0,Promise.resolve().then(callback)}:this.finishCallback=void 0,!this.processing){this.finishCallback?.();return}this.startDeferredWork()}startDeferredWork(){this.pending=0;let angularTimeout=this.getAngularTimeout();angularTimeout&&(this.angularRootScope||=window.globalAngularRootScope,this.angularRootScope&&(this.pending++,angularTimeout(()=>this.onOperationComplete(),0))),window.Vue?.nextTick&&(this.pending++,window.Vue.nextTick(()=>this.onOperationComplete())),this.pending===0&&(this.warned||(this.warned=!0,console.warn(`Stream Coordinator: No Angular $timeout() nor Vue.nextTick() detected, using only Promise microtask instead`)),this.complete())}onOperationComplete(){this.processing&&(this.pending--,this.pending<=0&&this.complete())}complete(){this.processing&&(this.safetyTimer&&=(clearTimeout(this.safetyTimer),null),Promise.resolve().then(()=>{this.processing=!1,window.beamng?.uiFrameCallback?.(),this.finishCallback?.()}))}forceComplete(){this.complete()}},dependencies,bridge$3;const useBridge=()=>{if(bridge$3)return bridge$3;if(window.bridge)return bridge$3=window.bridge;let events$3=new dependencies.Emitter,coordinator=new lite_default(events$3);Hooks_default.setStreamCoordinator(coordinator);let api$1=dependencies.overrideAPI||new BeamNGAPI_default(events$3,dependencies.beamng);return bridge$3={api:api$1,lua:Lua_default,events:events$3,streams:new StreamManager_default(api$1),coordinator,hooks:Hooks_default,units:new UIUnits_default(events$3,api$1),gameBlurrer:GameBlurrer_default,beamNG:dependencies.beamng},bridge$3},setBridgeDependencies=deps$1=>dependencies=deps$1;var DEBUG=1,INFO=2,WARN=4,ERROR=8,consoleLogMethods={[DEBUG]:`log`,[INFO]:`info`,[WARN]:`warn`,[ERROR]:`error`},consoleLogProvider={log(level$1,...msgs){level$1 in consoleLogMethods&&console[consoleLogMethods[level$1]](...msgs)}},level=14,providersInUse=[consoleLogProvider],STACK_TRACE=Symbol(`Stack trace`),_stackTrace=()=>`
`+Error().stack,_log=(lvl,...msgs)=>{level&lvl&&(msgs=msgs.map(msg=>msg===STACK_TRACE?_stackTrace():msg),providersInUse.forEach(p$1=>p$1.log&&p$1.log(lvl,...msgs)))},_assert=async(lvl,cond,...msgs)=>{level&lvl&&(cond?cond instanceof Promise?cond.then(res=>!res&&_log(lvl,...msgs)):typeof cond==`function`&&!await cond()&&_log(lvl,...msgs):_log(lvl,...msgs))},logger={DEBUG,INFO,WARN,ERROR,setProviders:(...providers)=>providersInUse=providers,set level(val){return level=val},get level(){return level},STACK_TRACE,log:(...msgs)=>_log(DEBUG,...msgs),debug:(...msgs)=>_log(DEBUG,...msgs),info:(...msgs)=>_log(INFO,...msgs),warn:(...msgs)=>_log(WARN,...msgs),error:(...msgs)=>_log(ERROR,...msgs),assert:(cond,...msgs)=>_assert(DEBUG,cond,...msgs),assertDebug:(cond,...msgs)=>_assert(DEBUG,cond,...msgs),assertInfo:(cond,...msgs)=>_assert(INFO,cond,...msgs),assertWarn:(cond,...msgs)=>_assert(WARN,cond,...msgs),assertError:(cond,...msgs)=>_assert(ERROR,cond,...msgs)};window.BNG_Logger=logger;var logger_default=logger;function warn(msg,err){typeof console<`u`&&(console.warn(`[intlify] `+msg),err&&console.warn(err.stack))}var inBrowser=typeof window<`u`,makeSymbol=(name,shareable=!1)=>shareable?Symbol.for(name):Symbol(name),generateFormatCacheKey=(locale,key,source)=>friendlyJSONstringify({l:locale,k:key,s:source}),friendlyJSONstringify=json=>JSON.stringify(json).replace(/\u2028/g,`\\u2028`).replace(/\u2029/g,`\\u2029`).replace(/\u0027/g,`\\u0027`),isNumber=val=>typeof val==`number`&&isFinite(val),isRegExp=val=>toTypeString(val)===`[object RegExp]`,isEmptyObject=val=>isPlainObject(val)&&Object.keys(val).length===0,assign$1=Object.assign,_create=Object.create,create=(obj=null)=>_create(obj),_globalThis,getGlobalThis=()=>_globalThis||=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:create();function escapeHtml(rawText){return rawText.replace(/&/g,`&`).replace(//g,`>`).replace(/"/g,`"`).replace(/'/g,`'`).replace(/\//g,`/`).replace(/=/g,`=`)}function escapeAttributeValue(value){return value.replace(/&(?![a-zA-Z0-9#]{2,6};)/g,`&`).replace(/"/g,`"`).replace(/'/g,`'`).replace(//g,`>`)}function sanitizeTranslatedHtml(html){return html=html.replace(/(\w+)\s*=\s*"([^"]*)"/g,(_,attrName,attrValue)=>`${attrName}="${escapeAttributeValue(attrValue)}"`),html=html.replace(/(\w+)\s*=\s*'([^']*)'/g,(_,attrName,attrValue)=>`${attrName}='${escapeAttributeValue(attrValue)}'`),/\s*on\w+\s*=\s*["']?[^"'>]+["']?/gi.test(html)&&(html=html.replace(/(\s+)(on)(\w+\s*=)/gi,`$1on$3`)),[/(\s+(?:href|src|action|formaction)\s*=\s*["']?)\s*javascript:/gi,/(style\s*=\s*["'][^"']*url\s*\(\s*)javascript:/gi].forEach(pattern=>{html=html.replace(pattern,`$1javascript:`)}),html}var hasOwnProperty=Object.prototype.hasOwnProperty;function hasOwn(obj,key){return hasOwnProperty.call(obj,key)}var isArray$1=Array.isArray,isFunction=val=>typeof val==`function`,isString=val=>typeof val==`string`,isBoolean=val=>typeof val==`boolean`,isObject=val=>typeof val==`object`&&!!val,isPromise=val=>isObject(val)&&isFunction(val.then)&&isFunction(val.catch),objectToString=Object.prototype.toString,toTypeString=value=>objectToString.call(value),isPlainObject=val=>toTypeString(val)===`[object Object]`,toDisplayString$1=val=>val==null?``:isArray$1(val)||isPlainObject(val)&&val.toString===objectToString?JSON.stringify(val,null,2):String(val);function join(items$2,separator=``){return items$2.reduce((str,item,index)=>index===0?str+item:str+separator+item,``)}var isNotObjectOrIsArray=val=>!isObject(val)||isArray$1(val);function deepCopy(src,des){if(isNotObjectOrIsArray(src)||isNotObjectOrIsArray(des))throw Error(`Invalid value`);let stack$2=[{src,des}];for(;stack$2.length;){let{src:src$1,des:des$1}=stack$2.pop();Object.keys(src$1).forEach(key=>{key!==`__proto__`&&(isObject(src$1[key])&&!isObject(des$1[key])&&(des$1[key]=Array.isArray(src$1[key])?[]:create()),isNotObjectOrIsArray(des$1[key])||isNotObjectOrIsArray(src$1[key])?des$1[key]=src$1[key]:stack$2.push({src:src$1[key],des:des$1[key]}))})}}function createPosition(line,column,offset$2){return{line,column,offset:offset$2}}function createLocation(start,end,source){let loc={start,end};return source!=null&&(loc.source=source),loc}var CompileErrorCodes={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14,UNHANDLED_CODEGEN_NODE_TYPE:15,UNHANDLED_MINIFIER_NODE_TYPE:16},COMPILE_ERROR_CODES_EXTEND_POINT=17,errorMessages={[CompileErrorCodes.EXPECTED_TOKEN]:`Expected token: '{0}'`,[CompileErrorCodes.INVALID_TOKEN_IN_PLACEHOLDER]:`Invalid token in placeholder: '{0}'`,[CompileErrorCodes.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER]:`Unterminated single quote in placeholder`,[CompileErrorCodes.UNKNOWN_ESCAPE_SEQUENCE]:`Unknown escape sequence: \\{0}`,[CompileErrorCodes.INVALID_UNICODE_ESCAPE_SEQUENCE]:`Invalid unicode escape sequence: {0}`,[CompileErrorCodes.UNBALANCED_CLOSING_BRACE]:`Unbalanced closing brace`,[CompileErrorCodes.UNTERMINATED_CLOSING_BRACE]:`Unterminated closing brace`,[CompileErrorCodes.EMPTY_PLACEHOLDER]:`Empty placeholder`,[CompileErrorCodes.NOT_ALLOW_NEST_PLACEHOLDER]:`Not allowed nest placeholder`,[CompileErrorCodes.INVALID_LINKED_FORMAT]:`Invalid linked format`,[CompileErrorCodes.MUST_HAVE_MESSAGES_IN_PLURAL]:`Plural must have messages`,[CompileErrorCodes.UNEXPECTED_EMPTY_LINKED_MODIFIER]:`Unexpected empty linked modifier`,[CompileErrorCodes.UNEXPECTED_EMPTY_LINKED_KEY]:`Unexpected empty linked key`,[CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS]:`Unexpected lexical analysis in token: '{0}'`,[CompileErrorCodes.UNHANDLED_CODEGEN_NODE_TYPE]:`unhandled codegen node type: '{0}'`,[CompileErrorCodes.UNHANDLED_MINIFIER_NODE_TYPE]:`unhandled mimifier node type: '{0}'`};function createCompileError(code,loc,options={}){let{domain,messages,args}=options,msg=code,error=SyntaxError(String(msg));return error.code=code,loc&&(error.location=loc),error.domain=domain,error}function defaultOnError(error){throw error}var CHAR_SP=` `,CHAR_CR=`\r`,CHAR_LF=`
Parent:`,parent$1,`
Child:`,prioNode),warnPrioNesting=!0)}let active=document.activeElement;(!active||!prioNode.contains(active))&&(rectNode=prioNode)}let rect=rectNode.getBoundingClientRect();if(rect.right<0||rect.bottom<0||rect.left>screen.width||rect.top>screen.height){node.classList.remove(MENU_NAVIGATION_CLASS);continue}node.classList.add(MENU_NAVIGATION_CLASS),node.tabIndex=0;let lnk={dom:node,rect};links.up&&links.up.push(lnk),links.down&&links.down.push(lnk),links.left&&links.left.push(lnk),links.right&&links.right.push(lnk)}return links.up&&links.up.sort((a$1,b)=>a$1.rect.top-b.rect.top),links.down&&links.down.sort((a$1,b)=>a$1.rect.bottom-b.rect.bottom),links.left&&links.left.sort((a$1,b)=>a$1.rect.left-b.rect.left),links.right&&links.right.sort((a$1,b)=>a$1.rect.right-b.rect.right),links}function isAvailable(node){if(!isVisibleFast(node))return!1;let style=document.defaultView.getComputedStyle(node,null);return style[`pointer-events`]===`none`||!isVisible(node,style)?!1:!isOccluded(node)}function isOccluded(node,dontIgnoreOffscreen=!1){let rects=node.getClientRects();for(let rect of rects)if(!isOccluded$1(node,rect,dontIgnoreOffscreen))return!1;return!0}function getDistanceFast(curr,goal,direction$1,usePerpendicular=!1){let dx=Math.min(goal.right,curr.right)-Math.max(goal.left,curr.left),dy=Math.min(goal.bottom,curr.bottom)-Math.max(goal.top,curr.top);dx===goal.right-goal.left&&(dx=curr.right-goal.left),dy===goal.bottom-goal.top&&(dy=curr.bottom-goal.top);let res=1/0;if(direction$1===DIR.DOWN&&goal.bottom>curr.bottom?res=Math.max(0,goal.bottom-curr.top)-dx:direction$1===DIR.UP&&goal.topcurr.right?res=Math.max(0,goal.left-curr.right)-dy:direction$1===DIR.LEFT&&goal.left{let firstLink=null,firstElementDistance=2**53-1;for(let link of links){let distance=link.rect.top*link.rect.top+link.rect.left*link.rect.left;distance>firstElementDistance||(firstElementDistance=distance,firstLink=link)}if(!firstLink){console.log(`Couldn't locate any button anywhere. Menu navigation won't work`);return}focusOnElement(firstLink.dom),scrollFix(firstLink,direction$1)}),!0;if(active.nodeName===`MD-SLIDER`&&(direction$1===DIR.LEFT||direction$1===DIR.RIGHT)||active.nodeName===`MD-OPTION`&&(direction$1===DIR.UP||direction$1===DIR.DOWN)||active.nodeName===`INPUT`&&active.type===`range`&&(direction$1===DIR.LEFT||direction$1===DIR.RIGHT))return fireKey(active,direction$1),!0;let{nearestLink,fixScroll}=findNext(links,direction$1,active);if(nearestLink)return focusOnElement(nearestLink.dom),fixScroll?.(),nearestLink.dom;if(links.length===0){let mdBackdrops=[...document.querySelectorAll(`md-backdrop, .md-scroll-mask`)];if(mdBackdrops.length>0){for(let el of mdBackdrops)try{el.parentNode.removeChild(el)}catch{}return navigateNext(links,direction$1,activeOverride)}}return!1}function findNext(links,direction$1,activeOverride=null){let active=activeOverride||document.activeElement,activeRect=active.getBoundingClientRect(),fixScroll=!0;if(isScrolling(direction$1)&&isOccluded(active,activeRect,!0)){let axis,boundsame,boundchange;switch(direction$1){case DIR.UP:case DIR.DOWN:axis=`vertical`,boundsame=[`left`,`right`],boundchange=[`top`,`bottom`];break;case DIR.LEFT:case DIR.RIGHT:axis=`horizontal`,boundsame=[`top`,`bottom`],boundchange=[`left`,`right`];break}if(navScrolling[axis].area){let bounds=navScrolling[axis].area.bounds,axisBound=activeRect[boundchange[1]]scrollFix(nearestLink,direction$1):null}}var navScrolling={running:!1,listening:{vertical:!1,horizontal:!1},dom:null,rect:null,vertical:{active:!1,amount:0,area:null},horizontal:{active:!1,amount:0,area:null},hint:{show:!1}};function drawScrollHint(){let show=isScrolling();if(navScrolling.hint.show===show)return;navScrolling.hint.show=show;let elem=document.getElementById(`xf_scroll`);elem&&(elem.style.display=show?``:`none`)}function navigateScroll(axis,amount){if(axis===AXIS_V&&(amount=-amount),navScrolling[axis].amount=amount*15,Math.abs(navScrolling[axis].amount)<1){navScrolling[axis].active=!1;return}navScrolling[axis].active=!0;let dom=document.activeElement;navScrolling.dom!==dom&&(navScrolling.dom=dom,navScrolling.rect=dom.getBoundingClientRect(),navScrolling[axis===AXIS_H?AXIS_V:AXIS_H].active=!1);let area=findScrollable(navScrolling,axis,!0);if(navScrolling[axis].area=area,!area){navScrolling[axis].active=!1;return}return navScrolling.running||window.requestAnimationFrame(function scrl(){let set={};for(let axis$1 of[AXIS_V,AXIS_H]){let cur=navScrolling[axis$1];if(!cur.active||!cur.area)continue;let pos=cur.area.parent[cur.area.readby]+navScrolling[axis$1].amount;pos>cur.area.fullsize?cur.active=!1:set[cur.area.moveby]=pos}navScrolling.running=Object.keys(set).length>0,navScrolling.running&&(area.parent.scrollTo({...set,behavior:`instant`}),document.dispatchEvent(new CustomEvent(`mdtooltiphide`)),window.requestAnimationFrame(scrl))}),!0}function scrollCatch(axis,enable){if(navScrolling.listening[axis]===enable)return;let cur=isScrolling();navScrolling.listening[axis]=enable,cur!==isScrolling()&&(bngApi.engineLua(`local o = scenetree.findObject("MenuScrollActionMap"); if o then o:${enable?`push`:`pop`}() end`),window.bngVue.uiNavTracker&&(enable?window.bngVue.uiNavTracker.addEvent(UI_SCROLL_ACTION_EVENTS[axis],TRACKER_ID):window.bngVue.uiNavTracker.removeEvent(UI_SCROLL_ACTION_EVENTS[axis],TRACKER_ID)))}function isScrolling(direction$1=void 0){let scrolling=!1;return direction$1?direction$1===DIR.UP||direction$1===DIR.DOWN?scrolling=navScrolling.listening.vertical:(direction$1===DIR.LEFT||direction$1===DIR.RIGHT)&&(scrolling=navScrolling.listening.horizontal):scrolling=navScrolling.listening.horizontal||navScrolling.listening.vertical,scrolling}function isScrollListening(axis=void 0){let listening=!1;return listening=axis?navScrolling.listening[axis]:navScrolling.listening.horizontal||navScrolling.listening.vertical,listening}function findScrollable(link,axis,thumbstick){axis!==AXIS_V&&axis!==AXIS_H&&(axis=AXIS_V);let opts=axis===AXIS_H?{moveby:`left`,readby:`scrollLeft`,size:`width`,scroll:`scrollWidth`,client:`clientWidth`,overflow:`overflow-x`}:{moveby:`top`,readby:`scrollTop`,size:`height`,scroll:`scrollHeight`,client:`clientHeight`,overflow:`overflow-y`},forced=!1,parent,fullsize,size$3,node=link.dom?.parentNode;function setParent(node$1){if(!node$1)return;if(thumbstick){let noNav=node$1.attributes.getNamedItem(SCROLL_ATTR);if(noNav&&noNav.value===`false`)return}let styles$1=document.defaultView.getComputedStyle(node$1,null);(styles$1[opts.overflow]===`auto`||styles$1[opts.overflow]===`scroll`)&&(fullsize=node$1[opts.scroll],size$3=node$1[opts.client],fullsize>size$3&&(parent=node$1))}for(;node&&node.isConnected&&node.nodeType===Node.ELEMENT_NODE&&!((!thumbstick||node.attributes.getNamedItem(`bng-nav-scroll`))&&(setParent(node),parent));)node=node.parentNode;if(!parent){let elems$2=document.querySelectorAll(`[${SCROLL_FORCE_ATTR}]`);for(let elem of elems$2)if(setParent(elem),parent){forced=!0;break}}if(scrollCatch(axis,!!parent),drawScrollHint(),!parent)return null;let start=0,styles=document.defaultView.getComputedStyle(parent,null);[`relative`,`absolute`,`static`,`fixed`].includes(styles.position)&&(start+=parent.getBoundingClientRect()[opts.moveby]);let pad=link.rect?Math.max(size$3/4,link.rect[opts.size]):size$3/4,bounds=[start+pad,start+size$3-pad];return{parent,moveby:opts.moveby,readby:opts.readby,bounds,fullsize,start:0,finish:fullsize-size$3,forced}}function scrollFix(link,direction$1){let area=findScrollable(link,direction$1===DIR.UP||direction$1===DIR.DOWN?AXIS_V:AXIS_H);if(!area){document.querySelector(`[bng-nav-scroll], [bng-nav-scroll-force]`)&&findScrollable(link,direction$1===DIR.LEFT||direction$1===DIR.RIGHT?AXIS_V:AXIS_H);return}if(area.forced)return;let mov=-1;direction$1===DIR.UP||direction$1===DIR.DOWN?link.rect.toparea.bounds[1]&&(mov=Math.min(area.parent.scrollTop-area.bounds[1]+link.rect.bottom,area.finish)):link.rect.leftarea.bounds[1]&&(mov=Math.min(area.parent.scrollLeft-area.bounds[1]+link.rect.right,area.finish)),mov>-1&&area.parent.scrollTo({[area.moveby]:mov,behavior:`instant`})}function fireKey(element,direction$1){let key=DIR_KEYS[direction$1];key&&dispatchKey(key,element)}function handleUINavEvent(e,restrictTo=void 0){let d=e.detail,handled=!1;if(d.name in UI_SCALAR_EVENT_ACTIONS){let axis=UI_SCALAR_EVENT_ACTIONS[d.name],value=d.value;if(value!==0&&THUMBSTICK_DEADZONE>0&&Math.abs(value)>THUMBSTICK_DEADZONE){let adjustedValue=(axis===AXIS_V?-value:value)>0?1:-1,direction$1=axis===AXIS_H?adjustedValue>0?DIR.RIGHT:DIR.LEFT:adjustedValue>0?DIR.DOWN:DIR.UP;lastScalarValue[axis]!==adjustedValue&&(lastScalarValue[axis]=adjustedValue,navigate(collectRects(direction$1,restrictTo),direction$1))}else lastScalarValue[axis]=0;handled=!0}if(d.name in UI_NAV_EVENT_ACTIONS){let action=UI_NAV_EVENT_ACTIONS[d.name];switch(action){case`up`:case`down`:case`left`:case`right`:d.value==1&&(navigate(collectRects(action,restrictTo),action),handled=!0);break;case`confirm`:if(d.value==1){let activeEl=document.activeElement;isNavigable$1(activeEl)&&(typeof activeEl.click==`function`?activeEl.click():activeEl.dispatchEvent(new CustomEvent(`click`))),handled=!0}break}}else if(d.name in UI_SCROLL_EVENT_ACTIONS){let axis=UI_SCROLL_EVENT_ACTIONS[d.name];navigateScroll(axis,d.value),handled=isScrollListening(axis)}handled&&e.preventDefault()}var SCOPED_NAV_ATTR$1=`bng-scoped-nav`,UI_NAV_ACTION_GROUP$1=`UINavActions`,GAME_UI_NAVIGATION_EVENT$1=`UINavigation`,GAME_UI_NAV_MAP_ENABLED_EVENT$1=`MenuActionMapEnabled`,DOM_UI_NAVIGATION_EVENT$1=`ui_nav`,UI_SCOPE_ATTR$3=`bng-ui-scope`,UI_EVENT_ATTR$1=`ui-nav-event`,ACTIONS_BY_UI_EVENT$1={focus_u:`menu_item_up`,focus_r:`menu_item_right`,focus_d:`menu_item_down`,focus_l:`menu_item_left`,menu:`toggleMenues`,back:`menu_item_back`,details:`cui_details`,advanced:`cui_advanced`,camera:`cui_camera`,logs:`cui_logs`,tab_l:`menu_tab_left`,tab_r:`menu_tab_right`,modifier:`cui_modifier`,action_4:`cui_action_4`,focus_ud:`menu_item_focus_ud`,focus_lr:`menu_item_focus_lr`,rotate_h_cam:`menu_item_radial_right_x`,rotate_v_cam:`menu_item_radial_right_y`,ok:`menu_item_select`,cancel:`cui_cancel`,action_2:`cui_action_2`,action_3:`cui_action_3`,gameplay_interact:`cui_gameplay_interact`,context:`cui_context`},UI_EVENTS_BY_ACTION$1=Object.assign({},...Object.entries(ACTIONS_BY_UI_EVENT$1).map(([k,v])=>({[v]:k}))),UI_EVENTS$1={focus_u:`focus_u`,focus_r:`focus_r`,focus_d:`focus_d`,focus_l:`focus_l`,pause:`pause`,menu:`menu`,back:`back`,details:`details`,advanced:`advanced`,camera:`camera`,logs:`logs`,tab_l:`tab_l`,tab_r:`tab_r`,modifier:`modifier`,zoom_out:`zoom_out`,zoom_in:`zoom_in`,subtab_l:`subtab_l`,subtab_r:`subtab_r`,center_cam:`center_cam`,action_4:`action_4`,move_ud:`move_ud`,move_lr:`move_lr`,focus_ud:`focus_ud`,focus_lr:`focus_lr`,rotate_h_cam:`rotate_h_cam`,rotate_v_cam:`rotate_v_cam`,ok:`ok`,cancel:`cancel`,action_2:`action_2`,action_3:`action_3`,gameplay_interact:`gameplay_interact`,context:`context`},UI_EVENT_GROUPS$1={focusMove:[UI_EVENTS$1.focus_u,UI_EVENTS$1.focus_d,UI_EVENTS$1.focus_l,UI_EVENTS$1.focus_r],focusMoveScalar:[UI_EVENTS$1.focus_ud,UI_EVENTS$1.focus_lr],moveScalar:[UI_EVENTS$1.move_ud,UI_EVENTS$1.move_lr],navigation:[UI_EVENTS$1.focus_u,UI_EVENTS$1.focus_d,UI_EVENTS$1.focus_l,UI_EVENTS$1.focus_r,UI_EVENTS$1.focus_ud,UI_EVENTS$1.focus_lr,UI_EVENTS$1.move_ud,UI_EVENTS$1.move_lr],allEvents:Object.keys(ACTIONS_BY_UI_EVENT$1)},setFilteredEvents=(...events$3)=>{clearFilteredEvents();let actionsToFilter=[...new Set(events$3.flat(1/0))].map(event=>ACTIONS_BY_UI_EVENT$1[event]);Lua_default.extensions.core_input_actionFilter.setGroup(UI_NAV_ACTION_GROUP$1,actionsToFilter),Lua_default.extensions.core_input_actionFilter.addAction(0,UI_NAV_ACTION_GROUP$1,!0)};setFilteredEvents.allExcept=(...events$3)=>{let eventsToNotFilter=[...new Set(events$3.flat(1/0))];setFilteredEvents(UI_EVENT_GROUPS$1.allEvents.filter(ev=>!eventsToNotFilter.includes(ev)))};var clearFilteredEvents=()=>{Lua_default.extensions.core_input_actionFilter.addAction(0,UI_NAV_ACTION_GROUP$1,!1),Lua_default.extensions.core_input_actionFilter.setGroup(UI_NAV_ACTION_GROUP$1,[])};const clamp=(val,min$1,max$1)=>Math.min(Math.max(val,min$1),max$1),round=(val,step=1)=>{if(val===void 0)throw Error(`The function at least needs a value`);return Math.round(val/step+2**-52)*step},roundDec=(val,dec=0)=>{if(val===void 0)throw Error(`The function at least needs a value`);if(dec>15)throw Error(`Floating point won't be precise after 15th decimal`);if(val===0)return 0;if(!Number.isInteger(dec))throw Error(`Decimal point must be an integer`);let pow=10**dec;return Math.round(val*pow+2**-52)/pow},roundDecSample=(val,sample=0)=>{let dec=getDecimalPlaces(sample);return dec===0?round(val):roundDec(val,dec)},getDecimalPlaces=num=>{if(Number.isInteger(num)||!Number.isFinite(num))return 0;let dec=0;for(;!Number.isInteger(num)&&Number.isFinite(num)&&(num*=10,dec++,!(dec>15)););return dec};var UIUnits_default=class{uiUnits={uiUnitLength:`metric`,uiUnitTemperature:`f`,uiUnitWeight:`lb`,uiUnitConsumptionRate:`imperial`,uiUnitTorque:`imperial`,uiUnitEnergy:`imperial`,uiUnitDate:`us`,uiUnitPower:`bhp`,uiUnitVolume:`gal`,uiUnitPressure:`psi`};mapping={length:`uiUnitLength`,speed:`uiUnitLength`,temperature:`uiUnitTemperature`,weight:`uiUnitWeight`,consumptionRate:`uiUnitConsumptionRate`,torque:`uiUnitTorque`,energy:`uiUnitEnergy`,date:`uiUnitDate`,power:`uiUnitPower`,volume:`uiUnitVolume`,pressure:`uiUnitPressure`,lengthMinor:`uiUnitLength`};userSettings={uiLanguage:`en-US`};eventBus={};api={};constructor(eventBus$1,api$1){this.eventBus=eventBus$1,this.api=api$1,this.beamBucks=this.beamBucks.bind(this),this.eventBus.on(`SettingsChanged`,data=>this.onSettingsChanged(data)),api$1.engineLua(`settings.notifyUI()`)}onSettingsChanged(data){for(let name in this.uiUnits)data.values[name]!==void 0&&(this.uiUnits[name]=data.values[name]);for(let name in this.userSettings)data.values[name]!==void 0&&(this.userSettings[name]=data.values[name].replace(/_/g,`-`))}buildString(func,val,numDecs,system){if([`division`,`buildString`,`date`].includes(func)||typeof this[func]!=`function`)throw Error(`Cannot use this function to build a string`);this.mapping[func]!==void 0&&system===void 0&&(system=this.uiUnits[this.mapping[func]]);let helper=this[func](val,system);return helper===null?``:typeof helper.val==`string`?helper.val:typeof helper.val==`number`?(helper.val<0&&helper.val>-(10**-numDecs)&&(helper.val=0),Intl.NumberFormat(this.userSettings.uiLanguage,{style:`decimal`,minimumFractionDigits:numDecs,maximumFractionDigits:numDecs}).format(helper.val)+` `+helper.unit):``}division(func1,func2,val1,val2,numDecs,system1,system2){let unsupported=[`division`,`weightPower`,`buildString`,`date`];if(unsupported.includes(func1)||typeof this[func1]!=`function`||unsupported.includes(func2)||typeof this[func2]!=`function`)throw Error(`Cannot use these functions`);let helper1=this[func1](val1,system1),helper2=this[func2](val2,system2);if(helper1!==null&&helper2!==null){let newVal=helper1.val/helper2.val;return{val:numDecs===void 0?newVal:roundDec(newVal,numDecs),unit:`${helper1.unit}/${helper2.unit}`}}else return console.error(`got null`,arguments),null}weightPower(x){let helper=this.division(`weight`,`power`,1,1);return helper===null?null:{val:helper.val*x,unit:helper.unit}}length(meters,system=this.uiUnits.uiUnitLength){if(system===`metric`)return meters<.01?{val:meters*1e3,unit:`mm`}:meters<1?{val:meters*100,unit:`cm`}:meters<1e3?{val:meters,unit:`m`}:{val:meters*.001,unit:`km`};if(system===`imperial`){let yd=meters*1.0936;return yd<1?{val:yd*36,unit:`in`}:yd<3?{val:yd*3,unit:`ft`}:{val:yd*568182e-9,unit:`mi`}}return null}distance=this.length;lengthMinor(meters,system=this.uiUnits.uiUnitLength){return system===`metric`?{val:meters*1,unit:`m`}:system===`imperial`?{val:meters*1.0936*3,unit:`ft`}:null}area(squareMeters,system=this.uiUnits.uiUnitLength){if(system===`metric`)return squareMeters<1e3?{val:squareMeters,unit:`sq m`}:{val:squareMeters*.001*.001,unit:`sq km`};if(system===`imperial`){let sqrYards=squareMeters*1.0936*1.0936;return sqrYards<1760?{val:sqrYards,unit:`sq yd`}:{val:sqrYards*568182e-9*568182e-9,unit:`sq mi`}}return null}temperature(x,system=this.uiUnits.uiUnitTemperature){switch(system){case`c`:return{val:x,unit:`°C`};case`f`:return{val:x*1.8+32,unit:`°F`};case`k`:return{val:x+273.15,unit:`K`};default:return null}}volume(x,system=this.uiUnits.uiUnitVolume){switch(system){case`l`:return{val:x,unit:`L`};case`gal`:return{val:x*.2642,unit:`gal`};default:return null}}pressure(x,system=this.uiUnits.uiUnitPressure){switch(system){case`inHg`:return{val:x*.2953,unit:`in.Hg`};case`bar`:return{val:x*.01,unit:`Bar`};case`psi`:return{val:x*.145038,unit:`PSI`};case`kPa`:return{val:x,unit:`kPa`};default:return null}}weight(x,system=this.uiUnits.uiUnitWeight){switch(system){case`kg`:return{val:x,unit:`kg`};case`lb`:return{val:2.20462262*x,unit:`lbs`};default:return null}}consumptionRate(x,system=this.uiUnits.uiUnitConsumptionRate){switch(system){case`metric`:return{val:1e5*x>5e4?`n/a`:1e5*x,unit:`L/100km`};case`imperial`:return{val:x===0?0:235*1e-5/x,unit:`MPG`};default:return null}}speed(x,system=this.uiUnits.uiUnitLength){switch(system){case`metric`:return{val:3.6*x,unit:`km/h`};case`imperial`:return{val:2.23693629*x,unit:`mph`};default:return null}}power(x,system=this.uiUnits.uiUnitPower){switch(system){case`kw`:return{val:.735499*x,unit:`kW`};case`hp`:return{val:x,unit:`PS`};case`bhp`:return{val:.98632*x,unit:`bhp`};default:return null}}torque(x,system=this.uiUnits.uiUnitTorque){switch(system===`metric`?system=`kg`:system===`imperial`&&(system=`lb`),system){case`kg`:return{val:x,unit:`Nm`};case`lb`:return{val:.7375621495*x,unit:`lb-ft`};default:return null}}energy(x,system=this.uiUnits.uiUnitEnergy){switch(system===`metric`?system=`j`:system===`imperial`&&(system=`ft lb`),system){case`j`:return{val:x,unit:`J`};case`ft lb`:return{val:.7375621495*x,unit:`ft lb`};default:return null}}date(x,system=this.uiUnits.uiUnitDate){switch(system){case`ger`:return x.toLocaleDateString(`de-DE`);case`uk`:return x.toLocaleDateString(`en-GB`);case`us`:return x.toLocaleDateString(`en-US`);default:return null}}beamBucks(x){return Intl.NumberFormat(this.userSettings.uiLanguage,{style:`decimal`,maximumFractionDigits:2,minimumFractionDigits:2}).format(+x)}},lite_default=class{constructor(){this.processing=!1,this.pending=0,this.finishCallback=null,this.angularRootScope=window.globalAngularRootScope,this.angularTimeout=null,this.angularTimeoutRetry=null,this.angularTimeoutWarned=!1,this.safetyTimeout=2e3,this.safetyTimer=null,this.warned=!1}setAngularRootScope(rootScope){this.angularRootScope=rootScope,this.angularTimeout=null,this.angularTimeoutRetry&&=(clearTimeout(this.angularTimeoutRetry),null)}getAngularTimeout(){if(this.angularTimeout!==null)return typeof this.angularTimeout==`function`?this.angularTimeout:null;let code;this.angularTimeoutRetry&&(code=`retry`,clearTimeout(this.angularTimeoutRetry));try{if(window.angular!==void 0&&window.angular.element){let injector=window.angular.element(document).injector();if(injector)return this.angularTimeout=injector.get(`$timeout`),this.angularTimeoutWarned&&console.log(`Stream Coordinator: Angular $timeout service resolved after retry`),this.angularTimeout;code=`no-injector`}else code=`no-angular`}catch{code=`error`}return this.angularTimeout=!1,this.angularTimeoutRetry||=setTimeout(()=>{this.angularTimeout||=null},5e3),console.warn(`Stream Coordinator: Angular $timeout service not available (${code})`),this.angularTimeoutWarned=!0,null}beforeBroadcast(){this.processing||(this.processing=!0,this.finishCallback=null,this.pending=0,this.safetyTimer&&clearTimeout(this.safetyTimer),this.safetyTimer=setTimeout(()=>{this.processing&&this.forceComplete()},this.safetyTimeout))}afterBroadcast(callback){if(callback&&typeof callback==`function`?this.finishCallback=()=>{this.finishCallback=void 0,Promise.resolve().then(callback)}:this.finishCallback=void 0,!this.processing){this.finishCallback?.();return}this.startDeferredWork()}startDeferredWork(){this.pending=0;let angularTimeout=this.getAngularTimeout();angularTimeout&&(this.angularRootScope||=window.globalAngularRootScope,this.angularRootScope&&(this.pending++,angularTimeout(()=>this.onOperationComplete(),0))),window.Vue?.nextTick&&(this.pending++,window.Vue.nextTick(()=>this.onOperationComplete())),this.pending===0&&(this.warned||(this.warned=!0,console.warn(`Stream Coordinator: No Angular $timeout() nor Vue.nextTick() detected, using only Promise microtask instead`)),this.complete())}onOperationComplete(){this.processing&&(this.pending--,this.pending<=0&&this.complete())}complete(){this.processing&&(this.safetyTimer&&=(clearTimeout(this.safetyTimer),null),Promise.resolve().then(()=>{this.processing=!1,window.beamng?.uiFrameCallback?.(),this.finishCallback?.()}))}forceComplete(){this.complete()}},dependencies,bridge$3;const useBridge=()=>{if(bridge$3)return bridge$3;if(window.bridge)return bridge$3=window.bridge;let events$3=new dependencies.Emitter,coordinator=new lite_default(events$3);Hooks_default.setStreamCoordinator(coordinator);let api$1=dependencies.overrideAPI||new BeamNGAPI_default(events$3,dependencies.beamng);return bridge$3={api:api$1,lua:Lua_default,events:events$3,streams:new StreamManager_default(api$1),coordinator,hooks:Hooks_default,units:new UIUnits_default(events$3,api$1),gameBlurrer:GameBlurrer_default,beamNG:dependencies.beamng},bridge$3},setBridgeDependencies=deps$1=>dependencies=deps$1;var DEBUG=1,INFO=2,WARN=4,ERROR=8,consoleLogMethods={[DEBUG]:`log`,[INFO]:`info`,[WARN]:`warn`,[ERROR]:`error`},consoleLogProvider={log(level$1,...msgs){level$1 in consoleLogMethods&&console[consoleLogMethods[level$1]](...msgs)}},level=14,providersInUse=[consoleLogProvider],STACK_TRACE=Symbol(`Stack trace`),_stackTrace=()=>`
`+Error().stack,_log=(lvl,...msgs)=>{level&lvl&&(msgs=msgs.map(msg=>msg===STACK_TRACE?_stackTrace():msg),providersInUse.forEach(p$1=>p$1.log&&p$1.log(lvl,...msgs)))},_assert=async(lvl,cond,...msgs)=>{level&lvl&&(cond?cond instanceof Promise?cond.then(res=>!res&&_log(lvl,...msgs)):typeof cond==`function`&&!await cond()&&_log(lvl,...msgs):_log(lvl,...msgs))},logger={DEBUG,INFO,WARN,ERROR,setProviders:(...providers)=>providersInUse=providers,set level(val){return level=val},get level(){return level},STACK_TRACE,log:(...msgs)=>_log(DEBUG,...msgs),debug:(...msgs)=>_log(DEBUG,...msgs),info:(...msgs)=>_log(INFO,...msgs),warn:(...msgs)=>_log(WARN,...msgs),error:(...msgs)=>_log(ERROR,...msgs),assert:(cond,...msgs)=>_assert(DEBUG,cond,...msgs),assertDebug:(cond,...msgs)=>_assert(DEBUG,cond,...msgs),assertInfo:(cond,...msgs)=>_assert(INFO,cond,...msgs),assertWarn:(cond,...msgs)=>_assert(WARN,cond,...msgs),assertError:(cond,...msgs)=>_assert(ERROR,cond,...msgs)};window.BNG_Logger=logger;var logger_default=logger;function warn(msg,err){typeof console<`u`&&(console.warn(`[intlify] `+msg),err&&console.warn(err.stack))}var inBrowser=typeof window<`u`,makeSymbol=(name,shareable=!1)=>shareable?Symbol.for(name):Symbol(name),generateFormatCacheKey=(locale,key,source)=>friendlyJSONstringify({l:locale,k:key,s:source}),friendlyJSONstringify=json=>JSON.stringify(json).replace(/\u2028/g,`\\u2028`).replace(/\u2029/g,`\\u2029`).replace(/\u0027/g,`\\u0027`),isNumber=val=>typeof val==`number`&&isFinite(val),isRegExp=val=>toTypeString(val)===`[object RegExp]`,isEmptyObject=val=>isPlainObject(val)&&Object.keys(val).length===0,assign$1=Object.assign,_create=Object.create,create=(obj=null)=>_create(obj),_globalThis,getGlobalThis=()=>_globalThis||=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:create();function escapeHtml(rawText){return rawText.replace(/&/g,`&`).replace(//g,`>`).replace(/"/g,`"`).replace(/'/g,`'`).replace(/\//g,`/`).replace(/=/g,`=`)}function escapeAttributeValue(value){return value.replace(/&(?![a-zA-Z0-9#]{2,6};)/g,`&`).replace(/"/g,`"`).replace(/'/g,`'`).replace(//g,`>`)}function sanitizeTranslatedHtml(html){return html=html.replace(/(\w+)\s*=\s*"([^"]*)"/g,(_,attrName,attrValue)=>`${attrName}="${escapeAttributeValue(attrValue)}"`),html=html.replace(/(\w+)\s*=\s*'([^']*)'/g,(_,attrName,attrValue)=>`${attrName}='${escapeAttributeValue(attrValue)}'`),/\s*on\w+\s*=\s*["']?[^"'>]+["']?/gi.test(html)&&(html=html.replace(/(\s+)(on)(\w+\s*=)/gi,`$1on$3`)),[/(\s+(?:href|src|action|formaction)\s*=\s*["']?)\s*javascript:/gi,/(style\s*=\s*["'][^"']*url\s*\(\s*)javascript:/gi].forEach(pattern=>{html=html.replace(pattern,`$1javascript:`)}),html}var hasOwnProperty=Object.prototype.hasOwnProperty;function hasOwn(obj,key){return hasOwnProperty.call(obj,key)}var isArray$1=Array.isArray,isFunction=val=>typeof val==`function`,isString=val=>typeof val==`string`,isBoolean=val=>typeof val==`boolean`,isObject=val=>typeof val==`object`&&!!val,isPromise=val=>isObject(val)&&isFunction(val.then)&&isFunction(val.catch),objectToString=Object.prototype.toString,toTypeString=value=>objectToString.call(value),isPlainObject=val=>toTypeString(val)===`[object Object]`,toDisplayString$1=val=>val==null?``:isArray$1(val)||isPlainObject(val)&&val.toString===objectToString?JSON.stringify(val,null,2):String(val);function join(items$2,separator=``){return items$2.reduce((str,item,index)=>index===0?str+item:str+separator+item,``)}var isNotObjectOrIsArray=val=>!isObject(val)||isArray$1(val);function deepCopy(src,des){if(isNotObjectOrIsArray(src)||isNotObjectOrIsArray(des))throw Error(`Invalid value`);let stack$2=[{src,des}];for(;stack$2.length;){let{src:src$1,des:des$1}=stack$2.pop();Object.keys(src$1).forEach(key=>{key!==`__proto__`&&(isObject(src$1[key])&&!isObject(des$1[key])&&(des$1[key]=Array.isArray(src$1[key])?[]:create()),isNotObjectOrIsArray(des$1[key])||isNotObjectOrIsArray(src$1[key])?des$1[key]=src$1[key]:stack$2.push({src:src$1[key],des:des$1[key]}))})}}function createPosition(line,column,offset$2){return{line,column,offset:offset$2}}function createLocation(start,end,source){let loc={start,end};return source!=null&&(loc.source=source),loc}var CompileErrorCodes={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14,UNHANDLED_CODEGEN_NODE_TYPE:15,UNHANDLED_MINIFIER_NODE_TYPE:16},COMPILE_ERROR_CODES_EXTEND_POINT=17,errorMessages={[CompileErrorCodes.EXPECTED_TOKEN]:`Expected token: '{0}'`,[CompileErrorCodes.INVALID_TOKEN_IN_PLACEHOLDER]:`Invalid token in placeholder: '{0}'`,[CompileErrorCodes.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER]:`Unterminated single quote in placeholder`,[CompileErrorCodes.UNKNOWN_ESCAPE_SEQUENCE]:`Unknown escape sequence: \\{0}`,[CompileErrorCodes.INVALID_UNICODE_ESCAPE_SEQUENCE]:`Invalid unicode escape sequence: {0}`,[CompileErrorCodes.UNBALANCED_CLOSING_BRACE]:`Unbalanced closing brace`,[CompileErrorCodes.UNTERMINATED_CLOSING_BRACE]:`Unterminated closing brace`,[CompileErrorCodes.EMPTY_PLACEHOLDER]:`Empty placeholder`,[CompileErrorCodes.NOT_ALLOW_NEST_PLACEHOLDER]:`Not allowed nest placeholder`,[CompileErrorCodes.INVALID_LINKED_FORMAT]:`Invalid linked format`,[CompileErrorCodes.MUST_HAVE_MESSAGES_IN_PLURAL]:`Plural must have messages`,[CompileErrorCodes.UNEXPECTED_EMPTY_LINKED_MODIFIER]:`Unexpected empty linked modifier`,[CompileErrorCodes.UNEXPECTED_EMPTY_LINKED_KEY]:`Unexpected empty linked key`,[CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS]:`Unexpected lexical analysis in token: '{0}'`,[CompileErrorCodes.UNHANDLED_CODEGEN_NODE_TYPE]:`unhandled codegen node type: '{0}'`,[CompileErrorCodes.UNHANDLED_MINIFIER_NODE_TYPE]:`unhandled mimifier node type: '{0}'`};function createCompileError(code,loc,options={}){let{domain,messages,args}=options,msg=code,error=SyntaxError(String(msg));return error.code=code,loc&&(error.location=loc),error.domain=domain,error}function defaultOnError(error){throw error}var CHAR_SP=` `,CHAR_CR=`\r`,CHAR_LF=`
`,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(/