Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Combine cp ad hud mouse control #1957

Open
wants to merge 48 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
e92432e
deactivate CP action
Dueesberch Apr 15, 2021
b00d320
bugfix 1886
Dueesberch Apr 15, 2021
259e54a
bugfix 1886, mouse working
Dueesberch Apr 20, 2021
b3e2d33
rework tooltip text
Dueesberch Apr 20, 2021
c6605a6
Fixed debug marker issue caused by telemetryExport
Stephan-S May 9, 2021
8f9d8db
Added subPrio recording.
Stephan-S May 9, 2021
7f70da8
Worked on harvest unloader efficiency. WIP
Stephan-S May 9, 2021
b097bea
Testing improved reaction to combines 90° turn.
Stephan-S May 10, 2021
d872d6f
Added initial version of 'Tip of the day' feature.
Stephan-S May 10, 2021
25bbe18
Version bump to RC1
Stephan-S May 10, 2021
edf478f
Reduced grid cell size check when cell is on the field.
Stephan-S May 11, 2021
1b91664
Removed possible cause for undrivable pathfinder coursed.
Stephan-S May 11, 2021
7ccfe5f
Improved tip of the day
Stephan-S May 11, 2021
67fe88e
Reduced minTurnRadius to a previous value..
Stephan-S May 11, 2021
910abd7
Increased cornering speed for tight corners on the field.
Stephan-S May 11, 2021
288b86b
If a vehicle is already at the target (< 8m) it will only reveive tha…
Stephan-S May 11, 2021
65ee68a
Fixed my bug in the HUD. Set Park destination was accidentally set as…
Stephan-S May 12, 2021
afadea0
Version bump
Stephan-S May 12, 2021
31f15e0
Reverse Driving now always uses the proper reverse driving code to ke…
Stephan-S May 12, 2021
8da8246
Decreased stepsPerFrame for path refinement to remove stuttering.
Stephan-S May 12, 2021
6f41a0e
Removed very verbose debug messages.
Stephan-S May 12, 2021
0d0bf81
Removed bug which caused driver to wait a few seconds after emptying …
Stephan-S May 12, 2021
7863112
Added brake hysteresis.
Stephan-S May 12, 2021
4f02ff1
Added Forward turning manoeuvre.
Stephan-S May 13, 2021
4d7e015
Bugfix. Allow at least one stepPerFrame.
Stephan-S May 13, 2021
f697123
Potential fix for dedi servers due to Tip of the day feature.
Stephan-S May 15, 2021
1169558
Tip of the day - Dedi fix
Stephan-S May 15, 2021
d75a7ab
Added fourth button functionality. LShift + Left mouse / right mouse …
Stephan-S May 15, 2021
e21da5f
Adjusted recording and connecting of waypoints.
Stephan-S May 16, 2021
91aaaed
Fix
Stephan-S May 16, 2021
b2a3bb9
Reverted strange refactoring bug in group creation.
Stephan-S May 18, 2021
25b4980
Reenabled new pathcaluclation after one year. To be tested!
Stephan-S May 21, 2021
36508e9
Adjusted dynamic front collision box to be just in front of vehicle o…
Stephan-S May 21, 2021
553e782
Readded required frontAxle check again
Stephan-S May 21, 2021
86079f0
Adjusted sugarcane check to not fire for attached harvesters.
Stephan-S May 22, 2021
07566c4
Bugfix which prevented blue line traffic detection.
Stephan-S May 22, 2021
aebf940
Added line break
Stephan-S May 22, 2021
c01d215
Reenabled start all active helpers button again..
Stephan-S May 22, 2021
1357744
Prevent vehicle from starting in wrong direction on blue lines.
Stephan-S May 24, 2021
8524242
Added bunker unload mode again.
Stephan-S May 24, 2021
85b6b50
Fixed silo length calculation.
Stephan-S May 24, 2021
a55b377
Adjusted bga target distances to vehicle length
Stephan-S May 24, 2021
1344312
Do not draw the subPrio Marker node.
Stephan-S May 30, 2021
53e6554
Adjusted weight for preferred start correction.
Stephan-S May 30, 2021
8f231e7
Dont force show tip of the day for now. Increased RC number.
Stephan-S May 30, 2021
78bd800
Merge branch 'master' of https://github.com/Stephan-S/FS19_AutoDrive …
Dueesberch Jun 6, 2021
f636fec
merge beta-testing
Dueesberch Jun 6, 2021
8ae86cc
rollback combine CP AD Hud control
Dueesberch Jun 11, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions FS19_AutoDrive/gui/debugSettingsPage.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,14 @@
<GuiElement type="text" profile="autoDriveDebugSettingsCheckboxToggleText" text="$l10n_gui_ad_debugChannelRoadNetwork" />
</GuiElement>
</GuiElement>
<GuiElement type="bitmap" profile="autoDriveDebugSettingsCheckbox" onCreate="onCreateCheckbox" onCreateArgs="1024">
<GuiElement type="toggleButton" profile="autoDriveDebugSettingsCheckboxToggle" onClick="onClickToggle">
<GuiElement type="button" profile="autoDriveDebugSettingsCheckboxToggleTick" />
<GuiElement type="button" profile="autoDriveDebugSettingsCheckboxToggleUntick" />
<GuiElement type="bitmap" profile="autoDriveDebugSettingsCheckboxToggleIcon" imageUVs="256px 128px 128px 128px" />
<GuiElement type="text" profile="autoDriveDebugSettingsCheckboxToggleText" text="$l10n_gui_ad_debugChannelBGA" />
</GuiElement>
</GuiElement>
<GuiElement type="bitmap" profile="autoDriveDebugSettingsCheckbox" onCreate="onCreateCheckbox" onCreateArgs="65535">
<GuiElement type="toggleButton" profile="autoDriveDebugSettingsCheckboxToggle" onClick="onClickToggle">
<GuiElement type="button" profile="autoDriveDebugSettingsCheckboxToggleTick" />
Expand Down
62 changes: 62 additions & 0 deletions FS19_AutoDrive/gui/guiProfiles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -276,4 +276,66 @@
<Value name="textOffset" value="46px 2px" />
<Value name="textFocusedOffset" value="46px 2px" />
</Profile>

