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/editor/dynamicDecals/brushes.lua
local dir, fileName, fileExt = path.split(decalColorTexturePath)
name = string.sub(fileName, 1, #fileName - (#fileExt + 1))
end
@/lua/vehicle/extensions/gameplayInterface.lua
local _, file, _ = path.split(filePath)
local fileName = file:sub(1, -5)
local extensionPath = "gameplayInterfaceModules/" .. fileName
@/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/ge/extensions/gameplay/missions/unlocks.lua
for _, file in ipairs(files) do
local aConds = require(file:sub(0,-5))
@/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/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/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/ge/extensions/util/nodeBeamExport.lua
local dir = vdata.vehicleDirectory
if string.sub(dir, -1) ~= '/' then dir = dir .. '/' end
@/inspector/External/three.js/OrbitControls.js
offset.copy( position ).sub( scope.target );
var position = scope.object.position;
offset.copy( position ).sub( scope.target );
var targetDistance = offset.length();
@/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/career/saveSystem.lua
else
local newPath = string.sub(folders[i], oldNameLength + 2)
newPath = newName .. newPath
@/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/editor/dynamicDecals/layerTypes/path.lua
for k, v in ipairs(layer.textCharacterPositions) do
im.TextUnformatted(string.sub(layer.text, k, k))
im.SameLine()
@/lua/common/libs/lua-websockets/websocket/frame.lua
end
return decoded,fin,opcode,encoded_bak:sub(bytes+1),mask
end
if #data > 2 then
reason = data:sub(3)
end
@/lua/ge/extensions/career/career.lua
local currentSaveSlot, currentSavePath = career_saveSystem.getCurrentSaveSlot()
imgui.Text((string.sub(currentSavePath, string.len(career_saveSystem.getSaveRootDirectory())+2, -1)))
imgui.Separator()
@/lua/vehicle/energyStorage.lua
local _, fileNameWithExt, _ = path.split(file)
local fileName = fileNameWithExt:sub(1, -5)
local storageFactoryPath = "energyStorage/" .. fileName
@/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/ge/extensions/editor/resourceChecker.lua
local stringend = ", "
txtstring = string.sub(txtstring, 1, #txtstring - #stringend)
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/vehicle/controller/vehicleController/shiftLogic/electricMotor.lua
for i = 1, modeCount do
local mode = modes:sub(i, i)
if automaticHandling.availableModeLookup[mode] then
@/lua/vehicle/input.lua
--print(string.format("/ Splitting '%10s' into long: '%5s', side: '%5s' .", wheelName, long, side))
long = long and long:sub(1, 1) or long
side = side and side:sub(1, 1) or side
long = long and long:sub(1, 1) or long
side = side and side:sub(1, 1) or side
--print(string.format("\\_ Splitting '%10s' into long: '%5s', side: '%5s' .", wheelName, long, side))
@/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/common/jbeam/slotSystem.lua
if type(v3) == "number" and str_byte(k3, 1) == 36 then
local actualK3 = k3:sub(3) --remove the magic chars at the beginning to get the actual KEY, this can potentially lead to issues if k3 omits the second magic char
local existingValue = target[sectionKey][actualK3]
@/lua/ge/extensions/editor/veMain.lua
local _, fn, _ = path.split(file)
local name = string.sub(fn, 1, -5)
if name ~= "veMain" then
local _, fn, _ = path.split(file)
local name = string.sub(fn, 1, -5)
if name ~= "veMain" then
local _, fn, _ = path.split(file)
local name = string.sub(fn, 1, -5)
if name ~= "veMain" then
@/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/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/editor/raceEditor.lua
table.insert(allFiles,{
name = string.sub(filename,1,-11),
file = f
@/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/common/libs/luasocket/socket/mbox.lua
if not i then break end
local message = string.sub(mbox_s, j, i-1)
table.insert(mbox, message)
@/lua/vehicle/controller/drivingDynamics/actuators/adaptiveDampers.lua
if slashPos then
nameString = nameString:sub(slashPos + 1)
end
@/lua/vehicle/controller/drivingDynamics/actuators/electronicDiffLock.lua
if slashPos then
nameString = nameString:sub(slashPos + 1)
end
@/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/core/vehicle/partmgmt.lua
end
elseif dataType == 'string' and configData:sub(1, 1) == '{' then
local res, newConfigData = preprocessPartConfig(deserialize(configData))
-- notify the vehicle selector that the vehicle has been saved and clear the cache
local configWithoutFilename = string.sub(filename, #(playerVehicleData.vehicleDirectory or "") + 1)
configWithoutFilename = configWithoutFilename:gsub("%.pc$", "")
for _, file in pairs(files) do
local basename = string.sub(file, string.len(playerVehicle.vehicleDirectory) + 1, -1)
table.insert(result,
fileName = basename,
name = string.sub(basename,0, -4),
official = isOfficialConfig(basename),
@/lua/ge/extensions/editor/vizHelper.lua
for k, v in ipairs(vizHelper) do
vizHelper[k] = string.sub(v, string.len(artPath) + 1)
end
@/lua/ge/extensions/ui/uiNavi.lua
if minimapImage:startswith("/") then
minimapImage = minimapImage:sub(2)
end
@/lua/ge/extensions/util/trackBuilder/splineTrack.lua
local _, fn, e = path.split(file)
local name = fn:sub(1, #fn - #e - 1)
local read = loadJSON(name)
local _, fn, e = path.split(file)
previews[i] = fn:sub(1, #fn - #e - 1)
end
local _, fn, e = path.split(file)
previews[i] = fn:sub(1, #fn - #e - 1)
end
@/lua/ge/extensions/ui/liveryEditor/camera.lua
local switchOrder = {"right", "front", "left", "back"}
local startsWithTop = string.sub(orthographicView, 1, 3) == "top"
if startsWithTop and y == -1 then
local view = string.sub(orthographicView, 4)
M.setOrthographicView(view)
@/lua/vehicle/controller/drivingDynamics/actuators/activeDiffLock.lua
if slashPos then
nameString = nameString:sub(slashPos + 1)
end
@/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/ui/liveryEditor/userData.lua
local _, fn, e = path.split(file)
return fn:sub(1, #fn - #dynDecalsExtension)
end
@/lua/ge/extensions/flowgraph/nodes/string/subString.lua
function C:work()
self.pinOut.value.value = string.sub(self.pinIn.value.value, self.data.from, self.data.to)
end
@/lua/ge/extensions/editor/flowgraph/references.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/core/remoteController.lua
--log('D', logTag, "got '" .. tostring(data) .. "' from "..tostring(ip) .. ":" .. tostring(listenPort))
if(data:sub(0, 6) == 'beamng') then -- new device trying to connect
local args = split(data, '|')
@/lua/ge/extensions/editor/dataBlockEditor.lua
resultTable[name] = {}
stringList = stringList:sub(last+1)
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/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
@/lua/ge/extensions/editor/api/gui.lua
if withoutExtension then
filename = string.sub(filename, 1, #filename - 4)
end
if not pos2 then
imgui.TextColored(textColor, text:sub(pos1))
break
elseif pos1 < pos2 then
imgui.TextColored(textColor, text:sub(pos1, pos2 - 1))
imgui.SameLine()
local pos3 = pos2 + highlightLowerLen
imgui.TextColored(textHighlightColor, text:sub(pos2, pos3))
imgui.SameLine()
@/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/gameplay/statistic.lua
local _, file, _ = path.split(filePath)
local fileName = file:sub(1, -5)
local extensionPath = "gameplay/statisticModules/" .. fileName
activityType = "scenario"
activityDetail = "/fg"..missionId:sub(levelFolder:len()+1):gsub("/","@")
elseif scenario_scenarios and scenario_scenarios.getScenario() then
@/lua/vehicle/ai.lua
return laneConfig:sub(1, leftIdx-1), laneConfig:sub(leftIdx, rightIdx), laneConfig:sub(rightIdx+1, numOfLanes)
end
return laneConfig:sub(1, leftIdx-1), laneConfig:sub(leftIdx, rightIdx), laneConfig:sub(rightIdx+1, numOfLanes)
end
return laneConfig:sub(1, leftIdx-1), laneConfig:sub(leftIdx, rightIdx), laneConfig:sub(rightIdx+1, numOfLanes)
end
local i = string.find(k, '\0')
local n1id = string.sub(k, 1, i-1)
local sqDist = positions[n1id]:squaredDistance(ego.pos)
target = n1id
targetLink = string.sub(k, i+1, #k)
end
@/lua/ge/extensions/editor/flowgraph/properties.lua
if data.filepath:find(pin.node.mgr.savedDir) then
sel = data.filepath:sub(pin.node.mgr.savedDir:len()+1,-1)
end
if validExt then
local shortPath = file:sub(pin.node.mgr.savedDir:len()+1,-1)
if im.Selectable1(shortPath) then
@/lua/vehicle/controller/driveModes.lua
for k, v in pairs(jbeamData) do
if k:sub(1, #"modes") == "modes" then
tableMergeRecursive(modeData, v)
if k:sub(1, #"enabledModes") == "enabledModes" then
for _, modeKey in pairs(v) do
@/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
@/lua/vehicle/controller/lineLock.lua
end
wheelNamesString = wheelNamesString:sub(0, wheelNamesString:len() - 2)
@/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/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/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/flowgraph/nodelibrary.lua
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
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/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/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
@/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/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/ge/extensions/core/modmanager.lua
if string.startswith(path, "/vehicles/") and not string.startswith(path, "/vehicles/mod_info") then
vehicles[string.sub(path, 20)] = 1
end
local tmp = e:gsub(filename, "")
if tmp:sub(1,1) ~= "/" then tmp = "/"..tmp end
filesInZIP[#filesInZIP+1] = tmp
local needManualAction = true
if string.sub(oldFilepath,1,11) == "/mods/repo/" then
zip:close()
local path, filename, ext = path.split(v)
local infofile = path .. string.sub(filename, 0, -string.len(ext)-2) .. '.json'
local data = jsonReadFile(infofile)
local tmp = e:gsub(mods[modname].unpackedPath, "")
if tmp:sub(1,1) ~= "/" then tmp = "/"..tmp end
mountedFilesChange[i] = {filename = tmp, type = reason }
if zipPath:startswith(mods[modname].unpackedPath) then
zipPath = string.sub(zipPath, string.len(mods[modname].unpackedPath) + 1)
if string.startswith(zipPath, '/') then
if string.startswith(zipPath, '/') then
zipPath = string.sub(zipPath, 2)
end
if string.startswith(realPath, userPath) then
local modPath = realPath:sub(string.len(userPath))
modPath = modPath:gsub("\\", "/")
if zipPos then
modPath = modPath:sub(1, zipPos + 3)
else
@/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/levelValidator.lua
im.PushStyleColor2(im.Col_Text, logColor)
local textSize = im.CalcTextSize(logItem.message:sub(1, 1000) or "", nil, nil, im.GetColumnWidth(2) - im.GetStyle().ItemSpacing.x)
if im.Selectable1(" " .. (logItem.logLevel or "") .. "##" .. i, selected == i, im.SelectableFlags_SpanAllColumns, im.ImVec2(0, textSize.y + 5)) then
-- Add [IGNORED] prefix for ignored items
local displayMessage = logItem.message:sub(1, 1000) or ""
if isIgnored then
@/lua/ge/extensions/editor/dynamicDecals/export.lua
-- local maps = {"_color", "_colorPalette"}
local dirPath = string.sub(texturesExport_DirectoryPath, -1) == "/" and texturesExport_DirectoryPath or texturesExport_DirectoryPath .. "/"
@/lua/vehicle/extensions/core/quickAccess.lua
end
if string.sub(args.level, string.len(args.level)) ~= "/" then
args.level = args.level .. "/"
@/lua/vehicle/controller/drivingDynamics/actuators/activeDiffBias.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/tech/utils.lua
else
local _,level,_ = path.split(path.split(levelPath):sub(1, -2))
M.level = level
@/lua/vehicle/controller/drivingDynamics/actuators/electronicSplitShaftLock.lua
if slashPos then
nameString = nameString:sub(slashPos + 1)
end
@/lua/vehicle/controller/gauges/analogOdometer.lua
for k, v in pairs(jbeamData) do
if k:sub(1, #"configuration_") == "configuration_" then
tableMergeRecursive(configData, v)
@/lua/ge/extensions/editor/vehicleEditor/staticEditor/veJBeamModifierLeakVis.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)
elseif sectionName:match('^scale') and type(section) == "number" then
modsScalers[sectionName:sub(6, #sectionName)] = {modVal = section, partPath = partName}
end
@/lua/vehicle/controller/drivingDynamics/actuators/adaptiveTorsionBars.lua
if slashPos then
nameString = nameString:sub(slashPos + 1)
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/editor/assemblySpline/molecule.lua
for _, anchorName in ipairs(anchorNames) do
if anchorName:sub(1, 5) == anchorPrefixStrWithDot then
local parts = {}
@/lua/common/libs/luaqrcode/qrencode.lua
if #a == 2 then
b1 = asciitbl[string.byte(string.sub(a,1,1))]
b2 = asciitbl[string.byte(string.sub(a,2,2))]
b1 = asciitbl[string.byte(string.sub(a,1,1))]
b2 = asciitbl[string.byte(string.sub(a,2,2))]
int = b1 * 45 + b2
cpty_ec_bits = cpty_ec_bits + size_ecblock_bytes * 8
datablocks[#datablocks + 1] = string.sub(data, pos * 8 + 1,( pos + size_datablock_bytes)*8)
local tmp_tab = calculate_error_correction(datablocks[#datablocks],size_ecblock_bytes)
if pos < #datablocks[i] then
arranged_data = arranged_data .. string.sub(datablocks[i],pos, pos + 7)
end
if pos < #ecblocks[i] then
arranged_ec = arranged_ec .. string.sub(ecblocks[i],pos, pos + 7)
end
for i=1,7 do
bit = string.sub(ec_mask_type,i,i)
fill_matrix_position(matrix, bit, 9, #matrix - i + 1)
for i=8,9 do
bit = string.sub(ec_mask_type,i,i)
fill_matrix_position(matrix,bit,9,17-i)
for i=10,15 do
bit = string.sub(ec_mask_type,i,i)
fill_matrix_position(matrix,bit,9,16 - i)
for i=1,6 do
bit = string.sub(ec_mask_type,i,i)
fill_matrix_position(matrix,bit,i,9)
end
bit = string.sub(ec_mask_type,7,7)
fill_matrix_position(matrix,bit,8,9)
for i=8,15 do
bit = string.sub(ec_mask_type,i,i)
fill_matrix_position(matrix,bit,#matrix - 15 + i,9)
for i=1,#bitstring do
bit = string.sub(bitstring,i,i)
x = start_x + math.fmod(i - 1,3)
for i=1,#bitstring do
bit = string.sub(bitstring,i,i)
x = start_x + math.floor( (i - 1) / 3 )
_y = positions[i][2]
m = get_pixel_with_mask(mask,_x,_y,string.sub(byte,i,i))
if debugging then
@/lua/common/libs/lua-MessagePack/MessagePack.lua
c.i = i+n
return s:sub(i, e)
end
c.i = i+n
return m.build_ext(tag, s:sub(i, e))
end
underflow = function(self, e)
self.s = self.s:sub(self.i)
e = e - self.i + 1
@/lua/ge/extensions/ui/uiMods.lua
end
local relPath = filepath:sub(#modDir + #modname + 2)
table.insert(mods[modname].files, relPath)
@/lua/ge/extensions/core/commandhandler.lua
if arg1:startswith('beamng:') then
onSchemeCommand(arg1:sub(8), true) -- strip 'beamng:'
break
@/lua/ge/extensions/tech/techCore.lua
sourceFile = fgMgr.savedDir .. name .. '.json'
if string.sub(sourceFile, 1, 1) ~= '/' then
sourceFile = '/' .. sourceFile
@/lua/ge/extensions/core/input/bindings.lua
if string.startswith(device, "xinput") then
local n = string.sub(device, -1, -1) -- get controller number (xinput3 -> 3)
local event = {controller = n, connected = true}
if string.startswith(device, "xinput") then
local n = string.sub(device, -1, -1) -- get controller number (xinput3 -> 3)
local event = {controller = n, connected = false}
@/lua/common/libs/lua-websockets/websocket/client_ev.lua
end
until response:sub(#response-3) == '\r\n\r\n'
read_io:stop(loop)
@/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/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
@/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/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/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/flowgraph/nodes/vehicle/ai/scriptAI/pathFromFile.lua
for _, fileName in pairs(self.files) do
local fnShort = string.sub(fileName, string.len(trackFilePath) + 1)
fnShort = string.sub(fnShort, 1, string.len(fnShort) - string.len(trackFileExt))
local fnShort = string.sub(fileName, string.len(trackFilePath) + 1)
fnShort = string.sub(fnShort, 1, string.len(fnShort) - string.len(trackFileExt))
if im.Selectable1(fnShort, fnShort==self.fnShort) then
if self.fileName and self.fileName ~= "" then
local fnShort = string.sub(self.fileName, string.len(trackFilePath) + 1)
self.fnShort = string.sub(fnShort, 1, string.len(fnShort) - string.len(trackFileExt))
local fnShort = string.sub(self.fileName, string.len(trackFilePath) + 1)
self.fnShort = string.sub(fnShort, 1, string.len(fnShort) - string.len(trackFileExt))
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/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/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/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/gameplay/drift/saveLoad.lua
local dir, _, _ = path.split(file)
local spotId = level .."/".. string.sub(dir, #levelSpotsDir+1, -2)
-- main data
@/lua/ge/extensions/editor/preferences.lua
if string.len(defVal) > 100 then
defVal = string.sub(defVal, 1, 100) .. "..."
end
@/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/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/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/engineAudioDebug.lua
local dataString = jsonEncodePretty(data)
dataString = dataString:sub(3, dataString:len() - 2)
setClipboard(dataString)
@/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/common/libs/ezSVG/EzSVG.lua
if type(k) == "number" then return true end
if string.sub(k, 1, k.len("__")) == "__" then return false end
return true
@/lua/common/libs/resty/template.lua
while s > 0 do
local c = sub(view, s, s)
if c == " " or c == "\t" or c == "\0" or c == "\x0B" then
local function escaped(view, s)
if s > 1 and sub(view, s - 1, s - 1) == "\\" then
if s > 2 and sub(view, s - 2, s - 2) == "\\" then
if s > 1 and sub(view, s - 1, s - 1) == "\\" then
if s > 2 and sub(view, s - 2, s - 2) == "\\" then
return false, 1
local file, location = path, vars and var.template_location
if sub(file, 1) == "/" then file = sub(file, 2) end
if location and location ~= "" then
local file, location = path, vars and var.template_location
if sub(file, 1) == "/" then file = sub(file, 2) end
if location and location ~= "" then
if location and location ~= "" then
if sub(location, -1) == "/" then location = sub(location, 1, -2) end
local res = capture(concat{ location, '/', file})
if location and location ~= "" then
if sub(location, -1) == "/" then location = sub(location, 1, -2) end
local res = capture(concat{ location, '/', file})
local root = vars and (var.template_root or var.document_root) or prefix
if sub(root, -1) == "/" then root = sub(root, 1, -2) end
return readfile(concat{ root, "/", file }) or path
local root = vars and (var.template_root or var.document_root) or prefix
if sub(root, -1) == "/" then root = sub(root, 1, -2) end
return readfile(concat{ root, "/", file }) or path
while s do
local t, p = sub(view, s + 1, s + 1), s + 2
if t == "{" then
c[j] = "___[#___+1]=[=[\n"
c[j+1] = sub(view, i, s - 1 - w)
c[j+2] = "]=]\n"
c[j] = "___[#___+1]=template.escape("
c[j+1] = trim(sub(view, p, e - 1))
c[j+2] = ")\n"
c[j] = "___[#___+1]=[=[\n"
c[j+1] = sub(view, i, s - 1 - w)
c[j+2] = "]=]\n"
c[j] = "___[#___+1]=template.output("
c[j+1] = trim(sub(view, p, e - 1))
c[j+2] = ")\n"
c[j] = "___[#___+1]=[=[\n"
c[j+1] = sub(view, i, s - 1 - w)
c[j+2] = "]=]\n"
local n = e + 2
if sub(view, n, n) == "\n" then
n = n + 1
c[j] = "___[#___+1]=[=[\n"
c[j+1] = sub(view, i, r)
c[j+2] = "]=]\n"
end
c[j] = trim(sub(view, p, e - 1))
c[j+1] = "\n"
c[j] = "___[#___+1]=[=[\n"
c[j+1] = sub(view, i, s - 1 - w)
c[j+2] = "]=]\n"
else
local f = sub(view, p, e - 1)
local x = find(f, ",", 2, true)
c[j] = "___[#___+1]=include([=["
c[j+1] = trim(sub(f, 1, x - 1))
c[j+2] = "]=],"
c[j+2] = "]=],"
c[j+3] = trim(sub(f, x + 1))
c[j+4] = ")\n"
c[j] = "___[#___+1]=[=[\n"
c[j+1] = sub(view, i, s - 1 - w)
c[j+2] = "]=]\n"
c[j] = "___[#___+1]=include("
c[j+1] = trim(sub(view, p, e - 1))
c[j+2] = ")\n"
if e then
local x, y = find(view, sub(view, s, e + 1), e + 2, true)
if x then
c[j] = "___[#___+1]=[=[\n"
c[j+1] = sub(view, i, s - 1 - w)
c[j+2] = "]=]\n"
x = x - 1
if sub(view, y, y) == "\n" then
y = y + 1
end
local b = trim(sub(view, p, e - 1))
if b == "verbatim" or b == "raw" then
c[j] = "___[#___+1]=[=[\n"
c[j+1] = sub(view, i, s - 1 - w)
c[j+2] = "]=]\n"
c[j] = "___[#___+1]=[=["
c[j+1] = sub(view, e + 2, x)
c[j+2] = "]=]\n"
else
if sub(view, x, x) == "\n" then
x = x - 1
c[j] = "___[#___+1]=[=[\n"
c[j+1] = sub(view, i, r)
c[j+2] = "]=]\n"
c[j+2] = '"]=include[=['
c[j+3] = sub(view, e + 2, x)
c[j+4] = "]=]\n"
c[j] = "___[#___+1]=[=[\n"
c[j+1] = sub(view, i, s - 1 - w)
c[j+2] = "]=]\n"
e = e + 2
if sub(view, e, e) == "\n" then
e = e + 1
end
s = sub(view, i)
if s and s ~= "" then
@/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/ui/vehicleSelector/vehicleSpecifications.lua
local start = math.max(1, i - 2)
table.insert(parts, 1, integerPart:sub(start, i))
end
@/lua/ge/extensions/editor/resourceChecker/resourceUtil.lua
local function strEnds(s, suffix)
return s and suffix and s:sub(-#suffix) == suffix
end
if title then
title = title:sub(2, -2)
t[title] = t[title] or {}
key = key:gsub(' ', "")
value = value:sub(2, -2)
t[titleS][key] = value
@/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/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/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/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
@/lua/ge/server/server.lua
local levelDir = path.dirname(levelPath)
if string.sub(levelDir, -1) ~= '/' then
levelDir = levelDir.."/"
@/lua/ge/extensions/editor/dynamicDecals/layerStack.lua
local dir, file, ext = path.split(data.filepath)
file = string.sub(file, 1, #file - (#ext + 1))
api.exportLayerMask(layer, dir, file, ext)
@/lua/common/jit/v.lua
local oidx = 6 * info
info = sub(vmdef.bcnames, oidx+1, oidx+6)
end
@/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/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/libs/slaxml/slaxml.lua
if first>textStart and self._call.text then
local text = sub(xml,textStart,first-1)
if options.stripWhitespace then
@/lua/vehicle/partCondition.lua
result[partId] = getCondition(partId)
--log("I", "partCondition.getConditions", string.format("Got condition for partId %25s: ", partId) .. string.sub(serialize(result[partId]), 1, 100))
end,
@/lua/ge/extensions/util/worker.lua
local src = daePath
local dst = dir .. filename:sub(1, -4) .. 'cdae'
local dstData = dir .. filename:sub(1, -4) .. 'meshes.json'
local dst = dir .. filename:sub(1, -4) .. 'cdae'
local dstData = dir .. filename:sub(1, -4) .. 'meshes.json'
@/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/libs/lunajson/lunajson/decoder.lua
local function f_nul()
if sub(json, pos, pos+2) == 'ull' then
pos = pos+3
local function f_fls()
if sub(json, pos, pos+3) == 'alse' then
pos = pos+4
local function f_tru()
if sub(json, pos, pos+2) == 'rue' then
pos = pos+3
local str = sub(json, pos, tmppos)
pos = newpos
@/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/vehicle/controller.lua
for _, v in pairs(loadedControllers) do
if v.typeName:sub(1, #path) == path then
table.insert(controllers, v)
@/lua/ge/extensions/util/procTrack.lua
while i*5 < #word do
local w = string.sub(word, 1+ i*5, 5+i*5)
@/lua/vehicle/controller/gauges/genericGauges.lua
for k, v in pairs(jbeamData) do
if k:sub(1, #"configuration_") == "configuration_" then
tableMergeRecursive(configData, v)
@/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/ge/extensions/flowgraph/nodes/string/format.lua
if txt:len() > 16 then
im.Text(txt:sub(1,16).."...")
else
@/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/gameplay/missions/missionTypes/editorHelper.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/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/ge/extensions/core/audio.lua
local function cacheSetEntry(bankFilePath)
if string.sub(bankFilePath, 1, 1) ~= '/' then
bankFilePath = "/"..bankFilePath
local function cacheClearEntry(bankFilePath)
if string.sub(bankFilePath, 1, 1) ~= '/' then
bankFilePath = "/"..bankFilePath
for _,filepath in ipairs(bankFiles) do
if string.sub(filepath, 1, 1) ~= '/' then
filepath = "/"..filepath
for _,filepath in ipairs(bankFiles) do
if string.sub(filepath, 1, 1) ~= '/' then
filepath = "/"..filepath
for _,filepath in ipairs(bankFiles) do
if string.sub(filepath, 1, 1) ~= '/' then
filepath = "/"..filepath
for _,filepath in ipairs(bankFiles) do
if string.sub(filepath, 1, 1) ~= '/' then
filepath = "/"..filepath
end
if string.sub(path, 1, 1) ~= '/' then
path = "/"..path
local function loadLevelBank(bankFilePath)
if string.sub(bankFilePath, 1, 1) ~= '/' then
bankFilePath = "/"..bankFilePath
local function loadVehicleBank(bankPath)
if string.sub(bankPath, 1, 1) ~= '/' then
bankPath = "/"..bankPath
-- make sure the key we use here matches that used previously in loadBaseBank
if string.sub(filename, 1, 1) ~= '/' then
filename = "/"..filename
@/lua/ge/extensions/editor/masterSpline/splineMgr.lua
local baseName = decalSpline.name or "Decal Spline"
local uniqueName = baseName .. " - " .. string.sub(spline.id, 1, 8)
setNameJumpTable[decalSplineLink.getToolPrefixStr()](spline.id, uniqueName)
@/lua/ge/extensions/editor/dynamicDecals/layerTypes/decal.lua
local dir, fileName, fileExt = path.split(api.getDecalTexturePath("color"))
newBrushName = string.sub(fileName, 1, #fileName - (#fileExt + 1))
im.OpenPopup("SaveBrushPopup")
if im.InputText(string.format("##%s_%s", guiId, "decalLayerFontCharacter"), editor.getTempCharPtr(api.getDecalLayerFontCharacter()), nil, im.InputTextFlags_AutoSelectAll) then
api.setDecalLayerFontCharacter(string.sub(editor.getTempCharPtr(), 1, 1))
end
@/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/vehicle/controller/drivingDynamics/CMU.lua
if slashPos then
controllerName = controllerName:sub(slashPos + 1)
end
@/lua/common/libs/LuaIRC/util.lua
local lineStart = 1
if line:sub(1,1) == ":" then
local space = line:find(" ")
local space = line:find(" ")
prefix = line:sub(2, space-1)
lineStart = space
if trailToken then
trailing = line:sub(trailToken + 1)
lineStop = trailToken - 2
local randindex = random(1, #nick)
local randchar = sub(nick, randindex, randindex)
local b = byte(randchar)
-- Get the halves before and after the changed character
local first = sub(nick, 1, randindex - 1)
local last = sub(nick, randindex + 1, #nick)
local first = sub(nick, 1, randindex - 1)
local last = sub(nick, randindex + 1, #nick)
nick = first..char(b)..last -- Insert the new charachter
@/lua/ge/extensions/ui/console.lua
if tostring(slashed[1]):len() > 4096 then
logs[logsTail] = {t,lvl,origin,tostring(slashed[1]):sub(1,4096)} --trim so we save memory and don't stress other part of code
else
if tostring(slashed[i]):len() > 4096 then
logs[logsTail] = {t,lvl,origin,tostring(slashed[i]):sub(1,4096)} --trim so we save memory and don't stress other part of code
else
if v ~= 2 and im.GetContentRegionAvailWidth() < txtwidth then
im.TextColored(lcol,string.format("%s", tostring(v):sub(1,256) ))
txtwidth = txtwidth * (1/fontConsoleFact[0])
while(bt:len() > chunkSize and chunk:len() < 2048) do
chunk = chunk..bt:sub(1,chunkSize).."\n"
bt = bt:sub(chunkSize+1)
chunk = chunk..bt:sub(1,chunkSize).."\n"
bt = bt:sub(chunkSize+1)
end
--table.insert(console_log_buffer, {'r', tostring(res)})
if type(res)=="string" and res:sub(1,7)== "Error: " then
log("E", "exec", res)
strI = strI..", "..vobj:getJBeamFilename()
if vobj.partConfig:sub(1,1) == "{" or vobj.partConfig:sub(1,1) == "[" then
strI = strI..", *custom*"
strI = strI..", "..vobj:getJBeamFilename()
if vobj.partConfig:sub(1,1) == "{" or vobj.partConfig:sub(1,1) == "[" then
strI = strI..", *custom*"
@/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/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)