11AutoDrive = {}
2- AutoDrive .version = " 2.0.1.0 "
2+ AutoDrive .version = " 2.0.1.2 "
33
44AutoDrive .directory = g_currentModDirectory
55
@@ -11,7 +11,7 @@ AutoDrive.experimentalFeatures = {}
1111AutoDrive .experimentalFeatures .redLinePosition = false
1212-- AutoDrive.experimentalFeatures.telemetryOutput = false
1313AutoDrive .experimentalFeatures .enableRoutesManagerOnDediServer = false
14- AutoDrive .experimentalFeatures .detectGrasField = true
14+ AutoDrive .experimentalFeatures .detectSwath = true
1515AutoDrive .experimentalFeatures .colorAssignmentMode = false
1616AutoDrive .experimentalFeatures .UTurn = true
1717AutoDrive .experimentalFeatures .FoldImplements = true
@@ -289,7 +289,7 @@ function AutoDrive:refreshContextInputAIFrame()
289289end
290290
291291function AutoDrive :drawBaseMission ()
292- if AutoDrive .aiFrameOpen then
292+ if AutoDrive .aiFrameOpen then
293293 AutoDrive :drawRouteOnMap ()
294294 AutoDrive .drawNetworkOnMap ()
295295 if AutoDrive .aiFrameVehicle ~= nil then
@@ -355,20 +355,20 @@ function AutoDrive.drawRouteOnMap()
355355 if lastWp ~= nil and index >= currentWp then
356356 local startX , startY , _ , _ = AutoDrive .getScreenPosFromWorldPos (lastWp .x , lastWp .z )
357357 local endX , endY , _ , _ = AutoDrive .getScreenPosFromWorldPos (wp .x , wp .z )
358-
358+
359359 if startX and startY and endX and endY then
360360 dx2D = endX - startX ;
361361 dy2D = ( endY - startY ) / g_screenAspectRatio ;
362362 width = MathUtil .vector2Length (dx2D , dy2D );
363-
363+
364364 dx = wp .x - lastWp .x ;
365365 dz = wp .z - lastWp .z ;
366366 rotation = MathUtil .getYRotationFromDirection (dx , dz ) - math.pi * 0.5 ;
367-
367+
368368 local lineThickness = 2 / g_screenHeight
369369 setOverlayColor ( AutoDrive .courseOverlayId , 0.3 , 0.5 , 0.56 , 1 )
370370 setOverlayRotation ( AutoDrive .courseOverlayId , rotation , 0 , 0 )
371-
371+
372372 renderOverlay ( AutoDrive .courseOverlayId , startX , startY , width , lineThickness )
373373 end
374374 setOverlayRotation ( AutoDrive .courseOverlayId , 0 , 0 , 0 ) -- reset overlay rotation
@@ -407,34 +407,34 @@ function AutoDrive.drawNetworkOnMap()
407407 local outNode = network [outNodeId ]
408408 local startX , startY , _ , _ = AutoDrive .getScreenPosFromWorldPos (node .x , node .z )
409409 local endX , endY , _ , _ = AutoDrive .getScreenPosFromWorldPos (outNode .x , outNode .z )
410-
410+
411411 if startX and startY and endX and endY then
412412 dx2D = endX - startX ;
413413 dy2D = ( endY - startY ) / g_screenAspectRatio ;
414414 width = MathUtil .vector2Length (dx2D , dy2D );
415-
415+
416416 dx = outNode .x - node .x ;
417417 dz = outNode .z - node .z ;
418418 rotation = MathUtil .getYRotationFromDirection (dx , dz ) - math.pi * 0.5 ;
419-
419+
420420 local lineThickness = 2 / g_screenHeight
421421 local r , g , b , a = unpack (AutoDrive .currentColors .ad_color_singleConnection )
422-
422+
423423 if isSubPrio (outNode ) then
424424 r , g , b , a = unpack (AutoDrive .currentColors .ad_color_subPrioSingleConnection )
425425 end
426-
426+
427427 if ADGraphManager :isDualRoad (node , outNode ) then
428428 r , g , b , a = unpack (AutoDrive .currentColors .ad_color_dualConnection )
429429 if isSubPrio (outNode ) then
430430 r , g , b , a = unpack (AutoDrive .currentColors .ad_color_subPrioDualConnection )
431- end
432- elseif ADGraphManager :isReverseRoad (start , target ) then
431+ end
432+ elseif ADGraphManager :isReverseRoad (start , target ) then
433433 r , g , b , a = unpack (AutoDrive .currentColors .ad_color_reverseConnection )
434434 end
435435 setOverlayColor ( AutoDrive .courseOverlayId , r , g , b , a )
436436 setOverlayRotation ( AutoDrive .courseOverlayId , rotation , 0 , 0 )
437-
437+
438438 renderOverlay ( AutoDrive .courseOverlayId , startX , startY , width , lineThickness )
439439 end
440440 setOverlayRotation ( AutoDrive .courseOverlayId , 0 , 0 , 0 ) -- reset overlay rotation
@@ -448,7 +448,7 @@ function AutoDrive.getScreenPosFromWorldPos(worldX, worldZ)
448448 local objectX = (worldX + AutoDrive .aiFrame .ingameMapBase .worldCenterOffsetX ) / AutoDrive .aiFrame .ingameMapBase .worldSizeX * 0.5 + 0.25
449449 local objectZ = (worldZ + AutoDrive .aiFrame .ingameMapBase .worldCenterOffsetZ ) / AutoDrive .aiFrame .ingameMapBase .worldSizeZ * 0.5 + 0.25
450450 local x , y , _ , _ = AutoDrive .aiFrame .ingameMapBase .layout :getMapObjectPosition (objectX , objectZ , 0 , 0 , 0 , true )
451-
451+
452452 return x , y
453453end
454454
557557function AutoDrive :mouseEvent (posX , posY , isDown , isUp , button )
558558 local vehicle = AutoDrive .getADFocusVehicle ()
559559 local mouseActiveForAutoDrive = (g_gui .currentGui == nil or AutoDrive .aiFrameOpen ) and (g_inputBinding :getShowMouseCursor () == true )
560-
560+
561561 if not mouseActiveForAutoDrive then
562562 AutoDrive .lastButtonDown = nil
563563 return
@@ -591,7 +591,7 @@ function AutoDrive:mouseEvent(posX, posY, isDown, isUp, button)
591591 end
592592end
593593
594- function AutoDrive :update (dt )
594+ function AutoDrive :update (dt )
595595 if AutoDrive .scanDialogState == AutoDrive .SCAN_DIALOG_NONE and ADGraphManager :getWayPointsCount () == 0 then
596596 if g_server ~= nil and g_dedicatedServer == nil then
597597 -- open dialog
@@ -657,7 +657,7 @@ function AutoDrive:update(dt)
657657 ADTriggerManager :update (dt )
658658 ADRoutesManager :update (dt )
659659
660- -- AutoDrive.handleTelemetry(dt)
660+ -- AutoDrive.handleTelemetry(dt)
661661end
662662
663663function AutoDrive :draw ()
0 commit comments