<Profile name="autoDriveTipOfTheDayNavigationBox" extends="emptyPanel" with="lightFrame">
<Value name="size" value="720px 662px" />
<Value name="position" value="0px -45px" />
<Value name="screenAlign" value="topCenter" />
<Value name="positionOrigin" value="topCenter" />
</Profile>

<Profile name="autoDriveTipOfTheDayText" extends="textDefault">
<Value name="size" value="562px 600px" />
<Value name="textMaxWidth" value="456px" />
<Value name="textVerticalAlignment" value="top" />
<Value name="textSize" value="16px" />
<Value name="textBold" value="true" />
<Value name="textOffset" value="46px 2px" />
<Value name="textFocusedOffset" value="46px 2px" />
<Value name="textFocusedOffset" value="46px 2px" />
<Value name="textWrapWidth" value="456px" />
<Value name="positionOrigin" value="topLeft" />
<Value name="screenAlign" value="topLeft" />
<Value name="position" value="130px -10px" />
</Profile>

<Profile name="autoDriveNotificationHistoryItemIcon" extends="baseReference">
<Value name="size" value="128px 128px" />
<Value name="position" value="10px -10px" />
<Value name="imageFilename" value="g_autoDriveTipOfTheDayUIFilename" />
<Value name="imageUVs" value="0px 0px 128px 128px" />
<Value name="frameThickness" value="0 0 0 0" />
<Value name="positionOrigin" value="topLeft" />
<Value name="screenAlign" value="topLeft" />
</Profile>

