Definition
-- @/=[C]:-1
function format(...)
Callers
@/lua/vehicle/extensions/ui/simplePowertrainControl.lua
local function setButton(id, uiName, icon, color, ringValue, onClickCallback, remove)
--print(string.format("id: %q, uiName: %q, icon: %q, ringvalue: %q, click: %q, remove: %q", id, uiName, icon, color, ringValue, onClickCallback, remove))
guihooks.trigger("ChangePowerTrainButtons", {id = id, tooltip = uiName, icon = icon, color = color, ringValue = ringValue, onClick = onClickCallback, remove = remove})
@/lua/vehicle/controller/drivingDynamics/actuators/activeDiffBias.lua
if not relevantDifferential then
log("E", "activeDiffBias.initSecondStage", string.format("Can't find configured differential (%q), disabling system...", diffName))
return
local dotLeft = vectorRight:dot(wheelVector) --calculate dot product of said vector and left vector
--print(string.format("Side: %d, Name: %q, Front/Back: %.2f, LeftRight: %.2f", wheelSideIndex, relevantWheels[wheelSideIndex].wheels[1].name, dotForward, dotLeft))
@/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
@/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/assemblySpline/import.lua
if x and y and z and w then
obj:setField("rotation", 0, string.format("%s %s %s %s", x, y, z, w))
else
if invalidCount > 0 then
log("W", logtag, string.format("Skipped %d TSStatic objects that don't have tool-compatible anchor points (nail.*)", invalidCount))
end
rootMeshPath = uniqueMeshPaths[1]
log("W", logtag, string.format("No mesh with 'root' in name found. Using first rigid mesh as root: %s", rootMeshPath))
else
log("I", logtag, string.format("Reconstructed assembly kit with %d unique meshes, root: %s", #assemblyKit, rootMeshPath or "none"))
@/lua/vehicle/powertrain/dctGearbox.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/career/modules/inspectVehicle.lua
core_vehicleBridge.executeAction(newVeh, 'setFreeze', true)
newVeh:queueLuaCommand(string.format("partCondition.initConditions(nil, %d, nil, %f)", vehicleInfo.Mileage, career_modules_vehicleShopping.getVisualValueFromMileage(vehicleInfo.Mileage)))
return newVeh
if career_career.isActive() and testDriveInfo then
local id = string.format("inspectVehicle-%s-%s-parkingEnd",testDriveInfo.dealershipName, testDriveInfo.route)
local poi = {
@/lua/ge/extensions/career/modules/insurance/insurance.lua
})
ui_message(string.format("'%s' insurance has given you a repair forgiveness due to not having submitted any claim for a while", availableInsurances[plInsuranceData.insuranceId].name))
for coverageOptionName, coverageOptionInfo in pairs(insuranceInfo.coverageOptions.roadsideAssistance.choices) do
coverageOptionInfo.choiceText = string.format("%i tows", coverageOptionInfo.value)
end
for coverageOptionName, coverageOptionInfo in pairs(insuranceInfo.coverageOptions.repairTime.choices) do
coverageOptionInfo.choiceText = coverageOptionInfo.value / 60 > 0 and string.format("%i min", coverageOptionInfo.value / 60) or "Instant"
end
for coverageOptionName, coverageOptionInfo in pairs(insuranceInfo.coverageOptions.deductible.choices) do
coverageOptionInfo.choiceText = string.format("%i$", coverageOptionInfo.value)
end
local function makeTestDriveDamageClaim(vehId)
local label = string.format("Test drive vehicle damaged: -%i$", testDriveClaimPrice.money.amount)
ui_message(label)
local renewalPrice = M.calculateInsurancePremium(insuranceId).totalPriceWithDriverScore
local logBookLabel = string.format("Insurance '%s' renewed!", availableInsurances[insuranceId].name)
career_modules_payment.pay({money = { amount = renewalPrice, canBeNegative = true}}, {label=logBookLabel})
career_modules_payment.pay({money = { amount = renewalPrice, canBeNegative = true}}, {label=logBookLabel})
local label = string.format("Insurance '%s' renewed! (-%0.2f$)", availableInsurances[insuranceId].name, renewalPrice)
ui_message(label)
})
ui_message(string.format("Safe driving: Driver score increased by %d to %d", safeDrivingScoreIncrease, plDriverScore))
end
local isSignaturePerk = insuranceInfo.perks.reduceDeductible.isSignaturePerk or false
sanitizedData.baseDeductibledData.perkData = formatPerkIconData(string.format("- %i%%", reduceDeductiblePerk * 100), string.format("Your %s insurance reduces your deductible by %i%%!", insuranceInfo.name, reduceDeductiblePerk * 100), reduceDeductiblePerk, isSignaturePerk)
sanitizedData.baseDeductibledData.oldPrice = insuranceInfo.coverageOptions.deductible.choices[2].oldValue
local isSignaturePerk = insuranceInfo.perks.reduceDeductible.isSignaturePerk or false
sanitizedData.baseDeductibledData.perkData = formatPerkIconData(string.format("- %i%%", reduceDeductiblePerk * 100), string.format("Your %s insurance reduces your deductible by %i%%!", insuranceInfo.name, reduceDeductiblePerk * 100), reduceDeductiblePerk, isSignaturePerk)
sanitizedData.baseDeductibledData.oldPrice = insuranceInfo.coverageOptions.deductible.choices[2].oldValue
end
sanitizedData.groupDiscountData.secondaryText = string.format("Adding this vehicle will advance you to Tier %i with a %i%% discount on your insurance !", sanitizedData.groupDiscountData.futureTierData.id, sanitizedData.groupDiscountData.futureTierData.discount * 100)
end
local niceName = career_modules_inventory.getVehicle(invVehId).niceName
local label = string.format("Insurance of '%s' changed to '%s'", niceName, insuranceName)
if insuranceChangeFees > 0 then
local label = string.format("Insurance coverage changed. Tier : %s", availableInsurances[invVehs[invVehId].insuranceId].name)
career_modules_payment.pay({money = { amount = availableInsurances[invVehs[invVehId].insuranceId].paperworkFees, canBeNegative = false}}, {label=label})
local isSignaturePerk = availableInsurances[insuranceId].perks.fuelDiscount.isSignaturePerk or false
data.perkData = formatPerkIconData(string.format("- %i%%", data.fuelDiscount * 100), string.format("Your %s insurance saves you %i%% on fuel and charging!", data.insuranceName, data.fuelDiscount * 100), nil, isSignaturePerk)
end
local isSignaturePerk = availableInsurances[insuranceId].perks.fuelDiscount.isSignaturePerk or false
data.perkData = formatPerkIconData(string.format("- %i%%", data.fuelDiscount * 100), string.format("Your %s insurance saves you %i%% on fuel and charging!", data.insuranceName, data.fuelDiscount * 100), nil, isSignaturePerk)
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/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/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
@/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/client/postFx.lua
for key, obj in pairs(preset) do
local flag = string.format("$PostFXManager::Settings::%s", key)
if type(obj) ~= "table" then
for field, value in pairs(obj) do
local fullFlag = string.format("%s::%s", flag, field)
TorqueScriptLua.setVar(fullFlag, value)
@/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/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/ge/extensions/gameplay/rally/vehicleTracker.lua
local speedKmh = speed * 3.6
local text = string.format("VehicleTracker | Pos: %.1f,%.1f,%.1f | Speed: %.1f km/h (%.1f m/s)",
pos.x, pos.y, pos.z, speedKmh, speed)
@/lua/ge/extensions/ui/apps.lua
jsonWriteFile(userFilePath, userLayout, true)
log("I","",string.format("User layout was updated. File: %s", userFilePath))
end
@/lua/ge/extensions/gameplay/sites/zone.lua
debugDrawer:drawTextAdvanced(((v.pos + self.vertices[v.next])/2),
String(string.format("t=%0.1f | u=%s",v.t,tostring(v.u))),
ColorF(1,1,1,1),true, false,
--print("from: " .. dumps(cur) .. " to " .. dumps(nex))
--print(string.format("Distance: %0.2f, steps: %d", dist, steps))
for i = 0, steps-1 do
@/lua/ge/extensions/core/recoveryPrompt.lua
if not career_modules_insurance_insurance.isRoadSideAssistanceFree(invVehId) then
career_modules_payment.pay({money = {amount = towToRoadCost, canBeNegative = true}}, {label = string.format("Towed your vehicle to the road")})
else
if not career_modules_insurance_insurance.isRoadSideAssistanceFree(invVehId) then
career_modules_payment.pay({money = {amount = flipUpRightCost, canBeNegative = true}}, {label = string.format("Flipped your vehicle upright")})
else
buttonOptions[string.format("towTo%s", garage.id)] =
{
label = function(options, target)
return string.format("%s", translateLanguage(garage.name, garage.name, true))
end,
if price then
career_modules_payment.pay(price, {label = string.format("Towed your vehicle to your garage")})
end
if not garage.noQuickTravel then
buttonOptions[string.format("taxiTo%s", garage.id)] =
{
label = function(options)
return string.format("%s", translateLanguage(garage.name, garage.name, true))
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/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/drag/debug.lua
for vehId, _ in pairs(dragData.racers or {}) do
if im.Selectable1(string.format("Racer ID: %d Lane: %d", vehId, dragData.racers[vehId].lane), vehId == selectedVehicle) then
selectElement(vehId)
@/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/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
@/inspector/Views/DebuggerSidebarPanel.js
var toolTip = WI.UIString("Enable all breakpoints (%s)").format(WI.toggleBreakpointsKeyboardShortcut.displayName);
var altToolTip = WI.UIString("Disable all breakpoints (%s)").format(WI.toggleBreakpointsKeyboardShortcut.displayName);
var toolTip = WI.UIString("Enable all breakpoints (%s)").format(WI.toggleBreakpointsKeyboardShortcut.displayName);
var altToolTip = WI.UIString("Disable all breakpoints (%s)").format(WI.toggleBreakpointsKeyboardShortcut.displayName);
toolTip = WI.UIString("Pause script execution (%s or %s)").format(WI.pauseOrResumeKeyboardShortcut.displayName, WI.pauseOrResumeAlternateKeyboardShortcut.displayName);
altToolTip = WI.UIString("Continue script execution (%s or %s)").format(WI.pauseOrResumeKeyboardShortcut.displayName, WI.pauseOrResumeAlternateKeyboardShortcut.displayName);
toolTip = WI.UIString("Pause script execution (%s or %s)").format(WI.pauseOrResumeKeyboardShortcut.displayName, WI.pauseOrResumeAlternateKeyboardShortcut.displayName);
altToolTip = WI.UIString("Continue script execution (%s or %s)").format(WI.pauseOrResumeKeyboardShortcut.displayName, WI.pauseOrResumeAlternateKeyboardShortcut.displayName);
this._debuggerStepOverButtonItem = new WI.ButtonNavigationItem("debugger-step-over", WI.UIString("Step over (%s or %s)").format(WI.stepOverKeyboardShortcut.displayName, WI.stepOverAlternateKeyboardShortcut.displayName), stepOverImage.src, stepOverImage.width, stepOverImage.height);
this._debuggerStepOverButtonItem.addEventListener(WI.ButtonNavigationItem.Event.Clicked, WI.debuggerStepOver, this);
this._debuggerStepIntoButtonItem = new WI.ButtonNavigationItem("debugger-step-into", WI.UIString("Step into (%s or %s)").format(WI.stepIntoKeyboardShortcut.displayName, WI.stepIntoAlternateKeyboardShortcut.displayName), stepIntoImage.src, stepIntoImage.width, stepIntoImage.height);
this._debuggerStepIntoButtonItem.addEventListener(WI.ButtonNavigationItem.Event.Clicked, WI.debuggerStepInto, this);
this._debuggerStepOutButtonItem = new WI.ButtonNavigationItem("debugger-step-out", WI.UIString("Step out (%s or %s)").format(WI.stepOutKeyboardShortcut.displayName, WI.stepOutAlternateKeyboardShortcut.displayName), stepOutImage.src, stepOutImage.width, stepOutImage.height);
this._debuggerStepOutButtonItem.addEventListener(WI.ButtonNavigationItem.Event.Clicked, WI.debuggerStepOut, this);
className: WI.DebuggerSidebarPanel.PausedBreakpointIconStyleClassName,
title: WI.UIString("%s Fired").format(pauseData.eventName),
});
if (pauseData && pauseData.message) {
this._pauseReasonTextRow.text = WI.UIString("Assertion with message: %s").format(pauseData.message);
return true;
// COMPATIBILITY (iOS 8): 'directive' was 'directiveText'.
this._pauseReasonTextRow.text = WI.UIString("Content Security Policy violation of directive: %s").format(pauseData.directive || pauseData.directiveText);
this._pauseReasonGroup.rows = [this._pauseReasonTextRow];
className: WI.DebuggerSidebarPanel.PausedBreakpointIconStyleClassName,
title: WI.UIString("\u201C%s\u201D Event Fired").format(pauseData.eventName),
});
var data = WI.RemoteObject.fromPayload(pauseData, target);
this._pauseReasonTextRow.text = WI.UIString("Exception with thrown value: %s").format(data.description);
this._pauseReasonGroup.rows = [this._pauseReasonTextRow];
className: WI.DebuggerSidebarPanel.PausedBreakpointIconStyleClassName,
title: WI.UIString("%s Fired").format(pauseData.eventName),
});
console.assert(pauseData.breakpointURL === "", "Should be the All Requests breakpoint which has an empty URL");
this._pauseReasonTextRow.text = WI.UIString("Requesting: %s").format(pauseData.url);
this._pauseReasonGroup.rows = [this._pauseReasonTextRow];
@/lua/ge/extensions/gameplay/markers/walkingMarker.lua
if iconRendererObj then
local iconId = iconRendererObj:addIcon(string.format("%s-gsIcon-%d",cluster.id, idx), cluster.icon, iconPos)
local iconInfo = iconRendererObj:getIconById(iconId)
@/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/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/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/vehicle/extensions/tech/mesh.lua
local adHocData = { requestId = adHocRequestId, reading = latestReading }
obj:queueGameEngineLua(string.format("tech_sensors.updateMeshAdHocRequest(%q)", lpack.encode(adHocData)))
end
@/lua/ge/extensions/editor/assemblySpline/populate.lua
local id = Engine.generateUUID()
obj:registerObject(string.format('Mesh_%s', id))
folder:addObject(obj.obj)
@/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/vehicle/powertrain/combustionEngineThermals.lua
-- Audio Debug
-- print (string.format(" AF Trig Insta %.3f/%.3f Eng InstVolCoef %.2f Exh VolCoef %.2f EngExh Vol TOTL %.2f Exh Color %.2f", parentEngine.instantAfterFireCoef, parentEngine.instantAfterFireCoef * n.afterFireAudioCoef, afterFire.instantVolumeCoef, n.afterFireVolumeCoef, afterFire.instantVolumeCoef * n.afterFireVolumeCoef, 1 - n.afterFireMufflingCoef))
end
-- Audio Debug
-- print (string.format(" AF Trig Shift %.3f/%.3f Eng InstVolCoef %.2f Exh VolCoef %.2f EngExh Vol TOTL %.2f Exh Color %.2f", parentEngine.shiftAfterFireCoef, parentEngine.shiftAfterFireCoef * n.afterFireAudioCoef, afterFire.shiftVolumeCoef, n.afterFireVolumeCoef, afterFire.shiftVolumeCoef * n.afterFireVolumeCoef, 1 - n.afterFireMufflingCoef))
end
obj:playSFXOnceCT(afterFire.sustainedAudioSample, n.finish, n.afterFireVolumeCoef * afterFire.sustainedVolumeCoef, 1.0, 1 - n.afterFireMufflingCoef, 0)
--print (string.format(" AF Trig Sustd %.3f/%.3f Eng InstVolCoef %.2f Exh VolCoef %.2f EngExh Vol TOTL %.2f Exh Color %.2f", parentEngine.sustainedAfterFireCoef, parentEngine.sustainedAfterFireCoef * n.afterFireAudioCoef, afterFire.sustainedVolumeCoef, n.afterFireVolumeCoef, afterFire.sustainedVolumeCoef * n.afterFireVolumeCoef, 1 - n.afterFireMufflingCoef))
end
-- Audio Debug
-- print (string.format("instantAfterFire coef %.2f / sustainedAfterFire coef %.2f / shiftVolumeCoef %.2f", jbeamData.instantAfterFireVolumeCoef, jbeamData.sustainedAfterFireVolumeCoef, jbeamData.shiftAfterFireVolumeCoef))
-- print (string.format("audibleThresholdInstant %.2f / audibleThresholdSustained %.2f / audibleThresholdShift %.2f", jbeamData.afterFireAudibleThresholdInstant, jbeamData.afterFireAudibleThresholdSustained, jbeamData.afterFireAudibleThresholdShift))
-- print (string.format("instantAfterFire coef %.2f / sustainedAfterFire coef %.2f / shiftVolumeCoef %.2f", jbeamData.instantAfterFireVolumeCoef, jbeamData.sustainedAfterFireVolumeCoef, jbeamData.shiftAfterFireVolumeCoef))
-- print (string.format("audibleThresholdInstant %.2f / audibleThresholdSustained %.2f / audibleThresholdShift %.2f", jbeamData.afterFireAudibleThresholdInstant, jbeamData.afterFireAudibleThresholdSustained, jbeamData.afterFireAudibleThresholdShift))
if radiatorFanTemperature > radiatorFanTemperatureDesired then
log("W", "engine.initThermals", string.format("Increased desired radiator fan temperature from '%dC' to '%dC' to prevent fan trigger issues with thermostat at '%dC'.", radiatorFanTemperatureDesired, radiatorFanTemperature, thermostatTemperature))
end
@/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/controller/bypassDampers.lua
local function setDamperZone(damper, zoneId)
--print(string.format("Damper %d set to zone %f", damper.beamCid, zoneCid))
local zone = damperZones[zoneId]
-- if M.name == "frontBypass" and _ == 1 then
-- print(string.format("CLICK! Switch from %d to %d at velocity %.3fm/s, volume: %.2f", damper.previousDirection, smoothDirection, velocity, volume))
-- end
@/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/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/vehicle/extensions/tech/CANBus/ProjectBavariaKombi.lua
if crc == expectedCRC then
print(string.format("Found matching CRC XOR Value : %s", canBus.dumpsByteHex(i)))
end
@/lua/ge/extensions/editor/bulkRename.lua
else
return string.format("%0" .. width .. "d", counter)
end
@/lua/ge/extensions/editor/dragRaceEditor/strips.lua
local laneCount = strip.lanes and #strip.lanes or 0
local label = string.format("%s (%d lanes)", strip.id or "unnamed", laneCount)
if im.IsItemHovered() then
im.tooltip(string.format("Name: %s\nDescription: %s", strip.name or "N/A", strip.description or "N/A"))
end
local isLaneSelected = i == selectedLaneIndex
local laneLabel = string.format("%d. %s (%s)", i, lane.name or "Unnamed", lane.color or "unknown")
local isWaypointSelected = i == selectedWaypointIndex
local waypointLabel = string.format("%d. %s", i, waypoint.type or "unknown")
@/lua/ge/extensions/scenario/raceMarkers/sideColumnMarker.lua
local sideHeight = clamp(inverseLerp(60,180,distanceFromMarker),0,20)+1 +clamp(inverseLerp(1800,2040,distanceFromMarker),0,20)
--debugDrawer:drawTextAdvanced(self.pos, String(string.format("%0.2f -> %0.2f / %0.2f / %0.2f", distanceFromMarker, sideRadius, sideHeight, baseHeight)), ColorF(1,1,1,1), true, false, ColorI(0,0,0,192))
left = scenetree.findObjectById(self.leftId)
@/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/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/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)
@/ui/ui-vue/src/modules/apps/rallyLoop/utils/timeFormatters.js
const hours12 = totalHours % 12 || 12 // Convert to 12-hour format (0 -> 12)
const period = shortenedPeriod
@/lua/vehicle/powertrain/manualGearbox.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
if doDisplayDamageMessage then
guihooks.message({txt = string.format("Synchronizer damage (Gear %g): %d%%", wornGearIndex, clamp(device.synchroWear[wornGearIndex] * 100, 1, 100)), context = {}}, 5, "vehicle.damage.synchros")
device.previouslyReportedSynchroWear[wornGearIndex] = device.synchroWear[wornGearIndex]
-- device:setGearIndex(0)
-- guihooks.message({txt = string.format("Gear popped out, too much transmission damage"), context = {}}, 5, "vehicle.damage.synchros")
-- end
local absAVDifference = abs(avDifference)
--print(string.format("AV difference: %.2f", avDifference))
local synchroWearCoef = linearScale(device.synchroWear[newDesiredIndex], 0.1, 1, 1, 0.4)
--shift succeeded without using the clutch
--print(string.format("AV difference is minimal, shift succeeded without clutch usage. Allowed AV difference: %.2f", device.shiftAllowedNonClutchAVDifference[newDesiredIndex]))
else
if absAVDifference > device.shiftMaxSynchroAVCapability[newDesiredIndex] * synchroWearCoef then
--print(string.format("AV difference too high to sync. Max: %.2f, actual: %.2f", device.shiftMaxSynchroAVCapability[newDesiredIndex], avDifference))
isSuccessfulShift = false
if not clutchPressedEnough then
--print(string.format("Not enough clutch input. Required: %.2f, actual: ", device.shiftRequiredClutchInput[newDesiredIndex], (1 - device.parent.clutchRatio)))
isSuccessfulShift = false
if availableSyncTime * maxSyncSpeed < absAVDifference then
--print(string.format("Available sync time too small. Required: %.4fs, actual: %.4fs", absAVDifference / maxSyncSpeed, availableSyncTime))
--print(string.format("Hypothetical sync rate required for this shift: %.2f rad/s", (absAVDifference / availableSyncTime)))
--print(string.format("Available sync time too small. Required: %.4fs, actual: %.4fs", absAVDifference / maxSyncSpeed, availableSyncTime))
--print(string.format("Hypothetical sync rate required for this shift: %.2f rad/s", (absAVDifference / availableSyncTime)))
isSuccessfulShift = false
else
--print(string.format("Good shift, perfection: %.1f%%", (absAVDifference / maxSyncSpeed) / availableSyncTime * 100))
end
@/lua/ge/extensions/career/modules/vehicleShopping.lua
newVeh:queueLuaCommand(string.format("partCondition.initConditions(nil, %d, nil, %f) obj:queueGameEngineLua('career_modules_vehicleShopping.onVehicleSpawnFinished(%d)')", vehicleInfo.Mileage, getVisualValueFromMileage(vehicleInfo.Mileage), newVeh:getID()))
return newVeh
local function payForVehicle()
local label = string.format("Bought a vehicle: %s", purchaseData.vehicleInfo.niceName)
if purchaseData.tradeInVehicleInfo then
if purchaseData.tradeInVehicleInfo then
label = label .. string.format(" and traded in vehicle id %d: %s", purchaseData.tradeInVehicleInfo.id, purchaseData.tradeInVehicleInfo.niceName)
end
local insuranceInfo = career_modules_insurance_insurance.getInsuranceDataById(purchaseData.insuranceId)
purchaseData.insuranceOptions.spendingReason = string.format("Insurance Policy: \"%s\"", insuranceInfo.name)
purchaseData.insuranceOptions.priceMoney = career_modules_insurance_insurance.calculateAddVehiclePrice(purchaseData.insuranceId, purchaseData.vehicleInfo.Value)
if buyVehicleOptions.licensePlateText then
career_modules_playerAttributes.addAttributes({money=-purchaseData.prices.customLicensePlate}, {tags={"buying"}, label=string.format("Bought custom license plate for new vehicle")})
end
vehicleWatchlist[shopId] = "sold"
guihooks.trigger("toastrMsg", {type="info", title="A vehicle you were interested in has been sold.", msg = vehicleInfo.Name .. " for $" .. string.format("%.2f", vehicleInfo.soldFor)})
break
@/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/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/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
@/lua/ge/extensions/gameplay/forceField.lua
local command = string.format('obj:setPlanets({%f, %f, %f, %d, %f})', center.x, center.y, center.z, planetRadius, mass * vehicleSizeFactor * forceMultiplier)
@/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/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/ge/screenshot.lua
local screenshotFolderString = getScreenShotFolderString()
local path = string.format("screenshots/%s", screenshotFolderString)
if not FS:directoryExists(path) then FS:directoryCreate(path) end
local screenshotDateTimeString = getScreenShotDateTimeString()
local subFilename = string.format("%s/screenshot_%s", path, screenshotDateTimeString)
local screenshotFormat = settings.getValue("screenshotFormat")
if screenshotNumber > 0 then
fullFilename = FS:expandFilename(string.format("%s_%s", subFilename, screenshotNumber))
else
@/lua/ge/extensions/editor/sitesEditor.lua
for _, spot in ipairs(list) do
spot.name = string.format("%s%0"..l.."d", name, c)
c = c+1
@/inspector/Views/TextEditor.js
let formatter = new WI.Formatter(this._codeMirror, builder);
formatter.format(start, end);
@/lua/ge/extensions/editor/materialEditor.lua
im.Separator()
im.TextUnformatted(string.format(
"TSStatic: %d ForestItemData: %d",
end
-- print(string.format("%0.2f", timer:stopAndReset()))
-- dump(tags)
im.TextUnformatted(absPath)
im.TextUnformatted(string.format("Dimensions (loaded MIP): %d x %d\nFormat: %s", tex.size.x, tex.size.y, tex.format))
im.TextUnformatted(string.format("Size (estimated): %.2f MB", size / 1e6))
im.TextUnformatted(string.format("Dimensions (loaded MIP): %d x %d\nFormat: %s", tex.size.x, tex.size.y, tex.format))
im.TextUnformatted(string.format("Size (estimated): %.2f MB", size / 1e6))
im.PopTextWrapPos()
if absPath ~= imgPath then
editor.logInfo(logTag .. string.format([[
Changed texture path from '%s' to '%s' for material '%s'!
im.NextColumn()
im.TextUnformatted(string.format("%s.%s", filename, ext))
if editor.uiButtonRightAlign("Open in explorer", nil, true) then
local totalSize = computeTotalTextureSize(currentMaterial)
im.TextUnformatted(string.format("%.2f MB", totalSize / 1e6))
--
@/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/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/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/common/extensions/ui/imgui_gen_luaintf.lua
if select('#', ...) == 0 then return string_fmt end
return string.format(string_fmt, ...)
end
@/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
@/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});
@/lua/vehicle/partCondition.lua
table.insert(partTypeTags[devicePartId], "powertrainDevice:" .. deviceName)
--print(string.format("%s -> %s:%s", devicePartId, deviceType, deviceName))
end
table.insert(partTypeTags[storagePartId], "energyStorage:" .. storageName)
--print(string.format("%s -> %s:%s", storagePartId, storageType, storageName))
end
if v.radiatorArea and not v.inertia then --look for the radiator part
--print(string.format("%s -> %s:%s", partId, k, "radiator"))
partTypeTags = partTypeTags or {}
partTypeTags[partId] = partTypeTags[partId] or {}
table.insert(partTypeTags[partId], string.format("powertrainDevice:%s:%s", k, "radiator"))
elseif v.torqueModExhaust and not v.inertia then --look for the exhaust part
elseif v.torqueModExhaust and not v.inertia then --look for the exhaust part
--print(string.format("%s -> %s:%s", partId, k, "exhaust"))
partTypeTags = partTypeTags or {}
partTypeTags[partId] = partTypeTags[partId] or {}
table.insert(partTypeTags[partId], string.format("powertrainDevice:%s:%s", k, "exhaust"))
elseif v.turbocharger and not v.inertia then
partTypeTags[partId] = partTypeTags[partId] or {}
table.insert(partTypeTags[partId], string.format("powertrainDevice:%s:%s", k, "turbocharger"))
--print(string.format("%s -> %s:%s", partId, k, "turbocharger"))
table.insert(partTypeTags[partId], string.format("powertrainDevice:%s:%s", k, "turbocharger"))
--print(string.format("%s -> %s:%s", partId, k, "turbocharger"))
end
partTypeTags[flexbody.partPath] = partTypeTags[flexbody.partPath] or {}
table.insert(partTypeTags[flexbody.partPath], string.format("jbeam:flexbody:%s", flexbody.mesh))
end
partTypeTags[partId] = partTypeTags[partId] or {}
--table.insert(partTypeTags[partId], string.format("jbeam:damper:%s", beam.name))
end
for _, breakGroup in ipairs(breakGroups) do
table.insert(partTypeTags[partId], string.format("jbeam:breakGroup:%s", breakGroup))
end
if v.data.beams[beamCid] and v.data.beams[beamCid].beamType ~= 7 then --exclude support beams (type 7 -> bdebug.lua)
table.insert(partTypeTags[partId], string.format("jbeam:beamDamage:%d", beamCid))
end
--TODO improve interface to GE for setting mesh colors
local colorCmd = string.format("getObjectByID(%d):setMeshColor(%q, ColorI(%d,%d,%d,%d), ColorI(%d,%d,%d,%d), ColorI(%d,%d,%d,%d))", objectId, split[3], baseColor1[1] * 255, baseColor1[2] * 255, baseColor1[3] * 255, 255, baseColor2[1] * 255, baseColor2[2] * 255, baseColor2[3] * 255, 255, baseColor3[1] * 255, baseColor3[2] * 255, baseColor3[3] * 255, 255)
--ColorI(roughness0, metallic0, clearCoatFactor0, clearCoatRoughness0)
--ColorI(roughness0, metallic0, clearCoatFactor0, clearCoatRoughness0)
local paintDataCmd = string.format("getObjectByID(%d):setMeshPaintData(%q, ColorI(%d,%d,%d,%d), ColorI(%d,%d,%d,%d), ColorI(%d,%d,%d,%d))", objectId, split[3], paintData1Roughness * 255, paintData1Metallic * 255, paintData1Clearcoat * 255, paintData1ClearcoatRoughness * 255, paintData2Roughness * 255, paintData2Metallic * 255, paintData2Clearcoat * 255, paintData2ClearcoatRoughness * 255, paintData3Roughness * 255, paintData3Metallic * 255, paintData3Clearcoat * 255, paintData3ClearcoatRoughness * 255)
obj:queueGameEngineLua(colorCmd)
if hasSetPartCondition[partId] then
log("E", "partCondition.initCondition", string.format("Trying to set part condition on part %q twice. Unexpected results might follow...", partId))
end
result[partId] = getCondition(partId)
--log("I", "partCondition.getConditions", string.format("Got condition for partId %25s: ", partId) .. string.sub(serialize(result[partId]), 1, 100))
end,
@/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/client/postFx/smaa.lua
local rtSize = smaaPostEffect:getRenderTargetSize()
local rtResolution = string.format("float4(1.0 / %d, 1.0 / %d, %d, %d)", rtSize.x, rtSize.y, rtSize.x, rtSize.y)
local currentRTResolution = smaaPostEffect:getField("rtResolution", 0)
@/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/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/ge/extensions/ui/vehicleSelector/general.lua
if not config then
log("W","",string.format("No config found for model: %s, config: %s", itemData.model, itemData.config))
end
@/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/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/ge/extensions/core/audioRibbon.lua
local nd = ribbon.nodes[i]
table.insert(nodesSer, string.format('{"x":%.10g,"y":%.10g,"z":%.10g,"depth":%.10g}', nd.x, nd.y, nd.z, ribbon.depths[i]))
end
-- Convert ribbon to JSON-like format (preserves key order).
local isEnabled = 0
end
local jsonLine = string.format(
'{"persistantId":"%s","name":"%s","isEnabled":%s,"isAmbient":%s,"isUpRibbon":%s,"isTopActive":%s,"isQuadAndVolume":%s,"speed":%.10g,' ..
@/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/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)
@/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/extensions/editor/measuresInspectorHeader.lua
if size then
imgui.Text("Size: " .. string.format("%.2f", size.x) .. " x " .. string.format("%.2f", size.y) .. " x " .. string.format("%.2f", size.z))
imgui.tooltip("The size of the selection bounding box, scale included")
if size then
imgui.Text("Size: " .. string.format("%.2f", size.x) .. " x " .. string.format("%.2f", size.y) .. " x " .. string.format("%.2f", size.z))
imgui.tooltip("The size of the selection bounding box, scale included")
if size then
imgui.Text("Size: " .. string.format("%.2f", size.x) .. " x " .. string.format("%.2f", size.y) .. " x " .. string.format("%.2f", size.z))
imgui.tooltip("The size of the selection bounding box, scale included")
@/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/CanvasContentView.js
let formatString = this.representedObject.recordingFrameCount === 1 ? WI.UIString("%d Frame") : WI.UIString("%d Frames");
title = formatString.format(this.representedObject.recordingFrameCount);
} else
@/inspector/Controllers/NetworkManager.js
{
message = WI.UIString("HAR Import Error: %s").format(message);
@/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
@/inspector/Models/ShaderProgram.js
{
return WI.UIString("Program %d").format(this._uniqueDisplayNumber);
}
@/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/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/vizHelper.lua
im.Separator()
im.Text("object: " .. tostring(mouseHit.object:getId() .. ' in ' .. string.format('%0.2f', mouseHit.distance) .. 'm'))
@/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/util/trackBuilder/materialUtil.lua
local value = string.format('%f %f %f %f', color[1], color[2], color[3], color[4])
if field == 'center_base' then
@/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/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/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/dynamicDecals/news.lua
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[3]))
for _, version in pairs(news) do
if im.CollapsingHeader1(string.format("%s", version.title), i == 1 and im.TreeNodeFlags_DefaultOpen or nil) then
version.guiFn()
@/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/flowgraph/nodes/ui/cornerTimer.lua
}
data.txt = string.format("%02d:%02d", math.floor(self.pinIn.value.value / 60), math.floor(self.pinIn.value.value % 60))
data.minutes = string.format("%02d", math.floor(self.pinIn.value.value / 60))
data.txt = string.format("%02d:%02d", math.floor(self.pinIn.value.value / 60), math.floor(self.pinIn.value.value % 60))
data.minutes = string.format("%02d", math.floor(self.pinIn.value.value / 60))
data.seconds = string.format("%02d", math.floor(self.pinIn.value.value % 60))
data.minutes = string.format("%02d", math.floor(self.pinIn.value.value / 60))
data.seconds = string.format("%02d", math.floor(self.pinIn.value.value % 60))
data.style = "text"
@/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"
@/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/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/vehicle/extensions/profiling/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/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/ge/extensions/ui/gridSelectorUtils/filterModule.lua
if currentMin > defaultMin and currentMax < defaultMax then
displayText = string.format("%s %s - %s", propName, currentMin, currentMax)
propValue = string.format("%s,%s", currentMin, currentMax)
displayText = string.format("%s %s - %s", propName, currentMin, currentMax)
propValue = string.format("%s,%s", currentMin, currentMax)
elseif currentMin > defaultMin then
elseif currentMin > defaultMin then
displayText = string.format("%s > %s", propName, currentMin)
propValue = string.format("> %s", currentMin)
displayText = string.format("%s > %s", propName, currentMin)
propValue = string.format("> %s", currentMin)
else
else
displayText = string.format("%s < %s", propName, currentMax)
propValue = string.format("< %s", currentMax)
displayText = string.format("%s < %s", propName, currentMax)
propValue = string.format("< %s", currentMax)
end
propValue = 'all',
displayText = string.format("%s: None!", propName),
isActive = false,
if #enabledOptions > #disabledOptions then
displayText = string.format("%s %s", propName, table.concat(disabledOptions, ', '))
propValue = table.concat(disabledOptions, ',')
-- If more elements are disabled than enabled, show the enabled names in green
displayText = string.format("%s %s", propName, table.concat(enabledOptions, ', '))
propValue = table.concat(enabledOptions, ',')
local function toggleFilter(propName, option)
log("D","",string.format("Toggling filter: %s, option: %s", propName, option))
if isFilterLocked(propName, option) then
log("W","",string.format("Cannot toggle locked filter: %s, option: %s", propName, option))
return
local function updateRangeFilter(propName, min, max)
log("D","",string.format("Updating range filter: %s, min: %s, max: %s", propName, min, max))
if isFilterLocked(propName) then
log("W","",string.format("Cannot update locked range filter: %s", propName))
return
local function resetRangeFilter(propName)
log("D","",string.format("Resetting range filter: %s", propName))
if isFilterLocked(propName) then
log("W","",string.format("Cannot reset locked range filter: %s", propName))
return
local function resetSetFilter(propName)
log("D","",string.format("Resetting set filter: %s", propName))
if isFilterLocked(propName) then
log("W","",string.format("Cannot reset locked set filter: %s", propName))
return
local function lockFilter(propName, options)
log("D","",string.format("Locking filter: %s", propName))
local function unlockFilter(propName, options)
log("D","",string.format("Unlocking filter: %s", propName))
local function lockFilterMode(propName, options)
log("D","",string.format("Locking filter mode: %s", propName))
local function lockFilterModeExclusive(propName, allowedOptions)
log("D","",string.format("Locking filter mode exclusive: %s", propName))
if filter.type ~= 'set' then
log("W","",string.format("lockFilterModeExclusive only works with set filters, got: %s", filter.type))
return
local function clearLockedFilters()
log("D","",string.format("Clearing all locked filters"))
lockedFiltersByProp = {}
@/lua/vehicle/controller/nitrousOxideInjection.lua
extensions.ui_simplePowertrainControl.setButton(M.name, "N2O", "powertrain_n2o", color, n2oData.tankRatio, string.format("controller.getController(%q).toggleActive()", M.name))
end
@/lua/ge/extensions/editor/sidewalkSpline/populate.lua
local id = Engine.generateUUID()
obj:registerObject(string.format('SidewalkMesh_%s', id))
obj.cansave = true
@/lua/vehicle/extensions/tech/CANBus/ButtonBox.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", "ButtonBox.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", "ButtonBox.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", "ButtonBox.virtualInputCallback", string.format("Received virtual input callback with deviceInstance %d and device info %s", deviceInstance or -1, dumps(deviceInfo)))
@/lua/ge/extensions/gameplay/rally/trafficExclusion.lua
log('I', logTag, string.format("Created %d traffic exclusion zones for %d missions", #zones, #missions))
return zones
@/lua/ge/extensions/gameplay/drift/scoring.lua
if im.Begin("Drift score") then
im.Text(string.format("Score : %i", driftScore.score))
im.Text(string.format("Cached score : %i", driftScore.cachedScore))
im.Text(string.format("Score : %i", driftScore.score))
im.Text(string.format("Cached score : %i", driftScore.cachedScore))
im.Text(string.format("Potential score : %i", driftScore.potentialScore))
im.Text(string.format("Cached score : %i", driftScore.cachedScore))
im.Text(string.format("Potential score : %i", driftScore.potentialScore))
im.Text(string.format("Combo : %0.2f Combo creep up : %d", driftScore.combo, driftScore.comboCreepup))
im.Text(string.format("Potential score : %i", driftScore.potentialScore))
im.Text(string.format("Combo : %0.2f Combo creep up : %d", driftScore.combo, driftScore.comboCreepup))
im.Text(string.format("Current perfomance factor : %0.2f (%i) | Very good drift score : %0.2f", performanceFactor, steppedPerformanceFactor, veryGoodScore))
im.Text(string.format("Combo : %0.2f Combo creep up : %d", driftScore.combo, driftScore.comboCreepup))
im.Text(string.format("Current perfomance factor : %0.2f (%i) | Very good drift score : %0.2f", performanceFactor, steppedPerformanceFactor, veryGoodScore))
im.Text(string.format("Score added this frame : %0.2f", scoreAddedThisFrame))
im.Text(string.format("Wall multi this frame : %0.2f", wallMulti))
im.Text(string.format("Score added this frame : %0.2f", scoreAddedThisFrame))
im.Text(string.format("Wall multi this frame : %0.2f", wallMulti))
im.Text(string.format("Speed multi this frame : %0.2f", speedMulti))
im.Text(string.format("Wall multi this frame : %0.2f", wallMulti))
im.Text(string.format("Speed multi this frame : %0.2f", speedMulti))
im.Text(string.format("Angle multi this frame : %0.2f", angleMulti))
im.Text(string.format("Speed multi this frame : %0.2f", speedMulti))
im.Text(string.format("Angle multi this frame : %0.2f", angleMulti))
else
@/lua/ge/extensions/career/modules/milestones/generalMilestones/insurance.lua
getLabel = function(step, displayValue, target) return "Sometimes, it happens." end,
getDescription = function(step, displayValue, target) return string.format("Get %d repair claims.", stepsInfo[step]) end,
getProgressLabel = function(step, current, target) return string.format("%d / %d", current, target) end,
getDescription = function(step, displayValue, target) return string.format("Get %d repair claims.", stepsInfo[step]) end,
getProgressLabel = function(step, current, target) return string.format("%d / %d", current, target) end,
getTarget = function(step) return step == 0 and 0 or stepsInfo[step] end,
@/inspector/Views/IssueTreeElement.js
if (displayColumnNumber > 0)
title = WI.UIString("Line %d:%d").format(displayLineNumber + 1, displayColumnNumber + 1); // The user visible line and column numbers are 1-based.
else
else
title = WI.UIString("Line %d").format(displayLineNumber + 1); // The user visible line number is 1-based.
@/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/core/remoteController.lua
--log('D', logTag, "Orientation: "..floor(orientation.x * 100)..", "..floor(orientation.y*100)..", "..floor(orientation.z*100))
--log('D', logTag, string.format("Orientation: %0.2f, %0.2f, %0.2f", orientation.x, orientation.y, orientation.z))
@/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/vehicle/extensions/vehicleStatsLogger.lua
local get_fname = function(i)
return "vehicle_stats_settings(" .. string.format("%03d", i) .. ").json"
end
@/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
@/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
@/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/ge/extensions/freeroam/bigMapMode.lua
-- deselecting the current marker
--log("I", "", string.format("Sel: %s Hov: %s HasTgt: %s", M.selectedPoiId, M.hoveredPoiId, dumps(core_groundMarkers.currentlyHasTarget())))
if M.selectedPoiId and (not M.hoveredPoiId or M.selectedPoiId == M.hoveredPoiId) then
@/lua/vehicle/controller/couplings/kingpin.lua
local data = {nodeId = kingpinNodeCid, nodePosition = position + nodePosition}
local fifthwheelCmd = string.format([[
controller.getControllerSafe(%q).kingpinDataCallback(%d, %s)
@/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))
@/inspector/Views/CanvasSidebarPanel.js
{
let folder = new WI.FolderTreeElement(WI.UIString("Frame %d").format((index + 1).toLocaleString()), frame);
@/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/ui/console.lua
if l then
txt = txt..string.format("%s|%s|%s|%s\n",l[1],l[2],l[3],l[4])
end
if l then
txt = txt..string.format("%s|%s|%s|%s\n",l[1],l[2],l[3],l[4])
end
im.tooltip("Clear console")
-- im.TextUnformatted(string.format("upd=%.3fms add=%.3fms", rollAvgCalc(rollAvgUpdate), rollAvgCalc(rollAvgAdd)) )
elseif type(timer) == "number" then
t = string.format("%.3f", timer)
else
-- if not l then
-- -- print( string.format("head = %d\ttail=%d\ti=%d",logsHead,logsTail , i ))
-- goto continue_skipline
if not l then
-- print( string.format("head = %d\ttail=%d\ti=%d",logsHead,logsTail , i ))
-- if viewColumn.time[0] then
if v ~= 2 and im.GetContentRegionAvailWidth() < txtwidth then
im.TextColored(lcol,string.format("%s", tostring(v):sub(1,256) ))
txtwidth = txtwidth * (1/fontConsoleFact[0])
dump = dump .. hex .. asc .. "\n"
hex = string.format( "%04x: ", i - 1 )
asc = ""
local ord = string.byte( str, i )
hex = hex .. string.format( "%02x ", ord )
if ord >= 32 and ord <= 126 then
@/lua/ge/extensions/gameplay/rally/tools/loopToolbox.lua
local translatedName = translateLanguage(mission.name, mission.name, true)
local displayName = string.format("%s (%s)", translatedName, mission.id)
table.insert(self.missionDropdownItems, displayName)
if hours > 0 then
return string.format("%d:%02d:%04.1f", hours, minutes, secondsWithDecimal)
else
else
return string.format("%d:%04.1f", minutes, secondsWithDecimal)
end
if hours > 0 then
return string.format("%d:%02d:%02d", hours, minutes, secs)
else
else
return string.format("%d:%02d", minutes, secs)
end
local statusColor = proximityData.isNear and colorGreen or colorRed
im.TextColored(statusColor, string.format("Near: %s | Dist: %.2fm | Frozen: %s", tostring(proximityData.isNear), proximityData.distance or 0, tostring(proximityData.isFrozen or false)))
local progress = (proximityData.timer or 0) / math.max(1e-12, proximityData.duration or 1)
local progress = (proximityData.timer or 0) / math.max(1e-12, proximityData.duration or 1)
im.ProgressBar(progress, im.ImVec2(200, 0), string.format("%.1f/%.1fs", proximityData.timer or 0, proximityData.duration or 0))
end
-- -- local splitTimeStr = self:formatDuration(split.time, true)
-- -- im.Text(string.format(" %s: %s", split.name, splitTimeStr))
-- -- end
local totalKm = manager:getTotalDistanceKm()
im.Text(string.format(" SS Distance: %.2f km", totalSSKm))
im.Text(string.format(" Liaison Distance: %.2f km", totalRoadSectionKm))
im.Text(string.format(" SS Distance: %.2f km", totalSSKm))
im.Text(string.format(" Liaison Distance: %.2f km", totalRoadSectionKm))
im.Text(string.format(" Total Distance: %.2f km", totalKm))
im.Text(string.format(" Liaison Distance: %.2f km", totalRoadSectionKm))
im.Text(string.format(" Total Distance: %.2f km", totalKm))
im.SetWindowFontScale(1.3)
im.TextColored(colorRed, string.format(" Total Penalty: +%ds", totalPenalty))
im.SetWindowFontScale(1.0)
if entry.distanceKm then
displayName = displayName .. string.format(" | %.2f km", entry.distanceKm)
end
if event.rescheduleCount and event.rescheduleCount > 0 then
eventText = eventText .. string.format(" (rescheduled %dx)", event.rescheduleCount)
end
if timingResult.totalPenalty > 0 then
statusText = statusText .. string.format(", would be +%ds penalty", timingResult.totalPenalty)
end
if timingResult.totalPenalty > 0 then
timecardText = timecardText .. string.format(" +%ds penalty", timingResult.totalPenalty)
end
im.SameLine()
im.TextColored(colorRed, string.format(" +%ds false start", falseStartPenalty))
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/vehicle/extensions/tech/vehicleSearcher.lua
local cData = { wheels = whData, electrics = elData, powertrain = pProc }
obj:queueGameEngineLua(string.format("editor_cosimulationSignalEditor.updateCollectedVehicleData(%q)", lpack.encode(cData)))
end
@/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/flowgraph/nodes/ui/endScreen.lua
local seconds = statsData.time - (minutes * 60)
statsData.time = string.format("%02.0f:%05.2f", minutes, seconds)
end
if type(c.new) == 'number' then
statsData.text = statsData.text .. string.format("%s: %0.2d -> %0.2d", c.key, c.old, c.new)
else
else
statsData.text = statsData.text .. string.format("%s: %s -> %s", c.key, c.old, c.new)
end
@/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/ui/gameplaySelector/tileGenerators/missionTiles.lua
local function getKeyFromDetails(details)
return string.format("mission_%s", details.missionId)
end
@/lua/ge/extensions/career/modules/vehicleClassGrouping.lua
local group = { -- this group is usable for the core_multiSpawn system
name = string.format("Class %s", class),
type = "custom",
for _, config in pairs(core_vehicles.getModel(model.key).configs) do
local modelConfigKey = string.format("%s/%s", model.key, config.key)
if not checkFilter(configFilter, modelConfigKey, invertedFilters.configFilter) then
@/lua/ge/extensions/editor/missionStartPositionEditor.lua
if startPos then
im.Text(string.format("Start Position: %.2f, %.2f, %.2f", startPos.x, startPos.y, startPos.z))
end
im.BeginTooltip()
im.Text(string.format("%d missions within 10m", #nearbyMissions))
im.EndTooltip()
@/lua/vehicle/controller/drivingDynamics/actuators/activeCenterDiffLock.lua
if not relevantDiff then
log("E", "electronicCenterDiffLock.initSecondStage", string.format("Can't find configured centerDiff (%q), disabling system...", centerDiffName))
return
@/lua/ge/extensions/editor/drivePathEditor/record.lua
local spline = splines[#splines]
spline.name = string.format("Recorded_%s", recordingVehicleName)
@/lua/ge/extensions/ui/gameplaySelector/tileGenerators/levelTiles.lua
local function getKeyFromDetails(details)
return string.format("spawnPoint_%s_%s", details.levelName, details.spawnPointObjectName)
end
levelTitle = translate(levelTitle)
name = string.format("%s (%s)", name, levelTitle)
end
if defaultSpawnPointCount > 1 then
log("E", "levelTiles", string.format("Default spawnpoint count is greater than 1 for level %s", level.levelName))
end
label = translate("ui.levelselect.size"),
value = string.format("%0.2f%s x %0.2f%s (%0.2f%s)", convertedSize1, unit, convertedSize2, unit, convertedArea, areaUnit),
icon = "scale"
if level.title then
name = string.format("%s (%s)", name, translate(level.title))
end
@/lua/ge/extensions/gameplay/statistic.lua
callbacksCareer[name][tostring(trigger)..tostring(callbackFunction)] = entry
log("I","",string.format("Registered callback for %s at %0.2f", name, trigger))
else
@/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/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/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()
@/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/ui/uiNavi.lua
targetVeh:queueJSUITexture(dashboard, string.format("%s(%s)", initmap or "map.setData", jsonEncode(mapTable)))
end
@/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/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/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
@/lua/ge/extensions/editor/api/core.lua
folderName = string.format("%04d", counter)
local path = "/settings/editor/autosaves/" .. editor.getLevelName() .. "/" .. folderName
@/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/flowgraph/references.lua
im.TableNextColumn()
im.TextWrapped(string.format("%-3d", categoryData.nodeTypeAmount))
im.TableNextColumn()
im.TableNextColumn()
im.TextWrapped(string.format("(%.2f", (categoryData.nodeTypeAmount / self.nodeStatistics.usedNoteTypeAmount) * 100) .. "%%)")
im.TableNextColumn()
im.TableNextColumn()
im.TextWrapped(string.format("(%.2f", (categoryData.nodeInstancesAmount / self.nodeStatistics.usedNodeInstances) * 100) .. "%%)")
im.TableNextColumn()
@/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/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/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
@/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)
@/inspector/Views/AuditNavigationSidebarPanel.js
version = Math.min(version, InspectorBackend.domains.Audit.VERSION);
versionContainer.textContent = WI.UIString("Audit version: %s").format(version);
let resultFolderTreeElement = new WI.FolderTreeElement(WI.UIString("Run %d").format(index + 1));
if (result instanceof WI.AuditTestResultBase) {
@/lua/common/libs/luaqrcode/qrencode.lua
local function binary(x,digits)
local s=string.format("%o",x)
local a={["0"]="000",["1"]="001", ["2"]="010",["3"]="011",
s = string.gsub(s,"^0*(.*)$","%1")
local fmtstring = string.format("%%%ds",digits)
local ret = string.format(fmtstring,s)
local fmtstring = string.format("%%%ds",digits)
local ret = string.format(fmtstring,s)
return string.gsub(ret," ","0")
if math.fmod(#arranged_data,8) ~= 0 then
return false, string.format("Arranged data %% 8 != 0: data length = %d, mod 8 = %d",#arranged_data, math.fmod(#arranged_data,8))
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/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
@/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/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/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/ge/extensions/gameplay/crawl/saveSystem.lua
log('D', logTag, string.format('Found %d %s files in path: %s', #files, type, path))
@/lua/ge/extensions/editor/roadSpline/import.lua
renderPriority = road.renderPriority,
startEndFade = string.format("%s %s", startFade, endFade)
},
@/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/gameplay/rally/loop/stagedCountdownUtils.lua
tmpMidPoint,
String(string.format("%.2fm (%s)", signedDistance, sideName)),
ColorF(1, 1, 1, 1),
im.Text(string.format("Epoch: %.1fs", currentEpochTime))
else
im.Text(string.format("Event at: %.1fs", scheduledEventTime))
end
im.Text(string.format("Event in: %.1fs", timeUntilEvent))
if timeUntilStagingCheck > 0 and timeUntilStagingCheck < stagingCheckTime then
im.TextColored(im.ImVec4(1, 0.8, 0.2, 1), string.format("Staging check in: %.1fs", timeUntilStagingCheck))
end
im.Text("State: " .. nodeData.state)
im.Text(string.format("Reschedules: %d/%d", nodeData.rescheduleCount, nodeData.maxReschedules or 3))
@/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/common/libs/slaxml/slaxdom.lua
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 = rich and el or nil
attribute = function(name,value,nsURI,nsPrefix)
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,nsPrefix=nsPrefix,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)
-- documents may only have text node children that are whitespace: https://www.w3.org/TR/xml/#NT-Misc
if current.type=='document' and not value:find('^%s+$') then error(("Document has non-whitespace text at root: '%s'"):format(value:gsub('[\r\n\t]',{['\r']='\\r', ['\n']='\\n', ['\t']='\\t'}))) end
push(current.kids,{type='text',name='#text',cdata=cdata and true or nil,value=value,parent=rich and current or nil})
@/lua/ge/extensions/gameplay/missions/missionScreen.lua
local function getUncertifiedVehicleOptions(certificationName)
return {{enabled = false, label = string.format("Vehicle needs %s certification to start this challenge", certificationName)}}
end
label = vouchers >= repairCostVoucher and "Pay Repair and Start" or "Not enough vouchers for repair",
optionsLabel = string.format("Repair for %d vouchers", repairCostVoucher),
type = "voucherRepair"
label = money >= repairCostMoney and "Pay Repair and Start" or "Not enough money to repair",
optionsLabel = string.format("Repair for %d$",repairCostMoney),
type = "moneyRepair",
-- branch/skill
local branchSkill = "branchSkill_"..string.format("%s_%s", m.careerSetup.branch or "No Branch", m.careerSetup.skill or "No Skill")
filterData.groupTags[branchSkill] = true
if not groupsByKey[branchSkill] then
groupsByKey[branchSkill] = {label = string.format("%s / %s", m.careerSetup.branch or "No Branch", m.careerSetup.skill or "No Skill"), meta = {type = "branchSkill"}}
end
@/lua/ge/extensions/gameplay/race/pathnode.lua
debugDrawer:drawTextAdvanced(self.pos,
string.format("%s: %0.3f",name,self.customFields.values[name]),
ColorF(1,1,1,alpha*0.8),true, false,
@/lua/common/libs/xlsxlib/tests/tests.lua
local content = string.format('// Test args: %s\r\n', serialize(queryArgs))
content = content .. jsonEncodePretty({data}, 1)
@/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))
@/lua/ge/extensions/ui/apps/pointsBar.lua
for i, threshold in ipairs(pointsData.thresholds) do
im.BulletText(string.format("Threshold %d: %d", i, threshold))
end
@/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/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/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/meshSpline.lua
selSpline.centerMeshName = path:match("([^/]+)$")
selSpline.mainComponentPath = string.format('main_%s', path)
selSpline.boxXLeft_Center, selSpline.boxXRight_Center = center.x - minExtents.x, maxExtents.x - center.x
selSpline.alias1MeshName = path:match("([^/]+)$")
selSpline.alias1ComponentPath = string.format('alias1_%s', path)
elseif meshTarget == 'alias2' then
selSpline.alias2MeshName = path:match("([^/]+)$")
selSpline.alias2ComponentPath = string.format('alias2_%s', path)
elseif meshTarget == 'alias3' then
selSpline.alias3MeshName = path:match("([^/]+)$")
selSpline.alias3ComponentPath = string.format('alias3_%s', path)
elseif meshTarget == 'start' then
selSpline.startCapMeshName = path:match("([^/]+)$")
selSpline.startCapComponentPath = string.format('startCap_%s', path)
elseif meshTarget == 'end' then
selSpline.endCapMeshName = path:match("([^/]+)$")
selSpline.endCapComponentPath = string.format('endCap_%s', path)
end
@/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/ge/extensions/ui/gameplaySelector/general.lua
end
title = string.format("%s", filterValue)
else
else
title = string.format("%s", clusterKey, groupKey, groupName)
end
@/lua/vehicle/controller/tech/screens.lua
for _, screen in pairs(screens) do
local queueString = string.format("extensions.tech_multiscreen.addVehicleView(%q, %.3f, %.3f, %.3f, %.3f, %.3f, %.3f, %d, %d, %.2f, %.2f, %.2f, %.2f, %d, %d, %d, %s)",
screen.name,
@/lua/ge/extensions/gameplay/traffic.lua
fileData = core_multiSpawn.fitGroup(fileData, policeAmount)
log('I', logTag, string.format('Loaded police group from file: %s', fileName or ''))
end
fileData = core_multiSpawn.fitGroup(fileData, amount)
log('I', logTag, string.format('Loaded traffic group from file: %s', fileName or ''))
end
if veh.debugText then
debugDrawer:drawTextAdvanced(veh.pos, string.format('[%d]: %d m, %d km/h', veh.id, math.floor(veh.focusDist), math.floor((veh.speed or 0) * 3.6)), txtColor, true, false, bgColor)
end
local amount, activeAmount = getTrafficAmount(), getTrafficAmount(true)
log('I', logTag, string.format('Traffic system started with %d active / %d total vehicles', activeAmount, amount))
if not next(mapNodes) then
@/lua/ge/extensions/flowgraph/nodes/ui/raceRecoveriesUsed.lua
if self.pinIn.max.value then
guihooks.trigger('RaceRecoveryCounterSet', string.format("Recoveries Used: %d / %d",self.pinIn.cur.value, self.pinIn.max.value))
else
else
guihooks.trigger('RaceRecoveryCounterSet', string.format("Recoveries Used: %d",self.pinIn.cur.value))
end
@/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/core/settings/settings.lua
removeConsoleVariable("$pref::Video::mode") -- deprecated flag
TorqueScript.eval(string.format('export("$pref::*", "%s" , False);', settings.impl.pathTorquescript))
else
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)))
end
-- a setter was already defined, cannot add a setter to propagate value to C++ side
log("E", "", string.format("Unable to propagate setting '%s' to C++ side, since it already has a custom setter in LUA side: this is likely a conflict of intentions that requires bugfixing", k))
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/career/modules/milestones/generalMilestones/delivery.lua
getLabel = function(step, displayValue, target) return config.label end,
getDescription = function(step, displayValue, target) return string.format(config.description, target) end,
getProgressLabel = function(step, current, target) return string.format(config.progressLabel, current, target) end,
getDescription = function(step, displayValue, target) return string.format(config.description, target) end,
getProgressLabel = function(step, current, target) return string.format(config.progressLabel, current, target) end,
getTarget = function(step) return step == 0 and 0 or config.targets[step] end,
getLabel = function(step, displayValue, target) return config.label end,
getDescription = function(step, displayValue, target) return string.format(config.description, target) end,
getProgressLabel = function(step, current, target) return string.format(config.progressLabel, current, target) end,
getDescription = function(step, displayValue, target) return string.format(config.description, target) end,
getProgressLabel = function(step, current, target) return string.format(config.progressLabel, current, target) end,
getTarget = function(step) return step == 0 and 0 or config.targets[step] end,
getLabel = function(step, displayValue, target) return "Facility Finder" end,
getDescription = function(step, displayValue, target) return string.format("Deliver any kind of cargo from %d different facilities.", target) end,
getProgressLabel = function(step, current, target) return string.format("%d / %d", current, target) end,
getDescription = function(step, displayValue, target) return string.format("Deliver any kind of cargo from %d different facilities.", target) end,
getProgressLabel = function(step, current, target) return string.format("%d / %d", current, target) end,
getTarget = function(step) return step == 0 and 0 or providerSteps[step] end,
getLabel = function(step, displayValue, target) return "Facility Satisfier" end,
getDescription = function(step, displayValue, target) return string.format("Deliver any kind of cargo to %d different facilities.", target) end,
getProgressLabel = function(step, current, target) return string.format("%d / %d", current, target) end,
getDescription = function(step, displayValue, target) return string.format("Deliver any kind of cargo to %d different facilities.", target) end,
getProgressLabel = function(step, current, target) return string.format("%d / %d", current, target) end,
getTarget = function(step) return step == 0 and 0 or receiverSteps[step] end,
@/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/gameplay/rally/notebook/test/testNotebook.lua
message = message or "assertion failed"
log('E', logTag, string.format("%s: expected '%s' but got '%s'", message, tostring(expected), tostring(actual)))
error("test failed: "..message)
@/lua/ge/extensions/editor/decalEditor.lua
debugDrawer:drawTextAdvanced(inst.position, String('ID: ' .. tostring(inst.id)), ColorF(1,1,1,1), true, false, ColorI(0,0,0,192))
debugDrawer:drawTextAdvanced(inst.position, String('Dist: ' .. string.format("%0.1f", dist) .. ' m'), ColorF(1,1,1,1), true, false, ColorI(0,0,0,192))
end
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiDragFloat3(string.format("##pos_%d_%s", selectedInstance.id, label), position, 0.1, minFloatValue, maxFloatValue,
"%0." .. editor.getPreference("ui.general.floatDigitCount") .. "f", 1, positionSliderEditEnded) then
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiInputFloat3(string.format("##rot_%d_%s", selectedInstance.id, label), input4FloatValue, "%.1f", im.InputTextFlags_EnterReturnsTrue, nil) then
local decalRot = quatFromEuler(degToRad(input4FloatValue[0]), degToRad(input4FloatValue[1]), degToRad(input4FloatValue[2]))
im.PushItemWidth(im.GetContentRegionAvailWidth())
if editor.uiInputFloat(string.format("##size_%d_%s", selectedInstance.id, label), size, 0.1, 1.0, "%0." .. editor.getPreference("ui.general.floatDigitCount") .. "f", nil) then
local oldSizes = {}
@/inspector/Models/SourceCodeLocation.js
var tooltip = WI.UIString("Located at %s").format(this.displayLocationString(WI.SourceCodeLocation.ColumnStyle.Shown, WI.SourceCodeLocation.NameStyle.Full));
tooltip += "\n" + WI.UIString("Originally %s").format(this.originalLocationString(WI.SourceCodeLocation.ColumnStyle.Shown, WI.SourceCodeLocation.NameStyle.Full));
var tooltip = WI.UIString("Located at %s").format(this.displayLocationString(WI.SourceCodeLocation.ColumnStyle.Shown, WI.SourceCodeLocation.NameStyle.Full));
tooltip += "\n" + WI.UIString("Originally %s").format(this.originalLocationString(WI.SourceCodeLocation.ColumnStyle.Shown, WI.SourceCodeLocation.NameStyle.Full));
return tooltip;
return prefix + name;
var lineSuffix = displayURL ? ":" + lineString : WI.UIString(" (line %s)").format(lineString);
return prefix + name + lineSuffix;
@/lua/ge/extensions/gameplay/rally/driveline/drivelineRoute.lua
if not item then error("expected item for stableId: " .. stableId) end
-- log('D', logTag, string.format("dist: %s, stableId: %s", dist, stableId))
-- log('D', logTag, "item: " .. dumps(item))
local dist = queryPoint:squaredDistanceToLineSegment(p1.pos, p2.pos)
-- log('D', logTag, string.format("itemIdx=%d, i=%d, squaredDist: %0.2f", itemIdx, i, dist))
if dist < minDistSq then
if bestSegmentIdx == searchMin and searchMin > 1 then
log('W', logTag, string.format("first searched segment (%d) was closest for queryPoint=%s. consider inspecting the segments in the vicinity to ensure the closest segment is found. potentially increase the search window (currently %d).", searchMin, stableId, searchWindow))
elseif bestSegmentIdx == searchMax then
elseif bestSegmentIdx == searchMax then
log('W', logTag, string.format("last searched segment (%d) was closest for queryPoint=%s. consider inspecting the segments in the vicinity to ensure the closest segment is found. potentially increase the search window (currently %d).", searchMax, stableId, searchWindow))
end
local shortWpType = WaypointTypes.shortenWaypointType(pacenoteWaypoint.waypointType)
local wpKey = string.format("wp%s", shortWpType)
local metadata = {
[wpKey] = pacenoteWaypoint,
stableId = string.format("%s[%s]", pacenote.name, shortWpType),
-- source = string.format("%s[%s]", pacenote.name, shortWpType),
stableId = string.format("%s[%s]", pacenote.name, shortWpType),
-- source = string.format("%s[%s]", pacenote.name, shortWpType),
source = "pacenote_" .. shortWpType
hasSplitLabel = true
point.metadata.splitLabel = string.format("%.2fkm", distFromStart / 1000)
end
local distFromStart = splitData.distFromStart
local splitLabel = string.format("%.1f", distFromStart / 1000)
if splitLabels[splitLabel] then
local distFromStart = splitData.distFromStart
local splitLabel = string.format("%.2f", distFromStart / 1000)
splitData.splitLabel = splitLabel
local distFromStart = splitData.distFromStart
local splitLabel = string.format("%.1f", distFromStart / 1000)
splitData.splitLabel = splitLabel
for i, point in ipairs(step3Points) do
local wp = string.format("driveline_%d", i)
if not wp then error("expected wp") end
if lastMetadataHasRacingData and curMetadataHasRacingData then
-- log('D', '', string.format("last.stableId=%s cur.stableId=%s", last.metadata.stableId, cur.metadata.stableId))
-- reject the merge if both points have racing data
-- local ce = point.metadata.wpCe
-- log('D', logTag, string.format("rpn.name='%s' cs.name='%s' ce.name='%s'", rpn and rpn.name or "nil", cs and cs:nameWithPacenote() or "nil", ce and ce:nameWithPacenote() or "nil"))
-- else
if point.distToTarget > actualNextFixedRoutePoint.distToTarget then
-- log('D', logTag, string.format("false point.distToTarget=%f nextWpRoutePoint.distToTarget=%f nextRacePathnodeRoutePoint.distToTarget=%f", point.distToTarget, nextWpRoutePoint.distToTarget, nextRacePathnodeRoutePoint.distToTarget))
return false
local pathPoint = self.routeStatic.path[i]
-- log('D', logTag, string.format("static route point: wp=%s stableId=%s", pathPoint.wp or "nil", pathPoint.metadata and pathPoint.metadata.stableId or "nil"))
local metadata = pathPoint.metadata
local pathPoint = self.routeStatic.path[i]
-- log('D', logTag, string.format("static route point: wp=%s stableId=%s", pathPoint.wp or "nil", pathPoint.metadata and pathPoint.metadata.stableId or "nil"))
local metadata = pathPoint.metadata
for i,pacenote in ipairs(self:getPacenotes()) do
-- log('D', logTag, string.format('clearing events for %s', pacenote.name))
self.events[pacenote.id] = nil
self.nextPacenoteIdxForEval = nil
-- log('D', logTag, string.format('nextPnId id=%d name=%s', nextPnId, self.nextPacenoteWpFromRecalc.pacenote.name))
for i, pacenote in ipairs(self:getPacenotes()) do
self.events[pacenote.id] = event
-- log('D', logTag, string.format('disabled event for %s', pacenote.name))
else
else
log('W', logTag, string.format('no event found for %s', pacenote.name))
end
-- if self.nextPacenoteWpFromRecalc then
-- log('D', logTag, string.format('nextPacenoteWp: %s', self.nextPacenoteWpFromRecalc:nameWithPacenote()))
-- end
-- if self.nextRacePathnodeFromRecalc then
-- log('D', logTag, string.format('nextRacePathnode: %s', self.nextRacePathnodeFromRecalc.name))
-- end
if not event then
-- log('D', logTag, string.format('creating event for %s', pacenote.name))
event = {
profilerPushEvent("DrivelineRoute - evaluatePacenoteEvents")
-- print(string.format("evaluating pacenote %s", pacenote.name))
if event.disabledByRecalc then
-- log('D', logTag, string.format('pacenote %s is disabled by recalc', pacenote.name))
return false
if not timeToCs then
log('E', logTag, string.format('expected timeToCs for %s', pacenote.name))
return false
threshold = (self:baseCodriverTiming() + audioLenTotalScaled) * speedMultiplier
-- log('D', logTag, string.format('threshold=%.2fs speedMph=%0.2fmph speedMultiplier[%0.1f(%dmph)-%0.1f(%dmph)]=%0.2f audioLenTotal=%.2fs audioLenTotalScaled=%.2fs', threshold, speedMph, self.minMultiplier, self.scaleMinSpeedMph, self.maxMultiplier, self.scaleMaxSpeedMph, speedMultiplier, audioLenTotal, audioLenTotalScaled))
-- gcprobe()
if markPacenoteAsCompleteThisTick then causedCompletionStr = "[C]" end
local eventStr = string.format("%s[%s]%s cs dynamic @ %0.2fs < %0.2fs, %0.2fmph", disableTrackingStr, pacenote.name, causedCompletionStr or '', timeToCs, threshold, calcSpeedMph(speedMs))
log('D', logTag, eventStr)
if markPacenoteAsCompleteThisTick then causedCompletionStr = "[C]" end
local eventStr = string.format("%s[%s]%s cs immediate @ %0.2fmph", disableTrackingStr, pacenote.name, causedCompletionStr or '', calcSpeedMph(speedMs))
log('D', logTag, eventStr)
if markPacenoteAsCompleteThisTick then causedCompletionStr = "[C]" end
local eventStr = string.format("%s[%s]%s cs static @ %0.2fm < %0.2fm", disableTrackingStr, pacenote.name, causedCompletionStr or '', relativeDistCs, self.staticDistanceThresholdMeters)
log('D', logTag, eventStr)
if markPacenoteAsCompleteThisTick then causedCompletionStr = "[C]" end
local eventStr = string.format("%s[%s]%s cs+%0.0f%% @ %0.2fm < %0.2fm", disableTrackingStr, pacenote.name, causedCompletionStr or '', percent * 100, relativeDistCsPercent, self.staticDistanceThresholdMeters)
log('D', logTag, eventStr)
local sign = offset < 0 and "-" or "+"
local eventStr = string.format("%s[%s]%s cs%s%0.0fm @ %0.2fm < %0.2fm", disableTrackingStr, pacenote.name, causedCompletionStr or '', sign, math.abs(offset), relativeDistCsOffset, self.staticDistanceThresholdMeters)
log('D', logTag, eventStr)
local sign = offset < 0 and "-" or "+"
local eventStr = string.format("%s[%s]%s ce%s%0.0fm @ %0.2fm < %0.2fm", disableTrackingStr, pacenote.name, causedCompletionStr or '', sign, math.abs(offset), relativeDistCeOffset, self.staticDistanceThresholdMeters)
log('D', logTag, eventStr)
if markPacenoteAsCompleteThisTick then causedCompletionStr = "[C]" end
local eventStr = string.format("%s[%s]%s ce static @ %0.2fm < %0.2fm", disableTrackingStr, pacenote.name, causedCompletionStr or '', relativeDistCe, self.staticDistanceThresholdMeters)
log('D', logTag, eventStr)
-- local vDist = vPos:distance(self.lastVPos)
-- print(string.format("vDist: %0.3fm vSpeed: %0.3fm/s", vDist, vSpeed))
-- end
if evalPacenote then
-- log('D', logTag, string.format('evaluating pacenote idx=%d name=%s', i, pacenote.name))
-- gcprobe() -- majority coming from here
else
-- log('W', logTag, string.format('no pacenote found for idx=%d', i))
end
-- bypass this tick if the speed is very high, which indicates a reset.
-- log('W', logTag, string.format('detected insane speed > 1000mph speed=%0.2fmph recalcNeeded=%s', speedMph, tostring(self.recalcNeeded)))
return
if dist and dist >= 0 then
return string.format("%.2fkm", dist / 1000)
else
self.raceCompletionData.distPct = distPct
self.raceCompletionData.distKm = string.format("%.2fkm", distM / 1000)
self.raceCompletionData.totalDistM = raceDistM
txtPos,
String(string.format("%0.1fm | %s[%s]%s", relativeDist, pacenoteName, wpType, pacenoteText)),
clrFg, true, false, clrIBg
local fmt = v % 1 == 0 and "%d" or "%.5f"
return string.format(fmt, v)
elseif type(v) == "boolean" then
pos,
string.format("%d", i),
clrFg,
pos,
string.format("i=%d %s", i, tableToOneLineString(pointFields)),
clrFg,
-- clrIBg = ColorI(150, 150, 150, 255)
-- debugDrawer:drawTextAdvanced(pos, string.format("i=%d no metadata", i), clrFg, true, false, clrIBg)
-- end
distStr = string.format(" | %s=%0.2fkm from_start=%0.3fm abs=%0.3fm", splitLabel, splitDistKm, distFromStart, point.distToTarget)
end
pos,
String(string.format(formatStr, fixedStr, source, stableId, distStr)),
textFg,
-- txtPos.z = txtPos.z + zOffset
-- debugDrawer:drawTextAdvanced(txtPos, String(string.format("%0.1fm | %s[%s]", relativeDist, pacenoteName, wpType)), clrFg, true, false, clrIBg)
-- drawn = drawn + 1
@/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/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/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/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/editor/forestEditor.lua
local popupId = string.format("%d##textureSet_Preview_Popup", id)
if im.BeginPopup(popupId) then
end
if im.Button(string.format("Remove texture##%d", id)) then
pM_textureSets.data[selectedTextureSetIdStr][id] = ""
local img = editor.getTempTextureObj(imgPath)
if im.ImageButton(string.format("TextureSetImageButton_%d", id), img.texId, im.ImVec2(imgSize, imgSize)) then
editor_fileDialog.openFile(
end
im.tooltip(string.format("%s\n%s\nLMB: Select texture\nRMB: Open context menu", tooltip, (pM_textureSets.data[selectedTextureSetIdStr] and pM_textureSets.data[selectedTextureSetIdStr][id]) and pM_textureSets.data[selectedTextureSetIdStr][id] or "-none-"))
end
im.Indent()
if im.Selectable1(string.format("%d##pMTextureSetList", i), i == pM_selectedTextureSetId and true or false) then
if pM_selectedTextureSetId ~= i then
if pM_selectedTextureSetId > 0 then
im.TextUnformatted(string.format("Selected texture set: %d", pM_selectedTextureSetId))
im.SameLine()
pM_textureSetsFilePath = string.format("%sart/parallaxMappingTextureSets.json", path.split(getMissionFilename()))
readOrIntializeParallaxMappingTextureSets()
@/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/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/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/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/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/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)}
}
@/inspector/Views/TimelineTreeElement.js
{
let tooltip = WI.UIString("Close %s timeline view").format(this.mainTitle);
let button = new WI.TreeElementStatusButton(WI.ImageUtilities.useSVGSymbol("Images/CloseLarge.svg", "close-button", tooltip));
@/inspector/Views/StyleOriginView.js
this.element.title = WI.UIString("%s cannot be modified").format(styleTitle);
}
@/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/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/gameplay/rally/loop/stagedCountdownTest.lua
self.environmentStartTimeSecs = adjustedHours * 3600 -- Convert to seconds
log('D', logTag, string.format('Test mode: environment start time: %.0f seconds', self.environmentStartTimeSecs))
else
log('D', logTag, string.format('Test mode: scheduled event at epoch %.2f (wall clock %.2f, in %.2f seconds)',
self.scheduledEventTime, targetWallClockSecs, self.scheduledEventTime - self.epoch))
log('D', logTag, string.format('Test mode: Rescheduled from %.2f to %.2f (attempt %d/%d)',
oldTime, self.scheduledEventTime, rescheduleCount + 1, maxReschedules))
@/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, {
@/inspector/Models/CSSStyleSheet.js
return WI.UIString("Anonymous StyleSheet %d").format(this._uniqueDisplayNameNumber);
}
@/lua/ge/extensions/gameplay/traffic/vehicle.lua
if not obj then
log('E', logTag, string.format('Failed to initialize traffic vehicle: %d', id))
return
if not modelData or not arrayFindValueIndex({'car', 'truck', 'automation', 'traffic', 'proptraffic', 'player'}, modelType) or obj.ignoreTraffic then
log('I', logTag, string.format('Ignoring traffic vehicle due to invalid vehicle type: %d', id))
return
if modelData.Name then
modelName = modelData.Brand and string.format('%s %s', modelData.Brand, modelData.Name) or modelData.Name
end
local tempModel = core_vehicles.getModelList().models[key] or {Name = 'Unknown'}
modelName = tempModel.Brand and string.format('%s %s', tempModel.Brand, tempModel.Name) or tempModel.Name
end
role = 'police'
log('I', logTag, string.format('Assigning police role using file name method: %d', self.id))
end
local obj = getObjectByID(self.id)
obj:queueLuaCommand(string.format('ai.setMode("%s")', mode))
if mode == 'traffic' then
obj:queueLuaCommand(string.format('ai.setAggression(%.3f)', self.vars.baseAggression))
obj:queueLuaCommand('ai.setSpeedMode("legal")')
if mode == 'flee' or mode == 'chase' then
obj:queueLuaCommand(string.format('ai.setAggression(%.3f)', max(0.8, self.vars.baseAggression)))
obj:queueLuaCommand('ai.setAggressionMode("off")')
else
obj:queueLuaCommand(string.format('ai.setAggression(%.3f)', self.vars.baseAggression))
end
local aggression = params.aggression or params.baseAggression
obj:queueLuaCommand(string.format('ai.setAggression(%.3f)', aggression))
end
obj:queueLuaCommand('ai.setSpeedMode("limit")')
obj:queueLuaCommand(string.format('ai.setSpeed(%.3f)', params.speedLimit))
else -- force legal speed
if params.aiAware then
obj:queueLuaCommand(string.format('ai.setAvoidCars("%s")', params.aiAware))
end
else
obj:queueLuaCommand(string.format('ai.setVehicleDebugMode({debugMode = "%s"})', self.vars.aiDebug))
end
if self.state == 'active' and self.alpha < 1 then
log('W', logTag, string.format('Vehicle that should be visible is invisible: %d', self.id))
end
if self.damage >= 500 and self.respawnActive and self.alpha > 0 then
log('W', logTag, string.format('Traffic vehicle respawned with big damage: %d', self.id))
self:fade(1)
@/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"
@/inspector/Views/MemoryTimelineOverviewGraph.js
this._legendElement.hidden = false;
this._legendElement.textContent = WI.UIString("Maximum Size: %s").format(Number.bytesToString(this._maxSize));
}
@/lua/ge/map.lua
--log('D', 'map', "generating roads took " .. string.format("%2.3f ms", timer:stopAndReset()))
be:sendToMailbox("mapData", lpack.encodeBinWorkBuffer(
if objbuildSerial ~= buildSerial then
be:queueObjectLua(objId, string.format("mapmgr.setMap(%d)", buildSerial))
if signalsDict and next(signalsDict) then
be:queueObjectLua(objId, string.format("mapmgr.setSignals(%s)", serialize(signalsDict)))
end
@/ui/ui-vue/src/bridge/libs/UIUnits.js
maximumFractionDigits: numDecs
}).format(helper.val)
return formattedVal + ' ' + helper.unit
minimumFractionDigits: 2
}).format(+x)
}
@/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/editor/sensorConfigurationEditor.lua
im.Text("Forward/Backward")
im.PlotLines1("##forward/backward", plotData.accX, plotLen, nextOffset, string.format("%+7.2f m/s²", plotData.lastAccX), FLT_MAX, FLT_MAX, plotSize)
im.Text("Right/Left")
im.Text("Right/Left")
im.PlotLines1("##right/left", plotData.accY, plotLen, nextOffset, string.format("%+7.2f m/s²", plotData.lastAccY), FLT_MAX, FLT_MAX, plotSize)
im.Text("Up/Down")
im.Text("Up/Down")
im.PlotLines1("##up/down", plotData.accZ, plotLen, nextOffset, string.format("%+7.2f m/s²", plotData.lastAccZ), FLT_MAX, FLT_MAX, plotSize)
im.Spacing()
im.Text("Pitch")
im.PlotLines1("##angVelX", plotData.angVelX, plotLen, nextOffset, string.format("%+7.3f rad/s", plotData.lastAngVelX), FLT_MAX, FLT_MAX, plotSize)
im.Text("Roll")
im.Text("Roll")
im.PlotLines1("##angVelY", plotData.angVelY, plotLen, nextOffset, string.format("%+7.3f rad/s", plotData.lastAngVelY), FLT_MAX, FLT_MAX, plotSize)
im.Text("Yaw")
im.Text("Yaw")
im.PlotLines1("##angVelZ", plotData.angVelZ, plotLen, nextOffset, string.format("%+7.3f rad/s", plotData.lastAngVelZ), FLT_MAX, FLT_MAX, plotSize)
else
im.Spacing()
im.Text(string.format("Range: %.2f m - %.2f m", minDist, maxDist))
im.Spacing()
if currentDist then
im.Text(string.format("Current: %.2f m", currentDist))
im.Spacing()
@/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/vehicle/extensions/tech/vehiclePOI.lua
numWheels = ctr - 1 }
obj:queueGameEngineLua(string.format("%s(%q)", callback, lpack.encode(cData)))
end
@/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/CPUTimelineView.js
let p1 = this._energyInfoPopoverContentElement.appendChild(document.createElement("p"));
p1.textContent = WI.UIString("Periods of high CPU utilization will rapidly drain battery. Strive to keep idle pages under %s average CPU utilization.").format(lowPercent);
let millisecondsStringNoDecimal = WI.UIString("%.0fms").format(nonIdleSamplesCount);
samplesElement.textContent = millisecondsStringNoDecimal;
for (let [key, entry] of sorted) {
let numberValue = entry.repeating ? WI.UIString("~%s", "Approximate Number", "Approximate count of events").format(entry.count) : entry.count;
let sourceCodeLocation = entry.callFrame ? entry.callFrame.sourceCodeLocation : entry.sourceCodeLocation;
this._energyImpactNumberElement.textContent = WI.UIString("Average CPU: %s").format(Number.percentageString(average / 100));
let durationDisplayString = Math.floor(visibleDuration);
this._energyImpactDurationElement.textContent = WI.UIString("Duration: %ss", "The duration of the Timeline recording in seconds (s).").format(durationDisplayString);
}
@/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
@/inspector/External/three.js/three.js
// film not completely covered in portrait format (aspect < 1)
return this.filmGauge * Math.min( this.aspect, 1 );
// film not completely covered in landscape format (aspect > 1)
return this.filmGauge / Math.max( this.aspect, 1 );
@/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/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()
@/inspector/Models/Script.js
console.assert(this._uniqueDisplayNameNumber);
return WI.UIString("Console Evaluation %d").format(this._uniqueDisplayNameNumber);
}
if (this._dynamicallyAddedScriptElement)
return WI.UIString("Script Element %d").format(this._dynamicallyAddedScriptElementNumber);
return WI.UIString("Anonymous Script %d").format(this._uniqueDisplayNameNumber);
}
@/gameplay/missionTypes/scatterPickup/customNodes/scatterAnimatorNode.lua
--debugDrawer:drawTextAdvanced(icon.pos, String(string.format("%d / %d", icon.remaining, icon.points)), ColorF(1,1,1,1), true, false, ColorI(0,0,0,192))
if icon.visible then
@/lua/ge/extensions/career/modules/playerAttributes.lua
}
log("W","",string.format("Changed attributes '%s' without giving a reason!", table.concat( tableKeysSorted(change), ", ")))
end
for oldName, newName in pairs(updatedNames) do
msg = msg .. string.format("\n %s -> %s", oldName, newName)
end
--local key = "money"
--changeText = changeText .. string.format('%s: %s%0.2f', key, change.attributeChange[key] > 0 and "+" or "", change.attributeChange[key])
end
-- changeText = changeText .. string.format('%s: %s%0.2f
', key, change.attributeChange[key] > 0 and "+" or "", change.attributeChange[key])
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/gameplay/race/race.lua
}
print(string.format("T: %0.6f", finishedSegmentT))
-- get correct startTime for this segment
local millis = (time - minutes*60 - seconds)*1000
return string.format("%02d:%02d.%03d",minutes, seconds, millis)
end
return sign .. string.format("%02d:%02d.%03d", minutes, seconds, millis)
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/editor/api/dynamicDecals/textures.lua
-- for k, v in pairs(tagsWithRefs) do
-- print(string.format("%s : %d", k, #v))
-- end
@/inspector/Views/CPUUsageView.js
this._detailsUsageElement.hidden = false;
this._detailsUsageElement.textContent = WI.UIString("Usage: %s").format(usage);
}
this._detailsAverageElement.hidden = !Number.isFinite(averageSize);
this._detailsAverageElement.textContent = WI.UIString("Average: %s").format(Number.isFinite(averageSize) ? Number.percentageString(averageSize / 100) : emDash);
}
@/lua/ge/extensions/flowgraph/nodes/gameplay/crawl/setupCrawl.lua
log('D', 'SetupCrawl', string.format('Input values - trailId: "%s", vehicleId: %s', tostring(trailId), tostring(vehicleId)))
trailId = trailFileVar
log('D', 'SetupCrawl', string.format('Found trail file from flowgraph variable: %s', trailId))
end
local missionFolder = self.mgr.activity.missionFolder
log('D', 'SetupCrawl', string.format('Checking mission folder: %s', missionFolder))
trailId = trailFiles[1]
log('D', 'SetupCrawl', string.format('Found trail file in mission folder: %s', trailId))
end
log('D', 'SetupCrawl', string.format('Trail loaded successfully - name: "%s", pathId: "%s", boundaryId: "%s", startingPositionId: "%s"',
tostring(trail.name), tostring(trail.pathId), tostring(trail.boundaryId), tostring(trail.startingPositionId)))
local vehicleIdToUse = vehicleId > 0 and vehicleId or nil
log('D', 'SetupCrawl', string.format('Calling bridge.setupCrawl with vehicleId: %s', tostring(vehicleIdToUse)))
if self.bridge.setupCrawl(vehicleIdToUse, trail) then
@/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
@/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/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/editor/crawlEditor.lua
dump(string.format('[CRAWL_EDITOR] Found files - Trails: %d, Paths: %d, Boundaries: %d, Starting Positions: %d',
#trailFiles, #pathFiles, #boundaryFiles, #startingPositionFiles))
dump(string.format('[CRAWL_EDITOR] Loaded %d trails, %d mission trails, %d paths, %d mission paths, %d boundaries, %d mission boundaries, %d starting positions', #allTrails, #missionTrails, #allPaths, #missionPaths, #allBoundaries, #missionBoundaries, #allStartingPositions))
end
return string.format("%03d", maxNumber + 1)
end
else
log('E', 'crawl_editor', string.format('Unknown object type: %s', type))
return false
log('D', 'crawl_editor', string.format('Successfully created and saved new %s to: %s', type, filePath))
else
else
log('E', 'crawl_editor', string.format('Failed to create and save new %s to: %s', type, filePath))
end
movedCount = movedCount + 1
log('D', 'crawl_editor', string.format('Moved trail (%s) to mission', trail._fileName or 'unnamed'))
end
trail._dirty = false
log('D', 'crawl_editor', string.format('Marked trail (%s) as clean after Save All', trail._fileName or 'unnamed'))
end
movedCount = movedCount + 1
log('D', 'crawl_editor', string.format('Moved trail (%s) to level', trail._fileName or 'unnamed'))
end
trail._dirty = false
log('D', 'crawl_editor', string.format('Marked mission trail (%s) as clean after Save All', trail._fileName or 'unnamed'))
end
path._dirty = false
log('D', 'crawl_editor', string.format('Marked path (%s) as clean after Save All', path._fileName or 'unnamed'))
end
path._dirty = false
log('D', 'crawl_editor', string.format('Marked mission path (%s) as clean after Save All', path._fileName or 'unnamed'))
end
boundary._dirty = false
log('D', 'crawl_editor', string.format('Marked boundary (%s) as clean after Save All', boundary._fileName or 'unnamed'))
end
boundary._dirty = false
log('D', 'crawl_editor', string.format('Marked mission boundary (%s) as clean after Save All', boundary._fileName or 'unnamed'))
end
startingPosition._dirty = false
log('D', 'crawl_editor', string.format('Marked starting position (%s) as clean after Save All', startingPosition._fileName or 'unnamed'))
end
@/inspector/Controllers/Formatter.js
format(from, to)
{
@/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/editor/missionEditor/setupModules.lua
local secs = math.floor(seconds - hours * 3600 - mins * 60)
return string.format("%02d:%02d:%02d", hours, mins, secs)
end
@/lua/ge/extensions/editor/meshEditor.lua
end
debugDrawer:drawTextAdvanced(pos, String(M.niceName .. " Width: " .. string.format("%.2f", mesh:getNodeWidth(tempNodeIndex)) .. ". Change width by dragging."), whiteF, true, false, blackI)
end
local middlePos = (pos + nextNodePos) / 2
debugDrawer:drawTextAdvanced(middlePos, String(string.format("%.2f m", nextNodePos.z - pos.z)), whiteF, true, false, blackI)
debugDrawer:drawSphere(focusPointNoMesh, editor.getPreference(M.preferencesName .. ".general.defaultWidth")/2, roadRiverGui.highlightColors.nodeTransparent, false)
debugDrawer:drawTextAdvanced(focusPointNoMesh, String(M.niceName .. " Width: " .. string.format("%.2f", editor.getPreference(M.preferencesName .. ".general.defaultWidth")) .. (editor.getPreference(M.preferencesName .. ".general.dragWidth") and ". Change width by dragging." or "")), ColorF(1.0,1.0,1.0,1), true, false, blackI)
end
@/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/editor/rallyEditor/measurementsTab.lua
local measurementLabelPos = pos + vec3(0, 0, 4) -- higher up for visibility
local distanceText = string.format("%s | %.2fm", measurement.name, measurement.totalDistance)
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
local isSelected = measurement.id == self.selectedMeasurementId
local displayText = string.format("%s (%.2fm, %d points)",
measurement.name,
im.Text(string.format("Total Distance: %.2f meters", selectedMeasurement.totalDistance))
im.Text(string.format("Number of Points: %d", #selectedMeasurement.points))
im.Text(string.format("Total Distance: %.2f meters", selectedMeasurement.totalDistance))
im.Text(string.format("Number of Points: %d", #selectedMeasurement.points))
local isPointSelected = i == self.selectedPointIndex
local pointText = string.format("Point %d: (%.1f, %.1f, %.1f)",
i, point.x, point.y, point.z)
@/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)
@/lua/ge/extensions/scenario/raceMarkers/sideMarker.lua
--debugDrawer:drawText(self.pos, String(string.format("%0.3f %s",t, self.blendState or "non")), ColorF(0, 0, 0, 1))
local a = 1
@/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)
@/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/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/flowgraph/nodes/gameplay/rally/raceEditorPath.lua
if missionManagerMissionId then
-- log('D', '', string.format('RallyMode using missionManager race file missionId=%s raceFileFname=%s raceFileSource=%s', missionManagerMissionId, raceFileFname, raceFileSource))
return 'race.race.json', 'Mission'
if fname and fname ~= '/gameplay/races/new.path.json' and fname ~= '/gameplay/races/NewRace.race.json' then
-- log('D', '', string.format('RallyMode using editor race file fname=%s raceFileFname=%s raceFileSource=%s', fname, fname, 'Editor'))
return fname, 'Editor'
local raceFileFname, raceFileSource = loadCurrentRaceFileState()
log('D', 'raceEditorPath.workOnce', string.format('RallyMode using race file from %s: %s', raceFileSource, raceFileFname))
self.pinOut.fname.value = raceFileFname
@/lua/ge/extensions/ui/apps/minimap/additionalInfo.lua
oldDistToTarget = distToTarget
additionalInfo.distToTarget = string.format("%.1f %s", distToTarget, unit)
hasNewAdditionalInfo = true
@/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])
@/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/rallyEditor/drivelineTab.lua
end
local dist_str = string.format("%.3f"..unit, dist)
return dist_str
-- Convert final points to spline format (they need normals)
local pointsWithNormals = {}
self.calculatedRaceDistance = distance
log('I', logTag, string.format('Calculated race distance: %.2fm', distance))
else
local elapsed = os.clock() - startTime
log('I', logTag, string.format('Generated buffer with %d circles in %.3fs', #self.bufferPoints, elapsed))
return true
local speedLimitMph = speedLimitPtr[0] * 0.621371
local label = string.format("Speed Limit kph (%.0f mph)", speedLimitMph)
if im.InputFloat(label, speedLimitPtr, 1.0, 10.0, "%.0f") then
else
im.Text(string.format("Buffer: %d circles, %.0fm radius", #self.bufferPoints, self.bufferRadius))
@/inspector/Controllers/AuditManager.js
{
message = WI.UIString("Audit Warning: %s").format(message);
{
message = WI.UIString("Audit Error: %s").format(message);
&& json.type !== WI.AuditTestCaseResult.TypeIdentifier && json.type !== WI.AuditTestGroupResult.TypeIdentifier) {
WI.AuditManager.synthesizeError(WI.UIString("unknown %s \u0022%s\u0022").format(WI.unlocalizedString("type"), json.type));
return;
if (object instanceof WI.AuditTestResultBase)
filename = WI.UIString("%s Result").format(filename);
new WI.AuditTestCase("getElementsByComputedRole", removeWhitespace(getElementsByComputedRole), {description: WI.UIString("This test will pass with all DOM nodes that have a computed role of \u0022link\u0022."), supports: 1}),
new WI.AuditTestCase("getActiveDescendant", removeWhitespace(getActiveDescendant), {description: WI.UIString("This test will pass with the active descendant (\u0022%s\u0022) of the element, if it exists.").format(WI.unlocalizedString("aria-activedescendant")), supports: 1}),
new WI.AuditTestCase("getChildNodes", removeWhitespace(getChildNodes), {description: WI.UIString("This test will pass with all of the child nodes of the element in the accessibility tree."), supports: 1}),
new WI.AuditTestCase("getComputedProperties", removeWhitespace(getComputedProperties), {description: WI.UIString("This test will pass with a variety of accessibility information about the element."), supports: 3}),
new WI.AuditTestCase("getControlledNodes", removeWhitespace(getControlledNodes), {description: WI.UIString("This test will pass with all nodes controlled (\u0022%s\u0022) by the element, if any exist.").format(WI.unlocalizedString("aria-controls")), supports: 1}),
new WI.AuditTestCase("getFlowedNodes", removeWhitespace(getFlowedNodes), {description: WI.UIString("This test will pass with all nodes flowed to (\u0022%s\u0022) from the element, if any exist.").format(WI.unlocalizedString("aria-flowto")), supports: 1}),
new WI.AuditTestCase("getControlledNodes", removeWhitespace(getControlledNodes), {description: WI.UIString("This test will pass with all nodes controlled (\u0022%s\u0022) by the element, if any exist.").format(WI.unlocalizedString("aria-controls")), supports: 1}),
new WI.AuditTestCase("getFlowedNodes", removeWhitespace(getFlowedNodes), {description: WI.UIString("This test will pass with all nodes flowed to (\u0022%s\u0022) from the element, if any exist.").format(WI.unlocalizedString("aria-flowto")), supports: 1}),
new WI.AuditTestCase("getMouseEventNode", removeWhitespace(getMouseEventNode), {description: WI.UIString("This test will pass with the node that would handle mouse events for the element, if applicable."), supports: 1}),
new WI.AuditTestCase("getMouseEventNode", removeWhitespace(getMouseEventNode), {description: WI.UIString("This test will pass with the node that would handle mouse events for the element, if applicable."), supports: 1}),
new WI.AuditTestCase("getOwnedNodes", removeWhitespace(getOwnedNodes), {description: WI.UIString("This test will pass with all nodes owned (\u0022%s\u0022) by the element, if any exist.").format(WI.unlocalizedString("aria-owns")), supports: 1}),
new WI.AuditTestCase("getParentNode", removeWhitespace(getParentNode), {description: WI.UIString("This test will pass with the parent node of the element in the accessibility tree."), supports: 1}),
new WI.AuditTestCase("getParentNode", removeWhitespace(getParentNode), {description: WI.UIString("This test will pass with the parent node of the element in the accessibility tree."), supports: 1}),
new WI.AuditTestCase("getSelectedChildNodes", removeWhitespace(getSelectedChildNodes), {description: WI.UIString("This test will pass with all child nodes that are selected (\u0022%s\u0022) of the element in the accessibility tree.").format(WI.unlocalizedString("aria-selected")), supports: 1}),
], {description: WI.UIString("These tests demonstrate how to use %s to get information about the accessibility tree.").format(WI.unlocalizedString("WebInspectorAudit.Accessibility")), supports: 1}),
new WI.AuditTestCase("getSelectedChildNodes", removeWhitespace(getSelectedChildNodes), {description: WI.UIString("This test will pass with all child nodes that are selected (\u0022%s\u0022) of the element in the accessibility tree.").format(WI.unlocalizedString("aria-selected")), supports: 1}),
], {description: WI.UIString("These tests demonstrate how to use %s to get information about the accessibility tree.").format(WI.unlocalizedString("WebInspectorAudit.Accessibility")), supports: 1}),
new WI.AuditTestGroup(WI.UIString("DOM"), [
new WI.AuditTestCase("hasEventListeners-click", removeWhitespace(hasEventListenersClick), {description: WI.UIString("This test will pass with data indicating whether the element has any click event listeners."), supports: 3}),
], {description: WI.UIString("These tests demonstrate how to use %s to get information about DOM nodes.").format(WI.unlocalizedString("WebInspectorAudit.DOM")), supports: 1}),
new WI.AuditTestGroup(WI.UIString("Resources"), [
new WI.AuditTestCase("getResourceContent", removeWhitespace(getResourceContent), {description: WI.UIString("This test will pass with the contents of the main resource."), supports: 3}),
], {description: WI.UIString("These tests demonstrate how to use %s to get information about loaded resources.").format(WI.unlocalizedString("WebInspectorAudit.Resources")), supports: 2}),
], {description: WI.UIString("These tests demonstrate how to use %s to access information not normally available to JavaScript.").format(WI.unlocalizedString("WebInspectorAudit")), supports: 1}),
], {description: WI.UIString("These tests demonstrate how to use %s to get information about loaded resources.").format(WI.unlocalizedString("WebInspectorAudit.Resources")), supports: 2}),
], {description: WI.UIString("These tests demonstrate how to use %s to access information not normally available to JavaScript.").format(WI.unlocalizedString("WebInspectorAudit")), supports: 1}),
], {description: WI.UIString("These tests serve as a demonstration of the functionality and structure of audits.")}),
new WI.AuditTestGroup(WI.UIString("Accessibility"), [
new WI.AuditTestCase("testMenuRoleForRequiredChidren", removeWhitespace(testMenuRoleForRequiredChidren), {description: WI.UIString("Ensure that element of role \u0022%s\u0022 and \u0022%s\u0022 have required owned elements in accordance with WAI-ARIA.").format(WI.unlocalizedString("menu"), WI.unlocalizedString("menubar")), supports: 1}),
new WI.AuditTestCase("testGridRoleForRequiredChidren", removeWhitespace(testGridRoleForRequiredChidren), {description: WI.UIString("Ensure that elements of role \u0022%s\u0022 have required owned elements in accordance with WAI-ARIA.").format(WI.unlocalizedString("grid")), supports: 1}),
new WI.AuditTestCase("testMenuRoleForRequiredChidren", removeWhitespace(testMenuRoleForRequiredChidren), {description: WI.UIString("Ensure that element of role \u0022%s\u0022 and \u0022%s\u0022 have required owned elements in accordance with WAI-ARIA.").format(WI.unlocalizedString("menu"), WI.unlocalizedString("menubar")), supports: 1}),
new WI.AuditTestCase("testGridRoleForRequiredChidren", removeWhitespace(testGridRoleForRequiredChidren), {description: WI.UIString("Ensure that elements of role \u0022%s\u0022 have required owned elements in accordance with WAI-ARIA.").format(WI.unlocalizedString("grid")), supports: 1}),
new WI.AuditTestCase("testForAriaLabelledBySpelling", removeWhitespace(testForAriaLabelledBySpelling), {description: WI.UIString("Ensure that \u0022%s\u0022 is spelled correctly.").format(WI.unlocalizedString("aria-labelledby")), supports: 1}),
new WI.AuditTestCase("testGridRoleForRequiredChidren", removeWhitespace(testGridRoleForRequiredChidren), {description: WI.UIString("Ensure that elements of role \u0022%s\u0022 have required owned elements in accordance with WAI-ARIA.").format(WI.unlocalizedString("grid")), supports: 1}),
new WI.AuditTestCase("testForAriaLabelledBySpelling", removeWhitespace(testForAriaLabelledBySpelling), {description: WI.UIString("Ensure that \u0022%s\u0022 is spelled correctly.").format(WI.unlocalizedString("aria-labelledby")), supports: 1}),
new WI.AuditTestCase("testForMultipleBanners", removeWhitespace(testForMultipleBanners), {description: WI.UIString("Ensure that only one banner is used on the page."), supports: 1}),
new WI.AuditTestCase("testForLinkLabels", removeWhitespace(testForLinkLabels), {description: WI.UIString("Ensure that links have accessible labels for assistive technology."), supports: 1}),
new WI.AuditTestCase("testRowGroupRoleForRequiredChidren", removeWhitespace(testRowGroupRoleForRequiredChidren), {description: WI.UIString("Ensure that element of role \u0022%s\u0022 have required owned elements in accordance with WAI-ARIA.").format(WI.unlocalizedString("rowgroup")), supports: 1}),
new WI.AuditTestCase("testTableRoleForRequiredChidren", removeWhitespace(testTableRoleForRequiredChidren), {description: WI.UIString("Ensure that elements of role \u0022%s\u0022 have required owned elements in accordance with WAI-ARIA.").format(WI.unlocalizedString("table")), supports: 1}),
new WI.AuditTestCase("testRowGroupRoleForRequiredChidren", removeWhitespace(testRowGroupRoleForRequiredChidren), {description: WI.UIString("Ensure that element of role \u0022%s\u0022 have required owned elements in accordance with WAI-ARIA.").format(WI.unlocalizedString("rowgroup")), supports: 1}),
new WI.AuditTestCase("testTableRoleForRequiredChidren", removeWhitespace(testTableRoleForRequiredChidren), {description: WI.UIString("Ensure that elements of role \u0022%s\u0022 have required owned elements in accordance with WAI-ARIA.").format(WI.unlocalizedString("table")), supports: 1}),
new WI.AuditTestCase("testForMultipleLiveRegions", removeWhitespace(testForMultipleLiveRegions), {description: WI.UIString("Ensure that only one live region is used on the page."), supports: 1}),
new WI.AuditTestCase("testForMultipleLiveRegions", removeWhitespace(testForMultipleLiveRegions), {description: WI.UIString("Ensure that only one live region is used on the page."), supports: 1}),
new WI.AuditTestCase("testListBoxRoleForRequiredChidren", removeWhitespace(testListBoxRoleForRequiredChidren), {description: WI.UIString("Ensure that elements of role \u0022%s\u0022 have required owned elements in accordance with WAI-ARIA.").format(WI.unlocalizedString("listbox")), supports: 1}),
new WI.AuditTestCase("testImageLabels", removeWhitespace(testImageLabels), {description: WI.UIString("Ensure that elements of role \u0022%s\u0022 have accessible labels for assistive technology.").format(WI.unlocalizedString("img")), supports: 1}),
new WI.AuditTestCase("testListBoxRoleForRequiredChidren", removeWhitespace(testListBoxRoleForRequiredChidren), {description: WI.UIString("Ensure that elements of role \u0022%s\u0022 have required owned elements in accordance with WAI-ARIA.").format(WI.unlocalizedString("listbox")), supports: 1}),
new WI.AuditTestCase("testImageLabels", removeWhitespace(testImageLabels), {description: WI.UIString("Ensure that elements of role \u0022%s\u0022 have accessible labels for assistive technology.").format(WI.unlocalizedString("img")), supports: 1}),
new WI.AuditTestCase("testForAriaHiddenFalse", removeWhitespace(testForAriaHiddenFalse), {description: WI.UIString("Ensure aria-hidden=\u0022%s\u0022 is not used.").format(WI.unlocalizedString("false")), supports: 1}),
new WI.AuditTestCase("testImageLabels", removeWhitespace(testImageLabels), {description: WI.UIString("Ensure that elements of role \u0022%s\u0022 have accessible labels for assistive technology.").format(WI.unlocalizedString("img")), supports: 1}),
new WI.AuditTestCase("testForAriaHiddenFalse", removeWhitespace(testForAriaHiddenFalse), {description: WI.UIString("Ensure aria-hidden=\u0022%s\u0022 is not used.").format(WI.unlocalizedString("false")), supports: 1}),
new WI.AuditTestCase("testTreeRoleForRequiredChidren", removeWhitespace(testTreeRoleForRequiredChidren), {description: WI.UIString("Ensure that element of role \u0022%s\u0022 have required owned elements in accordance with WAI-ARIA.").format(WI.unlocalizedString("tree")), supports: 1}),
new WI.AuditTestCase("testForAriaHiddenFalse", removeWhitespace(testForAriaHiddenFalse), {description: WI.UIString("Ensure aria-hidden=\u0022%s\u0022 is not used.").format(WI.unlocalizedString("false")), supports: 1}),
new WI.AuditTestCase("testTreeRoleForRequiredChidren", removeWhitespace(testTreeRoleForRequiredChidren), {description: WI.UIString("Ensure that element of role \u0022%s\u0022 have required owned elements in accordance with WAI-ARIA.").format(WI.unlocalizedString("tree")), supports: 1}),
new WI.AuditTestCase("testRadioGroupRoleForRequiredChidren", removeWhitespace(testRadioGroupRoleForRequiredChidren), {description: WI.UIString("Ensure that element of role \u0022%s\u0022 have required owned elements in accordance with WAI-ARIA.").format(WI.unlocalizedString("radiogroup")), supports: 1}),
new WI.AuditTestCase("testTreeRoleForRequiredChidren", removeWhitespace(testTreeRoleForRequiredChidren), {description: WI.UIString("Ensure that element of role \u0022%s\u0022 have required owned elements in accordance with WAI-ARIA.").format(WI.unlocalizedString("tree")), supports: 1}),
new WI.AuditTestCase("testRadioGroupRoleForRequiredChidren", removeWhitespace(testRadioGroupRoleForRequiredChidren), {description: WI.UIString("Ensure that element of role \u0022%s\u0022 have required owned elements in accordance with WAI-ARIA.").format(WI.unlocalizedString("radiogroup")), supports: 1}),
new WI.AuditTestCase("testFeedRoleForRequiredChidren", removeWhitespace(testFeedRoleForRequiredChidren), {description: WI.UIString("Ensure that elements of role \u0022%s\u0022 have required owned elements in accordance with WAI-ARIA.").format(WI.unlocalizedString("feed")), supports: 1}),
new WI.AuditTestCase("testRadioGroupRoleForRequiredChidren", removeWhitespace(testRadioGroupRoleForRequiredChidren), {description: WI.UIString("Ensure that element of role \u0022%s\u0022 have required owned elements in accordance with WAI-ARIA.").format(WI.unlocalizedString("radiogroup")), supports: 1}),
new WI.AuditTestCase("testFeedRoleForRequiredChidren", removeWhitespace(testFeedRoleForRequiredChidren), {description: WI.UIString("Ensure that elements of role \u0022%s\u0022 have required owned elements in accordance with WAI-ARIA.").format(WI.unlocalizedString("feed")), supports: 1}),
new WI.AuditTestCase("testTabListRoleForRequiredChidren", removeWhitespace(testTabListRoleForRequiredChidren), {description: WI.UIString("Ensure that element of role \u0022%s\u0022 have required owned elements in accordance with WAI-ARIA.").format(WI.unlocalizedString("tablist")), supports: 1}),
new WI.AuditTestCase("testFeedRoleForRequiredChidren", removeWhitespace(testFeedRoleForRequiredChidren), {description: WI.UIString("Ensure that elements of role \u0022%s\u0022 have required owned elements in accordance with WAI-ARIA.").format(WI.unlocalizedString("feed")), supports: 1}),
new WI.AuditTestCase("testTabListRoleForRequiredChidren", removeWhitespace(testTabListRoleForRequiredChidren), {description: WI.UIString("Ensure that element of role \u0022%s\u0022 have required owned elements in accordance with WAI-ARIA.").format(WI.unlocalizedString("tablist")), supports: 1}),
new WI.AuditTestCase("testButtonLabels", removeWhitespace(testButtonLabels), {description: WI.UIString("Ensure that buttons have accessible labels for assistive technology."), supports: 1}),
new WI.AuditTestCase("testButtonLabels", removeWhitespace(testButtonLabels), {description: WI.UIString("Ensure that buttons have accessible labels for assistive technology."), supports: 1}),
new WI.AuditTestCase("testRowRoleForRequiredChidren", removeWhitespace(testRowRoleForRequiredChidren), {description: WI.UIString("Ensure that elements of role \u0022%s\u0022 have required owned elements in accordance with WAI-ARIA.").format(WI.unlocalizedString("row")), supports: 1}),
new WI.AuditTestCase("testListRoleForRequiredChidren", removeWhitespace(testListRoleForRequiredChidren), {description: WI.UIString("Ensure that elements of role \u0022%s\u0022 have required owned elements in accordance with WAI-ARIA.").format(WI.unlocalizedString("list")), supports: 1}),
new WI.AuditTestCase("testRowRoleForRequiredChidren", removeWhitespace(testRowRoleForRequiredChidren), {description: WI.UIString("Ensure that elements of role \u0022%s\u0022 have required owned elements in accordance with WAI-ARIA.").format(WI.unlocalizedString("row")), supports: 1}),
new WI.AuditTestCase("testListRoleForRequiredChidren", removeWhitespace(testListRoleForRequiredChidren), {description: WI.UIString("Ensure that elements of role \u0022%s\u0022 have required owned elements in accordance with WAI-ARIA.").format(WI.unlocalizedString("list")), supports: 1}),
new WI.AuditTestCase("testComboBoxRoleForRequiredChidren", removeWhitespace(testComboBoxRoleForRequiredChidren), {description: WI.UIString("Ensure that elements of role \u0022%s\u0022 have required owned elements in accordance with WAI-ARIA.").format(WI.unlocalizedString("combobox")), supports: 1}),
new WI.AuditTestCase("testListRoleForRequiredChidren", removeWhitespace(testListRoleForRequiredChidren), {description: WI.UIString("Ensure that elements of role \u0022%s\u0022 have required owned elements in accordance with WAI-ARIA.").format(WI.unlocalizedString("list")), supports: 1}),
new WI.AuditTestCase("testComboBoxRoleForRequiredChidren", removeWhitespace(testComboBoxRoleForRequiredChidren), {description: WI.UIString("Ensure that elements of role \u0022%s\u0022 have required owned elements in accordance with WAI-ARIA.").format(WI.unlocalizedString("combobox")), supports: 1}),
new WI.AuditTestCase("testForMultipleMainContentSections", removeWhitespace(testForMultipleMainContentSections), {description: WI.UIString("Ensure that only one main content section is used on the page."), supports: 1}),
new WI.AuditTestCase("testDialogsForLabels", removeWhitespace(testDialogsForLabels), {description: WI.UIString("Ensure that dialogs have accessible labels for assistive technology."), supports: 1}),
new WI.AuditTestCase("testForInvalidAriaHiddenValue", removeWhitespace(testForInvalidAriaHiddenValue), {description: WI.UIString("Ensure that values for \u0022%s\u0022 are valid.").format(WI.unlocalizedString("aria-hidden")), supports: 1})
], {description: WI.UIString("Diagnoses common accessibility problems affecting screen readers and other assistive technology.")}),
@/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/freeroam/facilities/fuelPrice.lua
end
local priceStr = string.format("%.3f", price):gsub("%.", "")
for i=1, #v2.displayObjects do
@/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/editor/missionEditor/additionalAttributes.lua
local secs = math.floor(seconds - hours * 3600 - mins * 60)
return string.format("%02d:%02d:%02d", hours, mins, secs)
end
local m = listById[mId]
im.Text(string.format("%s - %s - %s",os.date('%Y-%m-%d %H:%M:%S', m.date), translateLanguage(m.name, m.name, true), m.id) )
im.tooltip("Click to remove")
@/inspector/Views/TypeTreeElement.js
var displayName = this._isPrototype ? WI.UIString("%s Prototype").format(name.replace(/Prototype$/, "")) : name;
var nameElement = document.createElement("span");
@/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/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/ge/extensions/flowgraph/nodes/mission/selectGarage2GarageZones.lua
log("I","",string.format("G2G Route: %s/%s to %s/%s direct distance: %0.1f",
self.pinOut.startSpot.value, self.pinOut.startLocation.value,
@/lua/ge/extensions/career/modules/delivery/parcelManager.lua
if cargo._transientMove then
log("E","",string.format("Cargo %d already has a transient move: %s!", cargoId, dumps(move)))
return
cargo.rewards.money = cargo.slots
log("I","",string.format("Merged Cargo %d into %d.", movedCargo.id, cargo.id))
end
if loc.type == "facilityParkingspot" then
return string.format("%s",
dGenerator.getFacilityById(loc.facId).name)
if be:getPlayerVehicleID(0) == loc.vehId then
return string.format("Current Vehicle (%d)", loc.vehId)
else
else
return string.format("Other Vehicle (%d)", loc.vehId)
end
end
return string.format("%d possible locations",#loc.destinations)
else
local ps = dGenerator.getParkingSpotByPath(loc.psPath)
return ps.customFields:has("name") and string.format("%s - %s",
dGenerator.getFacilityById(loc.facId).name,
if be:getPlayerVehicleID(0) == loc.vehId then
return string.format("Current Vehicle (%d)", loc.vehId)
else
else
return string.format("Other Vehicle (%d)", loc.vehId)
end
end
return string.format("%d possible locations",#loc.destinations)
elseif loc.type == "playerAvatar" then
local organizationElement = {
label = string.format("Loaner Organization (%d%% cut)", round(organizationCut * 100)),
rewards = {money = -organizationCut * originalRewards.money},
for _, c in ipairs(cargo) do
local gId = string.format("%d-%d", c.groupId, c.loadedAtTimeStamp or -1)
cargoByGroupId[gId] = cargoByGroupId[gId] or {}
if not mod.delayedMessageFlag and expiredTime > mod.timeUntilDelayed then
guihooks.trigger('Message',{clear = nil, ttl = 10, msg = string.format("Delivery of %s to %s is now delayed.",cargo.name, M.getLocationLabelShort(cargo.destination)), category = "delivery", icon = "warning"})
mod.delayedMessageFlag = true
elseif not mod.lateMessageFlag and expiredTime > mod.timeUntilLate then
guihooks.trigger('Message',{clear = nil, ttl = 10, msg = string.format("Delivery of %s to %s is now late.",cargo.name, M.getLocationLabelShort(cargo.destination)), category = "delivery", icon = "warning"})
mod.lateMessageFlag = true
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 _, cargo in ipairs(allCargo) do
@/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/ge/extensions/gameplay/rally/notebook/structured/textCompositor.lua
-- print(string.format("Enumerating from %d to %d with step %d", self.min, self.max, self.step))
local out = {}
log('I', logTag, string.format('Enumerated %d phrases (%d chars) for compositor "%s"',
out.stats.totalPhrases, out.stats.totalChars, self.compositorName))
out.stats.totalPhrases, out.stats.totalChars, self.compositorName))
log('I', logTag, string.format('Details: %d distance calls, %d pacenotes, %d system pacenotes',
out.stats.distancePhrases, out.stats.notePhrases, out.stats.systemPhrases))
@/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/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
@/inspector/Views/RenderingFrameTimelineOverviewGraph.js
label.classList.add("label");
label.innerText = WI.UIString("%d fps").format(framesPerSecond);
divider.appendChild(label);
@/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/editor/toolUtilities/skeleton.lua
log('I', logTag, string.format("bitmapToMask() complete. Range: [%g, %g], threshold: %.3f", minVal, maxVal, threshold))
return mask
@/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/vehicle/damageTracker.lua
if notifyUI then
local notifyKey = string.format("vehicle.%s.%s.%s", group, name, value)
guihooks.message(notifyKey, 5, notifyKey)
@/inspector/Views/HeapSnapshotContentView.js
this._exportButtonNavigationItem = new WI.ButtonNavigationItem("export", WI.UIString("Export"), "Images/Export.svg", 15, 15);
this._exportButtonNavigationItem.tooltip = WI.UIString("Export (%s)").format(WI.saveKeyboardShortcut.displayName);
this._exportButtonNavigationItem.buttonStyle = WI.ButtonNavigationItem.Style.ImageAndText;
];
let filename = WI.UIString("Heap Snapshot %s-%s-%s at %s.%s.%s").format(...values);
WI.FileUtilities.save({
@/lua/vehicle/controller/sound/linearMovement.lua
if printDebug then
print(string.format("%s: position: %.2f, velocity: %.2f, volume: %.2f, pitch: %.2f, isPlaying: %s", M.name, positionSensorBeamLength, movementVelocity, volume, pitch, isPlaying))
end
@/lua/ge/extensions/gameplay/rally/loop/rallyLoopManager.lua
self.wallClockStartTimeSecs = self.environmentStartTimeSecs -- Alias for compatibility
log('D', logTag, string.format('Environment start time: %.0f seconds', self.environmentStartTimeSecs))
else
log('D', logTag, string.format('Rally start time: %.0f seconds (%.2f minutes from environment start)',
rallyStartTimeSecs, (rallyStartTimeSecs - currentTimeSecs) / 60))
local timeStr = self:formatTimeFromSecondsString(wallClockSecs, true, true)
return string.format("%s, Day %d", timeStr, day)
end
if event.missionId == currentMissionId and event.spName == eventName then
-- log('D', logTag, string.format('Found event "%s" for mission "%s" at time %.2f',
-- eventName, currentMissionId, event.time or -1))
log('W', logTag, string.format('Event "%s" not found for current mission "%s"', eventName, currentMissionId))
return nil
if currentEvent.missionId ~= currentMissionId then
log('E', logTag, string.format('Event mission mismatch: event is for mission %s but current mission is %s (entry: %s)',
currentEvent.missionId or 'nil', currentMissionId or 'nil', entryName))
if entryName ~= currentEvent.spName then
log('E', logTag, string.format('Entry name mismatch: expected "%s" but got "%s" for event %d',
currentEvent.spName or 'nil', entryName, self.nextEventIndex))
-- if item.type == 'penalty' and item.data.penaltyType == 'route_recalc' and item.eventId == currentEvent.eventId then
-- log('W', logTag, string.format('Route recalc penalty: +%ds (violation #%d, recalcs: %d)',
-- item.data.amount, item.data.violationNumber, item.data.recalcCount))
-- local modeStr = item.data.strictMode and ' (STRICT)' or ''
-- log('W', logTag, string.format('Speeding penalty: +%ds (%.1f kph over %d kph)%s',
-- item.data.amount, item.data.speedOver, item.data.speedLimit, modeStr))
-- local modeStr = item.data.strictMode and ' (STRICT)' or ''
-- log('W', logTag, string.format('Speeding penalty (service_in): +%ds (%.1f kph over %d kph)%s',
-- item.data.amount, item.data.speedOver, item.data.speedLimit, modeStr))
if timeUntilStartLine < threshold then
log('D', logTag, string.format('TC arrival: %.1fs until start line (< %.1fs threshold), rescheduling',
timeUntilStartLine, threshold))
else
log('D', logTag, string.format('TC arrival: %.1fs until start line (>= %.1fs threshold), no reschedule needed',
timeUntilStartLine, threshold))
event.scheduledTimeWasAdjusted = false
log('D', logTag, string.format('SS start time unchanged at %.2f (calculated %.2f was not later) - %s',
originalTime, newTime, reason))
log('D', logTag, string.format('Updated SS start time from %.2f to %.2f - %s (reschedule #%d)',
originalTime, newTime, reason, event.rescheduleCount))
calculatedStartLineTime = self:roundToNextMinute(tcArrivalTime)
log('D', logTag, string.format('TC arrival at +%.1fs into minute, %.1fs until next minute (>= %.1fs threshold), scheduling to next minute',
secondsIntoMinute, secondsUntilNextMinute, threshold))
calculatedStartLineTime = self:roundToNextMinute(tcArrivalTime + minDelay)
log('D', logTag, string.format('TC arrival at +%.1fs into minute, %.1fs until next minute (< %.1fs threshold), scheduling to minute after next',
secondsIntoMinute, secondsUntilNextMinute, threshold))
local result = self:_updateSSStartTime(calculatedStartLineTime, true, string.format('TC arrival, smart rounding'))
return result.newTime
function C:formatDuration(seconds)
-- Format relative time duration in M:SS format (e.g., "0:11", "1:33")
if not seconds then return nil end
return string.format("%d:%02d", minutes, secs)
end
-- Show hours: H:MM:SS.T or HH:MM:SS.T
return string.format("%d:%02d:%02d.%d", hours, minutes, secs, tenths)
elseif minutes > 0 then
-- Show minutes: M:SS.T or MM:SS.T (no leading zero for minutes)
return string.format("%d:%02d.%d", minutes, secs, tenths)
else
-- Show only seconds: S.T or SS.T (no leading zero for seconds)
return string.format("%d.%d", secs, tenths)
end
tcOutLabel = "TC" .. (nextSSNumber - 1) .. "A"
log('D', logTag, string.format('ServiceIn road section TC_out: nextSSNumber=%d, label=%s', nextSSNumber, tcOutLabel))
else
log('D', logTag, string.format('Road section %d: TC_in=%s, TC_out=%s, isServiceIn=%s, lastTCLabel=%s',
roadSectionCount, tcInLabel or 'nil', tcOutLabel or 'nil', tostring(isServiceInRoadSection), updatedLastTCLabel or 'nil'))
local isServiceInRoadSection = (missionId == serviceInRoadSectionId)
log('D', logTag, string.format('Checking road section: missionId=%s, serviceInRoadSectionId=%s, isServiceIn=%s',
missionId or 'nil', serviceInRoadSectionId or 'nil', tostring(isServiceInRoadSection)))
log('D', logTag, string.format('Schedule calculated for %s: %.2f km, %s',
missionId, distanceKm or 0, tempRallyManager:getTimeAllocationString() or 'N/A'))
self.clock = -(rallyStartTimeSecs - self.environmentStartTimeSecs)
log('D', logTag, string.format('Clock initialized to rally epoch: %.2f seconds', self.clock))
log('D', logTag, string.format('Schedule calculation complete - Total SS: %.2f km, Total Road Section: %.2f km, Total Distance: %.2f km',
self.totalSSDistanceKm, self.totalRoadSectionDistanceKm, self.totalDistanceKm))
log('D', logTag, string.format('Built events list with %d events', #self.events))
-- Get scheduled time in wall clock format (if event has a time)
if event.time then
self.clock = targetTime
log('I', logTag, string.format('Skipped from epoch time %.2fs to %.2fs (advanced %.2fs)',
oldClock, targetTime, targetTime - oldClock))
-- Use shared method to update (onlyIfLater = false, since we always want to reschedule to next slot)
local result = self:_updateSSStartTime(newTime, false, string.format('Not staged at -10s, slot: %d min', slotSizeMinutes))
return result
log('W', logTag, string.format('Recorded route recalc penalty #%d: %ds for TC event %d (%s)',
penaltyData.data.violationNumber, penaltyData.amount, eventIndex, tcLabel or 'unknown'))
-- guihooks.trigger('Message', {
-- msg = string.format('Speeding penalty: +%ds%s', penaltyAmount, modeStr),
-- ttl = 3,
-- log('W', logTag, string.format('Recorded speeding penalty: %ds for event %d (%s, type: %s) - Speed: %.1f kph over %d kph limit%s',
-- penaltyAmount, eventIndex, eventLabel or 'unknown', event.type or 'unknown',
log('I', logTag, string.format('Applied %d traffic exclusion zones for rally loop', #zones))
]]
@/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/ge/extensions/gameplay/police.lua
if gameplay_traffic.showMessages and policePlayer and not policePlayer.role.flags.busy then
ui_message(string.format('%s %s', translateLanguage('ui.traffic.suspectFlee', 'A suspect is fleeing from you! Vehicle:'), targetVeh.modelName), 5, 'traffic', 'traffic')
end
for _, v in ipairs(veh.pursuit.offensesList) do
table.insert(offensesTranslated, translateLanguage(string.format('ui.traffic.infractions.%s', v), v))
end
ui_message(string.format('%s %s', translateLanguage('ui.traffic.infractions.title', 'Offenses:'), table.concat(offensesTranslated, ', ')), 5, 'trafficInfractions', 'traffic')
end
else
log('W', logTag, string.format('Failed to start pursuit gameplay, suspect vehicle not found: %d', suspectId))
return false
if policeAmount > 0 or propAmount > 0 then
log('I', logTag, string.format('Activated %d police vehicles and %d police props', policeAmount, propAmount))
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);
}
@/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/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/ge/extensions/scenario/raceUI.lua
local curTime = string.format("%.3f", data.time) .. 's'
--guihooks.trigger('ScenarioFlashMessage', {{'Lap ' ..tostring(data.lap) .. ' time: ' .. curTime, 3}} )
@/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/FontResourceContentView.js
if (this.resource.mimeTypeComponents.type === "image/svg+xml")
format = " format(\"svg\")";
@/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/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]
@/inspector/Views/SourcesNavigationSidebarPanel.js
identifier: "debugger-breakpoints",
defaultToolTip: WI.UIString("Enable all breakpoints (%s)").format(WI.toggleBreakpointsKeyboardShortcut.displayName),
activatedToolTip: WI.UIString("Disable all breakpoints (%s)").format(WI.toggleBreakpointsKeyboardShortcut.displayName),
defaultToolTip: WI.UIString("Enable all breakpoints (%s)").format(WI.toggleBreakpointsKeyboardShortcut.displayName),
activatedToolTip: WI.UIString("Disable all breakpoints (%s)").format(WI.toggleBreakpointsKeyboardShortcut.displayName),
image: "Images/Breakpoints.svg",
identifier: "debugger-pause-resume",
defaultToolTip: WI.UIString("Pause script execution (%s or %s)").format(WI.pauseOrResumeKeyboardShortcut.displayName, WI.pauseOrResumeAlternateKeyboardShortcut.displayName),
alternateToolTip: WI.UIString("Continue script execution (%s or %s)").format(WI.pauseOrResumeKeyboardShortcut.displayName, WI.pauseOrResumeAlternateKeyboardShortcut.displayName),
defaultToolTip: WI.UIString("Pause script execution (%s or %s)").format(WI.pauseOrResumeKeyboardShortcut.displayName, WI.pauseOrResumeAlternateKeyboardShortcut.displayName),
alternateToolTip: WI.UIString("Continue script execution (%s or %s)").format(WI.pauseOrResumeKeyboardShortcut.displayName, WI.pauseOrResumeAlternateKeyboardShortcut.displayName),
defaultImage: "Images/Pause.svg",
identifier: "debugger-step-over",
toolTipOrLabel: WI.UIString("Step over (%s or %s)").format(WI.stepOverKeyboardShortcut.displayName, WI.stepOverAlternateKeyboardShortcut.displayName),
image: "Images/StepOver.svg",
identifier: "debugger-step-into",
toolTipOrLabel: WI.UIString("Step into (%s or %s)").format(WI.stepIntoKeyboardShortcut.displayName, WI.stepIntoAlternateKeyboardShortcut.displayName),
image: "Images/StepInto.svg",
identifier: "debugger-step-out",
toolTipOrLabel: WI.UIString("Step out (%s or %s)").format(WI.stepOutKeyboardShortcut.displayName, WI.stepOutAlternateKeyboardShortcut.displayName),
image: "Images/StepOut.svg",
className: "breakpoint-paused-icon",
title: WI.UIString("%s Fired").format(pauseData.eventName),
});
if (pauseData && pauseData.message)
this._pauseReasonTextRow.text = WI.UIString("Assertion with message: %s").format(pauseData.message);
else
// COMPATIBILITY (iOS 8): 'directive' was 'directiveText'.
this._pauseReasonTextRow.text = WI.UIString("Content Security Policy violation of directive: %s").format(pauseData.directive || pauseData.directiveText);
this._pauseReasonGroup.rows = [this._pauseReasonTextRow];
className: "breakpoint-paused-icon",
title: WI.UIString("\u201C%s\u201D Event Fired").format(pauseData.eventName),
});
let data = WI.RemoteObject.fromPayload(pauseData, target);
this._pauseReasonTextRow.text = WI.UIString("Exception with thrown value: %s").format(data.description);
this._pauseReasonGroup.rows = [this._pauseReasonTextRow];
className: "breakpoint-paused-icon",
title: WI.UIString("%s Fired").format(pauseData.eventName),
});
console.assert(pauseData.breakpointURL === "", "Should be the All Requests breakpoint which has an empty URL");
this._pauseReasonTextRow.text = WI.UIString("Requesting: %s").format(pauseData.url);
this._pauseReasonGroup.rows = [this._pauseReasonTextRow];
@/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/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/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/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/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
@/gameplay/missionTypes/precisionParking/customNodes/parkingPointsNode.lua
local score = round(math.min(20,(angleScore+sideScore+forwardScore) * 6 + 2))
log("D","",string.format("Parking Score: %d (angle: %0.2fpts (%0.2f°) | side: %0.2fpts (%0.2fm) | forw: %0.2fpts (%0.2fm) | +2pts by default)",score, angleScore*6, angle, sideScore*6, self.pinIn.sideDist.value, forwardScore*6, self.pinIn.forwardDist.value ))
if score >= 20 then
@/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/TimelineRuler.js
case WI.TimelineMarker.Type.LoadEvent:
markerElement.title = WI.UIString("Load \u2014 %s").format(Number.secondsToString(markerTime));
break;
case WI.TimelineMarker.Type.DOMContentEvent:
markerElement.title = WI.UIString("DOM Content Loaded \u2014 %s").format(Number.secondsToString(markerTime));
break;
if (marker.details)
markerElement.title = WI.UIString("%s \u2014 %s").format(marker.details, Number.secondsToString(markerTime));
else
else
markerElement.title = WI.UIString("Timestamp \u2014 %s").format(Number.secondsToString(markerTime));
break;
@/lua/ge/extensions/editor/fileDialog.lua
im.NextColumn()
im.TextUnformatted(string.format("%d x %d", imgSize.x, imgSize.y))
im.Columns(1, "FilePreviewColumns")
@/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/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/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/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/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)})
@/inspector/Views/ConsoleMessageView.js
if (this._message.parameters[0].type === "string") {
var prefixedFormatString = WI.UIString("Trace: %s").format(this._message.parameters[0].description);
args = [prefixedFormatString].concat(this._message.parameters.slice(1));
if (this._message.parameters[0].type === "string") {
var prefixedFormatString = WI.UIString("Assertion Failed: %s").format(this._message.parameters[0].description);
args = [prefixedFormatString].concat(this._message.parameters.slice(1));
// String.format does treat formattedResult like a Builder, result is an object.
return String.format(parameters[0].description, parameters.slice(1), formatters, formattedResult, append);
}
@/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/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))
@/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/career/modules/delivery/vehicleTasks.lua
local brokenPartsRelative = taskData.brokenPartsNumber / taskData.partsNumber
log("I","",string.format("Broken Parts: %0.1f%% (%d / %d)", brokenPartsRelative*100, taskData.brokenPartsNumber, taskData.partsNumber))
local distanceDriven = (taskData.offer.endingOdometer - taskData.offer.startingOdometer)
end
log("I","",string.format("Driven Distance: %0.3fkm (%0.1f%% of allowed %0.3fkm)", distanceDriven/1000, 100*distanceDriven/taskData.offer.data.originalDistance, 1.2*taskData.offer.data.originalDistance/1000))
local timeTaken = dGeneral.time() - taskData.startedTimestamp
local expectedTime = (taskData.offer.data.originalDistance/12 + 30 )
log("I","",string.format("Time Taken: %0.1f seconds (expected: %0.1fs)", timeTaken, expectedTime))
local organizationElement = {
label = string.format("Loaner Organization (%d%% cut)", round(organizationCut * 100)),
rewards = {money = -organizationCut * originalRewards.money},
local message = string.format("Delivery %s abandoned. \n %0.2f$ penalty. " .. (taskData.offer.organization and "\n%d reputation lost." or ""), taskData.offer.name, -fine.money, taskData.offer.organization and -fine[taskData.offer.organization .. "Reputation"] or 0)
core_jobsystem.create(showMessageJob, nil, message, "delivery", "local_shipping")
@/lua/ge/extensions/scenario/raceMarkers/ringMarker.lua
--debugDrawer:drawText(self.pos, String(string.format("%0.3f %s",t, self.blendState or "non")), ColorF(0, 0, 0, 1))
--debugDrawer:drawLine(vec3(self.pos), vec3(self.pos + self.normal), ColorF(1,0,0,1))
@/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/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/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/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
@/inspector/Views/ConsoleSession.js
let timestamp = data.timestamp || Date.now();
header.textContent = headerText.format(new Date(timestamp).toLocaleTimeString());
element.append(header);
@/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);
@/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/editor/util/transformUtil.lua
self.id = getNextUniqueIdentifier()
self.editName = string.format("%s (%d)",editName, self.id)
self.objectName = objectName or "Object"
@/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/freeroam/organizations.lua
end
log("D","",string.format("Loaded organizations"))
end
@/inspector/Views/ScopeChainDetailsSidebarPanel.js
if (scope.__baseClosureScope && scope.name)
title = WI.UIString("Closure Variables (%s)").format(scope.name);
else
@/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/ge/extensions/editor/sceneTree.lua
if SimObject.isNameValid(name) == false then
local msg = "Cannot rename scene node to '" .. name .. "', bad format (cannot start with %, a digit 0-9 or /, cannot be a class name)"
editor.logError(msg)
imgui.TableNextColumn()
imgui.TextUnformatted(string.format('%0.1f', node.cameraDistance) .. 'm')
end
if searchRange > 0 then
label = label .. ' in ' .. string.format('%g', searchRange) .. 'm'
end
@/lua/vehicle/powertrain/shaft.lua
end
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
@/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/vehicle/controller/vehicleController/shiftLogic/manualGearbox.lua
M.shiftingAggression = shiftAggression
--print(string.format("GR: %.2f, AG: %.2f, IN: %.2f -> %.2f", gearRatioCoef, aggressionCoef, inertiaCoef, shiftAggression))
end
@/inspector/Views/DatabaseTableContentView.js
// no data, the SELECT query only returns column names when there is data.
this._messageTextViewElement = WI.createMessageTextView(WI.UIString("The \u201C%s\u201D\ntable is empty.").format(this.representedObject.name), false);
this.element.appendChild(this._messageTextViewElement);
this._messageTextViewElement = WI.createMessageTextView(WI.UIString("An error occurred trying to read the \u201C%s\u201D table.").format(this.representedObject.name), true);
this.element.appendChild(this._messageTextViewElement);
@/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/ge/extensions/util/trackBuilder/splineTrack.lua
if filename == "" then
name = string.format("%.4d-%.2d-%.2d_%.2d-%.2d-%.2d", date.year, date.month, date.day, date.hour, date.min, date.sec)
else
@/lua/common/libs/xlsxlib/tests/TestManager.lua
local func = tests[name]
local displayName = string.format("%-60s", name:gsub('_shouldFail$', ''))
@/lua/vehicle/extensions/tech/trailSim.lua
data[2][2] = yawAV or 0 -- trailer yaw velocity
BeamEngine:queueAllObjectLua(string.format("if tech_trailSim then tech_trailSim.trailerData(%q,%d) end", serialize(data), objectId))
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/vehicle/controller/advancedCouplerControl.lua
if not controllerName or not nonAllowedState then
log("E", "advancedCouplerControl.toggleGroupConditional", string.format("Wrong condition data, groupName: %q, nonAllowedState: %q", controllerName, nonAllowedState))
return
if not groupController or groupController.typeName ~= "advancedCouplerControl" then
log("D", "advancedCouplerControl.toggleGroupConditional", string.format("Can't find group controller with name %q or it's the wrong type", controllerName))
end
@/lua/ge/extensions/gameplay/rally.lua
ttl = 5,
msg = string.format('%s: %.1fs', msg, newVal),
category = 'rally',
if pathnode and rallyManager then
-- log('D', logTag, string.format('Rally.onRacePathnodeReached name=%s id=%d time=%0.1f', pathnode.name, pathnode.id, time))
rallyManager:recordSplit(pathnode.id, time)
-- local distance = rallyManager:getPointDistanceFromStartKm(rp)
-- -- log('W', logTag, string.format('pathnode route point source=%s racePathnodeType=%s distance=%.1fkm', source, racePathnodeType, distance))
-- if debugLogging then log('D', logTag, string.format('RallyMode: reached %s (%s %.1fkm)', pathnode.name, racePathnodeType, distance)) end
-- -- log('W', logTag, string.format('pathnode route point source=%s racePathnodeType=%s distance=%.1fkm', source, racePathnodeType, distance))
-- if debugLogging then log('D', logTag, string.format('RallyMode: reached %s (%s %.1fkm)', pathnode.name, racePathnodeType, distance)) end
-- else
-- else
-- if debugLogging then log('D', logTag, string.format('onRacePathnodeReached name=%s split=%s', pathnode.name, tostring(pathnode.useAsSplit))) end
-- end
@/inspector/Models/AuditTestCaseResult.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 (!Object.values(WI.AuditTestCaseResult.Level).includes(payload.level)) {
WI.AuditManager.synthesizeError(WI.UIString("\u0022%s\u0022 has an invalid \u0022%s\u0022 value").format(payload.name, WI.unlocalizedString("level")));
return null;
if ("data" in payload)
WI.AuditManager.synthesizeWarning(WI.UIString("\u0022%s\u0022 has a non-object \u0022%s\u0022 value").format(payload.name, WI.unlocalizedString("data")));
payload.data = {};
if (!Array.isArray(payload.data[key])) {
WI.AuditManager.synthesizeWarning(WI.UIString("\u0022%s\u0022 has a non-array \u0022%s\u0022 value").format(payload.name, WI.unlocalizedString("data.%s").format(key)));
payload.data[key] = [];
if (!Array.isArray(payload.data[key])) {
WI.AuditManager.synthesizeWarning(WI.UIString("\u0022%s\u0022 has a non-array \u0022%s\u0022 value").format(payload.name, WI.unlocalizedString("data.%s").format(key)));
payload.data[key] = [];
if ("metadata" in payload)
WI.AuditManager.synthesizeWarning(WI.UIString("\u0022%s\u0022 has a non-object \u0022%s\u0022 value").format(payload.name, WI.unlocalizedString("metadata")));
if ("startTimestamp" in payload.metadata)
WI.AuditManager.synthesizeWarning(WI.UIString("\u0022%s\u0022 has a non-object \u0022%s\u0022 value").format(payload.name, WI.unlocalizedString("metadata.startTimestamp")));
if ("asyncTimestamp" in payload.metadata)
WI.AuditManager.synthesizeWarning(WI.UIString("\u0022%s\u0022 has a non-object \u0022%s\u0022 value").format(payload.name, WI.unlocalizedString("metadata.asyncTimestamp")));
if ("endTimestamp" in payload.metadata)
WI.AuditManager.synthesizeWarning(WI.UIString("\u0022%s\u0022 has a non-object \u0022%s\u0022 value").format(payload.name, WI.unlocalizedString("metadata.endTimestamp")));
if ("url" in payload.metadata)
WI.AuditManager.synthesizeWarning(WI.UIString("\u0022%s\u0022 has a non-object \u0022%s\u0022 value").format(payload.name, WI.unlocalizedString("metadata.url")));
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")));
@/lua/ge/extensions/editor/scriptAIManager.lua
end
statetxt = statetxt .. ' - ' .. string.format('%3.0f', vi.percent) .. '%'
end
@/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/flowgraph/nodelibrary.lua
im.SameLine()
im.Text(string.format(" | %d%%%% Match" ,100*result.score))
if result.frecency then
im.SameLine()
im.Text(string.format(" | %d%%%% Frecency", result.frecency *100))
end
@/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/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/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/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/crawl/display.lua
ui_message("ui.crawl.crawlCompleted", nil, "crawlCompleted")
ui_message({txt="ui.crawl.crawlResults", context={time=string.format("%.3f", time), points=points}}, 10, "crawlCompleted")
end
@/lua/common/libs/LuLPeg/lulpeg.lua
or s:sub(i,i+20) .. "..."
msg = ("pattern error near '%s'"):format(msg)
error(msg, 2)
@/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/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))
@/inspector/Models/Recording.js
if (typeof payload.version !== "number") {
WI.Recording.synthesizeError(WI.UIString("non-number %s").format(WI.unlocalizedString("version")));
return null;
if (payload.version < 1 || payload.version > WI.Recording.Version) {
WI.Recording.synthesizeError(WI.UIString("unsupported %s").format(WI.unlocalizedString("version")));
return null;
if (parseInt(payload.version) !== payload.version) {
WI.Recording.synthesizeWarning(WI.UIString("non-integer %s").format(WI.unlocalizedString("version")));
payload.version = parseInt(payload.version);
default:
WI.Recording.synthesizeWarning(WI.UIString("unknown %s \u0022%s\u0022").format(WI.unlocalizedString("type"), payload.type));
type = String(payload.type);
if ("initialState" in payload)
WI.Recording.synthesizeWarning(WI.UIString("non-object %s").format(WI.unlocalizedString("initialState")));
if ("attributes" in payload.initialState)
WI.Recording.synthesizeWarning(WI.UIString("non-object %s").format(WI.unlocalizedString("initialState.attributes")));
if ("states" in payload.initialState)
WI.Recording.synthesizeWarning(WI.UIString("non-array %s").format(WI.unlocalizedString("initialState.states")));
if ("parameters" in payload.initialState)
WI.Recording.synthesizeWarning(WI.UIString("non-array %s").format(WI.unlocalizedString("initialState.attributes")));
if ("content" in payload.initialState)
WI.Recording.synthesizeWarning(WI.UIString("non-string %s").format(WI.unlocalizedString("initialState.content")));
if ("frames" in payload)
WI.Recording.synthesizeWarning(WI.UIString("non-array %s").format(WI.unlocalizedString("frames")));
if ("data" in payload)
WI.Recording.synthesizeWarning(WI.UIString("non-array %s").format(WI.unlocalizedString("data")));
{
message = WI.UIString("Recording Warning: %s").format(message);
{
message = WI.UIString("Recording Error: %s").format(message);
do {
name = WI.UIString("Recording %d").format(recordingNumber++);
} while (recordingNameSet.has(name));
@/lua/common/json.lua
if curlen >= i then
error(string.format("%s near line %d, '%s'",msg, n, w:match'^%s*(.*%S)' or ''))
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), 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
@/lua/vehicle/powertrain/electricMotor.lua
device.soundConfiguration[reference].blendFile = samplePath
obj:queueGameEngineLua(string.format("core_sounds.initEngineSound(%d,%d,%q,%s,%f,%f)", objectId, soundID, samplePath, serialize(engineNodeIDs), offLoadGain, onLoadGain))
device.soundConfiguration[reference].soundID = soundID
obj:queueGameEngineLua(string.format("core_sounds.setEngineSoundParameterList(%d,%d,%s)", objectId, soundID, serialize(params)))
end
@/lua/ge/extensions/gameplay/drift/freeroam/driftSpots.lua
local highestScore = getHighestScoreData()
local label = highestScore.score > 0 and string.format("Highest score by \"".. highestScore.licensePlate .. "\": %i", highestScore.score) or "No highscore yet, rip it!"
guihooks.trigger("SetTasklistTask", {
if spot.saveData.scores[1] then
poi.markerInfo.bigmapMarker.description = poi.markerInfo.bigmapMarker.description .. "\n" .. string.format("Current Highscore: %d by %s.", spot.saveData.scores[1].score, spot.saveData.scores[1].licensePlate)
end
@/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/ge/extensions/core/groundMarkers.lua
if not deprecationWarningDone[oldFunction] then
log('W', logTag, string.format('function "%s" is deprecated. Please use function "%s" instead', oldFunction, newFunction))
deprecationWarningDone[oldFunction] = true
markers = {},
color = string.format("#%02X%02X%02XFF", M.color[1]*255, M.color[2]*255, M.color[3]*255)
}
@/gameplay/missionTypes/timeTrial/constructor.lua
if self.missionTypeData.allowRollingStart then rolling = false end
self.defaultProgressKey = string.format("%d-%s-%s",self.missionTypeData.defaultLaps, reverse, rolling)
self.defaultAggregateValues = {
end
log("D","", string.format("%s - %s dynamically adjusted for %d laps", self.id, key, laps))
return baseList
end
log("D","", string.format("%s - %s dynamically adjusted for having used %s %d x %d times before", self.id, key, originKey, originId, vehicleUsedForStarTimes))
return baseList
function C:getProgressKeyForUserSetting(userSettings)
return string.format("%d-%s-%s",userSettings.laps or self.missionTypeData.defaultLaps, (userSettings.reverse or false) and self.missionTypeData.reversible, (userSettings.rolling or false) and self.missionTypeData.allowRollingStart)
end
self:processCommonSettings(settings)
self.currentProgressKey = string.format("%d-%s-%s",settings.laps or self.missionTypeData.defaultLaps, (settings.reverse or false) and self.missionTypeData.reversible, (settings.rolling or false) and self.missionTypeData.allowRollingStart)
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/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/common/mathlib.lua
local function numSer(v)
return v * 0 ~= 0 and (v > 0 and '9e999' or '-9e999') or string.format('%.10g', v)
end
function LuaVec3:__tostring()
return string.format('vec3(%s,%s,%s)', numSer(self.x), numSer(self.y), numSer(self.z))
end
local s = stackv3[stacki]
return string.format('push3(%.10g,%.10g,%.10g)', numSer(s.x), numSer(s.y), numSer(s.z))
end
function LuaQuat:__tostring()
return string.format('quat(%.10g,%.10g,%.10g,%.10g)', numSer(self.x), numSer(self.y), numSer(self.z), numSer(self.w))
end
@/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
@/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/editor/roadEditor.lua
for i=1, #editor_roadUtils.getMaterials() do
im.PushID1(string.format('template_%d', i))
if im.ImageButton(editor_roadUtils.getMaterials()[i].texId, im.ImVec2(128, 128), im.ImVec2Zero, im.ImVec2One, 1, im.ImColorByRGB(0,0,0,255).Value, im.ImColorByRGB(255,255,255,255).Value) then
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()
templateDialog()
im.Text(string.format("Road Length: %0." .. editor.getPreference("ui.general.floatDigitCount") .. "f m", selectedRoad:getField("debugRoadLength", "")))
end
end
debugDrawer:drawTextAdvanced(pos, String("Road Width: " .. string.format("%.2f", road:getNodeWidth(tempNodeIndex)) .. ". Change width by dragging."), ColorF(1.0,1.0,1.0,1), true, false, ColorI(0, 0, 0, 128))
end
debugDrawer:drawSphere(focusPointP3F, editor.getPreference("roadEditor.general.defaultWidth") / 2, roadRiverGui.highlightColors.nodeTransparent, false)
debugDrawer:drawTextAdvanced(focusPointP3F, String("Road Width: " .. string.format("%.2f", editor.getPreference("roadEditor.general.defaultWidth")) .. (editor.getPreference("roadEditor.general.dragWidth") and ". Change width by dragging." or "")), ColorF(1.0,1.0,1.0,1), true, false, ColorI(0, 0, 0, 128))
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/vehicle/energyStorage.lua
else
log("D", "energyStorage.getStorageSafe", string.format("Didn't find storage '%s', returning nilStorage.", name))
--log("D", "energyStorage.getStorageSafe", debug.traceback())
@/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/editor/mainToolbar.lua
if im.Button("New Set") then
local newSetName = string.format("Edit Mode Set %d", #editModeSets + 1)
addEditModeSet(newSetName)
@/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/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/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/gameplay/rally/recce/drivelineRecording.lua
log('I', logTag, 'loaded driveline in '.. string.format("%.3f", t_load)..'s with '..tostring(#rawPoints)..' points')
@/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/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/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/flowgraph/search.lua
im.SameLine()
im.Text(string.format(" | %d%%%% Match" ,100*result.score))
if result.frecency and result.frecency > 0 then
im.SameLine()
im.Text(string.format(" | %d%%%% Frecency", result.frecency *100))
end
@/lua/ge/extensions/career/modules/delivery/generator.lua
if loc2.type == "facilityParkingspot" then
local distanceKey = string.format("%s-%s-%s-%s", loc1.facId, loc1.psPath, loc2.facId, loc2.psPath)
distanceCache[distanceKey] = distanceCache[distanceKey] or distanceBetween(getLocationCoordinates(loc1), getLocationCoordinates(loc2))
end
log("I","",string.format("Loaded %d item templates from %d files.", #tableKeys(parcelItemTemplates), #files))
end
if not destinationFac then
log("W","",string.format("Could not find target facility to deliver from %s with type %s", fac.id, logisticType))
return
templateId = -1,
name = string.format("%s from %s",materialData.name, fac.name),
type = materialData.type,
local facName = translateLanguage(fac.name, fac.name, true)
log("I","",string.format("Moved %d %s from %s (%d -> %d)", change, materialType, facName, storage.storedVolume, storage.storedVolume + change))
if storage.storedVolume > storage.capacity then
log("W","",string.format("Stored too much %s in %s (from %d, added %d, maximum %d) : %d too much", materialType, facName, storage.storedVolume-change, change, storage.capacity, storage.storedVolume+change-storage.capacity))
if storage.storedVolume < 0 then
log("W","",string.format("Took too much %s from %s (from %d, removed %d) : %d too much", materialType, facName, storage.storedVolume-change, -change, -change-storage.storedVolume))
storage.storedVolume = 0
for _, item in ipairs(generator.validTemplates) do
-- print(string.format(" - %02d%% %s",100 * item.chance / generator.sumChance, item.item.id))
for amount, amountChance in ipairs(item.item.duplicationChance) do
for amount, amountChance in ipairs(item.item.duplicationChance) do
print(string.format(" - %02d%% Group of %d %s (%s slots)",100 * item.chance / generator.sumChance * amountChance / item.item.duplicationChanceSum, amount, item.item.id, table.concat(item.item.slots, ", ")))
end
for i, generator in ipairs(fac.logisticGenerators) do
generator.name = string.format("%s %d %s %d", fac.name, i, generator.type, generator.interval)
generator.nextGenerationTimestamp = dGeneral.time() + (generator.interval) * math.random()
if missing then
log("E","",string.format("Fix Facility %s provided types: [\"%s\"]", fac.id, table.concat(tableKeysSorted(fac.logisticTypesProvidedLookup),'", "') )
)
)
log("E","",string.format("Fix Facility %s received types: [\"%s\"]", fac.id, table.concat(tableKeysSorted(fac.logisticTypesReceivedLookup),'", "') )
)
end
--print(string.format("Facility: %s provides systems: %s", fac.name, table.concat(tableKeys(fac.providedSystemsLookup),", " )))
--print(string.format("Facility: %s receives systems: %s", fac.name, table.concat(tableKeys(fac.receivedSystemsLookup),", " )))
--print(string.format("Facility: %s provides systems: %s", fac.name, table.concat(tableKeys(fac.providedSystemsLookup),", " )))
--print(string.format("Facility: %s receives systems: %s", fac.name, table.concat(tableKeys(fac.receivedSystemsLookup),", " )))
end
for _, key in ipairs(tableKeysSorted(allTypes)) do
--print(string.format("%s -> %s", key, dumps(logisticTypeToSystem(key))))
end
print(key)
print(string.format("Total IN: %0.2f/min", materialRatesProvided[key].total*60))
for _, facId in ipairs(tableKeysSorted(materialRatesProvided[key])) do
if facId ~= "total" then
print(string.format(" - IN : %0.2f/min (%s)", materialRatesProvided[key][facId]*60, facId))
print(string.format(" - real capacity: %d (%d min)",facilitiesById[facId].materialStorages[key].target, facilitiesById[facId].materialStorages[key].target / (materialRatesProvided[key][facId]*60)))
print(string.format(" - IN : %0.2f/min (%s)", materialRatesProvided[key][facId]*60, facId))
print(string.format(" - real capacity: %d (%d min)",facilitiesById[facId].materialStorages[key].target, facilitiesById[facId].materialStorages[key].target / (materialRatesProvided[key][facId]*60)))
end
end
print(string.format("Total OUT: %0.2f/min", materialRatesReceived[key].total*60))
for _, facId in ipairs(tableKeysSorted(materialRatesReceived[key])) do
if facId ~= "total" then
print(string.format(" - OUT: %0.2f/min (%s)", materialRatesReceived[key][facId]*60, facId))
print(string.format(" - real capacity: %d (%d min)",facilitiesById[facId].materialStorages[key].capacity - facilitiesById[facId].materialStorages[key].target, (facilitiesById[facId].materialStorages[key].capacity - facilitiesById[facId].materialStorages[key].target) / (materialRatesReceived[key][facId]*60)))
print(string.format(" - OUT: %0.2f/min (%s)", materialRatesReceived[key][facId]*60, facId))
print(string.format(" - real capacity: %d (%d min)",facilitiesById[facId].materialStorages[key].capacity - facilitiesById[facId].materialStorages[key].target, (facilitiesById[facId].materialStorages[key].capacity - facilitiesById[facId].materialStorages[key].target) / (materialRatesReceived[key][facId]*60)))
end
log("I","",string.format("Setup Logistics Facilities: %d Facilities (%d only provide, %d mixed, %d only receive), %d Parking spots", #tableKeys(facilitiesById), countProviders, countMixed, countReceivers, #tableKeys(parkingSpotsByPath)))
facilitiesSetup = true
@/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/util/richPresence.lua
local function onRaceLap(data)
local timeStr = string.format("%.2d:%.2d.%.3d", (data.time)/60, (data.time)%60, (data.time%1)*1000)
if Steam then
local function onRaceResult(data)
local timeStr = string.format("%.2d:%.2d.%.3d", (data.finalTime)/60, (data.finalTime)%60, data.finalTime%1*1000)
if Steam then
@/lua/ge/extensions/scenario/distanceGoal.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/editor/util/plotHelperUtil.lua
-- Method to set graph data
-- Must be in this format (multiple y values for one x allowed):
-- {{x0, y0, ...}, {x1, y1, ...}, ...}
-- Method to set graph data
-- Must be in this format (multiple y values for one x allowed):
-- {{x0, y0, ...}, {x1, y1, ...}, ...}
else
txt = string.format("%.3e", graphX)
end
else
txt = string.format("%.3e", graphY)
end
local strX = string.format(self.formatX, ptX)
local strY = string.format(self.formatY, ptY)
local strX = string.format(self.formatX, ptX)
local strY = string.format(self.formatY, ptY)
@/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/api/gui.lua
end
imgui.Button(string.format("Metal: %0.1f | Rough: %0.1f | Coat: %0.1f | CoatRough: %0.1f", col.pbr[1][0], col.pbr[2][0], col.pbr[3][0], col.pbr[4][0]))
if imgui.IsItemClicked() then
else
val = string.format(format, v[v_index])
end
end
imgui.tooltip(string.format("Decrease by %.2f\nDecrease by %.2f while holding ctrl", step, step_fast))
imgui.SameLine()
end
imgui.tooltip(string.format("Increase by %.2f\nIncrease by %.2f while holding ctrl", step, step_fast))
end
if not id then lbl = label end
id = string.format("##%s_%s", label or "", id or "")
if not id then lbl = label end
id = string.format("##%s_%s", label or "", id or "")
if not id then lbl = label end
id = string.format("##%s_%s", label or "", id or "")
if not id then lbl = label end
id = string.format("##%s_%s", label or "", id or "")
else
return string.format('%i', tempIntPtr[0])
end
else
return string.format('%d %d', tempIntArr2[0], tempIntArr2[1])
end
else
return string.format('%f', tempFloatPtr[0])
end
else
return string.format('%f %f', tempFloatArr2[0], tempFloatArr2[1])
end
else
return string.format('%f %f %f %f', tempFloatArr4[0], tempFloatArr4[1], tempFloatArr4[2], tempFloatArr4[3])
end
@/lua/common/testFramework/TestManager.lua
local func = tests[name]
local displayName = string.format("%-60s", name:gsub('_shouldFail$', ''))
@/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/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/editor/aiTests.lua
if options.routeDetails[0] then
debugDrawer:drawTextAdvanced(pos, String(string.format("%0.1fm", point.distToTarget or -1)), colorWhite, true, false, colorIBlack)
end
local idx, dist = route:trackVehicle(playerVehicle)
im.Text(string.format("Idx: %d, distance: %0.1f", idx or -1, dist or -1))
routeTracking = true
obj:queueLuaCommand("ai.setAggression("..aiParams.aggression..")")
obj:queueLuaCommand(string.format("ai.setParameters(%s)", serialize(aiParams)))
@/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(/