Skip to content

Commit 61ecadf

Browse files
authored
Merge pull request #1181 from Stephan-S/dev-iwan
Release 2.0.1.8
2 parents 23043f5 + fe8430d commit 61ecadf

55 files changed

Lines changed: 3036 additions & 500 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
/.vscode

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# FS22_AutoDrive
22
FS22 version of the AutoDrive mod
33

4-
### Latest Release: 2.0.1.6
4+
### Latest Release: 2.0.1.8
55
![GitHub all releases](https://img.shields.io/github/downloads/Stephan-S/FS22_AutoDrive/total?label=Downloads&style=plastic)
66
Direct Download: https://github.com/Stephan-S/FS22_AutoDrive/releases/latest/download/FS22_AutoDrive.zip
77

gui/userSettingsPage.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,14 @@
114114
<GuiElement type="bitmap" profile="multiTextOptionSettingsBg" />
115115
<GuiElement type="bitmap" profile="baseReference" position="730px 0px" size="50px 50px"/>
116116
</GuiElement>
117+
<GuiElement type="multiTextOption" profile="multiTextOptionSettings" onCreate="onCreateAutoDriveSetting" onClick="onOptionChange" name="scaleMarkerText" toolTipElementId="ingameMenuHelpBoxText">
118+
<GuiElement type="button" profile="multiTextOptionSettingsLeft" />
119+
<GuiElement type="button" profile="multiTextOptionSettingsRight" />
120+
<GuiElement type="text" profile="multiTextOptionSettingsText" />
121+
<GuiElement type="text" profile="multiTextOptionSettingsTitle" position="27px 0px" />
122+
<GuiElement type="bitmap" profile="multiTextOptionSettingsBg" />
123+
<GuiElement type="bitmap" profile="baseReference" position="730px 0px" size="50px 50px"/>
124+
</GuiElement>
117125
</GuiElement>
118126
</GuiElement>
119127

modDesc.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Différents modes d'utilisation ont été ajoutés depuis les premières version
3232
<![CDATA[Этот мод может быть использован для создания сети маршрутов для транспортных средств для автономного вождения. После настройки вы можете указать трактору, стоящему где-угодно рядом с сетью, проехать в любую точку, например, в магазин, поле №1 или в точку продажи.]]>
3333
</ru>
3434
</description>
35-
<version>2.0.1.6</version>
35+
<version>2.0.1.8</version>
3636
<multiplayer supported="true" />
3737
<iconFilename>icon.dds</iconFilename>
3838
<extraSourceFiles>

register.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ source(Utils.getFilename("scripts/Utils/Buffer.lua", g_currentModDirectory))
6464
source(Utils.getFilename("scripts/Utils/FlaggedTable.lua", g_currentModDirectory))
6565
source(Utils.getFilename("scripts/Utils/CollisionDetectionUtils.lua", g_currentModDirectory))
6666
source(Utils.getFilename("scripts/Utils/PathFinderUtils.lua", g_currentModDirectory))
67+
source(Utils.getFilename("scripts/Utils/Dubins.lua", g_currentModDirectory))
6768
source(Utils.getFilename("scripts/Utils/AutoDriveUtilFuncs.lua", g_currentModDirectory))
6869
source(Utils.getFilename("scripts/Utils/SortedQueue.lua", g_currentModDirectory))
6970
source(Utils.getFilename("scripts/Utils/DevFuncs.lua", g_currentModDirectory))

scripts/AutoDrive.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
AutoDrive = {}
2-
AutoDrive.version = "2.0.1.6"
2+
AutoDrive.version = "2.0.1.8"
33

44
AutoDrive.directory = g_currentModDirectory
55

@@ -17,6 +17,7 @@ AutoDrive.experimentalFeatures.UTurn = true
1717
AutoDrive.experimentalFeatures.FoldImplements = true
1818
AutoDrive.experimentalFeatures.RefuelOnlyAtValidStations = true
1919
AutoDrive.experimentalFeatures.RecordWhileNotInVehicle = false
20+
AutoDrive.experimentalFeatures.NewPathfinder = true
2021

2122
AutoDrive.dynamicChaseDistance = true
2223
AutoDrive.smootherDriving = true
@@ -440,7 +441,7 @@ function AutoDrive.drawNetworkOnMap()
440441
if isSubPrio(outNode) then
441442
r, g, b, a = unpack(AutoDrive.currentColors.ad_color_subPrioDualConnection)
442443
end
443-
elseif ADGraphManager:isReverseRoad(start, target) then
444+
elseif ADGraphManager:isReverseRoad(node, outNode) then
444445
r, g, b, a = unpack(AutoDrive.currentColors.ad_color_reverseConnection)
445446
end
446447
setOverlayColor( AutoDrive.courseOverlayId, r, g, b, a)

scripts/ExternalInterface.lua

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,7 @@ function AutoDrive:notifyDestinationListeners()
209209
end
210210

211211
function AutoDrive:combineIsCallingDriver(combine) --only for CoursePlay
212-
local openPipe,_ = ADHarvestManager.getOpenPipePercent(combine)
213-
return openPipe or ADHarvestManager.doesHarvesterNeedUnloading(combine, true)
212+
return AutoDrive:getIsCPWaitingForUnload(combine)
214213
end
215214

216215
function AutoDrive:getCombineOpenPipePercent(combine) --for AIVE
@@ -828,9 +827,9 @@ function AutoDrive:getALFillTypes(object) -- used by PullDownList, getSupportedF
828827
-- spec_universalAutoload
829828
local spec = object.spec_universalAutoload
830829
if spec and AutoDrive:hasAL(object) then
831-
AutoDrive.debugPrint(vehicle, AutoDrive.DC_EXTERNALINTERFACEINFO, "AutoDrive:getALCurrentFillType spec_universalAutoload function not supported!")
830+
AutoDrive.debugPrint(object, AutoDrive.DC_EXTERNALINTERFACEINFO, "AutoDrive:getALCurrentFillType spec_universalAutoload function not supported!")
832831
end
833-
AutoDrive.debugPrint(vehicle, AutoDrive.DC_EXTERNALINTERFACEINFO, "AutoDrive:getALFillTypes #fillTypes %s", tostring(#fillTypes))
832+
AutoDrive.debugPrint(object, AutoDrive.DC_EXTERNALINTERFACEINFO, "AutoDrive:getALFillTypes #fillTypes %s", tostring(#fillTypes))
834833
return fillTypes
835834
end
836835

@@ -847,7 +846,7 @@ function AutoDrive:getALCurrentFillType(object) -- used by onEnterVehicle, onPos
847846
-- spec_universalAutoload
848847
local spec = object.spec_universalAutoload
849848
if spec and AutoDrive:hasAL(object) then
850-
AutoDrive.debugPrint(vehicle, AutoDrive.DC_EXTERNALINTERFACEINFO, "AutoDrive:getALCurrentFillType spec_universalAutoload function not supported!")
849+
AutoDrive.debugPrint(object, AutoDrive.DC_EXTERNALINTERFACEINFO, "AutoDrive:getALCurrentFillType spec_universalAutoload function not supported!")
851850
end
852851
return nil
853852
end

scripts/Hud.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,7 @@ function AutoDriveHud:mouseEvent(vehicle, posX, posY, isDown, isUp, button)
429429

430430
if mouseActiveForAutoDrive then
431431
local mouseEventHandled = false
432+
local silent = false
432433
if AutoDrive.splineInterpolation ~= nil then
433434
AutoDrive.splineInterpolation.valid = false
434435
end

scripts/Hud/PullDownList.lua

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -497,14 +497,16 @@ function ADPullDownList:createSelection_FillType()
497497

498498
if vehicle ~= nil then
499499
local trailers, _ = AutoDrive.getAllUnits(vehicle)
500-
supportedFillTypes = {}
501-
for _, trailer in ipairs(trailers) do
502-
if AutoDrive:hasAL(trailer) then
503-
local alFillTypes = AutoDrive:getALFillTypes(trailer)
504-
if alFillTypes ~= nil and #alFillTypes > 0 then
505-
-- self.autoLoadFillTypes is either nil or it contains items. It is never empty.
506-
self.autoLoadFillTypes = alFillTypes
507-
break
500+
if trailers then
501+
supportedFillTypes = {}
502+
for _, trailer in ipairs(trailers) do
503+
if AutoDrive:hasAL(trailer) then
504+
local alFillTypes = AutoDrive:getALFillTypes(trailer)
505+
if alFillTypes ~= nil and #alFillTypes > 0 then
506+
-- self.autoLoadFillTypes is either nil or it contains items. It is never empty.
507+
self.autoLoadFillTypes = alFillTypes
508+
break
509+
end
508510
end
509511
end
510512
end
@@ -703,21 +705,29 @@ function ADPullDownList:act(vehicle, posX, posY, isDown, isUp, button)
703705
elseif button == 4 and isUp then
704706
-- mouse wheel
705707
local oldSelected = self.selected
706-
self.selected = math.max(1, self.selected - 1)
708+
local decrement = 1
709+
if AutoDrive.leftCTRLmodifierKeyPressed then
710+
decrement = 10
711+
end
712+
self.selected = math.max(1, self.selected - decrement)
707713
if oldSelected ~= self.selected then
708-
self.hovered = math.max(1, self.hovered - 1)
714+
self.hovered = math.max(1, self.hovered - decrement)
709715
end
710-
if self.hovered > (self.selected + ADPullDownList.MAX_SHOWN - 1) then
711-
self.hovered = self.selected + ADPullDownList.MAX_SHOWN - 1
716+
if self.hovered > (self.selected + ADPullDownList.MAX_SHOWN - decrement) then
717+
self.hovered = self.selected + ADPullDownList.MAX_SHOWN - decrement
712718
end
713719
AutoDrive.mouseWheelActive = true
714720
return true
715721
elseif button == 5 and isUp then
716722
-- mouse wheel
717-
if self:getListElementByIndex(vehicle, self.selected + 1 + ADPullDownList.MAX_SHOWN - 3) ~= nil then
718-
self.selected = self.selected + 1
719-
if self:getListElementByIndex(vehicle, self.hovered + 1 + ADPullDownList.MAX_SHOWN - 3) ~= nil then
720-
self.hovered = self.hovered + 1
723+
local increment = 1
724+
if AutoDrive.leftCTRLmodifierKeyPressed then
725+
increment = 10
726+
end
727+
if self:getListElementByIndex(vehicle, self.selected + increment + ADPullDownList.MAX_SHOWN - 3) ~= nil then
728+
self.selected = self.selected + increment
729+
if self:getListElementByIndex(vehicle, self.hovered + increment + ADPullDownList.MAX_SHOWN - 3) ~= nil then
730+
self.hovered = self.hovered + increment
721731
end
722732
end
723733
AutoDrive.mouseWheelActive = true

scripts/Manager/BunkerSiloManager.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,11 @@ function ADBunkerSiloManager:update(dt)
5454
if triggerX ~= nil then
5555
local distance = MathUtil.vector2Length(triggerX - vehicleX, triggerZ - vehicleZ)
5656
if distance < bsmRange then
57-
if AutoDrive.isVehicleInBunkerSiloArea(vehicle) or bunkerSilo.adClosestVehicle == vehicle then
57+
local fillLevel, _, _, _ = AutoDrive.getAllFillLevels(AutoDrive.getAllUnits(vehicle))
58+
if AutoDrive.isVehicleInBunkerSiloArea(vehicle)
59+
or bunkerSilo.adClosestVehicle == vehicle
60+
or fillLevel < 0.1
61+
then
5862
-- IMPORTANT: DO NOT SET setUnPaused to avoid crash with CP silo compacter !!!
5963
-- vehicle.ad.drivePathModule:setUnPaused()
6064
else

0 commit comments

Comments
 (0)