<Profile name="autoDriveTipOfTheDayTitleText" extends="textDefault">
<Value name="size" value="720px 50px" />
<Value name="textMaxWidth" value="720px" />
<Value name="textVerticalAlignment" value="top" />
<Value name="textSize" value="20px" />
<Value name="textBold" value="true" />
<Value name="position" value="15px 25px" />
<Value name="screenAlign" value="topLeft" />
<Value name="positionOrigin" value="topLeft" />
</Profile>

<Profile name="autoDriveTipOfTheDayCheckbox" extends="baseReference" with="lightFrame">
<Value name="size" value="450px 48px" />
<Value name="frameThickness" value="1dp 1dp 1dp 1dp" />
<Value name="imageColor" value="$preset_colorGlassMedium" />
<Value name="imageDisabledColor" value="$preset_colorGlass" />
<Value name="margin" value="24px 12px 48px 32px" />
<Value name="screenAlign" value="bottomLeft" />
<Value name="positionOrigin" value="bottomLeft" />
<Value name="position" value="45px 15px" />
</Profile>

<Profile name="autoDriveTipOfTheDayCheckboxToggle" extends="ingameMenuMPActionsListPermissionCheckbox" with="anchorMiddleLeft">
<Value name="frameThickness" value="0 0 1dp 0" />
</Profile>

<Profile name="autoDriveTipOfTheDayCheckboxToggleText" extends="textDefault" with="anchorMiddleLeft">
<Value name="position" value="60px 0px" />
</Profile>
</GUIProfiles>
29 changes: 29 additions & 0 deletions FS19_AutoDrive/gui/tipOfTheDayGUI.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8" standalone="no" ?>
<GUI onOpen="onOpen" onClose="onClose" onCreate="onCreate">
<GuiElement type="empty" profile="newLayer" />

<GuiElement type="bitmap" profile="yesNoDialogBg" position="0px -150px" size="810px 780px" screenAlign="topCenter" positionOrigin="topCenter">
<GuiElement type="bitmap" profile="dialogHeaderDocked">
<GuiElement type="text" profile="dialogHeaderText" text="$l10n_gui_ad_tipOfTheDayTitle" />
</GuiElement>

<GuiElement type="empty" profile="autoDriveTipOfTheDayNavigationBox" id="tipOfTheDayTemplate">
<GuiElement type="text" profile="autoDriveTipOfTheDayTitleText" text="$l10n_ad_helpTitle_01"/>
<GuiElement type="bitmap" profile="autoDriveNotificationHistoryItemIcon" name="listItemIcon" />
<GuiElement type="text" profile="autoDriveTipOfTheDayText" text="$l10n_ad_helpText_08_01" name="listItemText" />
</GuiElement>

<GuiElement type="bitmap" profile="autoDriveTipOfTheDayCheckbox" onCreate="onCreateCheckbox" onCreateArgs="2">
<GuiElement type="toggleButton" profile="autoDriveTipOfTheDayCheckboxToggle" onClick="onClickToggle">
<GuiElement type="button" profile="autoDriveDebugSettingsCheckboxToggleTick" />
<GuiElement type="button" profile="autoDriveDebugSettingsCheckboxToggleUntick" />
<GuiElement type="text" profile="autoDriveTipOfTheDayCheckboxToggleText" text="$l10n_gui_ad_tipOfTheDayActive" />
</GuiElement>
</GuiElement>

