Script v1.7.1.0
- AI
- Animals
- Contracts
- Debug
- Economy
- Effects
- Events
- Farms
- GUI
- Handtools
- I3d
- Materials
- Misc
- Objects
- Placeables
- Player
- Shop
- Sounds
- Specializations
- AIConveyorBelt
- AIImplement
- AIVehicle
- AnimatedVehicle
- ArticulatedAxis
- Attachable
- AttacherJointControl
- AttacherJoints
- BaleGrab
- BaleLoader
- Baler
- BaleWrapper
- BaseMaterial
- BunkerSiloCompacter
- BunkerSiloInteractor
- BuyableBale
- CCTDrivable
- Combine
- ConnectionHoses
- ConveyorBelt
- Cover
- CrabSteering
- Crawlers
- Cultivator
- Cutter
- Cylindered
- CylinderedFoldable
- Dashboard
- Dischargeable
- Drivable
- DynamicallyLoadedParts
- DynamicMountAttacher
- Enterable
- FertilizingCultivator
- FertilizingSowingMachine
- FillTriggerVehicle
- FillUnit
- FillVolume
- Foldable
- FoliageBending
- ForageWagon
- FrontloaderAttacher
- FruitPreparer
- GroundAdjustedNodes
- GroundReference
- Honk
- HookLiftContainer
- HookLiftTrailer
- IKChains
- JigglingParts
- Leveler
- Lights
- LivestockTrailer
- Locomotive
- LogGrab
- ManureBarrel
- MixerWagon
- Motorized
- Mountable
- Mower
- Pickup
- Pipe
- Plow
- PowerConsumer
- PowerTakeOffs
- RandomlyMovingParts
- ReceivingHopper
- ReverseDriving
- Rideable
- RidgeMarker
- Roller
- Ropes
- SemiTrailerFront
- Shovel
- SlopeCompensation
- SmartAttach
- SowingMachine
- SpeedRotatingParts
- SplineVehicle
- Sprayer
- StrawBlower
- StumpCutter
- Suspensions
- Tedder
- TensionBeltObject
- TensionBelts
- TipOccluder
- Trailer
- TreePlanter
- TreeSaw
- TurnOnVehicle
- Washable
- WaterTrailer
- Wearable
- Weeder
- Wheels
- Windrower
- Wipers
- WoodCrusher
- WoodHarvester
- WorkArea
- WorkMode
- WorkParticles
- Triggers
- Utils
- Vehicles
- Weather
Engine v1.7.1.0
- AI
- Animation
- Camera
- Entity
- Fillplanes
- General
- I3D
- Input
- Lighting
- Math
- Network
- Node
- Overlays
- Particle System
- Physics
- Rendering
- Scenegraph
- Shape
- Sound
- Spline
- String
- Terrain Detail
- Text Rendering
- Tire Track
- XML
- general
Foundation Reference
AttacherJointControl
DescriptionSpecialization to steplessly control the height of an attacherJointFunctions
- actionEventAttacherJointControl
- actionEventAttacherJointControlSetPoint
- controlAttacherJoint
- controlAttacherJointHeight
- controlAttacherJointTilt
- getCanBeSelected
- getControlAttacherJointDirection
- getLoweringActionEventState
- loadInputAttacherJoint
- onDelete
- onLoad
- onPostAttach
- onPreDetach
- onReadStream
- onReadUpdateStream
- onRegisterActionEvents
- onUpdate
- onWriteStream
- onWriteUpdateStream
- prerequisitesPresent
- registerEventListeners
- registerFunctions
- registerLoweringActionEvent
- registerOverwrittenFunctions
actionEventAttacherJointControl
DescriptionDefinitionactionEventAttacherJointControl()Code
446 | function AttacherJointControl.actionEventAttacherJointControl(self, actionName, inputValue, callbackState, isAnalog) |
447 | if math.abs(inputValue) > 0 then |
448 | local spec = self.spec_attacherJointControl |
449 | local control = spec.nameToControl[actionName] |
450 | |
451 | -- multiply by 0.025 to have to same speed as in fs17 |
452 | local changedAlpha = inputValue * control.mouseSpeedFactor * 0.025 |
453 | if control.invertAxis then |
454 | changedAlpha = -changedAlpha |
455 | end |
456 | |
457 | self:controlAttacherJoint(control, control.moveAlpha + changedAlpha) |
458 | end |
459 | end |
actionEventAttacherJointControlSetPoint
DescriptionDefinitionactionEventAttacherJointControlSetPoint()Code
463 | function AttacherJointControl.actionEventAttacherJointControlSetPoint(self, actionName, inputValue, callbackState, isAnalog) |
464 | local spec = self.spec_attacherJointControl |
465 | if spec.jointDesc ~= nil then |
466 | if self:getControlAttacherJointDirection() then |
467 | spec.heightTargetAlpha = spec.jointDesc.lowerAlpha |
468 | else |
469 | spec.heightTargetAlpha = spec.jointDesc.upperAlpha |
470 | end |
471 | end |
472 | end |
controlAttacherJoint
DescriptionUpdates attacher joint move alpha and update joint frameDefinition
controlAttacherJoint(table control, float moveAlpha)Arguments
table | control | control |
float | moveAlpha | move alpha |
245 | function AttacherJointControl:controlAttacherJoint(control, moveAlpha) |
246 | local spec = self.spec_attacherJointControl |
247 | local jointDesc = spec.jointDesc |
248 | |
249 | if jointDesc ~= nil then |
250 | moveAlpha = control.func(self, moveAlpha) |
251 | |
252 | local attacherVehicle = self:getAttacherVehicle() |
253 | attacherVehicle:updateAttacherJointRotation(jointDesc, self) |
254 | if self.isServer and jointDesc.jointIndex ~= 0 then |
255 | setJointFrame(jointDesc.jointIndex, 0, jointDesc.jointTransform) |
256 | end |
257 | end |
258 | |
259 | spec.lastMoveTime = g_time |
260 | |
261 | control.moveAlpha = moveAlpha |
262 | self:raiseDirtyFlags(spec.dirtyFlag) |
263 | end |
controlAttacherJointHeight
DescriptionUpdates attacher joint height by given mve alpha valueDefinition
controlAttacherJointHeight(float moveAlpha)Arguments
float | moveAlpha | move alpha |
float | moveAlpha | limited move alpha |
269 | function AttacherJointControl:controlAttacherJointHeight(moveAlpha) |
270 | local spec = self.spec_attacherJointControl |
271 | local jointDesc = spec.jointDesc |
272 | |
273 | if moveAlpha == nil then |
274 | moveAlpha = jointDesc.moveAlpha |
275 | end |
276 | |
277 | moveAlpha = MathUtil.clamp(moveAlpha, jointDesc.upperAlpha, jointDesc.lowerAlpha) |
278 | if jointDesc.rotationNode ~= nil then |
279 | setRotation(jointDesc.rotationNode, MathUtil.vector3ArrayLerp(jointDesc.upperRotation, jointDesc.lowerRotation, moveAlpha)) |
280 | end |
281 | if jointDesc.rotationNode2 ~= nil then |
282 | setRotation(jointDesc.rotationNode2, MathUtil.vector3ArrayLerp(jointDesc.upperRotation2, jointDesc.lowerRotation2, moveAlpha)) |
283 | end |
284 | |
285 | spec.lastHeightAlpha = moveAlpha |
286 | |
287 | return moveAlpha |
288 | end |
controlAttacherJointTilt
DescriptionUpdates attacher joint tilt by given mve alpha valueDefinition
controlAttacherJointTilt(float moveAlpha)Arguments
float | moveAlpha | move alpha |
float | moveAlpha | limited move alpha |
294 | function AttacherJointControl:controlAttacherJointTilt(moveAlpha) |
295 | local spec = self.spec_attacherJointControl |
296 | |
297 | if moveAlpha == nil then |
298 | moveAlpha = 0.5 |
299 | end |
300 | |
301 | moveAlpha = MathUtil.clamp(moveAlpha, 0, 1) |
302 | local angle = spec.maxTiltAngle * -(moveAlpha - 0.5) |
303 | |
304 | spec.jointDesc.upperRotationOffset = spec.jointDesc.upperRotationOffsetBackup + angle |
305 | spec.jointDesc.lowerRotationOffset = spec.jointDesc.lowerRotationOffsetBackup + angle |
306 | |
307 | return moveAlpha |
308 | end |
getCanBeSelected
DescriptionDefinitiongetCanBeSelected()Code
376 | function AttacherJointControl:getCanBeSelected(superFunc) |
377 | return true |
378 | end |
getControlAttacherJointDirection
DescriptionReturns direction boolean for lifting and lowering the implement by button pressDefinition
getControlAttacherJointDirection()Return Values
boolean | direction | direction |
313 | function AttacherJointControl:getControlAttacherJointDirection() |
314 | local spec = self.spec_attacherJointControl |
315 | if spec.heightTargetAlpha ~= -1 then |
316 | return spec.heightTargetAlpha == spec.jointDesc.upperAlpha |
317 | end |
318 | |
319 | local lastAlpha = spec.heightController.moveAlpha |
320 | return math.abs(lastAlpha - spec.jointDesc.lowerAlpha) > math.abs(lastAlpha - spec.jointDesc.upperAlpha) |
321 | end |
getLoweringActionEventState
DescriptionDefinitiongetLoweringActionEventState()Code
354 | function AttacherJointControl:getLoweringActionEventState(superFunc) |
355 | local spec = self.spec_attacherJointControl |
356 | if spec.heightController then |
357 | local showText = spec.jointDesc ~= nil |
358 | |
359 | local text |
360 | if showText then |
361 | if self:getControlAttacherJointDirection() then |
362 | text = string.format(g_i18n:getText("action_lowerOBJECT"), self.typeDesc) |
363 | else |
364 | text = string.format(g_i18n:getText("action_liftOBJECT"), self.typeDesc) |
365 | end |
366 | end |
367 | |
368 | return showText, text |
369 | end |
370 | |
371 | return superFunc(self) |
372 | end |
loadInputAttacherJoint
DescriptionCalled on loadingDefinition
loadInputAttacherJoint(table savegame)Arguments
table | savegame | savegame |
326 | function AttacherJointControl:loadInputAttacherJoint(superFunc, xmlFile, key, inputAttacherJoint, i) |
327 | if not superFunc(self, xmlFile, key, inputAttacherJoint, i) then |
328 | return false |
329 | end |
330 | |
331 | inputAttacherJoint.isControllable = Utils.getNoNil(getXMLBool(xmlFile, key .. "#isControllable"), false) |
332 | |
333 | return true |
334 | end |
onDelete
DescriptionDefinitiononDelete()Code
131 | function AttacherJointControl:onDelete() |
132 | if self.isClient then |
133 | local spec = self.spec_attacherJointControl |
134 | g_soundManager:deleteSample(spec.samples.hydraulic) |
135 | end |
136 | end |
onLoad
DescriptionCalled on loadingDefinition
onLoad(table savegame)Arguments
table | savegame | savegame |
57 | function AttacherJointControl:onLoad(savegame) |
58 | local spec = self.spec_attacherJointControl |
59 | |
60 | XMLUtil.checkDeprecatedXMLElements(self.xmlFile, self.configFileName, "vehicle.attacherJointControl.control1", "vehicle.attacherJointControl.control with #controlFunction 'controlAttacherJointHeight'") -- FS17 |
61 | XMLUtil.checkDeprecatedXMLElements(self.xmlFile, self.configFileName, "vehicle.attacherJointControl.control2", "vehicle.attacherJointControl.control with #controlFunction 'controlAttacherJointTilt'") -- FS17 |
62 | |
63 | local baseKey = "vehicle.attacherJointControl" |
64 | spec.maxTiltAngle = Utils.getNoNilRad(getXMLFloat(self.xmlFile, baseKey .. "#maxTiltAngle"), math.rad(25)) |
65 | spec.heightTargetAlpha = -1 |
66 | |
67 | spec.controls = {} |
68 | spec.nameToControl = {} |
69 | local i = 0 |
70 | while true do |
71 | local key = string.format("%s.control(%d)", baseKey, i) |
72 | if not hasXMLProperty(self.xmlFile, key) then |
73 | break |
74 | end |
75 | |
76 | local control = {} |
77 | |
78 | local controlFunc = getXMLString(self.xmlFile, key .. "#controlFunction") |
79 | if controlFunc ~= nil and self[controlFunc] ~= nil then |
80 | control.func = self[controlFunc] |
81 | |
82 | if control.func == self.controlAttacherJointHeight then |
83 | spec.heightController = control |
84 | end |
85 | else |
86 | g_logManager:xmlWarning(self.configFileName, "Unknown control function '%s' for attacher joint control '%s'", tostring(controlFunc), key) |
87 | break |
88 | end |
89 | |
90 | local actionBindingName = getXMLString(self.xmlFile, key .. "#controlAxis") |
91 | if actionBindingName ~= nil and InputAction[actionBindingName] ~= nil then |
92 | control.controlAction = InputAction[actionBindingName] |
93 | else |
94 | g_logManager:xmlWarning(self.configFileName, "Unknown control axis '%s' for attacher joint control '%s'", tostring(actionBindingName), key) |
95 | break |
96 | end |
97 | |
98 | XMLUtil.checkDeprecatedXMLElements(self.xmlFile, self.configFileName, key.."#controlAxisIcon", key.."#iconName") --FS17 to FS19 |
99 | |
100 | local iconName = getXMLString(self.xmlFile, key .. "#iconName") or "" |
101 | if InputHelpElement.AXIS_ICON[iconName] == nil then |
102 | -- add the mod name as a prefix to match axis icon loading name collision avoidance |
103 | iconName = (self.customEnvironment or "") .. iconName |
104 | end |
105 | |
106 | control.axisActionIcon = iconName |
107 | |
108 | control.invertAxis = Utils.getNoNil( getXMLString(self.xmlFile, key .. "#invertControlAxis"), false ) |
109 | control.mouseSpeedFactor = Utils.getNoNil( getXMLFloat(self.xmlFile, key .. "#mouseSpeedFactor"), 1.0 ) |
110 | control.moveAlpha = 0 |
111 | |
112 | spec.nameToControl[actionBindingName] = control |
113 | table.insert(spec.controls, control) |
114 | |
115 | i = i + 1 |
116 | end |
117 | |
118 | if self.isClient then |
119 | spec.lastMoveTime = 0 |
120 | |
121 | spec.samples = {} |
122 | spec.samples.hydraulic = g_soundManager:loadSampleFromXML(self.xmlFile, baseKey..".sounds", "hydraulic", self.baseDirectory, self.components, 0, AudioGroup.VEHICLE, self.i3dMappings, self) |
123 | end |
124 | |
125 | spec.jointDesc = nil |
126 | spec.dirtyFlag = self:getNextDirtyFlag() |
127 | end |
onPostAttach
DescriptionCalled if vehicle gets attachedDefinition
onPostAttach(table attacherVehicle, integer inputJointDescIndex, integer jointDescIndex)Arguments
table | attacherVehicle | attacher vehicle |
integer | inputJointDescIndex | index of input attacher joint |
integer | jointDescIndex | index of attacher joint it gets attached to |
403 | function AttacherJointControl:onPostAttach(attacherVehicle, inputJointDescIndex, jointDescIndex) |
404 | local spec = self.spec_attacherJointControl |
405 | |
406 | local inputAttacherJoints = self:getInputAttacherJoints() |
407 | if inputAttacherJoints[inputJointDescIndex] ~= nil and inputAttacherJoints[inputJointDescIndex].isControllable then |
408 | local attacherJoints = attacherVehicle:getAttacherJoints() |
409 | local jointDesc = attacherJoints[jointDescIndex] |
410 | jointDesc.allowsLoweringBackup = jointDesc.allowsLowering |
411 | jointDesc.allowsLowering = false |
412 | jointDesc.upperRotationOffsetBackup = jointDesc.upperRotationOffset |
413 | jointDesc.lowerRotationOffsetBackup = jointDesc.lowerRotationOffset |
414 | |
415 | spec.jointDesc = jointDesc |
416 | |
417 | -- reset control values |
418 | for _, control in ipairs(spec.controls) do |
419 | control.moveAlpha = control.func(self) |
420 | end |
421 | |
422 | --lift after attach |
423 | spec.heightTargetAlpha = spec.jointDesc.upperAlpha |
424 | |
425 | self:requestActionEventUpdate() |
426 | end |
427 | end |
onPreDetach
DescriptionCalled if vehicle gets detachedDefinition
onPreDetach(table attacherVehicle, table implement)Arguments
table | attacherVehicle | attacher vehicle |
table | implement | implement |
433 | function AttacherJointControl:onPreDetach(attacherVehicle, implement) |
434 | local spec = self.spec_attacherJointControl |
435 | |
436 | if spec.jointDesc ~= nil then |
437 | spec.jointDesc.allowsLowering = spec.jointDesc.allowsLoweringBackup |
438 | spec.jointDesc.upperRotationOffset = spec.jointDesc.upperRotationOffsetBackup |
439 | spec.jointDesc.lowerRotationOffset = spec.jointDesc.lowerRotationOffsetBackup |
440 | spec.jointDesc = nil |
441 | end |
442 | end |
onReadStream
DescriptionCalled on client side on joinDefinition
onReadStream(integer streamId, integer connection)Arguments
integer | streamId | streamId |
integer | connection | connection |
142 | function AttacherJointControl:onReadStream(streamId, connection) |
143 | if connection:getIsServer() then |
144 | if streamReadBool(streamId) then |
145 | local spec = self.spec_attacherJointControl |
146 | for _, control in ipairs(spec.controls) do |
147 | local moveAlpha = streamReadFloat32(streamId) |
148 | self:controlAttacherJoint(control, moveAlpha) |
149 | end |
150 | end |
151 | end |
152 | end |
onReadUpdateStream
DescriptionCalled on on updateDefinition
onReadUpdateStream(integer streamId, integer timestamp, table connection)Arguments
integer | streamId | stream ID |
integer | timestamp | timestamp |
table | connection | connection |
174 | function AttacherJointControl:onReadUpdateStream(streamId, timestamp, connection) |
175 | if not connection:getIsServer() then |
176 | if streamReadBool(streamId) then |
177 | local spec = self.spec_attacherJointControl |
178 | for _, control in ipairs(spec.controls) do |
179 | local moveAlpha = streamReadFloat32(streamId) |
180 | self:controlAttacherJoint(control, moveAlpha) |
181 | end |
182 | end |
183 | end |
184 | end |
onRegisterActionEvents
DescriptionDefinitiononRegisterActionEvents()Code
382 | function AttacherJointControl:onRegisterActionEvents(isActiveForInput, isActiveForInputIgnoreSelection) |
383 | if self.isClient then |
384 | local spec = self.spec_attacherJointControl |
385 | self:clearActionEventsTable(spec.actionEvents) |
386 | |
387 | if isActiveForInput then |
388 | if spec.jointDesc ~= nil then |
389 | for _, control in ipairs(spec.controls) do |
390 | local _, actionEventId = self:addActionEvent(spec.actionEvents, control.controlAction, self, AttacherJointControl.actionEventAttacherJointControl, false, false, true, true, nil, control.axisActionIcon) |
391 | g_inputBinding:setActionEventTextPriority(actionEventId, GS_PRIO_NORMAL) |
392 | end |
393 | end |
394 | end |
395 | end |
396 | end |
onUpdate
DescriptionCalled on updateDefinition
onUpdate(float dt, boolean isActiveForInput, boolean isSelected)Arguments
float | dt | time since last call in ms |
boolean | isActiveForInput | true if vehicle is active for input |
boolean | isSelected | true if vehicle is selected |
207 | function AttacherJointControl:onUpdate(dt, isActiveForInput, isActiveForInputIgnoreSelection, isSelected) |
208 | local spec = self.spec_attacherJointControl |
209 | local control = spec.heightController |
210 | |
211 | --update attacher joint height by target alpha |
212 | if control ~= nil then |
213 | if spec.jointDesc ~= nil then |
214 | if spec.heightTargetAlpha ~= -1 then |
215 | local diff = spec.heightTargetAlpha - control.moveAlpha + 0.0001 |
216 | local moveTime = diff / (spec.jointDesc.upperAlpha - spec.jointDesc.lowerAlpha) * spec.jointDesc.moveTime |
217 | local moveStep = dt / moveTime * diff |
218 | if diff > 0 then |
219 | moveStep = -moveStep |
220 | end |
221 | local newAlpha = control.moveAlpha + moveStep |
222 | self:controlAttacherJoint(control, newAlpha) |
223 | if math.abs(spec.heightTargetAlpha - newAlpha) < 0.01 then |
224 | spec.heightTargetAlpha = -1 |
225 | end |
226 | end |
227 | end |
228 | end |
229 | |
230 | if spec.lastMoveTime + 100 > g_time then |
231 | if not g_soundManager:getIsSamplePlaying(spec.samples.hydraulic) then |
232 | g_soundManager:playSample(spec.samples.hydraulic) |
233 | end |
234 | else |
235 | if g_soundManager:getIsSamplePlaying(spec.samples.hydraulic) then |
236 | g_soundManager:stopSample(spec.samples.hydraulic) |
237 | end |
238 | end |
239 | end |
onWriteStream
DescriptionCalled on server side on joinDefinition
onWriteStream(integer streamId, integer connection)Arguments
integer | streamId | streamId |
integer | connection | connection |
158 | function AttacherJointControl:onWriteStream(streamId, connection) |
159 | if not connection:getIsServer() then |
160 | local spec = self.spec_attacherJointControl |
161 | if streamWriteBool(streamId, spec.jointDesc ~= nil) then |
162 | for _, control in ipairs(spec.controls) do |
163 | streamWriteFloat32(streamId, control.moveAlpha) |
164 | end |
165 | end |
166 | end |
167 | end |
onWriteUpdateStream
DescriptionCalled on on updateDefinition
onWriteUpdateStream(integer streamId, table connection, integer dirtyMask)Arguments
integer | streamId | stream ID |
table | connection | connection |
integer | dirtyMask | dirty mask |
191 | function AttacherJointControl:onWriteUpdateStream(streamId, connection, dirtyMask) |
192 | if connection:getIsServer() then |
193 | local spec = self.spec_attacherJointControl |
194 | if streamWriteBool(streamId, bitAND(dirtyMask, spec.dirtyFlag) ~= 0) then |
195 | for _, control in ipairs(spec.controls) do |
196 | streamWriteFloat32(streamId, control.moveAlpha) |
197 | end |
198 | end |
199 | end |
200 | end |
prerequisitesPresent
DescriptionChecks if all prerequisite specializations are loadedDefinition
prerequisitesPresent(table specializations)Arguments
table | specializations | specializations |
boolean | hasPrerequisite | true if all prerequisite specializations are loaded |
17 | function AttacherJointControl.prerequisitesPresent(specializations) |
18 | return SpecializationUtil.hasSpecialization(Attachable, specializations) |
19 | end |
registerEventListeners
DescriptionDefinitionregisterEventListeners()Code
41 | function AttacherJointControl.registerEventListeners(vehicleType) |
42 | SpecializationUtil.registerEventListener(vehicleType, "onLoad", AttacherJointControl) |
43 | SpecializationUtil.registerEventListener(vehicleType, "onDelete", AttacherJointControl) |
44 | SpecializationUtil.registerEventListener(vehicleType, "onReadStream", AttacherJointControl) |
45 | SpecializationUtil.registerEventListener(vehicleType, "onWriteStream", AttacherJointControl) |
46 | SpecializationUtil.registerEventListener(vehicleType, "onReadUpdateStream", AttacherJointControl) |
47 | SpecializationUtil.registerEventListener(vehicleType, "onWriteUpdateStream", AttacherJointControl) |
48 | SpecializationUtil.registerEventListener(vehicleType, "onUpdate", AttacherJointControl) |
49 | SpecializationUtil.registerEventListener(vehicleType, "onRegisterActionEvents", AttacherJointControl) |
50 | SpecializationUtil.registerEventListener(vehicleType, "onPostAttach", AttacherJointControl) |
51 | SpecializationUtil.registerEventListener(vehicleType, "onPreDetach", AttacherJointControl) |
52 | end |
registerFunctions
DescriptionDefinitionregisterFunctions()Code
23 | function AttacherJointControl.registerFunctions(vehicleType) |
24 | SpecializationUtil.registerFunction(vehicleType, "controlAttacherJoint", AttacherJointControl.controlAttacherJoint) |
25 | SpecializationUtil.registerFunction(vehicleType, "controlAttacherJointHeight", AttacherJointControl.controlAttacherJointHeight) |
26 | SpecializationUtil.registerFunction(vehicleType, "controlAttacherJointTilt", AttacherJointControl.controlAttacherJointTilt) |
27 | SpecializationUtil.registerFunction(vehicleType, "getControlAttacherJointDirection", AttacherJointControl.getControlAttacherJointDirection) |
28 | end |
registerLoweringActionEvent
DescriptionDefinitionregisterLoweringActionEvent()Code
338 | function AttacherJointControl:registerLoweringActionEvent(superFunc, actionEventsTable, inputAction, target, callback, triggerUp, triggerDown, triggerAlways, startActive, callbackState, customIconName) |
339 | local spec = self.spec_attacherJointControl |
340 | if spec.heightController then |
341 | local _, actionEventId = self:addActionEvent(actionEventsTable, InputAction.LOWER_IMPLEMENT, self, AttacherJointControl.actionEventAttacherJointControlSetPoint, triggerUp, triggerDown, triggerAlways, startActive, callbackState, customIconName) |
342 | g_inputBinding:setActionEventTextPriority(actionEventId, GS_PRIO_HIGH) |
343 | |
344 | if inputAction == InputAction.LOWER_IMPLEMENT then |
345 | return |
346 | end |
347 | end |
348 | |
349 | superFunc(self, actionEventsTable, inputAction, target, callback, triggerUp, triggerDown, triggerAlways, startActive, callbackState, customIconName) |
350 | end |
registerOverwrittenFunctions
DescriptionDefinitionregisterOverwrittenFunctions()Code
32 | function AttacherJointControl.registerOverwrittenFunctions(vehicleType) |
33 | SpecializationUtil.registerOverwrittenFunction(vehicleType, "loadInputAttacherJoint", AttacherJointControl.loadInputAttacherJoint) |
34 | SpecializationUtil.registerOverwrittenFunction(vehicleType, "registerLoweringActionEvent", AttacherJointControl.registerLoweringActionEvent) |
35 | SpecializationUtil.registerOverwrittenFunction(vehicleType, "getLoweringActionEventState", AttacherJointControl.getLoweringActionEventState) |
36 | SpecializationUtil.registerOverwrittenFunction(vehicleType, "getCanBeSelected", AttacherJointControl.getCanBeSelected) |
37 | end |