Skip to content

Commit

Permalink
6.01.00183:fixed fertilizerSowingmachines
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasGaertner committed Apr 12, 2019
1 parent 94de542 commit 6a0d7f8
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
8 changes: 8 additions & 0 deletions base.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1951,6 +1951,14 @@ end
AIVehicle.stopAIVehicle = Utils.overwrittenFunction(AIVehicle.stopAIVehicle, courseplay.stopAIVehicle)


function courseplay.processSowingMachineArea(tool,originalFunction, superFunc, workArea, dt)
tool.spec_sprayer.workAreaParameters.sprayFillLevel = tool.fertilizerEnabled and tool.spec_sprayer.workAreaParameters.sprayFillLevel or 0

return originalFunction(tool, superFunc, workArea, dt)
end
FertilizingSowingMachine.processSowingMachineArea = Utils.overwrittenFunction(FertilizingSowingMachine.processSowingMachineArea, courseplay.processSowingMachineArea)


-- Tour dialog messes up the CP yes no dialogs.
function courseplay:showTourDialog()
print('Tour dialog is disabled by Courseplay.')
Expand Down
2 changes: 1 addition & 1 deletion hud.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1187,7 +1187,7 @@ function courseplay.hud:updatePageContent(vehicle, page)
vehicle.cp.hud.content.pages[page][line][2].text = vehicle.cp.oppositeTurnMode and courseplay:loc('COURSEPLAY_OPPOSITE_TURN_WHEN_POSSIBLE') or courseplay:loc('COURSEPLAY_OPPOSITE_TURN_AT_END');

elseif entry.functionToCall == 'toggleFertilizeOption' then
if vehicle.cp.hasFertilizerSowingMachine then
if vehicle.cp.hasFertilizerSowingMachine and not vehicle:getIsCourseplayDriving() then
self:enableButtonWithFunction(vehicle,page, 'toggleFertilizeOption')
vehicle.cp.hud.content.pages[page][line][1].text = courseplay:loc('COURSEPLAY_FERTILIZERFUNCTION');
vehicle.cp.hud.content.pages[page][line][2].text = vehicle.cp.fertilizerEnabled and courseplay:loc('COURSEPLAY_ACTIVATED') or courseplay:loc('COURSEPLAY_DEACTIVATED');
Expand Down
2 changes: 1 addition & 1 deletion modDesc.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" standalone="no" ?>
<modDesc descVersion="40">
<version>6.01.00182</version>
<version>6.01.00183</version>
<author><![CDATA[Courseplay.devTeam]]></author>
<title>
<br>CoursePlay SIX</br>
Expand Down
12 changes: 4 additions & 8 deletions start_stop.lua
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,9 @@ function courseplay:start(self)
end

if workTool.spec_sprayer ~= nil and self.cp.hasFertilizerSowingMachine then
if workTool.cp.orignalAllowsSpraying == nil then
workTool.cp.orignalAllowsSpraying = workTool.spec_sprayer.allowsSpraying
end
workTool.spec_sprayer.allowsSpraying = self.cp.fertilizerEnabled
workTool.fertilizerEnabled = self.cp.fertilizerEnabled
end

if workTool.cp.isSugarCaneAugerWagon then
isReversePossible = false
end
Expand Down Expand Up @@ -679,12 +677,10 @@ function courseplay:stop(self)
end
tool.cp.originalCapacities = nil
end
if tool.cp.orignalAllowsSpraying ~= nil then
tool.spec_sprayer.allowsSpraying = tool.cp.orignalAllowsSpraying
tool.cp.orignalAllowsSpraying = nil
if tool.fertilizerEnabled ~= nil then
tool.fertilizerEnabled = nil
end
end

if self.cp.directionNodeToTurnNodeLength ~= nil then
self.cp.directionNodeToTurnNodeLength = nil
end
Expand Down

0 comments on commit 6a0d7f8

Please sign in to comment.