<GuiElement type="flowLayout" profile="buttonBoxDocked">
<GuiElement type="button" profile="buttonBack" text="$l10n_button_back" onClick="onClickBack" />
<GuiElement type="button" profile="buttonActivate" text="$l10n_ad_next_tip" onClick="onClickActivate" />
</GuiElement>
</GuiElement>
</GUI>
16 changes: 8 additions & 8 deletions FS19_AutoDrive/gui/userSettingsPage.xml
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,14 @@
<GuiElement type="bitmap" profile="multiTextOptionSettingsBg" />
<GuiElement type="bitmap" profile="baseReference" screenAlign="topLeft" position="5px 4px" size="17px 17px" />
</GuiElement>
<!-- <GuiElement type="multiTextOption" profile="multiTextOptionSettings" onCreate="onCreateAutoDriveSetting" onClick="onOptionChange" name="combineCPADHudMouse" toolTipElementId="ingameMenuHelpBoxText"> -->
<!-- <GuiElement type="button" profile="multiTextOptionSettingsLeft" /> -->
<!-- <GuiElement type="button" profile="multiTextOptionSettingsRight" /> -->
<!-- <GuiElement type="text" profile="multiTextOptionSettingsText" /> -->
<!-- <GuiElement type="text" profile="multiTextOptionSettingsTitle" position="27px 6px" /> -->
<!-- <GuiElement type="bitmap" profile="multiTextOptionSettingsBg" /> -->
<!-- <GuiElement type="bitmap" profile="baseReference" screenAlign="topLeft" position="5px 4px" size="17px 17px" /> -->
<!-- </GuiElement> -->
<GuiElement type="multiTextOption" profile="multiTextOptionSettings" onCreate="onCreateAutoDriveSetting" onClick="onOptionChange" name="showTipOfTheDay" toolTipElementId="ingameMenuHelpBoxText">
<GuiElement type="button" profile="multiTextOptionSettingsLeft" />
<GuiElement type="button" profile="multiTextOptionSettingsRight" />
<GuiElement type="text" profile="multiTextOptionSettingsText" />
<GuiElement type="text" profile="multiTextOptionSettingsTitle" position="27px 6px" />
<GuiElement type="bitmap" profile="multiTextOptionSettingsBg" />
<GuiElement type="bitmap" profile="baseReference" screenAlign="topLeft" position="5px 4px" size="17px 17px" />
</GuiElement>
</GuiElement>
</GuiElement>

