dataReady.value?isPlayingAnimations.value?`skip`:findNextUnvisitedMandatoryPage()===null?!1:`continue`:!1),skipAnimations=()=>{currentPage.value&&(animationsEndTime.value=Date.now(),showPage(currentPage.value))},continueToNextPage=()=>{let nextMandatoryPage=findNextUnvisitedMandatoryPage();nextMandatoryPage&&showPage(nextMandatoryPage)},shouldShowMandatoryDot=page=>{if(!dataReady.value)return!1;let pageInfo=pagesInfo.value[page];return page===currentPage.value?pageInfo?.mandatory&&isPlayingAnimations.value:pageInfo?.mandatory&&!visitedPages.value.has(page)};function updatePanel(newPanel){let index=layout.value.findIndex(p$1=>p$1.type===newPanel.type);index!==-1&&(layout.value[index]=newPanel,console.log(newPanel.recordingFiles))}let leftBinding=ref(),rightBinding=ref(),leftIconClass=computed(()=>({"with-binding":leftBinding.value?.displayed})),rightIconClass=computed(()=>({"with-binding":rightBinding.value?.displayed}));return(_ctx,_cache)=>withDirectives((openBlock(),createBlock(unref(layoutSingle_default),{class:normalizeClass([`mission-control-layout`,{"main-sequence":props.mode===`endScreen`||props.mode===`test`}]),"bng-ui-scope":`mission-control`},{default:withCtx(()=>[header.value?(openBlock(),createElementBlock(`div`,{key:0,class:`top`,ref_key:`headerRef`,ref:headerRef},[createVNode(InfoCard_default,{class:`full-width`},{header:withCtx(()=>[createVNode(bngAdvCardHeading_default,{class:`header`},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$ctx_t(header.value.header)),1)]),_:1})]),content:withCtx(()=>[showPageNavigation.value?(openBlock(),createElementBlock(`div`,_hoisted_1$45,[createBaseVNode(`div`,_hoisted_2$36,[availablePages.value.length>1?(openBlock(),createBlock(unref(bngButton_default),{key:0,"bng-no-nav":`true`,accent:unref(ACCENTS).text,class:`page-nav`,onClick:focusPreviousPage},{default:withCtx(()=>[createVNode(unref(bngIcon_default),{type:leftBinding.value?.displayed?unref(icons).arrowSmallLeft:unref(icons).arrowLargeLeft,class:normalizeClass(leftIconClass.value)},null,8,[`type`,`class`]),createVNode(unref(bngBinding_default),{ref_key:`leftBinding`,ref:leftBinding,"ui-event":`tab_l`,controller:``},null,512)]),_:1},8,[`accent`])):createCommentVNode(``,!0)]),simpleStartScreen.value?createCommentVNode(``,!0):(openBlock(),createElementBlock(`div`,_hoisted_3$30,[(openBlock(!0),createElementBlock(Fragment,null,renderList(availablePages.value,page=>(openBlock(),createElementBlock(`div`,{key:page,class:`page-icon-wrapper`},[createVNode(unref(bngIcon_default),{type:getPageIcon(page),onClick:$event=>showPage(page),class:normalizeClass([`page-icon-button`,{"current-page":currentPage.value===page}])},null,8,[`type`,`onClick`,`class`]),shouldShowMandatoryDot(page)?(openBlock(),createElementBlock(`div`,_hoisted_4$22)):createCommentVNode(``,!0)]))),128))])),createBaseVNode(`div`,_hoisted_5$20,[availablePages.value.length>1?(openBlock(),createBlock(unref(bngButton_default),{key:0,"bng-no-nav":`true`,accent:unref(ACCENTS).text,class:`page-nav`,onClick:focusNextPage},{default:withCtx(()=>[createVNode(unref(bngBinding_default),{ref_key:`rightBinding`,ref:rightBinding,"ui-event":`tab_r`,controller:``},null,512),createVNode(unref(bngIcon_default),{type:rightBinding.value?.displayed?unref(icons).arrowSmallRight:unref(icons).arrowLargeRight,class:normalizeClass(rightIconClass.value)},null,8,[`type`,`class`])]),_:1},8,[`accent`])):createCommentVNode(``,!0)])])):createCommentVNode(``,!0)]),_:1})],512)):createCommentVNode(``,!0),layout.value?withDirectives((openBlock(),createElementBlock(`div`,{key:1,class:`columns`,ref_key:`wideColumnRef`,ref:wideColumnRef},[(openBlock(!0),createElementBlock(Fragment,null,renderList(currentPanels.value,panel=>(openBlock(),createBlock(unref(slotSwitcher_default),{key:panel.type,slotId:panel.type},{textPanel:withCtx(()=>[(openBlock(),createBlock(MissionTextPanel_default,{ref_for:!0,ref:el=>panelRefs.value[panel.type]=el,panel,"no-blur":!0,key:panel.key,style:normalizeStyle({"animation-delay":panel.slideAnimDelay||`0s`})},null,8,[`panel`,`style`]))]),crashTestStepDetails:withCtx(()=>[(openBlock(),createBlock(MissionCrashTestStepDetails_default,{ref_for:!0,ref:el=>panelRefs.value[panel.type]=el,"no-blur":!0,key:panel.key,panel},null,8,[`panel`]))]),replayPanel:withCtx(()=>[(openBlock(),createBlock(MissionReplayPanel_default,{ref_for:!0,ref:el=>panelRefs.value[panel.type]=el,"no-blur":!0,key:panel.key,panel,"onUpdate:panel":updatePanel,style:normalizeStyle({"animation-delay":panel.slideAnimDelay||`0s`})},null,8,[`panel`,`style`]))]),objectives:withCtx(()=>[panel.formattedProgress?(openBlock(),createBlock(MissionObjectives_default,{ref_for:!0,ref:el=>panelRefs.value[panel.type]=el,stars:panel.formattedProgress.stars,"no-blur":!0,key:panel.key,style:normalizeStyle({"animation-delay":panel.slideAnimDelay||`0s`})},null,8,[`stars`,`style`])):createCommentVNode(``,!0)]),ratings:withCtx(()=>[(openBlock(),createBlock(MissionRatings_default,{ratings:panel.progress.formattedProgress,style:normalizeStyle({"animation-delay":panel.slideAnimDelay||`0s`}),"no-blur":!0,key:panel.key},null,8,[`ratings`,`style`]))]),rewards:withCtx(()=>[(openBlock(),createBlock(MissionRewards_default,{change:panel.change,"no-blur":!0,"animation-delay":panel.slideAnimDelay||`0s`,key:panel.key},null,8,[`change`,`animation-delay`]))]),dragDial:withCtx(()=>[(openBlock(),createBlock(MissionDialPanel_default,{panel,style:normalizeStyle({"animation-delay":panel.slideAnimDelay||`0s`}),"no-blur":!0,key:panel.key},null,8,[`panel`,`style`]))]),dragTimeSlip:withCtx(()=>[(openBlock(),createBlock(MissionTimeSlipPanel_default,{panel,style:normalizeStyle({"animation-delay":panel.slideAnimDelay||`0s`}),"no-blur":!0,key:panel.key},null,8,[`panel`,`style`]))]),unlocks:withCtx(()=>[(openBlock(),createBlock(MissionUnlocks_default,{ref_for:!0,ref:el=>panelRefs.value[panel.type]=el,change:panel.change,style:normalizeStyle({"animation-delay":panel.slideAnimDelay||`0s`}),key:panel.key},null,8,[`change`,`style`]))]),_:2},1032,[`slotId`]))),128))])),[[unref(BngBlur_default),!0]]):createCommentVNode(``,!0),createBaseVNode(`div`,{class:`bottom`,ref_key:`buttonsRef`,ref:buttonsRef},[createVNode(InfoCard_default,{class:`full-width`},{content:withCtx(()=>[..._cache[2]||=[]]),button:withCtx(()=>[createBaseVNode(`div`,_hoisted_6$16,[supportsReplay.value&&props.mode===`startScreen`?(openBlock(),createElementBlock(`div`,_hoisted_7$15,[replayRecording.value?(openBlock(),createElementBlock(`div`,_hoisted_8$11,[createVNode(unref(bngIcon_default),{type:`danger`}),createTextVNode(` `+toDisplayString(unref($translate).instant(`missions.general.replay.increaseFps`)),1)])):createCommentVNode(``,!0),createVNode(unref(bngSwitch_default),{label:_ctx.$t(`missions.general.replay.enableMissionRecording`),modelValue:replayRecording.value,"onUpdate:modelValue":_cache[0]||=$event=>replayRecording.value=$event,onValueChanged:startScreenReplaySwitchClicked},null,8,[`label`,`modelValue`])])):createCommentVNode(``,!0),showContinueButton.value?(openBlock(),createBlock(unref(bngButton_default),{key:1,class:`large`,onClick:_cache[1]||=$event=>showContinueButton.value===`skip`?skipAnimations():continueToNextPage(),accent:`main`,disabled:isInputBlocked.value},{default:withCtx(()=>[createBaseVNode(`div`,null,toDisplayString(_ctx.$t(showContinueButton.value===`skip`?`ui.common.skip`:`ui.common.next`)),1)]),_:1},8,[`disabled`])):(openBlock(!0),createElementBlock(Fragment,{key:2},renderList(buttons.value,button=>withDirectives((openBlock(),createBlock(unref(bngButton_default),{class:`large`,onClick:$event=>buttonClicked(button),accent:button.main?`main`:`secondary`,disabled:isInputBlocked.value},{default:withCtx(()=>[createBaseVNode(`div`,null,toDisplayString(_ctx.$t(button.label)),1),button.fee?(openBlock(),createElementBlock(`div`,_hoisted_9$9,[_cache[3]||=createTextVNode(` (Pay `,-1),createVNode(RewardsPills_default,{class:`tiny-rewards`,rewards:button.fee},null,8,[`rewards`]),_cache[4]||=createTextVNode(` ) `,-1)])):createCommentVNode(``,!0)]),_:2},1032,[`onClick`,`accent`,`disabled`])),[[unref(BngFocusIf_default),button.focus]])),256))])]),_:1})],512)]),_:1},8,[`class`])),[[unref(BngOnUiNav_default),exit,`menu,back`],[unref(BngOnUiNav_default),focusPreviousPage,`tab_l`],[unref(BngOnUiNav_default),focusNextPage,`tab_r`]])}},MissionControl_default=__plugin_vue_export_helper_default(_sfc_main$53,[[`__scopeId`,`data-v-455699fd`]]),_hoisted_1$44={class:`tile`},_hoisted_2$35={class:`name`},_sfc_main$52={__name:`MissionTile`,props:{card:{type:Object}},setup(__props){return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$44,[createVNode(aspectRatio_default,{externalImage:__props.card.image,class:`image`},null,8,[`externalImage`]),__props.card.expandGroupKey?(openBlock(),createBlock(aspectRatio_default,{key:0,class:`folder`},{default:withCtx(()=>[createVNode(unref(bngIcon_default),{class:`glyph small`,type:__props.card.expanded?unref(icons).BNGFolder:unref(icons).folder},null,8,[`type`])]),_:1})):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_2$35,toDisplayString(_ctx.$tt(__props.card.name)),1)]))}},MissionTile_default=__plugin_vue_export_helper_default(_sfc_main$52,[[`__scopeId`,`data-v-85e164f5`]]),_hoisted_1$43={class:`content-container`},_hoisted_2$34={key:0,class:`grid-list`},_hoisted_3$29={class:`label`},_sfc_main$51={__name:`MissionsGrid`,setup(__props){useUINavScope(`missions-grid`);let data=ref({});onBeforeMount(async()=>{data.value=await Lua_default.core_vehicles.getVehicleTiles()}),onUnmounted(()=>{});function cardClicked(id){let card=data.value.tilesById[id];id&&card.expandGroupKey&&(card.expanded=!card.expanded)}return(_ctx,_cache)=>withDirectives((openBlock(),createBlock(unref(layoutSingle_default),{class:`layout-content-full flex-column`,"bng-ui-scope":`missions-grid`},{default:withCtx(()=>[createVNode(unref(bngScreenHeading_default),{divider:``},{default:withCtx(()=>[..._cache[0]||=[createTextVNode(` Challenges `,-1)]]),_:1}),createBaseVNode(`div`,_hoisted_1$43,[data.value&&data.value.groupsByKey?(openBlock(),createElementBlock(`div`,_hoisted_2$34,[(openBlock(!0),createElementBlock(Fragment,null,renderList(data.value.groupKeys,groupKey=>(openBlock(),createElementBlock(Fragment,null,[data.value.groupsByKey[groupKey].propName==`Type`?(openBlock(),createElementBlock(Fragment,{key:0},[createBaseVNode(`div`,_hoisted_3$29,toDisplayString(data.value.groupsByKey[groupKey].label),1),(openBlock(!0),createElementBlock(Fragment,null,renderList(data.value.groupsByKey[groupKey].tileIdsUnsorted,id=>(openBlock(),createElementBlock(Fragment,null,[data.value.tilesById[id].expandGroupKey?(openBlock(),createBlock(MissionTile_default,{key:0,class:`card`,card:data.value.tilesById[id],onClick:$event=>cardClicked(id)},null,8,[`card`,`onClick`])):createCommentVNode(``,!0),data.value.tilesById[id].expanded?(openBlock(!0),createElementBlock(Fragment,{key:1},renderList(data.value.groupsByKey[data.value.tilesById[id].expandGroupKey].tileIdsUnsorted,subId=>(openBlock(),createBlock(MissionTile_default,{class:`card`,card:data.value.tilesById[subId],onClick:$event=>cardClicked(subId)},null,8,[`card`,`onClick`]))),256)):createCommentVNode(``,!0)],64))),256))],64)):createCommentVNode(``,!0)],64))),256))])):createCommentVNode(``,!0),_cache[1]||=createBaseVNode(`div`,{class:`details-panel`},` Panel `,-1)])]),_:1})),[[unref(BngBlur_default)]])}},MissionsGrid_default=__plugin_vue_export_helper_default(_sfc_main$51,[[`__scopeId`,`data-v-a6877652`]]),_hoisted_1$42={key:0,"bng-ui-scope":`dragHistory`,class:`drag-history-wrapper`},_hoisted_2$33={key:0,class:`drag-history-container`},_hoisted_3$28={class:`drag-history-filters`},_hoisted_4$21={class:`filter-label`},_hoisted_5$19={class:`filter-active`},_hoisted_6$15={key:0,class:`filter-buttons`},_hoisted_7$14={key:1,class:`no-filters`},_hoisted_8$10={class:`drag-history-list`},_hoisted_9$8=[`onClick`],_hoisted_10$6={class:`drag-history-item-content`},_hoisted_11$6={class:`drag-history-meta`},_hoisted_12$5={class:`drag-history-item-label`},_hoisted_13$5={key:1,class:`drag-history-item`},_hoisted_14$5={class:`drag-history-details`},_hoisted_15$5={key:0,class:`drag-history-slip-wrap`},_hoisted_16$5={key:1,class:`drag-history-empty-message`},_hoisted_17$4={key:1,class:`drag-history-container`},_hoisted_18$4={class:`drag-history-details`},_sfc_main$50={__name:`MissionDragHistory`,props:{id:{type:String,required:!0},name:{type:String,required:!0},level:{type:String,required:!0}},setup(__props){useUINavScope(`dragHistory`);let props=__props,entryId=computed(()=>props.id===void 0?void 0:(``+props.id).replace(/\%/g,`/`)),name=computed(()=>props.name===void 0?void 0:props.name),level$1=computed(()=>props.level===void 0?void 0:props.level),historyData=ref(void 0);ref(null);let filterDefinitions=[{key:`brand`,label:`Brand`},{key:`country`,label:`Country`},{key:`drivetrain`,label:`Drivetrain`},{key:`fuelType`,label:`Fuel Type`},{key:`transmission`,label:`Transmission`},{key:`configType`,label:`Config Type`},{key:`inductionType`,label:`Induction Type`},{key:`tree`,label:`Tree Type`}],selectedFilters=ref({}),activeFilters=ref([]),availableFilterOptions=computed(()=>{if(!historyData.value?.history)return{};let options={};return filterDefinitions.forEach(filter=>{options[filter.key]=new Set}),historyData.value.history.forEach(entry=>{let vehicleInfo=entry.racerInfos[0];filterDefinitions.forEach(filter=>{filter.key===`tree`?entry.tree&&options[filter.key].add(entry.tree):vehicleInfo[filter.key]&&options[filter.key].add(vehicleInfo[filter.key])})}),Object.fromEntries(Object.entries(options).map(([key,values])=>[key,[...values].sort().map(value=>({label:value,value}))]))}),filteredHistory=computed(()=>!historyData.value?.history||activeFilters.value.length===0?historyData.value?.history||[]:historyData.value.history.filter(entry=>{let vehicleInfo=entry.racerInfos[0];return activeFilters.value.some(filter=>filter.type===`tree`?entry.tree===filter.value:vehicleInfo[filter.type]===filter.value)}));function setup$3(data){historyData.value=data,historyData.value&&historyData.value.history&&Array.isArray(historyData.value.history)&&historyData.value.history.length>0&&toggleExpand(historyData.value.history[0])}ref({});let selectedEntry=ref(void 0),toggleExpand=entry=>setTimeout(()=>{selectedEntry.value!==entry&&(selectedEntry.value=entry)},0),handleFilterChange=(filterKey,selectedValue)=>{if(!selectedValue||activeFilters.value.some(f=>f.type===filterKey&&f.value===selectedValue))return;let newFilterIndex=filterDefinitions.findIndex(f=>f.key===filterKey),insertIndex=activeFilters.value.findIndex(f=>filterDefinitions.findIndex(fd=>fd.key===f.type)>newFilterIndex),newFilter={type:filterKey,value:selectedValue};insertIndex===-1?activeFilters.value.push(newFilter):activeFilters.value.splice(insertIndex,0,newFilter),selectedEntry.value=filteredHistory.value[0]},exit=()=>window.bngVue.gotoGameState(`play`),start=()=>{Lua_default.gameplay_drag_dragBridge.getHistory(entryId.value).then(setup$3),filterDefinitions.forEach(filter=>{selectedFilters.value[filter.key]=null})},removeFilter=filterToRemove=>{activeFilters.value=activeFilters.value.filter(f=>!(f.type===filterToRemove.type&&f.value===filterToRemove.value)),selectedFilters.value[filterToRemove.type]=null,selectedEntry.value=filteredHistory.value[0]};return onMounted(start),(_ctx,_cache)=>withDirectives((openBlock(),createBlock(unref(layoutSingle_default),{class:`drag-history-layout`},{default:withCtx(()=>[historyData.value===void 0?createCommentVNode(``,!0):withDirectives((openBlock(),createElementBlock(`div`,_hoisted_1$42,[createVNode(unref(bngScreenHeading_default),{preheadings:[_ctx.$t(level$1.value)]},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(name.value))+` History`,1)]),_:1},8,[`preheadings`]),historyData.value&&historyData.value.history&&historyData.value.history.length>0?(openBlock(),createElementBlock(`div`,_hoisted_2$33,[createBaseVNode(`div`,_hoisted_3$28,[(openBlock(),createElementBlock(Fragment,null,renderList(filterDefinitions,filter=>createBaseVNode(`div`,{key:filter.key,class:`filter-item`},[createBaseVNode(`div`,_hoisted_4$21,toDisplayString(filter.label),1),createVNode(unref(bngDropdown_default),{modelValue:selectedFilters.value[filter.key],"onUpdate:modelValue":[$event=>selectedFilters.value[filter.key]=$event,val=>handleFilterChange(filter.key,val)],items:availableFilterOptions.value[filter.key],"show-search":!0},null,8,[`modelValue`,`onUpdate:modelValue`,`items`]),createBaseVNode(`div`,_hoisted_5$19,[activeFilters.value.some(f=>f.type===filter.key)?(openBlock(),createElementBlock(`div`,_hoisted_6$15,[(openBlock(!0),createElementBlock(Fragment,null,renderList(activeFilters.value.filter(f=>f.type===filter.key),activeFilter=>(openBlock(),createBlock(unref(bngButton_default),{key:activeFilter.value,size:`small`,accent:`orange`,onClick:$event=>removeFilter(activeFilter)},{default:withCtx(()=>[createTextVNode(toDisplayString(activeFilter.value)+` × `,1)]),_:2},1032,[`onClick`]))),128))])):(openBlock(),createElementBlock(`div`,_hoisted_7$14,`No filters selected`))])])),64))]),createBaseVNode(`div`,_hoisted_8$10,[createBaseVNode(`div`,{class:normalizeClass([`drag-history-tab-wrapper`,{"drag-history-empty":filteredHistory.value.length===0}])},[filteredHistory.value.length>0?(openBlock(!0),createElementBlock(Fragment,{key:0},renderList(filteredHistory.value,entry=>withDirectives((openBlock(),createElementBlock(`div`,{"bng-nav-item":``,class:normalizeClass([`drag-history-item`,{selected:selectedEntry.value!==void 0&&selectedEntry.value==entry}]),onClick:$event=>toggleExpand(entry)},[createBaseVNode(`div`,_hoisted_10$6,[createBaseVNode(`div`,_hoisted_11$6,[withDirectives(createBaseVNode(`div`,null,null,512),[[unref(BngRelativeTime_default),entry.stripInfo.dateTime]])]),createBaseVNode(`div`,_hoisted_12$5,toDisplayString(entry.stripInfo.dateTime),1)])],10,_hoisted_9$8)),[[unref(BngSoundClass_default),`bng_click_generic_small`]])),256)):(openBlock(),createElementBlock(`div`,_hoisted_13$5,[..._cache[0]||=[createBaseVNode(`div`,{class:`drag-history-item-content`},[createBaseVNode(`div`,{class:`drag-history-item-label`},`No matches found for current filters`)],-1)]]))],2)]),createBaseVNode(`div`,_hoisted_14$5,[createVNode(unref(bngCard_default),{class:`drag-history-content-card`},{default:withCtx(()=>[createVNode(unref(bngCardHeading_default),{class:`drag-history-heading`,type:`ribbon`},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(level$1.value))+` - `+toDisplayString(_ctx.$t(name.value)),1)]),_:1}),filteredHistory.value.length>0?(openBlock(),createElementBlock(Fragment,{key:0},[selectedEntry.value?(openBlock(),createElementBlock(`div`,_hoisted_15$5,[createVNode(Timeslip_default,{class:`drag-history-slip-item`,slip:selectedEntry.value},null,8,[`slip`])])):createCommentVNode(``,!0)],64)):(openBlock(),createElementBlock(`div`,_hoisted_16$5,` No timeslips match the selected filters. Try adjusting your filter criteria. `))]),_:1})])])):(openBlock(),createElementBlock(`div`,_hoisted_17$4,[_cache[2]||=createBaseVNode(`div`,{class:`drag-history-list`},[createBaseVNode(`div`,{class:`drag-history-tab-wrapper drag-history-empty`},[createBaseVNode(`div`,{class:`drag-history-item`},[createBaseVNode(`div`,{class:`drag-history-item-content`},[createBaseVNode(`div`,{class:`drag-history-item-label`},`No History Available`)])])])],-1),createBaseVNode(`div`,_hoisted_18$4,[createVNode(unref(bngCard_default),{class:`drag-history-content-card`},{default:withCtx(()=>[createVNode(unref(bngCardHeading_default),{class:`drag-history-heading`,type:`ribbon`},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$t(level$1.value))+` - `+toDisplayString(_ctx.$t(name.value)),1)]),_:1}),_cache[1]||=createBaseVNode(`div`,{class:`drag-history-empty-message`},` No drag race history yet. Start a practice run or play a drag race challenge! `,-1)]),_:1})])]))])),[[unref(BngOnUiNav_default),exit,`back,menu`]])]),_:1})),[[unref(BngBlur_default)]])}},MissionDragHistory_default=__plugin_vue_export_helper_default(_sfc_main$50,[[`__scopeId`,`data-v-003bb226`]]),_hoisted_1$41={class:`mission-details-layout-content`},_hoisted_2$32={class:`mission-details-topbar`},_hoisted_3$27={class:`details-pages-container`},_hoisted_4$20={class:`mission-details-content`},_hoisted_5$18={class:`available-missions-container`},_hoisted_6$14={key:0,class:`ongoing-mission-buttons`},_hoisted_7$13={key:1,class:`recovery-options-container`},_hoisted_8$9={class:`recovery-options-list`},_hoisted_9$7={class:`mission-card-container`},_hoisted_10$5={key:0,class:`group-header`},_hoisted_11$5={class:`label`},_hoisted_12$4={class:`mission-card-list`},_hoisted_13$4={key:0,class:`mission-info`},_hoisted_14$4={class:`details-content-container`},_hoisted_15$4={class:`details-content-entry`},_hoisted_16$4={key:0,class:`details-info-container`},_hoisted_17$3={class:`details-info-description`},_hoisted_18$3={key:3,class:`details-objectives-container`},_hoisted_19$2={key:0,class:`ongoing-mission-reconfigure-button`},_hoisted_20$2={key:1,class:`ongoing-mission-text`},_hoisted_21$2={key:2,class:`current-details-buttons`},_hoisted_22$2={key:0,class:`simple-settings-container`},_hoisted_23$2={key:1,class:`entry-fee`},_hoisted_24$1={key:2,class:`repair-item`},AVAILABLE_PAGES=[{value:`info`,label:`Info`,icon:`medal`},{value:`settings`,label:`Settings`,icon:`adjust`},{value:`leaderboards`,label:`Leaderboards`,icon:`chartBars`}],_sfc_main$49={__name:`MissionDetailsNew`,setup(__props){let store$1=useMissionDetailsStore(),{context,missionCards,missionBasicInfo,missionStartableDetails,missionSettings,missionProgress,selectedMission,isTutorialEnabled,hideReconfigureButton,hideRecoveryOptions,sameUserSettingsAsLast,preselectedPage}=storeToRefs(store$1),controls$1=controls_default(),scopedNav=useScopedNav(),tasksStore=useTasksStore(),currentPage=ref(`info`);watch(preselectedPage,newPage=>{newPage&&AVAILABLE_PAGES.some(page=>page.value===newPage)&&(currentPage.value=newPage)},{immediate:!0});let availablePages=computed(()=>AVAILABLE_PAGES.filter(page=>!(page.value===`settings`&&hideReconfigureButton.value))),scopeNavState=reactive({missionDetailsActivated:!1}),uiState=reactive({missionStarted:!1,settingsTriggered:!1}),isGamepadAvailable=controls$1.isGamepadAvailable(!0),showTasks=computed(()=>tasksStore.tasks.length>0&&isTutorialEnabled.value),preheadings=computed(()=>missionBasicInfo.value.missionTypeLabels.map(x=>$translate.contextTranslate(x)));computed(()=>{let showRestart=isGamepadAvailable&&isGamepadAvailable.value||sameUserSettingsAsLast.value;return{label:showRestart?`Restart`:`Reconfigure`,icon:showRestart?icons.restart:icons.reconfigure}});let displayedAuthor=computed(()=>missionBasicInfo.value.author||``),displayedDate=computed(()=>missionBasicInfo.value.date?new Date(missionBasicInfo.value.date*1e3).toLocaleDateString():``),showOfficialIcon=computed(()=>!!missionBasicInfo.value.official),showMissionInfo=computed(()=>displayedAuthor.value||displayedDate.value),missionInfoString=computed(()=>displayedAuthor.value&&displayedDate.value?`${displayedAuthor.value} • ${displayedDate.value}`:displayedAuthor.value?displayedAuthor.value:displayedDate.value?displayedDate.value:``),recoveryOptions=computed(()=>store$1.customRecoveryOptionsActiveState?Object.entries(store$1.customRecoveryOptionsActiveState).filter(([key,option])=>option.isRecoveryOption).map(([key,option])=>({key,...option})):[]),unpauseOnUnmount=!0;provide(`animationSettings`,{animate:!0,animateOnMount:!1,animateOnMountIntervalDelay:.2,animateOnEmptyIntervalDelay:.1,animateOnEmpty:!0,animateNextTask:!0,successCallback:()=>Lua_default.Engine.Audio.playOnce(`AudioGui`,`event:>UI>Career>Checkbox`)}),onMounted(()=>{Lua_default.simTimeAuthority.pause(!0)}),onBeforeMount(async()=>{await store$1.init()}),onUnmounted(()=>{store$1.$dispose(),unpauseOnUnmount&&Lua_default.simTimeAuthority.pause(!1)});let startMission=()=>{uiState.missionStarted=!0,window.bngVue.gotoGameState(`blank`,{tryAngular:!1,blankAngularJS:!0}),store$1.startMission()},selectMission=id=>{scopeNavState.missionDetailsActivated=!0,store$1.selectMission(id)},onDetailScopeChanged=(activated,event)=>{scopeNavState.missionDetailsActivated=activated},navigateToPage=(direction$1=1)=>{let nextIndex=(availablePages.value.findIndex(page=>page.value===currentPage.value)+direction$1+availablePages.value.length)%availablePages.value.length;currentPage.value=availablePages.value[nextIndex].value},handleBack=()=>{window.bngVue.gotoGameState(`play`)},handleContinue=async()=>{if(await Lua_default.extensions.gameplay_missions_missionScreen.isAnyMissionActive()){let isMissionStartOrEndScreen=await Lua_default.extensions.gameplay_missions_missionScreen.isMissionStartOrEndScreenActive();if(isMissionStartOrEndScreen){window.bngVue.gotoGameState(`mission-control`,{params:{mode:isMissionStartOrEndScreen}});return}}window.bngVue.gotoGameState(`play`)},handleMainMenu=()=>{unpauseOnUnmount=!1,gotoMenu()},gotoMenu=()=>{Lua_default.career_career.isActive().then(isActive=>{isActive?window.bngVue.gotoAngularState(`menu.careerPause`):window.bngVue.gotoAngularState(`menu.mainmenu`)})},gotoControl=()=>{Lua_default.extensions.gameplay_missions_missionScreen.isAnyMissionActive().then(isMissionActive=>{isMissionActive&&Lua_default.extensions.gameplay_missions_missionScreen.isMissionStartOrEndScreenActive().then(isMissionStartOrEndScreen=>{if(isMissionStartOrEndScreen){window.bngVue.gotoGameState(`mission-control`,{params:{mode:isMissionStartOrEndScreen}});return}}),window.bngVue.gotoGameState(`play`)})},gotoSettings=()=>{currentPage.value=`settings`,scopeNavState.missionDetailsActivated=!0,uiState.settingsTriggered=!0},onDetailsClick=event=>{scopeNavState.missionDetailsActivated||=!0},handleRecoveryOption=optionKey=>{Lua_default.core_recoveryPrompt.buttonPressed(optionKey,{type:`vehicle`,vehId:0})};async function handleExit(event){event.detail.force||await Lua_default.extensions.gameplay_missions_missionManager.getCurrentTaskdataTypeOrNil()||(context.value===`ongoingMission`?gotoControl():gotoMenu())}return(_ctx,_cache)=>withDirectives((openBlock(),createBlock(unref(layoutSingle_default),{class:`mission-details-layout`,onDeactivate:handleExit},{default:withCtx(()=>[createBaseVNode(`div`,_hoisted_1$41,[withDirectives((openBlock(),createElementBlock(`div`,_hoisted_2$32,[createVNode(unref(bngButton_default),{accent:unref(ACCENTS).text,"bng-no-nav":`true`,class:`page-nav`,onClick:_cache[0]||=$event=>navigateToPage(-1)},{default:withCtx(()=>[createVNode(unref(bngIcon_default),{class:`arrow-icon`,type:unref(icons).arrowSmallLeft},null,8,[`type`]),createVNode(unref(bngBinding_default),{"ui-event":`tab_l`,deviceMask:`xinput`,style:normalizeStyle({"--page-nav-icon":`'${unref(icons).arrowSmallLeft.glyph}'`}),class:`page-nav-icon`},null,8,[`style`])]),_:1},8,[`accent`]),createBaseVNode(`div`,_hoisted_3$27,[(openBlock(!0),createElementBlock(Fragment,null,renderList(availablePages.value,page=>(openBlock(),createElementBlock(`span`,{key:page.value,class:normalizeClass([`page`,{"current-page":currentPage.value===page.value}])},[createVNode(unref(bngIcon_default),{type:page.icon,class:`page-icon-button`,onClick:$event=>currentPage.value=page.value},null,8,[`type`,`onClick`])],2))),128))]),createVNode(unref(bngButton_default),{accent:unref(ACCENTS).text,"bng-no-nav":`true`,class:`page-nav`,onClick:_cache[1]||=$event=>navigateToPage(1)},{default:withCtx(()=>[createVNode(unref(bngBinding_default),{"ui-event":`tab_r`,deviceMask:`xinput`,style:normalizeStyle({"--page-nav-icon":`'${unref(icons).arrowSmallRight.glyph}'`}),class:`page-nav-icon`},null,8,[`style`]),createVNode(unref(bngIcon_default),{class:`arrow-icon`,type:unref(icons).arrowSmallRight},null,8,[`type`])]),_:1},8,[`accent`])])),[[unref(BngBlur_default)]]),createBaseVNode(`div`,_hoisted_4$20,[createBaseVNode(`div`,_hoisted_5$18,[unref(context)===`ongoingMission`||showTasks.value?(openBlock(),createBlock(InfoCard_default,{key:0},{header:withCtx(()=>[createVNode(unref(bngCardHeading_default),{type:`ribbon`},{default:withCtx(()=>[..._cache[6]||=[createTextVNode(` Ongoing Challenge `,-1)]]),_:1})]),content:withCtx(()=>[createVNode(TaskList_default,{class:`task-list`,header:unref(tasksStore).header,tasks:unref(tasksStore).tasks},null,8,[`header`,`tasks`])]),button:withCtx(()=>[unref(missionStartableDetails)?(openBlock(),createElementBlock(`div`,_hoisted_6$14,[unref(missionStartableDetails).continueVisible?withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:0,accent:unref(ACCENTS).secondary,"icon-right":unref(icons).catalog02,label:`Main Menu`,class:`large`,onClick:handleMainMenu},null,8,[`accent`,`icon-right`])),[[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0,focusRequired:!0}]]):createCommentVNode(``,!0),recoveryOptions.value.length>0&&!unref(isTutorialEnabled)&&!unref(hideRecoveryOptions)?(openBlock(),createElementBlock(`div`,_hoisted_7$13,[_cache[7]||=createBaseVNode(`div`,{class:`recovery-options-header`},`Recovery Options`,-1),createBaseVNode(`div`,_hoisted_8$9,[(openBlock(!0),createElementBlock(Fragment,null,renderList(recoveryOptions.value,option=>withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:option.key,accent:unref(ACCENTS).secondary,"icon-right":unref(icons)[option.icon],label:option.label,disabled:!option.active||!option.enabled,class:`recovery-option-button`,onClick:$event=>handleRecoveryOption(option.key)},null,8,[`accent`,`icon-right`,`label`,`disabled`,`onClick`])),[[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0,focusRequired:!0}]])),128))])])):createCommentVNode(``,!0),unref(missionStartableDetails).restartVisible?withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:2,accent:unref(ACCENTS).secondary,"icon-right":unref(icons).restart,label:`Restart`,disabled:!unref(store$1).customRecoveryOptionsActiveState?.restartMission?.active,class:`large`,onClick:unref(store$1).restartMission},null,8,[`accent`,`icon-right`,`disabled`,`onClick`])),[[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0,focusRequired:!0}]]):createCommentVNode(``,!0),!unref(hideReconfigureButton)&&!unref(isTutorialEnabled)?withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:3,accent:unref(ACCENTS).secondary,"icon-right":unref(icons).adjust,label:`Reconfigure`,class:`large`,onClick:gotoSettings},null,8,[`accent`,`icon-right`])),[[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0,focusRequired:!0}]]):createCommentVNode(``,!0),unref(missionStartableDetails).abandonVisible?withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:4,"icon-right":unref(icons).abandon,accent:unref(ACCENTS).attention,label:`Abandon`,class:`large`,onClick:unref(store$1).abandonMission},null,8,[`icon-right`,`accent`,`onClick`])),[[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0,focusRequired:!0}]]):createCommentVNode(``,!0),unref(missionStartableDetails).continueVisible?withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:5,"bng-scoped-nav-autofocus":``,"icon-right":unref(icons).fastTravel,label:`Continue`,class:`large`,onClick:handleContinue},null,8,[`icon-right`])),[[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0,focusRequired:!0}]]):createCommentVNode(``,!0),!unref(missionStartableDetails).startableVisible&&!unref(missionStartableDetails).continueVisible?withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:6,"icon-right":unref(icons).lockClosed,label:`Locked`,class:`large`,disabled:``},null,8,[`icon-right`])),[[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0,focusRequired:!0}]]):createCommentVNode(``,!0)])):createCommentVNode(``,!0)]),_:1})):(openBlock(),createBlock(InfoCard_default,{key:1},{header:withCtx(()=>[createVNode(unref(bngCardHeading_default),{type:`ribbon`},{default:withCtx(()=>[..._cache[8]||=[createTextVNode(` Available Challenges `,-1)]]),_:1})]),content:withCtx(()=>[createBaseVNode(`div`,_hoisted_9$7,[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(missionCards).groupKeys,groupKey=>(openBlock(),createElementBlock(`div`,{key:groupKey,class:`mission-group`},[unref(missionCards).groupsByKey[groupKey].label?(openBlock(),createElementBlock(`div`,_hoisted_10$5,[createBaseVNode(`div`,_hoisted_11$5,toDisplayString(_ctx.$ctx_t(unref(missionCards).groupsByKey[groupKey].label)),1),unref(missionCards).groupsByKey[groupKey].meta.formattedLeague?(openBlock(),createBlock(unref(bngMainStars_default),{key:0,"unlocked-stars":unref(missionCards).groupsByKey[groupKey].meta.formattedLeague.totalStarsObtained,"total-stars":unref(missionCards).groupsByKey[groupKey].meta.formattedLeague.totalStarsAvailable,class:`league-stars`,scale:.6,reverse:``,numerical:``},null,8,[`unlocked-stars`,`total-stars`])):createCommentVNode(``,!0)])):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_12$4,[(openBlock(!0),createElementBlock(Fragment,null,renderList(unref(missionCards).groupsByKey[groupKey].tileIdsUnsorted,id=>withDirectives((openBlock(),createBlock(MissionCard_default,{key:id,"data-mission-id":id,"bng-scoped-nav-autofocus":unref(selectedMission).id===id||!unref(selectedMission).id&&id===unref(missionCards).groupsByKey[groupKey].tileIdsUnsorted[0],mission:unref(missionCards).tilesById[id],class:normalizeClass([{highlighted:unref(selectedMission).id===id},`mission-card`]),onClick:withModifiers($event=>selectMission(id),[`stop`]),onFocusin:$event=>unref(store$1).selectMission(id)},null,8,[`data-mission-id`,`bng-scoped-nav-autofocus`,`mission`,`class`,`onClick`,`onFocusin`])),[[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0,focusRequired:!0}]])),128))])]))),128))])]),button:withCtx(()=>[withDirectives((openBlock(),createBlock(unref(bngButton_default),{accent:unref(ACCENTS).attention,"bng-no-nav":`true`,class:`exit-button`,onClick:handleBack},{default:withCtx(()=>[scopeNavState.missionDetailsActivated?createCommentVNode(``,!0):(openBlock(),createBlock(unref(bngBinding_default),{key:0,"ui-event":`back`,deviceMask:`xinput`})),_cache[9]||=createTextVNode(` Back `,-1)]),_:1},8,[`accent`])),[[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0,focusRequired:!0}],[unref(BngSoundClass_default),`bng_back_generic`]])]),_:1}))]),withDirectives((openBlock(),createElementBlock(`div`,{class:`current-details-container`,onActivate:_cache[4]||=$event=>onDetailScopeChanged(!0,$event),onDeactivate:_cache[5]||=$event=>onDetailScopeChanged(!1,$event)},[unref(missionBasicInfo)?(openBlock(),createBlock(InfoCard_default,{key:0,onClick:onDetailsClick},{header:withCtx(()=>[createVNode(bngAdvCardHeading_default,{mute:``,divider:``,preheadings:preheadings.value,icon:unref(missionBasicInfo).icon,class:`current-details-header`},{default:withCtx(()=>[createTextVNode(toDisplayString(_ctx.$ctx_t(unref(missionBasicInfo).name)),1)]),_:1},8,[`preheadings`,`icon`]),showMissionInfo.value?(openBlock(),createElementBlock(`div`,_hoisted_13$4,[showOfficialIcon.value?(openBlock(),createBlock(unref(bngIcon_default),{key:0,type:unref(icons).beamNG,class:`official-icon`},null,8,[`type`])):createCommentVNode(``,!0),createTextVNode(` `+toDisplayString(missionInfoString.value),1)])):createCommentVNode(``,!0),unref(scopedNav).isGamepadActive&&scopeNavState.missionDetailsActivated?withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:1,accent:unref(ACCENTS).attention,"bng-no-nav":`true`,tabindex:`-1`,class:`details-back-binding`,onClick:_cache[2]||=withModifiers($event=>scopeNavState.missionDetailsActivated=!1,[`stop`])},{default:withCtx(()=>[createVNode(unref(bngIcon_default),{type:unref(icons).arrowSmallLeft},null,8,[`type`]),createVNode(unref(bngBinding_default),{"ui-event":`back`,deviceMask:`xinput`}),createTextVNode(` `+toDisplayString(unref(context)===`ongoingMission`?`Back`:`Return to list`),1)]),_:1},8,[`accent`])),[[unref(BngSoundClass_default),`bng_back_generic`]]):createCommentVNode(``,!0)]),content:withCtx(()=>[createBaseVNode(`div`,_hoisted_14$4,[createBaseVNode(`div`,_hoisted_15$4,[currentPage.value===`info`?(openBlock(),createElementBlock(`div`,_hoisted_16$4,[unref(missionBasicInfo).images?(openBlock(),createBlock(unref(aspectRatio_default),{key:0,class:`details-info-preview`},{default:withCtx(()=>[createVNode(unref(bngImageCarousel_default),{images:unref(missionBasicInfo).images,transition:``,external:``},null,8,[`images`])]),_:1})):createCommentVNode(``,!0),createBaseVNode(`div`,_hoisted_17$3,toDisplayString(_ctx.$ctx_t(unref(missionBasicInfo).description)),1)])):currentPage.value===`settings`?(openBlock(),createElementBlock(Fragment,{key:1},[unref(missionSettings)&&!showTasks.value?(openBlock(),createBlock(MissionSettings_default,{key:0,"no-blur":``})):createCommentVNode(``,!0)],64)):currentPage.value===`leaderboards`?(openBlock(),createElementBlock(Fragment,{key:2},[unref(selectedMission)&&!showTasks.value?(openBlock(),createBlock(MissionLeaderboards_default,{key:0,"no-blur":``})):createCommentVNode(``,!0)],64)):createCommentVNode(``,!0),currentPage.value===`info`||currentPage.value===`settings`?(openBlock(),createElementBlock(`div`,_hoisted_18$3,[unref(missionProgress)?(openBlock(),createBlock(MissionObjectives_default,{key:0,stars:unref(missionProgress).stars,message:unref(missionProgress).message,showMessage:!0,noDisabledObjectives:!0,"no-blur":``,"card-heading-type":`line`},null,8,[`stars`,`message`])):createCommentVNode(``,!0)])):createCommentVNode(``,!0)])])]),button:withCtx(()=>[unref(context)===`ongoingMission`&¤tPage.value===`settings`?(openBlock(),createElementBlock(`div`,_hoisted_19$2,[withDirectives(createVNode(unref(bngButton_default),{accent:unref(ACCENTS).secondary,"icon-right":unref(icons).reconfigure,disabled:unref(sameUserSettingsAsLast),label:`Reconfigure and Restart mission`,class:`large`,onClick:unref(store$1).reconfigureMission},null,8,[`accent`,`icon-right`,`disabled`,`onClick`]),[[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0,focusRequired:!0}]])])):unref(context)===`ongoingMission`&¤tPage.value!==`settings`?(openBlock(),createElementBlock(`div`,_hoisted_20$2,toDisplayString(_ctx.$t(`missions.missions.general.challengeCurrentlyInProgress`)),1)):unref(context)===`availableMissions`?(openBlock(),createElementBlock(`div`,_hoisted_21$2,[currentPage.value===`info`&&unref(context)===`availableMissions`&&unref(missionSettings)&&unref(missionSettings).length>0?(openBlock(),createElementBlock(`div`,_hoisted_22$2,[withDirectives(createVNode(MissionSettingsSimple_default,{"mission-settings":unref(missionSettings),noInput:!0,onClick:_cache[3]||=()=>currentPage.value=`settings`},null,8,[`mission-settings`]),[[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0,focusRequired:!0}]])])):createCommentVNode(``,!0),unref(missionBasicInfo)&&unref(missionBasicInfo).entryFee?(openBlock(),createElementBlock(`div`,_hoisted_23$2,[_cache[10]||=createBaseVNode(`span`,{class:`label`},`Entry Fee:`,-1),createVNode(RewardsPills_default,{class:`tiny-rewards`,rewards:unref(missionBasicInfo).entryFee},null,8,[`rewards`])])):createCommentVNode(``,!0),unref(missionStartableDetails).needsRepair?(openBlock(),createElementBlock(`div`,_hoisted_24$1,[createVNode(unref(bngSelect_default),{loop:``,options:unref(missionStartableDetails).repairOptions,value:unref(missionStartableDetails).selectedRepairType,config:{label:x=>x.optionsLabel,value:x=>x.type},class:`repair-item-control`,onValueChanged:unref(store$1).changeRepairType},null,8,[`options`,`value`,`config`,`onValueChanged`])])):createCommentVNode(``,!0),unref(missionStartableDetails).needsRepair&&unref(missionStartableDetails).startableVisible?withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:3,"bng-scoped-nav-autofocus":``,"icon-left":unref(icons).wrench,disabled:!unref(missionStartableDetails).startableEnabled,label:unref(missionStartableDetails).selectedRepairTypeLabel,class:`large`,onClick:startMission},null,8,[`icon-left`,`disabled`,`label`])),[[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0,focusRequired:!0}]]):withDirectives((openBlock(),createBlock(unref(bngButton_default),{key:4,"bng-scoped-nav-autofocus":``,disabled:!unref(missionStartableDetails).startableEnabled,label:unref(missionStartableDetails).selectedRepairTypeLabel,class:`large`,onClick:startMission},{default:withCtx(()=>[..._cache[11]||=[createTextVNode(` Start Challenge `,-1)]]),_:1},8,[`disabled`,`label`])),[[unref(BngOnUiNav_default),void 0,`ok`,{asMouse:!0,focusRequired:!0}]])])):createCommentVNode(``,!0)]),_:1})):createCommentVNode(``,!0)],32)),[[unref(BngScopedNav_default),{activated:scopeNavState.missionDetailsActivated,type:`container`}]])])])]),_:1})),[[unref(BngScopedNav_default),{activateOnMount:!0,actionsOnSuspend:[unref(ACTIONS_ON_SUSPEND).allowNavigationLastNavItem]}],[unref(BngOnUiNav_default),()=>navigateToPage(-1),`tab_l`],[unref(BngOnUiNav_default),()=>navigateToPage(1),`tab_r`],[unref(BngOnUiNav_default),gotoControl,`menu`]])}},MissionDetailsNew_default=__plugin_vue_export_helper_default(_sfc_main$49,[[`__scopeId`,`data-v-cacd7a66`]]),routes_default$10=[{path:`/mission`,children:[{path:`details`,name:`mission-details`,component:MissionDetailsNew_default,meta:{infoBar:{visible:!0,showSysInfo:!1,hints:CROSSFIRE_HINTS_ALL},uiApps:{shown:!1}}},{path:`mission-control/:mode(\\*?.*?)?`,name:`mission-control`,component:MissionControl_default,meta:{uiApps:{shown:!1}},infoBar:{visible:!0,showSysInfo:!1,hints:CROSSFIRE_HINTS_ALL},props:!0},{path:`grid`,name:`missions-grid`,component:MissionsGrid_default,meta:{uiApps:{shown:!1}}},{path:`dragHistory/:id(\\*?.*?)?:name?/:level?/`,name:`dragHistory`,component:MissionDragHistory_default,meta:{uiApps:{shown:!1},infoBar:{visible:!0,showSysInfo:!1,hints:CROSSFIRE_HINTS_ALL}},props:!0}]}],_hoisted_1$40=[`innerHTML`],_hoisted_2$31=[`innerHTML`],_hoisted_3$26=[`innerHTML`],_sfc_main$48={__name:`OnlineConsentView`,setup(__props){useUINavScope(`consent`);let settings$1=useSettings(),{lua}=useBridge(),onlineFeaturesData=ref({}),telemetryData=ref({}),confirmationData=ref({}),parseDescription=descKey=>parse$1($translate.instant(descKey)),onlineFeaturesHtml=computed(()=>parseDescription(`ui.mainmenu.onlineFeatures.featureDescription`)),telemetryDescription=computed(()=>parseDescription(onlineFeaturesData.value.choice===`enable`?`ui.mainmenu.telemetry.featureDescription`:`ui.mainmenu.telemetryOnlineHint`)),confirmationHtml=computed(()=>parseDescription(`ui.mainmenu.privacyPolicyHint`)),onStepComplete=({stepId,data})=>{stepId===`onlineFeatures`&&(telemetryData.value=data.choice===`enable`?{}:{choice:`disable`})},onFinish=async()=>{try{let settingsToApply={};onlineFeaturesData.value.choice&&(settingsToApply.onlineFeatures=onlineFeaturesData.value.choice),telemetryData.value.choice&&(settingsToApply.telemetry=telemetryData.value.choice),await settings$1.apply(settingsToApply),settingsToApply.telemetry===`enable`?console.log(`Starting telemetry...`):settingsToApply.telemetry===`disable`&&console.log(`Unloading telemetry...`),backToMenu()}catch(error){console.error(`Error applying consent settings:`,error)}},backToMenu=()=>window.bngVue.gotoAngularState(`menu.mainmenu`);return onMounted(async()=>{await settings$1.waitForData();let onlineFeatures=settings$1.values.onlineFeatures;onlineFeatures&&onlineFeatures!==`ask`&&(onlineFeaturesData.value={choice:onlineFeatures});let telemetry=settings$1.values.telemetry;telemetry&&telemetry!==`ask`&&(telemetryData.value={choice:telemetry})}),(_ctx,_cache)=>withDirectives((openBlock(),createBlock(unref(WizardView_default),{title:`ui.mainmenu.onlineFeatures.featureTitle`,preheadings:[`Privacy & Features`],style:{"--wizard-height":`45rem`},"bng-ui-scope":`consent`,onStepComplete,onWizardFinish:onFinish},{default:withCtx(()=>[createVNode(unref(WizardStep_default),{id:`onlineFeatures`,title:`ui.options.onlineFeatures`,type:`choice`,modelValue:onlineFeaturesData.value,"onUpdate:modelValue":_cache[0]||=$event=>onlineFeaturesData.value=$event,choices:[{value:`disable`,label:`ui.common.no`,isNo:!0},{value:`enable`,label:`ui.common.yes`,isYes:!0}]},{description:withCtx(()=>[createBaseVNode(`div`,{innerHTML:onlineFeaturesHtml.value},null,8,_hoisted_1$40)]),_:1},8,[`modelValue`]),createVNode(unref(WizardStep_default),{id:`telemetry`,title:`ui.options.telemetry`,type:`choice`,modelValue:telemetryData.value,"onUpdate:modelValue":_cache[1]||=$event=>telemetryData.value=$event,"auto-skip":!0,"enabled-when":[{step:`onlineFeatures`,value:`enable`}],choices:[{value:`disable`,label:`ui.common.no`,isNo:!0},{value:`enable`,label:`ui.common.yes`,isYes:!0}]},{description:withCtx(()=>[createBaseVNode(`div`,{innerHTML:telemetryDescription.value},null,8,_hoisted_2$31)]),_:1},8,[`modelValue`]),createVNode(unref(WizardStep_default),{id:`confirmation`,title:`ui.consent.confirmation`,type:`confirmation`,modelValue:confirmationData.value,"onUpdate:modelValue":_cache[2]||=$event=>confirmationData.value=$event},{description:withCtx(()=>[createBaseVNode(`div`,{innerHTML:confirmationHtml.value},null,8,_hoisted_3$26)]),default:withCtx(()=>[createVNode(unref(WizardSummary_default))]),_:1},8,[`modelValue`])]),_:1})),[[unref(BngBlur_default)],[unref(BngOnUiNav_default),backToMenu,`menu,back`]])}},OnlineConsentView_default=_sfc_main$48,routes_default$11=[{path:`/online-consent`,name:`menu.onlineFeatures`,component:OnlineConsentView_default,meta:{infoBar:{visible:!0,showSysInfo:!0},uiApps:{shown:!1}}}],_sfc_main$47={__name:`CategoryTop`,props:{index:Number,hasSubcategories:Boolean,icon:String,selected:Boolean,disabled:Boolean,hiddenByCondition:Boolean,debugSettings:Boolean},emits:[`click`],setup(__props,{emit:__emit}){let emit$1=__emit;return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,{class:normalizeClass({"options-category":!0,selected:__props.selected,"has-subcategories":__props.hasSubcategories,"hidden-by-condition":__props.hiddenByCondition})},[createVNode(unref(bngButton_default),{class:normalizeClass({"options-category-button":!0,selected:__props.selected,"no-hover":__props.selected}),accent:unref(ACCENTS).custom,icon:__props.icon||`_empty`,disabled:__props.disabled,"bng-no-nav":``,onClick:_cache[0]||=$event=>emit$1(`click`)},{default:withCtx(()=>[createVNode(unref(textScroller_default),null,{default:withCtx(()=>[createTextVNode(toDisplayString(__props.debugSettings?`🐞`:``),1),renderSlot(_ctx.$slots,`default`,{},void 0,!0)]),_:3})]),_:3},8,[`class`,`accent`,`icon`,`disabled`])],2))}},CategoryTop_default=__plugin_vue_export_helper_default(_sfc_main$47,[[`__scopeId`,`data-v-7d90db8f`]]),_hoisted_1$39={key:0,class:`subcategory-svg-icon`},_hoisted_2$30={key:1,class:`subcategory-deco`},_sfc_main$46={__name:`CategorySide`,props:{index:Number,hasSubcategories:Boolean,subcategory:String,icon:String,selected:Boolean,editable:Boolean,disabled:Boolean,hiddenByCondition:Boolean,debugSettings:Boolean},emits:[`click`,`focus`,`edit-cmd`],setup(__props,{emit:__emit}){let canEdit,EditUI=null,EditFloater=computed(()=>null?.value?.EditFloater),emit$1=__emit,emitEdit=(event,...args)=>void 0;return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,{class:normalizeClass({"options-category":!0,editable:__props.editable,selected:__props.selected,subcategory:__props.subcategory,[`subcategory-${__props.subcategory}`]:__props.subcategory,"has-subcategories":__props.hasSubcategories,"hidden-by-condition":__props.hiddenByCondition})},[__props.hasSubcategories?(openBlock(),createElementBlock(`div`,_hoisted_1$39,[..._cache[2]||=[createBaseVNode(`svg`,{width:`100%`,height:`100%`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},[createBaseVNode(`path`,{d:`M3 12C3 10.8954 3.89543 10 5 10C6.10457 10 7 10.8954 7 12C7 13.1046 6.10457 14 5 14C3.89543 14 3 13.1046 3 12Z`,fill:`var(--bng-off-white)`}),createBaseVNode(`path`,{d:`M10 12C10 10.8954 10.8954 10 12 10C13.1046 10 14 10.8954 14 12C14 13.1046 13.1046 14 12 14C10.8954 14 10 13.1046 10 12Z`,fill:`var(--bng-off-white)`}),createBaseVNode(`path`,{d:`M17 12C17 10.8954 17.8954 10 19 10C20.1046 10 21 10.8954 21 12C21 13.1046 20.1046 14 19 14C17.8954 14 17 13.1046 17 12Z`,fill:`var(--bng-off-white)`})],-1)]])):createCommentVNode(``,!0),__props.subcategory&&__props.subcategory!==`none`?(openBlock(),createElementBlock(`div`,_hoisted_2$30)):createCommentVNode(``,!0),createVNode(unref(bngButton_default),{class:normalizeClass({"options-category-button":!0,selected:__props.selected,"no-hover":__props.selected}),accent:unref(ACCENTS).custom,icon:__props.icon||`_empty`,disabled:__props.disabled,onClick:_cache[0]||=$event=>emit$1(`click`),onFocus:_cache[1]||=$event=>emit$1(`focus`)},{default:withCtx(()=>[createTextVNode(toDisplayString(__props.debugSettings?`🐞`:``),1),renderSlot(_ctx.$slots,`default`,{},void 0,!0)]),_:3},8,[`class`,`accent`,`icon`,`disabled`]),unref(void 0)&&__props.editable?(openBlock(),createBlock(resolveDynamicComponent(EditFloater.value),{key:2,class:`options-edit`,"no-menu":``,onEmitEditCmd:emitEdit},null,32)):createCommentVNode(``,!0)],2))}},CategorySide_default=__plugin_vue_export_helper_default(_sfc_main$46,[[`__scopeId`,`data-v-2403a7c6`]]),_hoisted_1$38={class:`options-settings-list`},_hoisted_2$29={class:`options-settings-list-header`},_hoisted_3$25={class:`options-settings-list-items`},_hoisted_4$19=[`onClick`],_sfc_main$45={__name:`SettingsList`,setup(__props){let settingsList=inject(`settingsList`),goToSetting=inject(`goToSetting`),settingsMode=reactive({assigned:!0,unassigned:!1}),search$1=ref(``),settingsListView=computed(()=>{if(!settingsMode.assigned&&!settingsMode.unassigned)return[];let res=Object.entries(settingsList.value).map(([name,setting])=>({name,...setting})).sort((a$1,b)=>a$1.name.localeCompare(b.name));return(!settingsMode.assigned||!settingsMode.unassigned)&&(res=res.filter(setting=>setting.assigned===settingsMode.assigned)),search$1.value&&(res=res.filter(setting=>setting.name.toLowerCase().includes(search$1.value.toLowerCase()))),res});return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1$38,[createBaseVNode(`div`,_hoisted_2$29,[createBaseVNode(`div`,null,[(openBlock(!0),createElementBlock(Fragment,null,renderList(settingsMode,(val,name)=>(openBlock(),createBlock(unref(bngPillCheckbox_default),{key:name,modelValue:settingsMode[name],"onUpdate:modelValue":$event=>settingsMode[name]=$event},{default:withCtx(()=>[createTextVNode(toDisplayString(name),1)]),_:2},1032,[`modelValue`,`onUpdate:modelValue`]))),128))]),createVNode(unref(bngInput_default),{modelValue:search$1.value,"onUpdate:modelValue":_cache[0]||=$event=>search$1.value=$event,"floating-label":`Search`,"leading-icon":unref(icons).search},null,8,[`modelValue`,`leading-icon`])]),withDirectives((openBlock(),createElementBlock(`div`,_hoisted_3$25,[(openBlock(!0),createElementBlock(Fragment,null,renderList(settingsListView.value,setting=>(openBlock(),createElementBlock(`div`,{class:`options-settings-list-item`,key:setting.name},[createBaseVNode(`div`,null,toDisplayString(setting.name),1),createBaseVNode(`div`,null,[(openBlock(!0),createElementBlock(Fragment,null,renderList(setting.assignedIn,(cat,index)=>(openBlock(),createElementBlock(Fragment,{key:index},[index>0?(openBlock(),createElementBlock(Fragment,{key:0},[createTextVNode(`, `)],64)):createCommentVNode(``,!0),createBaseVNode(`span`,{class:`options-goto`,onClick:$event=>unref(goToSetting)(cat[1],cat[2])},toDisplayString(_ctx.$tt(cat[0])),9,_hoisted_4$19)],64))),128))])]))),128))])),[[unref(BngUiNavScroll_default),void 0,void 0,{force:!0}]])]))}},SettingsList_default=__plugin_vue_export_helper_default(_sfc_main$45,[[`__scopeId`,`data-v-f1159da1`]]),_hoisted_1$37={class:`options-licenses-text`},_hoisted_2$28={class:`options-licenses-text`},file=`licenses.txt`,_sfc_main$44={__name:`Licenses`,setup(__props){let licenses=ref([]);return onMounted(async()=>{try{let resp=await getFile(getURL(`/${file}`));try{let lines=(resp||``).split(`
`);if(lines.length<=1)throw Error(`No lines`);let res=[],cur={label:``,text:``};for(let line of lines)line=line.trimEnd(),line.startsWith(`===`)?line.charAt(4)!==`=`&&(cur={label:line.substring(3),text:``},res.push(cur)):cur.text+=line+`
@/lua/ge/extensions/ui/topBar.lua
for _, substate in pairs(item.substates) do
if string.sub(M.state.currentUIState, 1, #substate) == substate then
M.state.activeItem = item.id
-- -- remove leading slash from state
-- if type(state) == "string" and string.sub(state, 1, 1) == "/" then
-- state = string.sub(state, 2)
-- if type(state) == "string" and string.sub(state, 1, 1) == "/" then
-- state = string.sub(state, 2)
-- end
-- -- TODO: popup check is a hack for now. maybe we can check popup state from lua instead
-- if not opened or M.state.currentUIState == state or (type(state) == "string" and string.sub(state, 1, 5) == "popup") then
-- return
@/lua/ge/extensions/editor/materialEditor.lua
local filepath = currentMaterial:getField(k, i)
if tmp ~= "" and string.sub(filepath, 1, 1) ~= '/' then
filepath = "/"..filepath
@/lua/ge/extensions/util/docCreator.lua
if out.pidvid then
out.pid = out.pidvid:sub(1, 4)
out.vid = out.pidvid:sub(5, 8)
out.pid = out.pidvid:sub(1, 4)
out.vid = out.pidvid:sub(5, 8)
end
if info.vendorName then
if string.lower(string.sub(name, 1, string.len(info.vendorName))) == string.lower(info.vendorName) then
name = string.sub(name, string.len(info.vendorName) + 1)
if string.lower(string.sub(name, 1, string.len(info.vendorName))) == string.lower(info.vendorName) then
name = string.sub(name, string.len(info.vendorName) + 1)
name = name:gsub("^%s+", "") -- strip whitespaces
@/lua/ge/extensions/ui/uiNavi.lua
if minimapImage:startswith("/") then
minimapImage = minimapImage:sub(2)
end
@/lua/ge/extensions/gameplay/drift/saveLoad.lua
local dir, _, _ = path.split(file)
local spotId = level .."/".. string.sub(dir, #levelSpotsDir+1, -2)
-- main data
@/lua/common/jit/v.lua
local oidx = 6 * info
info = sub(vmdef.bcnames, oidx+1, oidx+6)
end
@/gameplay/missionTypes/busMode/constructor.lua
if hex:len() == 3 then
return {(tonumber("0x"..hex:sub(1,1))*17)/255, (tonumber("0x"..hex:sub(2,2))*17)/255, (tonumber("0x"..hex:sub(3,3))*17)/255, 1}
else
if hex:len() == 3 then
return {(tonumber("0x"..hex:sub(1,1))*17)/255, (tonumber("0x"..hex:sub(2,2))*17)/255, (tonumber("0x"..hex:sub(3,3))*17)/255, 1}
else
if hex:len() == 3 then
return {(tonumber("0x"..hex:sub(1,1))*17)/255, (tonumber("0x"..hex:sub(2,2))*17)/255, (tonumber("0x"..hex:sub(3,3))*17)/255, 1}
else
else
return {tonumber("0x"..hex:sub(1,2))/255, tonumber("0x"..hex:sub(3,4))/255, tonumber("0x"..hex:sub(5,6))/255, 1}
end
else
return {tonumber("0x"..hex:sub(1,2))/255, tonumber("0x"..hex:sub(3,4))/255, tonumber("0x"..hex:sub(5,6))/255, 1}
end
else
return {tonumber("0x"..hex:sub(1,2))/255, tonumber("0x"..hex:sub(3,4))/255, tonumber("0x"..hex:sub(5,6))/255, 1}
end
@/lua/ge/extensions/editor/preferences.lua
if string.len(defVal) > 100 then
defVal = string.sub(defVal, 1, 100) .. "..."
end
@/lua/ge/extensions/career/modules/inventory.lua
local dir, filename, ext = path.split(files[i])
local fileNameNoExt = string.sub(filename, 1, -6)
local inventoryId = tonumber(fileNameNoExt)
@/lua/vehicle/extensions/inputAnalyzer.lua
if inputLength >= is.stringLength then
local subStr = inputString:sub(inputLength - is.stringLength + 1)
if subStr == is.string then
if inputLength > 16 then
inputString = inputString:sub(2)
end
@/lua/common/libs/luasec/ssl.lua
local len = str:byte(i)
array[#array + 1] = str:sub(i + 1, i + len)
i = i + len + 1
@/lua/common/libs/LuLPeg/lulpeg.lua
local function patt_error (s, i)
local msg = (#s < i + 20) and s:sub(i)
or s:sub(i,i+20) .. "..."
local msg = (#s < i + 20) and s:sub(i)
or s:sub(i,i+20) .. "..."
msg = ("pattern error near '%s'"):format(msg)
local e = #c + i
if s:sub(i, e - 1) == c then return e else return nil end
end
@/lua/common/utils/pixellib.lua
for i = 1, string.len(text) do
local c = string.sub(text, i, i)
if c == ' ' then
for dx = 1, string.len(cl[dy]) do
local cf = string.sub(cl[dy], dx, dx)
if cf ~= ' ' then
@/flowgraphEditor/Tower/customNodes/towerNode.lua
local _, fn, ext = path.split(room.file, true)
local name = generateObjectNameForClass('Prefab', string.format("%s - %d - ", string.sub(fn, 1, string.len(fn) - string.len(ext)-1), i))
local scenetreeObject = spawnPrefab(name , self.mgr.savedDir .. room.file, "0 0 0", "0 0 1 0", "1 1 1", false)
@/lua/common/jsonDebug.lua
local infend = si + 6
if sub(s, si, infend) == "1#INF00" then
return math.huge, infend + 1
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
end
r = tonumber(sub(s, si, i - 1))
if r == nil then
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 ch == 34 then -- "
return sub(s, si1, i - 2), i
end
i = i - 1
key = sub(s, si, i)
@/lua/common/jsonPrettyEncoderCustom.lua
-- collapse anything below bindings that has less than 4 items
return path:sub(1,10) == '/bindings/' and tableSize(item) < 4
end
@/lua/ge/extensions/scenario/scenarios.lua
for _, wp in ipairs(scenario.lapConfig) do
if wp:sub(1,12) ~= '__generated_' then -- only process non-generated WPs
if scenario.nodes[wp] == nil then
if type(entry) == 'string' then
if not tableContains(triggers, entry) and not tableContains(waypoints, entry) and entry:sub(1,12) ~= '__generated_' then
log('E', logTag, 'Lapconfig entry is Invalid! It should be either a Trigger or Waypoint: '..entry)
@/lua/ge/extensions/editor/api/dynamicDecals.lua
local rdnNumber = math.random(1, #randomStringChars)
res = res .. string.sub(randomStringChars, rdnNumber, rdnNumber)
end
local _, filename, extension = path.split(layerData.decalColorTexturePath)
colorMapTextureString = string.sub(filename, 1, #filename - (#extension + 1))
elseif layerData.type == M.layerTypes.textureFill then
if filename ~= "" then
colorMapTextureString = string.sub(filename, 1, #filename - (#extension + 1))
end
if filename ~= "" then
normalMapTextureString = string.sub(filename, 1, #filename - (#extension + 1))
end
if filename ~= "" then
metallicMapTextureString = string.sub(filename, 1, #filename - (#extension + 1))
end
if filename ~= "" then
roughnessMapTextureString = string.sub(filename, 1, #filename - (#extension + 1))
end
if filename ~= "" then
alphaMapTextureString = string.sub(filename, 1, #filename - (#extension + 1))
end
@/lua/ge/extensions/gameplay/missions/missions.lua
while string.endswith(missionData.description, "\n") do
missionData.description = string.sub(missionData.description, 1, -2)
end
--dump(missionId)
missionId = string.sub(missionDir, #missionsDir+1)
missionData.id = missionId
local missionDir, _, _ = path.split(missionInfo)
missionDir = string.sub(missionDir,0,-2)
local missionData = loadMission(missionDir)
for _, file in ipairs(files) do
local gen = require(file:sub(0,-5))
gen.generate = gen.generate or nop
@/lua/ge/extensions/editor/flowgraph/examples.lua
local dirname, fn, e = path.splitWithoutExt(filename, true)
local path = dirname:sub(string.len(stateTemplatePath) + 1)
local moduleName = fn
--local requireFilename = string.sub(filename, 1, string.len(filename) - 4)
local lectionData = {}
if not pos2 then
im.Text(label:sub(pos1))
break
elseif pos1 < pos2 then
im.Text(label:sub(pos1, pos2 - 1))
im.SameLine()
local pos3 = pos2 + highlightLowerLen
im.TextColored(matchColor, label:sub(pos2, pos3))
im.SameLine()
@/lua/ge/extensions/editor/assetManagementTool.lua
if string.sub(path, 1, size) == newPathNotSetString then
return false
for hash, asset in pairs(assetsByHash) do
if string.sub(asset.targetPath, 1, size) == newPathNotSetString then
return false
@/lua/vehicle/controller/vehicleController/shiftLogic/dctGearbox.lua
modePrefix = "S"
elseif string.sub(automaticHandling.mode, 1, 1) == "M" then
modePrefix = "M"
local manualModeIndex
if string.sub(automaticHandling.mode, 1, 1) == "M" then
manualModeIndex = string.sub(automaticHandling.mode, 2)
if string.sub(automaticHandling.mode, 1, 1) == "M" then
manualModeIndex = string.sub(automaticHandling.mode, 2)
end
if string.find(automaticHandling.mode, "M") then
local gearIndex = tonumber(string.sub(automaticHandling.mode, 2))
gearRatio = gearbox.gearRatios[gearIndex]
if string.find(automaticHandling.mode, "M") then
local gearIndex = tonumber(string.sub(automaticHandling.mode, 2))
gearRatio = gearbox.gearRatios[gearIndex]
local isManualMode = string.sub(automaticHandling.mode, 1, 1) == "M"
--enforce things like L and M modes
for i = 1, modeCount do
local mode = modes:sub(i, i)
if automaticHandling.availableModeLookup[mode] then
@/lua/ge/extensions/freeroam/bigMapMode.lua
if not mission then
mission = gameplay_missions_missions.getMissionById(string.sub(missionId, 1, -3))
end
@/lua/ge/extensions/util/compileMeshes.lua
local src = f
local dst = dir1 .. filename:sub(1, -4) .. 'cdae'
local dstData = '' -- dir1 .. filename:sub(1, -4) .. 'meshes.json' -- do not use this feature for now
local dst = dir1 .. filename:sub(1, -4) .. 'cdae'
local dstData = '' -- dir1 .. filename:sub(1, -4) .. 'meshes.json' -- do not use this feature for now
local cacheFilename = nil
@/lua/vehicle/controller/drivingDynamics/actuators/electronicSplitShaftLock.lua
if slashPos then
nameString = nameString:sub(slashPos + 1)
end
@/lua/ge/extensions/editor/tech/roadArchitect/utilities.lua
if lastSeparator then
return path:sub(1, lastSeparator)
end
@/lua/vehicle/controller/vehicleController/shiftLogic/electricMotor.lua
for i = 1, modeCount do
local mode = modes:sub(i, i)
if automaticHandling.availableModeLookup[mode] then
@/lua/vehicle/controller/propAnimation/dualAxisLever.lua
local function handleMSModes(desiredMode)
local firstLetter = desiredMode:sub(1, 1)
if firstLetter == "S" then
elseif firstLetter == "M" then
local gearIndex = desiredMode:sub(2, desiredMode:len())
desiredMode = "M"
--get the base this mode relates to
local modeBaseName = impulseMode.modeName:sub(1, modeNameLength - 1)
--we need to actually have the base mode for this to work
@/lua/common/libs/lua-luaepnf/epnf.lua
local string, io = assert( string ), assert( io )
local V = string.sub( assert( _VERSION ), -4 )
local _G = assert( _G )
for i = 1, p do
if string.sub( s, i, i ) == "\n" then
lno = lno + 1
for i = sol, #s do
if string.sub( s, i, i ) == "\n" then
eol = i - 1
end
return string.sub( s, sol, eol ), lno, sol
end
if #line > clen then
line = string.sub( line, 1, clen ) .. "..."
end
local _,lno = string.gsub( s, "\n", "\n" )
if string.sub( s, -1, -1 ) ~= "\n" then lno = lno + 1 end
local msg = ": parse error at "
function epnf.parsestring( g, str, ... )
local s = string.sub( str, 1, 20 )
if #s < #str then s = s .. "..." end
@/lua/vehicle/controller/gauges/genericGauges.lua
for k, v in pairs(jbeamData) do
if k:sub(1, #"configuration_") == "configuration_" then
tableMergeRecursive(configData, v)
@/lua/vehicle/powertrain.lua
local _, file, _ = path.split(filePath)
local fileName = file:sub(1, -5)
if not factoryBlackList[fileName] then
local v = deviceJbeamData[device.name][k]
if k:sub(1, 12) == "deformGroups" then --check for magic prefix
local delim = "_" --underscore is used as the delim (eg "deformGroups_turbo")
@/lua/ge/extensions/core/input/actions.lua
if string.startswith(actionName, prefix) then
actionName = string.sub(actionName, 1+string.len(prefix))
else
@/lua/ge/extensions/editor/vizHelper.lua
for k, v in ipairs(vizHelper) do
vizHelper[k] = string.sub(v, string.len(artPath) + 1)
end
@/lua/vehicle/protocols.lua
local filename = filepath:match("[^/]*.lua$")
local name = filename:sub(0, #filename - 4)
local enabled = false
@/lua/ge/extensions/scenario/quickRaceLoader.lua
-- local _, fn, e = path.split(file)
-- local name = fn:sub(1,#fn - #e - 1)
-- local read = jsonReadFile(name)
local _, fn, e = path.split(file)
editorTracks[i] = fn:sub(1,#fn - #e - 1)
end
@/lua/ge/server/server.lua
local levelDir = path.dirname(levelPath)
if string.sub(levelDir, -1) ~= '/' then
levelDir = levelDir.."/"
@/lua/ge/extensions/campaign/campaignsLoader.lua
campaign.previews = {
imageExistsDefault(campaign.sourcePath..'/'..campaign.sourcePath:sub(index)..'.jpg')
}
@/lua/common/jbeam/sections/meshs.lua
return ColorF(v.r / 255, v.g / 255, v.b / 255, v.a / 255)
elseif type(v) == 'string' and string.len(v) > 7 and v:sub(1,1) == '#' then
v = v:gsub("#","")
v = v:gsub("#","")
return ColorF(tonumber("0x"..v:sub(1,2)) / 255, tonumber("0x"..v:sub(3,4)) / 255, tonumber("0x"..v:sub(5,6)) / 255, tonumber("0x"..v:sub(7,8)) / 255)
end
v = v:gsub("#","")
return ColorF(tonumber("0x"..v:sub(1,2)) / 255, tonumber("0x"..v:sub(3,4)) / 255, tonumber("0x"..v:sub(5,6)) / 255, tonumber("0x"..v:sub(7,8)) / 255)
end
v = v:gsub("#","")
return ColorF(tonumber("0x"..v:sub(1,2)) / 255, tonumber("0x"..v:sub(3,4)) / 255, tonumber("0x"..v:sub(5,6)) / 255, tonumber("0x"..v:sub(7,8)) / 255)
end
v = v:gsub("#","")
return ColorF(tonumber("0x"..v:sub(1,2)) / 255, tonumber("0x"..v:sub(3,4)) / 255, tonumber("0x"..v:sub(5,6)) / 255, tonumber("0x"..v:sub(7,8)) / 255)
end
@/lua/common/utils.lua
return color(v.r, v.g, v.b, v.a)
elseif type(v) == 'string' and string.len(v) > 7 and v:sub(1,1) == '#' then
v = v:gsub("#","")
v = v:gsub("#","")
return color(tonumber("0x"..v:sub(1,2)), tonumber("0x"..v:sub(3,4)), tonumber("0x"..v:sub(5,6)), tonumber("0x"..v:sub(7,8)))
elseif v == nil then
v = v:gsub("#","")
return color(tonumber("0x"..v:sub(1,2)), tonumber("0x"..v:sub(3,4)), tonumber("0x"..v:sub(5,6)), tonumber("0x"..v:sub(7,8)))
elseif v == nil then
v = v:gsub("#","")
return color(tonumber("0x"..v:sub(1,2)), tonumber("0x"..v:sub(3,4)), tonumber("0x"..v:sub(5,6)), tonumber("0x"..v:sub(7,8)))
elseif v == nil then
v = v:gsub("#","")
return color(tonumber("0x"..v:sub(1,2)), tonumber("0x"..v:sub(3,4)), tonumber("0x"..v:sub(5,6)), tonumber("0x"..v:sub(7,8)))
elseif v == nil then
function string.startswith(String,Start)
return string.sub(String,1,string.len(Start))==Start
end
function string.endswith(String,End)
return End=='' or string.sub(String,-string.len(End))==End
end
local result = str:gsub("([A-Z])", " %1")
return string.upper(result:sub(1, 1)) .. result:sub(2)
end
local result = str:gsub("([A-Z])", " %1")
return string.upper(result:sub(1, 1)) .. result:sub(2)
end
for k, expectedType in ipairs(expectedTypes) do
local isOptional = expectedType:sub(0,9) == "optional:"
local sanitizedExpectedType = isOptional and expectedType:sub(10, #expectedType) or expectedType
local isOptional = expectedType:sub(0,9) == "optional:"
local sanitizedExpectedType = isOptional and expectedType:sub(10, #expectedType) or expectedType
local actualType = type(data[k])
while true do
if filename == "" or string.sub(filename, -1) == "/" then
break
end
filename = string.sub(filename, 1, -2)
end
for _, lvlPath in ipairs(FS:findFiles('/levels/', '*', 0, false, true)) do
table.insert(ret, string.lower(lvlPath:sub(9)))
end
if string.len(line) > 0 then
local firstChar = string.sub(line, 1, 1)
if firstChar ~= '#' and firstChar ~= ';' and firstChar ~= '/' then
@/inspector/External/three.js/three.js
console.warn( 'THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.' );
return this.subVectors( v, w );
console.warn( 'THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.' );
return this.subVectors( v, w );
return this.sub( v1 );
return this.sub( v1.copy( normal ).multiplyScalar( 2 * this.dot( normal ) ) );
console.warn( 'THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.' );
return this.subVectors( v, w );
this.min.copy( center ).sub( halfSize );
this.max.copy( center ).add( halfSize );
this.min.sub( vector );
this.max.add( vector );
var clampedPoint = v1.copy( point ).clamp( this.min, this.max );
return clampedPoint.sub( point ).length();
target.sub( this.center ).normalize();
target.multiplyScalar( this.radius ).add( this.center );
this.direction.copy( v ).sub( this.origin ).normalize();
segCenter.copy( v0 ).add( v1 ).multiplyScalar( 0.5 );
segDir.copy( v1 ).sub( v0 ).normalize();
diff.copy( this.origin ).sub( segCenter );
segDir.copy( v1 ).sub( v0 ).normalize();
diff.copy( this.origin ).sub( segCenter );
vector3.setFromMatrixPosition( light.target.matrixWorld );
uniforms.direction.sub( vector3 );
uniforms.direction.transformDirection( viewMatrix );
vector3.setFromMatrixPosition( light.target.matrixWorld );
uniforms.direction.sub( vector3 );
uniforms.direction.transformDirection( viewMatrix );
var vec = pt2.clone().sub( pt1 );
return vec.normalize();
point.copy( this.v2 ).sub( this.v1 );
point.multiplyScalar( t ).add( this.v1 );
var tangent = this.v2.clone().sub( this.v1 );
point.copy( this.v2 ).sub( this.v1 );
point.multiplyScalar( t ).add( this.v1 );
this.ray.origin.setFromMatrixPosition( camera.matrixWorld );
this.ray.direction.set( coords.x, coords.y, 0.5 ).unproject( camera ).sub( this.ray.origin ).normalize();
var halfSize = v1.copy( size ).multiplyScalar( 0.5 );
this.min.copy( center ).sub( halfSize );
this.max.copy( center ).add( halfSize );
this.min.sub( vector );
this.max.add( vector );
var clampedPoint = v1.copy( point ).clamp( this.min, this.max );
return clampedPoint.sub( point ).length();
this.cone.lookAt( vector2.sub( vector ) );
@/lua/vehicle/energyStorage.lua
local _, fileNameWithExt, _ = path.split(file)
local fileName = fileNameWithExt:sub(1, -5)
local storageFactoryPath = "energyStorage/" .. fileName
@/lua/common/extensions/ui/imgui_custom_luaintf.lua
if not pos2 then
M.Text(label:sub(pos1))
break
elseif pos1 < pos2 then
M.Text(label:sub(pos1, pos2 - 1))
M.SameLine()
local pos3 = pos2 + highlightLowerLen
M.TextColored(matchColor, label:sub(pos2, pos3))
M.SameLine()
@/lua/ge/extensions/editor/barriersEditor.lua
local scenetreeObject = spawnPrefab("prefab_temp_" .. filename ..os.time(), f, "0 0 0 ", "0 0 1", "1 1 1")
local short = f:sub(levelPartLength)
local dirInLevel, _,_ = path.splitWithoutExt(short)
@/lua/ge/extensions/editor/undoHistory.lua
for s in actionData:gmatch("[^\n]+") do
table.insert(lines, s:sub(1, toolTipMaxWidth)) -- limit width
end
@/lua/ge/extensions/core/quickAccess.lua
end
if string.sub(args.level, string.len(args.level)) ~= '/' then args.level = args.level .. '/' end -- make sure there is always a trailing slash in the level
@/lua/common/csvlib.lua
for i = 1, headercount do
header[i] = #header[i] > 0 and tostring(header[i]):sub(1, 1) or "_"
end
filename = filename or self.headernym or format
if filename:sub(-4, -4) ~= '.' then
filename = string.format("%s_%s.%s", filename, os.date("%Y-%m-%dT%H_%M_%S"), format)
until (c == 34 and byte(s, i+1) ~= 34) or c == nil -- "
val = sub(s, si+1, i - 1):gsub('""', '"')
repeat i=i+1; c = byte(s,i) until c~=32 and c~=9 -- space tab
end
val = sub(s, si, i - 1)
if testnum then val = tonumber(val) or val end
@/lua/ge/extensions/editor/roadNetworkExporter.lua
local filename = data.filepath
extensions.tech_openDriveExporter.export(filename:sub(1, -(#".xodr" + 1)))
exportedFilename = FS:virtual2Native(filename)
local filename = data.filepath
extensions.tech_openStreetMapExporter.export(filename:sub(1, -(#".osm" + 1)))
osmExportedFilename = FS:virtual2Native(filename)
sumo_filename = filename
extensions.tech_sumoExporter.export(sumo_filename:sub(1, -(#".xml" + 1)))
sumoExportedFilename = FS:virtual2Native(sumo_filename)
@/lua/common/jbeam/expressionParser.lua
__index = function(tbl, key)
local val = varWrapper.vars['$' .. key:sub(5)]
if type(val) == "table" then return val.val else return val end
--strip leading "$=" from expression and replace all occurences of "$" with "_" (as these are used for lua variable names)
expr = expr:sub(3):gsub('%$', 'var_')
--strip leading "$=" from expression and replace all occurences of "$" with "_" (as these are used for lua variable names)
expr = expr:sub(3):gsub('%$', 'var_')
__index = function(tbl, key)
local val = varWrapper.vars['$' .. key:sub(5)]
if type(val) == "table" then return val.val else return val end
--strip leading "$=" from expression and replace all occurences of "$" with "_" (as these are used for lua variable names)
expr = expr:sub(3):gsub('%$', 'var_')
@/lua/ge/extensions/editor/flowgraph/main.lua
}}
local fn =self.mgr.savedDir.. self.mgr.savedFilename:sub(0,-10)..'json'
jsonWriteFile(fn, scenarioJson, true, 20)
local nodeData = readFile('/lua/ge/extensions/flowgraph/newNodeTemplate.lua')
nodeData = nodeData:gsub("New Node Template", data.filename:sub(1,-5)) -- change name
data.filepath = data.filepath:gsub(".lua","Node.lua") -- add Node for customNodes system
@/lua/ge/extensions/util/export.lua
local function _isTextureCookerFilepath(filepath)
if not string.sub(filepath, -4) == ".png" then return false end
return string.match(filepath, "%.color%.png$") or string.match(filepath, "%.normal%.png$") or string.match(filepath, "%.data%.png$")
if not FS:fileExists(filepath) then
if filepath:sub(1, 1) == '@' then
local filepathIn = filepath
elseif _isTextureCookerFilepath(filepath) then
filepath = string.sub(filepath, 1, -5) .. ".dds"
else
local dir, filename, ext = path.splitWithoutExt(filepath)
if filename:endswith(".dds") then filename = filename:sub(1, -5) end
@/lua/ge/extensions/editor/assemblySpline/import.lua
for _, anchorName in ipairs(obj:getAnchorNames()) do -- Check if any anchor points have the nail prefix.
if anchorName:sub(1, 5) == anchorPrefixStr .. '.' then
return true
@/lua/ge/extensions/editor/particleEditor.lua
if particleDataName then
stringList = stringList:sub(last+1)
local particleData = scenetree.findObject(particleDataName)
if particleDataName then
stringList = stringList:sub(last+1)
else
local first, last, _ = string.find(particles, "(" .. particle:getName() .. ")")
local newParticles = string.sub(particles, 1, first-1)
newParticles = newParticles .. string.sub(particles, last+1)
local newParticles = string.sub(particles, 1, first-1)
newParticles = newParticles .. string.sub(particles, last+1)
newParticles = cleanTabs(newParticles)
@/lua/ge/extensions/core/flowgraphManager.lua
local function reInitOnFileChange(filename)
local requireFilename = string.sub(filename, 1, string.len(filename) - 4)
log("I","flowgraphManager","Reloading Node: " .. tostring(requireFilename))
-- check basic nodes
if filename:sub(1, string.len(nodePath)) == nodePath then
reInitOnFileChange(filename)
-- check custom nodes
if filename:sub(string.len(filename)-7,string.len(filename)) == 'Node.lua' then
for _,manager in ipairs(managers) do
local dirname, fn, e = path.split(filename)
local path = dirname:sub(string.len(nodePath) + 1)
local pathArgs = split(path, '/')
end
local moduleName = string.sub(fn, 1, string.len(fn) - 4)
local requireFilename = string.sub(filename, 1, string.len(filename) - 4)
local moduleName = string.sub(fn, 1, string.len(fn) - 4)
local requireFilename = string.sub(filename, 1, string.len(filename) - 4)
local dirname, fn, e = path.splitWithoutExt(filename, true)
local path = dirname:sub(string.len(stateTemplatePath) + 1)
if path ~= "" then
local moduleName = fn
--local requireFilename = string.sub(filename, 1, string.len(filename) - 4)
local stateData = {}
@/lua/ge/extensions/gameplay/rally/notebook/structured/textCompositor.lua
-- separate digits if not a multiple of rounding threshold
distStr = distStr:sub(1, 1) .. " " .. distStr:sub(2)
end
-- separate digits if not a multiple of rounding threshold
distStr = distStr:sub(1, 1) .. " " .. distStr:sub(2)
end
@/lua/common/json-ast.lua
while true do
c = ctx.str:sub(ctx.pos, ctx.pos)
if c ~= chr or not c or c == '' then
while true do
c = ctx.str:sub(ctx.pos, ctx.pos)
ctx.pos = ctx.pos + 1
}
if num_str:sub(1, 1) == '+' then
node.prefixPlus = true
end
node.addPostfixDot = num_str:sub(num_len, num_len) == '.'
_addNode(ctx, node)
while true do
c = ctx.str:sub(ctx.pos, ctx.pos)
ctx.pos = ctx.pos + 1
end
local nextChar = ctx.str:sub(ctx.pos, ctx.pos)
if c == '\n' then
while true do
c = ctx.str:sub(ctx.pos, ctx.pos)
ctx.pos = ctx.pos + 1
end
if c == '*' and ctx.str:sub(ctx.pos, ctx.pos) == '/' then
ctx.pos = ctx.pos + 1
local chr = ctx.str:sub(ctx.pos, ctx.pos)
local posSaved = ctx.pos
ctx.pos = ctx.pos + 1
elseif chr == 't' and ctx.str:sub(ctx.pos, ctx.pos + 3) == 'true' then
_addNode(ctx, {'bool', true})
ctx.pos = ctx.pos + 4
elseif chr == 'f' and ctx.str:sub(ctx.pos, ctx.pos + 4) == 'false' then
_addNode(ctx, {'bool', false})
ctx.pos = ctx.pos + 1
elseif chr == '\r' and ctx.str:sub(ctx.pos + 1, ctx.pos + 1) == '\n' then
_addNode(ctx, {'newline_windows'})
ctx.pos = ctx.pos + 1
elseif chr == '/' and ctx.str:sub(ctx.pos + 1, ctx.pos + 1) == '/' then
_parse_comment(ctx)
_parse_comment(ctx)
elseif chr == '/' and ctx.str:sub(ctx.pos + 1, ctx.pos + 1) == '*' then
_parse_comment_multiline(ctx)
@/lua/vehicle/controller/drivingDynamics/actuators/electronicDiffLock.lua
if slashPos then
nameString = nameString:sub(slashPos + 1)
end
@/lua/ge/extensions/editor/util/editorElementHelper.lua
if key ~= "fieldName" and string.startswith(key, "fieldName") then
table.insert(ret, {label = string.sub(key, 10), fieldName = elem[key], elemLabel = elem.label})
end
@/lua/ge/extensions/editor/flowgraph/search.lua
if not pos2 then
im.Text(label:sub(pos1))
break
elseif pos1 < pos2 then
im.Text(label:sub(pos1, pos2 - 1))
im.SameLine()
local pos3 = pos2 + highlightLowerLen
im.TextColored(matchColor, label:sub(pos2, pos3))
im.SameLine()
if match:find(t..": ") ~= nil then
return t, string.sub(match, #t+3)
end
if match:find(t..":") ~= nil then
return t, string.sub(match, #t+2)
end
@/ui/ui-vue/src/modules/mainmenu/routes.js
{ // this state is used to display top/info-bar in menus
path: "/menu.:sub(.*)?",
name: "menu",
@/lua/ge/extensions/flowgraph/nodes/ui/multiDescription.lua
if txt:len() > 10 then
im.Text(txt:sub(1,10).."...")
else
@/lua/common/jbeam/loader.lua
-- the directory needs a leading and trailing slash
if vehicleDir:sub(1, 1) ~= '/' then
vehicleDir = '/' .. vehicleDir
end
if vehicleDir:sub(-1, -1) ~= '/' then
vehicleDir = vehicleDir .. '/'
@/lua/vehicle/main.lua
if j then
local m = _G[string.sub(funName, 1, j - 1)]
if type(m) == "table" then
if type(m) == "table" then
f = m[string.sub(funName, j + 1)]
end
@/lua/ge/extensions/career/branches.lua
local infoDir, _, _ = path.split(filePath)
branch.dir = string.sub(infoDir, 1, -1) -- Remove trailing '/'
branch.id = ""
local folders = {'domains'}
for folder in string.gmatch(string.sub(infoDir, #branchesDir, -2), "[^/]+") do
table.insert(folders, folder)
local folders = {'domains'}
for folder in string.gmatch(string.sub(infoDir, #branchesDir, -2), "[^/]+") do
table.insert(folders, folder)
@/lua/common/libs/luasocket/socket/url.lua
local function absolute_path(base_path, relative_path)
if string.sub(relative_path, 1, 1) == "/" then return relative_path end
local path = string.gsub(base_path, "[^/]*$", "")
end
if string.sub(path, 1, 1) == "/" then parsed.is_absolute = 1 end
if string.sub(path, -1, -1) == "/" then parsed.is_directory = 1 end
if string.sub(path, 1, 1) == "/" then parsed.is_absolute = 1 end
if string.sub(path, -1, -1) == "/" then parsed.is_directory = 1 end
return parsed
@/lua/ge/extensions/core/vehicles.lua
if dir and filename and ext and string.lower(ext) == "pc" then
local pcfn = filename:sub(1, #filename - 3)
res.configs[pcfn] = { Configuration = pcfn}
for _, filename in ipairs(jfiles) do
if string.lower(filename:sub(-18)) == '.paintlibrary.json' then
table.insert(filesPaints, filename)
table.insert(filesPaints, filename)
elseif string.lower(filename:sub(-5)) == '.json' then
table.insert(filesJson, filename)
table.insert(filesJson, filename)
elseif string.lower(filename:sub(-3)) == '.pc' then
table.insert(filesPC, filename)
table.insert(filesPC, filename)
elseif string.lower(filename:sub(-4)) == '.png' or string.lower(filename:sub(-4)) == '.jpg' then
filesImages[filename] = true
table.insert(filesPC, filename)
elseif string.lower(filename:sub(-4)) == '.png' or string.lower(filename:sub(-4)) == '.jpg' then
filesImages[filename] = true
for _, filename in ipairs(jfiles) do
if string.lower(filename:sub(-18)) == '.paintlibrary.json' then
table.insert(filesPaints, filename)
table.insert(filesAll, filename)
elseif string.lower(filename:sub(-5)) == '.json' then
table.insert(filesJson, filename)
table.insert(filesAll, filename)
elseif string.lower(filename:sub(-3)) == '.pc' then
table.insert(filesPC, filename)
table.insert(filesAll, filename)
elseif string.lower(filename:sub(-4)) == '.png' or string.lower(filename:sub(-4)) == '.jpg' then
filesImages[filename] = true
table.insert(filesAll, filename)
elseif string.lower(filename:sub(-4)) == '.png' or string.lower(filename:sub(-4)) == '.jpg' then
filesImages[filename] = true
local vehicleDirectory = path or '/vehicles/' .. model .. '/'
if string.sub(vehicleDirectory, -1) ~= '/' then vehicleDirectory = vehicleDirectory .. '/' end
local res = FS:findFiles(vehicleDirectory, '*.jbeam', -1, false, false) -- recursive search
return 'BeamNG - Official'
elseif string.sub(path, -3) == '.pc' then
return 'Custom'
local fLower = string.lower(filename)
if string.sub(fLower, -5) == '.json'
or string.sub(fLower, -6) == '.jbeam'
if string.sub(fLower, -5) == '.json'
or string.sub(fLower, -6) == '.jbeam'
or string.sub(fLower, -3) == '.pc'
or string.sub(fLower, -6) == '.jbeam'
or string.sub(fLower, -3) == '.pc'
or string.sub(fLower, -4) == '.jpg'
or string.sub(fLower, -3) == '.pc'
or string.sub(fLower, -4) == '.jpg'
or string.sub(fLower, -4) == '.png' then
or string.sub(fLower, -4) == '.jpg'
or string.sub(fLower, -4) == '.png' then
anyCacheFileModified = true
@/lua/ge/extensions/core/environment.lua
if string.len(k) > 31 then
local newk = string.sub(k, 1, 30)
log('E', 'ge.environment.reloadGroundModels', 'Ground model name too long: "' .. tostring(k) .. '" is longer than the supported 31 characters. It will be cut to "' .. tostring(newk) .. '")')
@/lua/ge/extensions/editor/assetDeduplicator.lua
local e = ext:lower()
if e:sub(1,1) ~= "." then e = "." .. e end
extBlacklist[e] = true
local spath = stockMatches[i]
if spath:sub(1, #currentLevelRoot) ~= currentLevelRoot then
filtered[#filtered + 1] = spath
local spath = modMatches[i]
if spath:sub(1, #currentLevelRoot) ~= currentLevelRoot then
filtered[#filtered + 1] = spath
@/lua/vehicle/controller/gauges/analogOdometer.lua
for k, v in pairs(jbeamData) do
if k:sub(1, #"configuration_") == "configuration_" then
tableMergeRecursive(configData, v)
@/lua/vehicle/controller/vehicleController/shiftLogic/cvtGearbox.lua
local manualModeIndex
if string.sub(automaticHandling.mode, 1, 1) == "M" then
manualModeIndex = string.sub(automaticHandling.mode, 2)
if string.sub(automaticHandling.mode, 1, 1) == "M" then
manualModeIndex = string.sub(automaticHandling.mode, 2)
end
for i = 1, modeCount do
local mode = modes:sub(i, i)
if automaticHandling.availableModeLookup[mode] then
@/lua/common/json.lua
local infend = si + 6
if sub(s, si, infend) == "1#INF00" then
return math.huge, infend + 1
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
end
r = tonumber(sub(s, si, i - 1))
if r == nil then
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 ch == 34 then -- "
return sub(s, si1, i - 2), i
end
i = i - 1
key = sub(s, si, i)
@/lua/vehicle/controller.lua
for _, v in pairs(loadedControllers) do
if v.typeName:sub(1, #path) == path then
table.insert(controllers, v)
@/lua/ge/extensions/gameplay/missions/missionScreen.lua
local previewFile = m.previewFile
if previewFile:sub(1, 1) == "/" then
previewFile = previewFile:sub(2)
if previewFile:sub(1, 1) == "/" then
previewFile = previewFile:sub(2)
end
@/lua/ge/extensions/career/modules/playerAttributes.lua
if attributeName:endswith("Reputation") then
local orgId = attributeName:sub(1, -11)
career_career.interactWithOrganization(orgId)
@/lua/vehicle/extensions/tech/CANBus/ProjectBavariaKombi.lua
local state = gearStateLookup[string.sub(electrics.values.gear or "", 1, 1)] or 0
if electrics.values.ignitionLevel <= 0 then
@/lua/vehicle/extensions/tech/CANBus/ProjectBavariaShifter.lua
local function applyInputs(leverState, parkButtonState)
local gear = string.sub(electrics.values.gear or "", 1, 1)
local function updateHardwareState(dt)
local state = gearStateLookup[string.sub(electrics.values.gear or "", 1, 1)] or 0
if electrics.values.ignitionLevel <= 0 then
@/lua/ge/extensions/core/levels.lua
if levelPath:find('main.level.json') and not FS:fileExists(levelPath) then
local newName = levelPath:sub(0, levelPath:find('main.level.json') - 1)
if FS:directoryExists(newName) then
@/lua/ge/extensions/editor/scriptAIManager.lua
local fn_short = string.sub(filename, string.len(trackFilePath) + 1)
fn_short = string.sub(fn_short, 1, string.len(fn_short) - string.len(trackFileExt))
local fn_short = string.sub(filename, string.len(trackFilePath) + 1)
fn_short = string.sub(fn_short, 1, string.len(fn_short) - string.len(trackFileExt))
if im.Button(fn_short) then
@/lua/ge/extensions/editor/decalEditor.lua
local _, _, ext = path.split(fileName)
local fileNameNoExt = string.sub(fileName, 1, -(ext:len() + 1))
if not FS:fileExists(fileNameNoExt .. "png") and not FS:fileExists(fileNameNoExt .. "dds") then
@/lua/ge/extensions/career/saveSystem.lua
else
local newPath = string.sub(folders[i], oldNameLength + 2)
newPath = newName .. newPath
@/lua/ge/extensions/flowgraph/nodes/input/blacklistAction.lua
if not pos2 then
im.Text(label:sub(pos1))
break
elseif pos1 < pos2 then
im.Text(label:sub(pos1, pos2 - 1))
im.SameLine()
local pos3 = pos2 + highlightLowerLen
im.TextColored(matchColor, label:sub(pos2, pos3))
im.SameLine()
@/lua/ge/extensions/flowgraph/nodes/activity/activityFlow.lua
im.Text("Activity: "..(self.mgr.activity and "yes" or "no"))
im.TextColored(self.mgr.activity and colorEnabled or colorDisabled, self.mgr.activity and ("..."..self.mgr.activity.id:sub(-15)) or "(standalone)")
end
@/lua/ge/extensions/editor/fileDialog.lua
fileCache = {}
if currentPath:sub(1,1) ~= "/" then currentPath = "/" .. currentPath end
if currentPath:sub(-1) ~= "/" then currentPath = currentPath.."/" end
if currentPath:sub(1,1) ~= "/" then currentPath = "/" .. currentPath end
if currentPath:sub(-1) ~= "/" then currentPath = currentPath.."/" end
currentPath = currentPath:gsub("/+", "/") -- Reducing multiple slashes to avoid trimmed list names
local s = FS:stat(fn)
s.name = string.sub(fn, pathLen)
s.name = string.gsub(s.name, "/(.*)", "%1") -- strip leading /
if lastSep then
parentFolder = currentPath:sub(1, currentPath:len()-lastSep+1 )
end
@/lua/ge/extensions/flowgraph/nodes/types/string.lua
if #self.string > 10 then
im.Text(self.string:sub(1,10).. "...")
else
@/lua/ge/extensions/flowgraph/nodes/string/format.lua
if txt:len() > 16 then
im.Text(txt:sub(1,16).."...")
else
@/lua/common/libs/lua-websockets/websocket/client_ev.lua
end
until response:sub(#response-3) == '\r\n\r\n'
read_io:stop(loop)
@/lua/ge/extensions/ui/liveryEditor/userData.lua
local _, fn, e = path.split(file)
return fn:sub(1, #fn - #dynDecalsExtension)
end
@/lua/ge/extensions/editor/dynamicDecals/brushes.lua
local dir, fileName, fileExt = path.split(decalColorTexturePath)
name = string.sub(fileName, 1, #fileName - (#fileExt + 1))
end
@/lua/common/libs/StackTracePlus/StackTracePlus.lua
--print("guessing function name")
if type(info.source) == "string" and info.source:sub(1,1) == "@" then
local file, err = io_open(info.source:sub(2), "r")
if type(info.source) == "string" and info.source:sub(1,1) == "@" then
local file, err = io_open(info.source:sub(2), "r")
if not file then
if _M.max_string_output_len > 0 and stringlen > _M.max_string_output_len then
self:add_f("%s%s = string[%d/%d]: %q (more...)\n", prefix, name, _M.max_string_output_len, stringlen, string.sub(tostring(value), 1, _M.max_string_output_len))
else
local source = info.source
if source:sub(2,7) == "string" then
source = source:sub(9) -- uno m�s, por el espacio que viene (string "Baragent.Main", por ejemplo)
if source:sub(2,7) == "string" then
source = source:sub(9) -- uno m�s, por el espacio que viene (string "Baragent.Main", por ejemplo)
end
local function_name = m_user_known_functions[info.func] or m_known_functions[info.func] or info.name
if source:sub(2, 7) == "string" then
source = source:sub(9)
if source:sub(2, 7) == "string" then
source = source:sub(9)
end
local function_type = (info.namewhat == "") and "function" or info.namewhat
if info.source and info.source:sub(1, 1) == "@" then
dumper:add_f("\n(%d) %s:%d %s (%s)", level_to_show, info.source:sub(2), info.currentline, function_name, function_type)
if info.source and info.source:sub(1, 1) == "@" then
dumper:add_f("\n(%d) %s:%d %s (%s)", level_to_show, info.source:sub(2), info.currentline, function_name, function_type)
elseif info.source and info.source:sub(1,1) == '#' then
dumper:add_f("\n(%d) %s:%d %s (%s)", level_to_show, info.source:sub(2), info.currentline, function_name, function_type)
elseif info.source and info.source:sub(1,1) == '#' then
dumper:add_f("\n(%d) Lua %s '%s' at template '%s:%d'%s", level_to_show, function_type, function_name, info.source:sub(2), info.currentline, was_guessed and " (best guess)" or "")
elseif info.source and info.source:sub(1,1) == '#' then
dumper:add_f("\n(%d) Lua %s '%s' at template '%s:%d'%s", level_to_show, function_type, function_name, info.source:sub(2), info.currentline, was_guessed and " (best guess)" or "")
else
else
dumper:add_f("\n(%d) %s:%d: %s", level_to_show, source:sub(2, -3), info.currentline, function_name)
end
local function_name = m_user_known_functions[info.func] or m_known_functions[info.func] or info.name
if source:sub(2, 7) == "string" then
source = source:sub(9)
if source:sub(2, 7) == "string" then
source = source:sub(9)
end
local function_type = (info.namewhat == "") and "function" or info.namewhat
if info.source and info.source:sub(1, 1) == "@" then
dumper:add_f("(%d) Lua %s '%s' at file '%s:%d'%s\n", level_to_show, function_type, function_name, info.source:sub(2), info.currentline, was_guessed and " (best guess)" or "")
if info.source and info.source:sub(1, 1) == "@" then
dumper:add_f("(%d) Lua %s '%s' at file '%s:%d'%s\n", level_to_show, function_type, function_name, info.source:sub(2), info.currentline, was_guessed and " (best guess)" or "")
elseif info.source and info.source:sub(1,1) == '#' then
dumper:add_f("(%d) Lua %s '%s' at file '%s:%d'%s\n", level_to_show, function_type, function_name, info.source:sub(2), info.currentline, was_guessed and " (best guess)" or "")
elseif info.source and info.source:sub(1,1) == '#' then
dumper:add_f("(%d) Lua %s '%s' at template '%s:%d'%s\n", level_to_show, function_type, function_name, info.source:sub(2), info.currentline, was_guessed and " (best guess)" or "")
elseif info.source and info.source:sub(1,1) == '#' then
dumper:add_f("(%d) Lua %s '%s' at template '%s:%d'%s\n", level_to_show, function_type, function_name, info.source:sub(2), info.currentline, was_guessed and " (best guess)" or "")
else
@/lua/vehicle/controller/lineLock.lua
end
wheelNamesString = wheelNamesString:sub(0, wheelNamesString:len() - 2)
@/lua/ge/extensions/telemetry/core.lua
-- Validate event name format: must start with lowercase and be camelCase
local firstChar = event.name:sub(1, 1)
if firstChar:upper() == firstChar then
@/lua/ge/extensions/editor/resourceChecker.lua
local stringend = ", "
txtstring = string.sub(txtstring, 1, #txtstring - #stringend)
end
@/lua/ge/extensions/editor/perfProfiler.lua
local dir, fn, ext = path.split(file, true)
fn = fn:sub(0,fn:len()-ext:len()-1)
@/lua/ge/extensions/freeroam/facilities/fuelPrice.lua
for i=1, #v2.displayObjects do
local char = priceStr:sub(i, i)
-- force 9/10 in US signs
@/inspector/Views/Layers3DContentView.js
let delta = new THREE.Vector3;
this._boundingBox.clampPoint(this._controls.target, delta).setZ(0).sub(this._controls.target);
this._controls.target.add(delta);
@/lua/ge/extensions/editor/dynamicDecals/history.lua
for s in actionData:gmatch("[^\n]+") do
table.insert(lines, s:sub(1, toolTipMaxWidth)) -- limit width
end
@/lua/common/jbeam/tableSchema.lua
-- is it a node material?
if valuePart:sub(1,3) == "NM_" then
ival = particles.getMaterialIDByName(materials, valuePart:sub(4))
if valuePart:sub(1,3) == "NM_" then
ival = particles.getMaterialIDByName(materials, valuePart:sub(4))
--log('D', "jbeam.replaceSpecialValues", "replaced "..valuePart.." with "..ival)
@/lua/vehicle/electricsCustomValueParser.lua
-- -- --if it's not in either table, it's forbidden and we abort parsing
-- s = s:sub(1, (s:find("%.") or (s:len() + 1)) - 1)
-- if not (customElectricsEnv[s] or keyworkdWhiteListLookup[s]) then
@/lua/ge/extensions/gameplay/sites/sitesManager.lua
local _, siteName = path.split(site)
if name == string.sub(siteName, 0, -12) then
return site
@/lua/ge/extensions/gameplay/rally/util.lua
local str = hashStringSHA1(s)
return str:sub(1, 16)
end
if thepath:sub(-1) == "/" then
thepath = thepath:sub(1, -2)
if thepath:sub(-1) == "/" then
thepath = thepath:sub(1, -2)
end
if dirname:sub(-1) == "/" then
dirname = dirname:sub(1, -2)
if dirname:sub(-1) == "/" then
dirname = dirname:sub(1, -2)
end
local hash = hashStringSHA1(randomStr)
return string.sub(hash, 1, 8)
end
@/lua/ge/extensions/scenario/busdriver.lua
if hex:len() == 3 then
return (tonumber("0x"..hex:sub(1,1))*17)/255, (tonumber("0x"..hex:sub(2,2))*17)/255, (tonumber("0x"..hex:sub(3,3))*17)/255
else
if hex:len() == 3 then
return (tonumber("0x"..hex:sub(1,1))*17)/255, (tonumber("0x"..hex:sub(2,2))*17)/255, (tonumber("0x"..hex:sub(3,3))*17)/255
else
if hex:len() == 3 then
return (tonumber("0x"..hex:sub(1,1))*17)/255, (tonumber("0x"..hex:sub(2,2))*17)/255, (tonumber("0x"..hex:sub(3,3))*17)/255
else
else
return tonumber("0x"..hex:sub(1,2))/255, tonumber("0x"..hex:sub(3,4))/255, tonumber("0x"..hex:sub(5,6))/255
end
else
return tonumber("0x"..hex:sub(1,2))/255, tonumber("0x"..hex:sub(3,4))/255, tonumber("0x"..hex:sub(5,6))/255
end
else
return tonumber("0x"..hex:sub(1,2))/255, tonumber("0x"..hex:sub(3,4))/255, tonumber("0x"..hex:sub(5,6))/255
end
@/lua/ge/extensions/tech/utils.lua
else
local _,level,_ = path.split(path.split(levelPath):sub(1, -2))
M.level = level
@/lua/ge/extensions/editor/missionEditor/conditions.lua
for _, file in ipairs(files) do
local aConds = require(file:sub(0,-5))
for key, value in pairs(aConds) do
@/lua/ge/extensions/editor/sidewalkSpline/kit.lua
local anchorName = anchorNames[i]
if anchorName:sub(1, 9) == anchorPrefixStrWithDot then
table.clear(tmpParts) -- Clear the reusable table.
@/lua/common/libs/xlsxlib/xlsxlib.lua
for i = 1, #col do
local char = col:sub(i, i):byte()
if char < 65 or char > 90 then
@/lua/ge/extensions/util/inputSystemUtils.lua
-- collapse anything below bindings that has less than 4 items
return path:sub(1,10) == '/bindings/' and tableSize(item) < 4
end
info.vidpid = filename:upper()
vendorId = filename:upper():sub(5, 8)
else
else
vendorId = info.vidpid:upper():sub(5, 8)
end
@/lua/common/libs/slaxml/slaxml.lua
if first>textStart and self._call.text then
local text = sub(xml,textStart,first-1)
if options.stripWhitespace then
@/lua/ge/extensions/tech/techCore.lua
sourceFile = fgMgr.savedDir .. name .. '.json'
if string.sub(sourceFile, 1, 1) ~= '/' then
sourceFile = '/' .. sourceFile
@/lua/ge/extensions/util/nodeBeamExport.lua
local dir = vdata.vehicleDirectory
if string.sub(dir, -1) ~= '/' then dir = dir .. '/' end
@/lua/ge/extensions/trackbuilder/trackBuilder.lua
for _, file in pairs(FS:findFiles(materialSettings.directory, "*.dds", -1, true, false)) do
local fileWithoutExtension = string.sub(file, 1, string.len(file) - 4)
local textureType = string.sub(fileWithoutExtension, string.len(fileWithoutExtension) - 1, string.len(fileWithoutExtension))
local fileWithoutExtension = string.sub(file, 1, string.len(file) - 4)
local textureType = string.sub(fileWithoutExtension, string.len(fileWithoutExtension) - 1, string.len(fileWithoutExtension))
local path = {}
local path = {}
for str in string.gmatch(string.sub(fileWithoutExtension, 1, string.len(fileWithoutExtension) - 2), "([^'/']+)") do
table.insert( path, str )
else -- glow map
local texType = string.sub(fileWithoutExtension, string.len(fileWithoutExtension) - 4, string.len(fileWithoutExtension))
if texType == "decal" then
local path = {}
for str in string.gmatch(string.sub(fileWithoutExtension, 1, string.len(fileWithoutExtension) - 6), "([^'/']+)") do
table.insert( path, str )
if editor.uiIconImageButton(editor.icons.undo, im.ImVec2(16,16), style.buttonColorBase, nil, nil, "resetMaterialButton") then
local materialLetter = string.sub(materials.matNames[materialSettings.selectedMaterial[0]+1],14,14)
tb.materialUtil.resetMaterialsToDefault(materialLetter)
local mat = tb.getPieceInfo(index, sub).materialInfo.centerMesh or 'track_editor_A_center'
mat = string.sub(mat, 0, 15)
materialSettings.selectedMaterial[0] = indexOf(materials.matNames,mat)-1
local mat = tb.getIntersection(name).centerMat or 'track_editor_A_center'
mat = string.sub(mat, 0, 15)
materialSettings.selectedMaterial[0] = indexOf(materials.matNames,mat)-1
@/lua/ge/extensions/flowgraph/manager.lua
-- TODO: clear up hack with filepaths (issue when loading a FG as a mission)
local path = dirname:sub(string.len(customNodePath) + string.find(dirname, customNodePath, 1, true))
local pathArgs = split(path, '/')
end
local moduleName = string.sub(fn, 1, string.len(fn) - 4)
local requireFilename = string.sub(filename, 1, string.len(filename) - 4)
local moduleName = string.sub(fn, 1, string.len(fn) - 4)
local requireFilename = string.sub(filename, 1, string.len(filename) - 4)
local status, node = pcall(rerequire, requireFilename)
@/lua/common/libs/luasocket/ltn12.lua
return function()
local chunk = string.sub(s, i, i+_M.BLOCKSIZE-1)
i = i + _M.BLOCKSIZE
@/lua/ge/extensions/editor/dynamicDecals/fonts.lua
local dir, filename, ext = path.split(file)
local fontName = string.sub(filename, 1, #filename - #fontAtlasJsonExtension)
local success = false
local path, filename, ext = path.split(fontPath)
local fontName = string.sub(filename, 1, #filename - (#ext + 1))
if not tableContains(generatedFontAtlases, fontName) then
@/lua/ge/extensions/editor/api/valueInspector.lua
elseif fieldTypeName == "TypeCommand" then
if imgui.Button(fieldValue:sub(1,20)) then
editor.newTextEditorInstance(self.selectedIds, fieldName)
@/lua/vehicle/controller/drivingDynamics/actuators/activeDiffBias.lua
if slashPos then
nameString = nameString:sub(slashPos + 1)
end
@/lua/ge/ge_utils.lua
function replace_char(pos, str, r)
return str:sub(1, pos-1) .. r .. str:sub(pos+1)
end
function replace_char(pos, str, r)
return str:sub(1, pos-1) .. r .. str:sub(pos+1)
end
function isPlayerVehConfig(vpath)
local osSep = package.config:sub(1,1)
if not shipping_build and FS:getGamePath() == FS:getUserPath() then return false end --make sure you don't delete official config
local k = math.random(1, sl)
res = res .. string.sub(ascii, k, k)
end
@/lua/vehicle/controller/drivingDynamics/actuators/activeDiffLock.lua
if slashPos then
nameString = nameString:sub(slashPos + 1)
end
@/lua/ge/extensions/flowgraph/nodes/util/closestRoad.lua
if index == 1 then
local short = string.sub(name,length+1,string.len(name))
local underscoreIndex = string.find(short,"_")
if underscoreIndex and underscoreIndex >= 0 then
local rdId = tonumber(string.sub(short,1,underscoreIndex-1))
if not idId then
if not idId then
local obj = scenetree.findObject(string.sub(short,1,underscoreIndex-1))
if obj then
end
local rdIdx = tonumber(string.sub(short,underscoreIndex+1,string.len(short)))
return rdId, rdIdx
@/lua/ge/extensions/util/richPresence.lua
M.state.levelName = M.state.levelName:gsub("_", " ")
M.state.levelName = string.gsub(" "..M.state.levelName, "%W%l", string.upper):sub(2)
msgFormat()
@/lua/ge/extensions/editor/engineAudioDebug.lua
local dataString = jsonEncodePretty(data)
dataString = dataString:sub(3, dataString:len() - 2)
setClipboard(dataString)
@/lua/ge/extensions/editor/terrainMaterialsEditor.lua
if im.InputText("##MaterialNameInput", terrainMtlCopyProxy.nameInput, nil, im.flags(im.InputTextFlags_CharsNoBlank)) then
local firstChar = tonumber(string.sub(ffi.string(terrainMtlCopyProxy.nameInput), 1, 1))
if firstChar and type(firstChar) == "number" then
@/lua/common/lpack.lua
end
r = tonumber(sub(s, seridx + 1, i - 1))
end
seridx = strs + strlen
return sub(s, strs, seridx-1), byte(s, seridx), seridx
end
@/lua/ge/extensions/editor/dataBlockEditor.lua
resultTable[name] = {}
stringList = stringList:sub(last+1)
else
@/lua/common/libs/lua-websockets/websocket/tools.lua
for j=1,#msg,64 do
local chunk = msg:sub(j,j+63)
assert(#chunk==64,#chunk)
@/lua/common/libs/luasec/options.lua
for k, option in ipairs(options) do
local name = string.lower(string.sub(option, 8))
print(string.format([[#if defined(%s)]], option))
@/lua/ge/extensions/flowgraph/states.lua
for k, func in pairs(node) do
if string.sub(k, 1, 2) == 'on' and type(func) == 'function' then
self.hookExists[k] = true
@/lua/vehicle/controller/vehicleController/vehicleController.lua
local vehicleSpeed = electrics.values.wheelspeed or 0
local speedLimit = (type(gearName) == "string" and gearName:sub(1, 1) == "R") and topSpeedLimitReverse or topSpeedLimit
if speedLimit > 0 then
@/lua/common/extensions.lua
local s = d.source
if s:sub(1,1) == '@' then s = s:sub(2) end
if not s:find(extPath) and s ~= 'lua/ge/extensions/core/jobsystem.lua' and s ~= 'lua/common/luaCore.lua' and s ~= '=[C]' then
local s = d.source
if s:sub(1,1) == '@' then s = s:sub(2) end
if not s:find(extPath) and s ~= 'lua/ge/extensions/core/jobsystem.lua' and s ~= 'lua/common/luaCore.lua' and s ~= '=[C]' then
extPath = extName
if string.sub(extPath, 1, 1) == '/' then -- strip leading '/' if present
extPath = string.gsub(extPath, "/(.*)", "%1")
if string.sub(extPath, 1, 1) == '/' then
extPath = string.gsub(extPath, "/(.*)", "%1") -- strip leading '/' if present
for _,luaFilename in pairs(luaFiles) do
load(luaFilename:sub(1,-5)) -- strip '.lua'
end
-- without it, vehicle extensions like custom_input would come out as custom/input which is wrong
loadAtRoot(file:sub(1,-5), "")
end
-- grab specified root
root = string.sub(extName, 1, string.find(extName, "_") - 1)
end
for k, func in pairs(m) do
if string.sub(k, 1, 2) == 'on' and type(func) == 'function' then
if not hookLists[k] then hookLists[k] = {} end
@/lua/ge/extensions/editor/gen/mesh.lua
-- lo('?? for_INST:'..tostring(k.parent.attr.name))
local s = string.sub(k.attr.url,2)
if dgeo[s] then
-- U.dump(k.attr,'?? for_ATTR:'..tostring(k.attr.semantic))
dsem[k.attr['source']:sub(2)] = k.attr.semantic
end
-- lo('?? kid_name:'..i..':'..tostring(k.name)..':'..tostring(k.attr.semantic))
dsem[k.attr['source']:sub(2)] = k.attr.semantic
end