@@ -127,7 +127,7 @@ function keyboardSteerMogli:isValidCam( index, createIfMissing )
127127 return false
128128end
129129
130- function keyboardSteerMogli :load (xmlFile )
130+ function keyboardSteerMogli :load (savegame )
131131 self .ksmScaleFx = keyboardSteerMogli .scaleFx
132132 self .ksmSetState = keyboardSteerMogli .mbSetState
133133 self .ksmIsValidCam = keyboardSteerMogli .isValidCam
@@ -140,7 +140,6 @@ function keyboardSteerMogli:load(xmlFile)
140140 keyboardSteerMogli .registerState ( self , " ksmCamFwd" , true , keyboardSteerMogli .ksmOnSetCamFwd )
141141 keyboardSteerMogli .registerState ( self , " ksmExponent" , 1 , keyboardSteerMogli .ksmOnSetFactor )
142142 keyboardSteerMogli .registerState ( self , " ksmWarningText" , " " , keyboardSteerMogli .ksmOnSetWarningText )
143- keyboardSteerMogli .registerState ( self , " ksmMirror" , true , keyboardSteerMogli .ksmOnSetMirror )
144143 keyboardSteerMogli .registerState ( self , " ksmLCtrlPressed" , false )
145144 keyboardSteerMogli .registerState ( self , " ksmLShiftPressed" , false )
146145
@@ -157,8 +156,6 @@ function keyboardSteerMogli:load(xmlFile)
157156 self .ksmLastAxisFwd = 0
158157 self .ksmDirChangeTimer = 0
159158 self .ksmChangeDir = false
160- self .ksmAddMirror = true
161- self .mirrorAvailable = self .ksmMirror
162159
163160 if KSMGlobals .ksmSteeringIsOn then
164161 self :ksmSetState ( " ksmSteeringIsOn" , true , true )
@@ -190,8 +187,6 @@ function keyboardSteerMogli:update(dt)
190187 elseif InputBinding .hasEvent (InputBinding .ksmMINUS ) then
191188 self :ksmSetState ( " ksmExponent" , self .ksmExponent - 1 )
192189 self :ksmSetState ( " ksmWarningText" , string.format (" Sensitivity %3.0f %%" , 100 * self .ksmFactor , true ) )
193- elseif self .ksmAddMirror and InputBinding .hasEvent (InputBinding .ksmMIRROR ) then
194- self :ksmSetState ( " ksmMirror" , not self .ksmMirror )
195190 elseif InputBinding .hasEvent (InputBinding .ksmENABLE ) then
196191 self :ksmSetState ( " ksmSteeringIsOn" , not self .ksmSteeringIsOn )
197192 elseif InputBinding .hasEvent (InputBinding .ksmCAMERA ) then
@@ -377,27 +372,23 @@ end
377372
378373function keyboardSteerMogli :draw ()
379374 if self .ksmLCtrlPressed then
380- g_currentMission :addHelpButtonText (keyboardSteerMogli .getText (" ksmPLUS" ), InputBinding .ksmPLUS )
381- g_currentMission :addHelpButtonText (keyboardSteerMogli .getText (" ksmMINUS" ), InputBinding .ksmMINUS )
382-
383- if self .ksmAddMirror then
384- if self .ksmMirror then
385- g_currentMission :addHelpButtonText (keyboardSteerMogli .getText (" ksmMIRROR_ON" ), InputBinding .ksmMIRROR )
375+ if self .ksmLShiftPressed then
376+ if self .ksmAnalogIsOn then
377+ g_currentMission :addHelpButtonText (keyboardSteerMogli .getText (" ksmANALOG_ON" ), InputBinding .ksmANALOG )
386378 else
387- g_currentMission :addHelpButtonText (keyboardSteerMogli .getText (" ksmMIRROR_OFF " ), InputBinding .ksmMIRROR )
379+ g_currentMission :addHelpButtonText (keyboardSteerMogli .getText (" ksmANALOG_OFF " ), InputBinding .ksmANALOG )
388380 end
381+ else
382+ g_currentMission :addHelpButtonText (keyboardSteerMogli .getText (" input_ksmPLUS" ), InputBinding .ksmPLUS )
383+ g_currentMission :addHelpButtonText (keyboardSteerMogli .getText (" input_ksmMINUS" ), InputBinding .ksmMINUS )
389384 end
385+
390386 elseif KSMGlobals .ksmDrawIsOn or self .ksmLShiftPressed then
391387 if self .ksmSteeringIsOn then
392388 g_currentMission :addHelpButtonText (keyboardSteerMogli .getText (" ksmENABLE_ON" ), InputBinding .ksmENABLE )
393389 else
394390 g_currentMission :addHelpButtonText (keyboardSteerMogli .getText (" ksmENABLE_OFF" ), InputBinding .ksmENABLE )
395391 end
396- if self .ksmAnalogIsOn then
397- g_currentMission :addHelpButtonText (keyboardSteerMogli .getText (" ksmANALOG_ON" ), InputBinding .ksmANALOG )
398- else
399- g_currentMission :addHelpButtonText (keyboardSteerMogli .getText (" ksmANALOG_OFF" ), InputBinding .ksmANALOG )
400- end
401392
402393 if self :ksmIsValidCam () then
403394 if self .ksmCameraIsOn then
@@ -466,9 +457,6 @@ function keyboardSteerMogli:getSaveAttributesAndNodes(nodeIdent)
466457 if self .ksmAnalogIsOn ~= nil and self .ksmAnalogIsOn ~= KSMGlobals .enableAnalogCtrl then
467458 attributes = attributes .. " ksmAnalogIsOn=\" " .. tostring (self .ksmAnalogIsOn ) .. " \" "
468459 end
469- if self .ksmMirror ~= nil and self .ksmMirror ~= true then
470- attributes = attributes .. " ksmMirror=\" " .. tostring (self .ksmMirror ) .. " \" "
471- end
472460
473461 for i ,b in pairs (self .ksmCameras ) do
474462 if b .rotation ~= keyboardSteerMogli .getDefaultRotation ( self , i ) then
@@ -494,10 +482,6 @@ function keyboardSteerMogli:loadFromAttributesAndNodes(xmlFile, key, resetVehicl
494482 if b ~= nil then
495483 self .ksmAnalogIsOn = b
496484 end
497- b = getXMLBool (xmlFile , key .. " #ksmMirror" )
498- if b ~= nil then
499- self :ksmSetState ( " ksmMirror" , b , true )
500- end
501485
502486 if self .ksmCameras == nil then
503487 self .ksmCameras = {}
@@ -528,7 +512,7 @@ function keyboardSteerMogli:scaleFx( fx, mi, ma )
528512 return Utils .clamp ( 1 + self .ksmFactor * ( fx - 1 ), mi , ma )
529513end
530514
531- function keyboardSteerMogli :newUpdateVehiclePhysics ( superFunc , axisForward , axisForwardIsAnalog , axisSide , axisSideIsAnalog , dt )
515+ function keyboardSteerMogli :newUpdateVehiclePhysics ( superFunc , axisForward , axisForwardIsAnalog , axisSide , axisSideIsAnalog , doHandbrake , dt , ... )
532516 local backup1 = self .autoRotateBackSpeed
533517 local backup2 = self .minRotTime
534518 local backup3 = self .maxRotTime
@@ -618,7 +602,7 @@ function keyboardSteerMogli:newUpdateVehiclePhysics( superFunc, axisForward, axi
618602 self .ksmLastAxisFwd = math.min ( axisForward , self .ksmLastAxisFwd + KSMGlobals .axisForwardSmooth * dt )
619603 end
620604
621- local state , result = pcall ( superFunc , self , axisForward , axisForwardIsAnalog , axisSide , axisSideIsAnalog , dt )
605+ local state , result = pcall ( superFunc , self , axisForward , axisForwardIsAnalog , axisSide , axisSideIsAnalog , doHandbrake , dt , ... )
622606 if not ( state ) then
623607 print (" Error in updateVehiclePhysics :" .. tostring (result ))
624608 end
@@ -685,17 +669,6 @@ function keyboardSteerMogli:ksmSetCameraFwd( camFwd )
685669 end
686670end
687671
688- function keyboardSteerMogli :ksmOnSetMirror ( old , new , noEventSend )
689- self .ksmMirror = new
690-
691- if self .ksmAddMirror then
692- self .mirrorAvailable = new
693- if self .cameras [self .camIndex ].useMirror then
694- self .setMirrorVisible (self , new )
695- end
696- end
697- end
698-
699672function keyboardSteerMogli :ksmOnSetFactor ( old , new , noEventSend )
700673 self .ksmExponent = new
701674 self .ksmFactor = 1.1 ^ new
0 commit comments