Expand Down
40 changes: 24 additions & 16 deletions FS19_AutoDrive/gui/vehicleSettingsPage.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,22 +90,22 @@
<GuiElement type="bitmap" profile="multiTextOptionSettingsBg" />
<GuiElement type="bitmap" profile="baseReference" screenAlign="topLeft" position="5px 4px" size="17px 17px" />
</GuiElement>
<!-- <GuiElement type="multiTextOption" profile="multiTextOptionSettings" onCreate="onCreateAutoDriveSetting" onClick="onOptionChange" name="shovelWidth" toolTipElementId="ingameMenuHelpBoxText"> -->
<!-- <GuiElement type="button" profile="multiTextOptionSettingsLeft" /> -->
<!-- <GuiElement type="button" profile="multiTextOptionSettingsRight" /> -->
<!-- <GuiElement type="text" profile="multiTextOptionSettingsText" /> -->
<!-- <GuiElement type="text" profile="multiTextOptionSettingsTitle" position="27px 6px" /> -->
<!-- <GuiElement type="bitmap" profile="multiTextOptionSettingsBg" /> -->
<!-- <GuiElement type="bitmap" profile="baseReference" screenAlign="topLeft" position="5px 4px" size="17px 17px" /> -->
<!-- </GuiElement> -->
<!-- <GuiElement type="multiTextOption" profile="multiTextOptionSettings" onCreate="onCreateAutoDriveSetting" onClick="onOptionChange" name="shovelHeight" toolTipElementId="ingameMenuHelpBoxText"> -->
<!-- <GuiElement type="button" profile="multiTextOptionSettingsLeft" /> -->
<!-- <GuiElement type="button" profile="multiTextOptionSettingsRight" /> -->
<!-- <GuiElement type="text" profile="multiTextOptionSettingsText" /> -->
<!-- <GuiElement type="text" profile="multiTextOptionSettingsTitle" position="27px 6px" /> -->
<!-- <GuiElement type="bitmap" profile="multiTextOptionSettingsBg" /> -->
<!-- <GuiElement type="bitmap" profile="baseReference" screenAlign="topLeft" position="5px 4px" size="17px 17px" /> -->
<!-- </GuiElement> -->
<GuiElement type="multiTextOption" profile="multiTextOptionSettings" onCreate="onCreateAutoDriveSetting" onClick="onOptionChange" name="shovelWidth" toolTipElementId="ingameMenuHelpBoxText">
<GuiElement type="button" profile="multiTextOptionSettingsLeft" />
<GuiElement type="button" profile="multiTextOptionSettingsRight" />
<GuiElement type="text" profile="multiTextOptionSettingsText" />
<GuiElement type="text" profile="multiTextOptionSettingsTitle" position="27px 6px" />
<GuiElement type="bitmap" profile="multiTextOptionSettingsBg" />
<GuiElement type="bitmap" profile="baseReference" screenAlign="topLeft" position="5px 4px" size="17px 17px" />
</GuiElement>
<GuiElement type="multiTextOption" profile="multiTextOptionSettings" onCreate="onCreateAutoDriveSetting" onClick="onOptionChange" name="shovelHeight" toolTipElementId="ingameMenuHelpBoxText">
<GuiElement type="button" profile="multiTextOptionSettingsLeft" />
<GuiElement type="button" profile="multiTextOptionSettingsRight" />
<GuiElement type="text" profile="multiTextOptionSettingsText" />
<GuiElement type="text" profile="multiTextOptionSettingsTitle" position="27px 6px" />
<GuiElement type="bitmap" profile="multiTextOptionSettingsBg" />
<GuiElement type="bitmap" profile="baseReference" screenAlign="topLeft" position="5px 4px" size="17px 17px" />
</GuiElement>
<GuiElement type="multiTextOption" profile="multiTextOptionSettings" onCreate="onCreateAutoDriveSetting" onClick="onOptionChange" name="autoRefuel" toolTipElementId="ingameMenuHelpBoxText">
<GuiElement type="button" profile="multiTextOptionSettingsLeft" />
<GuiElement type="button" profile="multiTextOptionSettingsRight" />
Expand Down Expand Up @@ -146,6 +146,14 @@
<GuiElement type="bitmap" profile="multiTextOptionSettingsBg" />
<GuiElement type="bitmap" profile="baseReference" screenAlign="topLeft" position="5px 4px" size="17px 17px" />
</GuiElement>
<GuiElement type="multiTextOption" profile="multiTextOptionSettings" onCreate="onCreateAutoDriveSetting" onClick="onOptionChange" name="useForwardTurningManoeuvre" toolTipElementId="ingameMenuHelpBoxText">
<GuiElement type="button" profile="multiTextOptionSettingsLeft" />
<GuiElement type="button" profile="multiTextOptionSettingsRight" />
<GuiElement type="text" profile="multiTextOptionSettingsText" />
<GuiElement type="text" profile="multiTextOptionSettingsTitle" position="27px 6px" />
<GuiElement type="bitmap" profile="multiTextOptionSettingsBg" />
<GuiElement type="bitmap" profile="baseReference" screenAlign="topLeft" position="5px 4px" size="17px 17px" />
</GuiElement>
</GuiElement>
</GuiElement>

