diff --git a/FS19_AutoDrive/gui/settingsGui.lua b/FS19_AutoDrive/gui/settingsGui.lua index 67fe339f..9b776840 100644 --- a/FS19_AutoDrive/gui/settingsGui.lua +++ b/FS19_AutoDrive/gui/settingsGui.lua @@ -152,4 +152,16 @@ end; function adSettingsGui:onCreateAutoDriveSettingRecalculationSpeed(element) self:onCreateAutoDriveSetting(element, "recalculationSpeed"); +end; + +function adSettingsGui:onCreateAutoDriveSettingShowNextPath(element) + self:onCreateAutoDriveSetting(element, "showNextPath"); +end; + +function adSettingsGui:onCreateAutoDriveSettingAvoidFruit(element) + self:onCreateAutoDriveSetting(element, "avoidFruit"); +end; + +function adSettingsGui:onCreateAutoDriveSettingPathFinderTime(element) + self:onCreateAutoDriveSetting(element, "pathFinderTime"); end; \ No newline at end of file diff --git a/FS19_AutoDrive/gui/settingsGui.xml b/FS19_AutoDrive/gui/settingsGui.xml index 752c73d5..93e674a6 100644 --- a/FS19_AutoDrive/gui/settingsGui.xml +++ b/FS19_AutoDrive/gui/settingsGui.xml @@ -143,7 +143,28 @@ - + + + + + + + + + + + + + + + + + + + + + + diff --git a/FS19_AutoDrive/modDesc.xml b/FS19_AutoDrive/modDesc.xml index 614ee728..24d220cb 100644 --- a/FS19_AutoDrive/modDesc.xml +++ b/FS19_AutoDrive/modDesc.xml @@ -31,7 +31,7 @@ Créer, ajouter, modifier, supprimer vos routes ou points de destination à l'ai ]]> - 1.0.3.6 + 1.0.3.7 store.dds diff --git a/FS19_AutoDrive/scripts/AutoDrive.lua b/FS19_AutoDrive/scripts/AutoDrive.lua index 16f54c34..6fcaaded 100644 --- a/FS19_AutoDrive/scripts/AutoDrive.lua +++ b/FS19_AutoDrive/scripts/AutoDrive.lua @@ -1,5 +1,5 @@ AutoDrive = {}; -AutoDrive.Version = "1.0.3.6"; +AutoDrive.Version = "1.0.3.7"; AutoDrive.config_changed = false; AutoDrive.directory = g_currentModDirectory; @@ -412,9 +412,11 @@ function AutoDrive:onDraw() end end; - if self.ad.currentWayPoint > 0 and self.ad.wayPoints ~= nil then - if self.ad.wayPoints[self.ad.currentWayPoint+1] ~= nil then - AutoDrive:drawLine(self.ad.wayPoints[self.ad.currentWayPoint], self.ad.wayPoints[self.ad.currentWayPoint+1], 1, 1, 1, 1); + if AutoDrive:getSetting("showNextPath") == true then + if self.ad.currentWayPoint > 0 and self.ad.wayPoints ~= nil then + if self.ad.wayPoints[self.ad.currentWayPoint+1] ~= nil then + AutoDrive:drawLine(self.ad.wayPoints[self.ad.currentWayPoint], self.ad.wayPoints[self.ad.currentWayPoint+1], 1, 1, 1, 1); + end; end; end; diff --git a/FS19_AutoDrive/scripts/AutoDrivePathFinder.lua b/FS19_AutoDrive/scripts/AutoDrivePathFinder.lua index f88277cc..c97a6d1b 100644 --- a/FS19_AutoDrive/scripts/AutoDrivePathFinder.lua +++ b/FS19_AutoDrive/scripts/AutoDrivePathFinder.lua @@ -1,5 +1,5 @@ AutoDrive.MAX_PATHFINDER_STEPS_PER_FRAME = 20; -AutoDrive.MAX_PATHFINDER_STEPS_TOTAL = 300; +AutoDrive.MAX_PATHFINDER_STEPS_TOTAL = 400; AutoDrive.PATHFINDER_TARGET_DISTANCE = 25; AutoDrive.PATHFINDER_START_DISTANCE = 5; AutoDrive.PP_UP = 0; @@ -211,7 +211,7 @@ function AutoDrivePathFinder:updatePathPlanning(driver) return; end; - if pf.steps > AutoDrive.MAX_PATHFINDER_STEPS_TOTAL then + if pf.steps > (AutoDrive.MAX_PATHFINDER_STEPS_TOTAL * AutoDrive:getSetting("pathFinderTime")) then if not pf.fallBackMode then --look for path through fruit pf.fallBackMode = true; pf.steps = 0; @@ -475,7 +475,7 @@ function AutoDrivePathFinder:checkGridCell(pf, cell) --cell.hasCollision = false; --end; - if pf.ignoreFruit ~= nil and pf.ignoreFruit == false then + if (((pf.ignoreFruit == nil) or (pf.ignoreFruit ~= nil and pf.ignoreFruit == false)) and AutoDrive:getSetting("avoidFruit")) then if pf.fruitToCheck == nil then --make async query until fruittype is known local callBack = PathFinderCallBack:new(pf, cell); diff --git a/FS19_AutoDrive/scripts/AutoDriveSettings.lua b/FS19_AutoDrive/scripts/AutoDriveSettings.lua index 23469ea1..a7c7b5ef 100644 --- a/FS19_AutoDrive/scripts/AutoDriveSettings.lua +++ b/FS19_AutoDrive/scripts/AutoDriveSettings.lua @@ -180,6 +180,36 @@ AutoDrive.settings.recalculationSpeed = { translate= false }; +AutoDrive.settings.showNextPath = { + values= {false, true}, + texts= {"gui_ad_no", "gui_ad_yes"}, + default= 2, + current= 2, + text= "gui_ad_showNextPath", + tooltip= "gui_ad_showNextPath_tooltip", + translate= true +}; + +AutoDrive.settings.avoidFruit = { + values= {false, true}, + texts= {"gui_ad_no", "gui_ad_yes"}, + default= 2, + current= 2, + text= "gui_ad_avoidFruit", + tooltip= "gui_ad_avoidFruit_tooltip", + translate= true +}; + +AutoDrive.settings.pathFinderTime = { + values= {0.25, 0.5, 1.0, 1.5, 2, 3, 4, 5, 10}, + texts= {"x0.25", "x0.5", "x1.0", "x1.5", "x2", "x3", "x4", "x5", "x10"}, + default= 3, + current= 3, + text= "gui_ad_pathFinderTime", + tooltip= "gui_ad_pathFinderTime_tooltip", + translate= false +}; + function AutoDrive:getSetting(settingName) if AutoDrive.settings[settingName] ~= nil then local setting = AutoDrive.settings[settingName] diff --git a/FS19_AutoDrive/translations/translation_de.xml b/FS19_AutoDrive/translations/translation_de.xml index 3a9603be..f9c0a54d 100644 --- a/FS19_AutoDrive/translations/translation_de.xml +++ b/FS19_AutoDrive/translations/translation_de.xml @@ -94,5 +94,11 @@ + + + + + + diff --git a/FS19_AutoDrive/translations/translation_en.xml b/FS19_AutoDrive/translations/translation_en.xml index dd480f54..97902047 100644 --- a/FS19_AutoDrive/translations/translation_en.xml +++ b/FS19_AutoDrive/translations/translation_en.xml @@ -94,5 +94,11 @@ + + + + + + diff --git a/releases/1.0.3.7/FS19_AutoDrive.zip b/releases/1.0.3.7/FS19_AutoDrive.zip new file mode 100644 index 00000000..2055a9f4 Binary files /dev/null and b/releases/1.0.3.7/FS19_AutoDrive.zip differ