Expand Down
3 changes: 2 additions & 1 deletion FS19_AutoDrive/modDesc.xml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ Traduit avec www.DeepL.com/Translator (version gratuite)
<![CDATA[Этот мод может быть использован для создания сети маршрутов для транспортных средств для автономного вождения. После настройки вы можете указать трактору, стоящему где-угодно рядом с сетью, проехать в любую точку, например, в магазин, поле №1 или в точку продажи.]]>
</ru>
</description>
<version>1.1.1.0</version>
<version>1.1.1.1</version>
<multiplayer supported="true" />
<iconFilename>icon.dds</iconFilename>
<extraSourceFiles>
Expand Down Expand Up @@ -170,6 +170,7 @@ Traduit avec www.DeepL.com/Translator (version gratuite)
<action name="AD_continue" category="VEHICLE" ignoreComboMask="false" />
<action name="ADParkVehicle" category="VEHICLE" ignoreComboMask="false" />
<action name="AD_devAction" category="VEHICLE" ignoreComboMask="false" />
<action name="AD_open_tipOfTheDay" category="VEHICLE" ignoreComboMask="false" />
</actions>

<inputBinding>
Expand Down
2 changes: 2 additions & 0 deletions FS19_AutoDrive/register.lua
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ source(Utils.getFilename("scripts/Gui/SettingsPage.lua", g_currentModDirectory))
source(Utils.getFilename("scripts/Gui/DebugSettingsPage.lua", g_currentModDirectory))
source(Utils.getFilename("scripts/Gui/ExperimentalFeaturesSettingsPage.lua", g_currentModDirectory))
source(Utils.getFilename("scripts/Gui/Settings.lua", g_currentModDirectory))
source(Utils.getFilename("scripts/Gui/TipOfTheDayGUI.lua", g_currentModDirectory))
source(Utils.getFilename("scripts/TipOfTheDayHandler.lua", g_currentModDirectory))

AutoDriveRegister = {}
AutoDriveRegister.version = g_modManager:getModByName(g_currentModName).version
Expand Down
11 changes: 8 additions & 3 deletions FS19_AutoDrive/scripts/AutoDrive.lua
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
AutoDrive = {}
AutoDrive.version = "1.1.1.0"
AutoDrive.version = "1.1.1.1-RC3"

AutoDrive.directory = g_currentModDirectory

g_autoDriveUIFilename = AutoDrive.directory .. "textures/GUI_Icons.dds"
g_autoDriveDebugUIFilename = AutoDrive.directory .. "textures/gui_debug_Icons.dds"
g_autoDriveTipOfTheDayUIFilename = AutoDrive.directory .. "textures/tipOfTheDay_icons.dds"

AutoDrive.experimentalFeatures = {}
AutoDrive.experimentalFeatures.redLinePosition = false
Expand Down Expand Up @@ -45,6 +46,7 @@ AutoDrive.DC_NETWORKINFO = 64
AutoDrive.DC_EXTERNALINTERFACEINFO = 128
AutoDrive.DC_RENDERINFO = 256
AutoDrive.DC_ROADNETWORKINFO = 512
AutoDrive.DC_BGA_MODE = 1024
AutoDrive.DC_ALL = 65535

AutoDrive.currentDebugChannelMask = AutoDrive.DC_NONE
Expand Down Expand Up @@ -94,8 +96,8 @@ AutoDrive.actions = {
{"AD_open_notification_history", false, 0},
{"AD_continue", false, 3},
{"ADParkVehicle", false, 0},
{"AD_devAction", false, 0}
-- {"COURSEPLAY_MOUSEACTION_SECONDARY", true, 1}
{"AD_devAction", false, 0},
{"AD_open_tipOfTheDay", false, 0}
}

function AutoDrive:onAllModsLoaded()
Expand Down Expand Up @@ -184,6 +186,7 @@ g_logManager:info("[AD] Start register later loaded mods end")
ADMultipleTargetsManager:load()

AutoDrive.initTelemetry()
AutoDrive.initTipOfTheDay()
end

function AutoDrive:init()
Expand Down Expand Up @@ -247,6 +250,7 @@ function AutoDrive:keyEvent(unicode, sym, modifier, isDown)
AutoDrive.leftLSHIFTmodifierKeyPressed = bitAND(modifier, Input.MOD_LSHIFT) > 0
AutoDrive.isCAPSKeyActive = bitAND(modifier, Input.MOD_CAPS) > 0
AutoDrive.rightCTRLmodifierKeyPressed = bitAND(modifier, Input.MOD_RCTRL) > 0
AutoDrive.rightSHIFTmodifierKeyPressed = bitAND(modifier, Input.MOD_RSHIFT) > 0

if AutoDrive.isInExtendedEditorMode() then
if (AutoDrive.rightCTRLmodifierKeyPressed and AutoDrive.toggleSphrere == true) then
Expand Down Expand Up @@ -317,6 +321,7 @@ function AutoDrive:update(dt)
ADRoutesManager:update(dt)

AutoDrive.handleTelemetry(dt)
AutoDrive.handleTipOfTheDay(dt)
end

function AutoDrive:draw()
Expand Down
11 changes: 7 additions & 4 deletions FS19_AutoDrive/scripts/Events/Graph/RecordWayPointEvent.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function AutoDriveRecordWayPointEvent:emptyNew()
return o
end

function AutoDriveRecordWayPointEvent:new(x, y, z, connectPrevious, dual, isReverse, previousId)
function AutoDriveRecordWayPointEvent:new(x, y, z, connectPrevious, dual, isReverse, isSubPrio, previousId)
local o = AutoDriveRecordWayPointEvent:emptyNew()
o.x = x
o.y = y
Expand All @@ -18,6 +18,7 @@ function AutoDriveRecordWayPointEvent:new(x, y, z, connectPrevious, dual, isReve
o.dual = dual or false
o.isReverse = isReverse
o.previousId = previousId
o.isSubPrio = isSubPrio
return o
end

Expand All @@ -29,6 +30,7 @@ function AutoDriveRecordWayPointEvent:writeStream(streamId, connection)
streamWriteBool(streamId, self.dual)
streamWriteBool(streamId, self.isReverse)
streamWriteFloat32(streamId, self.previousId)
streamWriteBool(streamId, self.isSubPrio)
end

function AutoDriveRecordWayPointEvent:readStream(streamId, connection)
Expand All @@ -39,19 +41,20 @@ function AutoDriveRecordWayPointEvent:readStream(streamId, connection)
self.dual = streamReadBool(streamId)
self.isReverse = streamReadBool(streamId)
self.previousId = streamReadFloat32(streamId)
self.isSubPrio = streamReadBool(streamId)
self:run(connection)
end

function AutoDriveRecordWayPointEvent:run(connection)
if connection:getIsServer() then
-- If the event is coming from the server, clients have to record the way point
ADGraphManager:recordWayPoint(self.x, self.y, self.z, self.connectPrevious, self.dual, self.isReverse, self.previousId, false)
ADGraphManager:recordWayPoint(self.x, self.y, self.z, self.connectPrevious, self.dual, self.isReverse, self.previousId, self.isSubPrio, false)
end
end

function AutoDriveRecordWayPointEvent.sendEvent(x, y, z, connectPrevious, dual, isReverse, previousId)
function AutoDriveRecordWayPointEvent.sendEvent(x, y, z, connectPrevious, dual, isReverse, previousId, isSubPrio)
if g_server ~= nil then
-- Server have to broadcast to all clients
g_server:broadcastEvent(AutoDriveRecordWayPointEvent:new(x, y, z, connectPrevious, dual, isReverse, previousId))
g_server:broadcastEvent(AutoDriveRecordWayPointEvent:new(x, y, z, connectPrevious, dual, isReverse, previousId, isSubPrio))
end
end
1 change: 1 addition & 0 deletions FS19_AutoDrive/scripts/ExternalInterface.lua
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ function AutoDrive:notifyDestinationListeners()
for object, callBackFunction in pairs(AutoDrive.destinationListeners) do
callBackFunction(object, true)
end
AutoDrive.triggerStaticOutput()
end

function AutoDrive:combineIsCallingDriver(combine) --only for CoursePlay
Expand Down
Loading