Skip to content

Commit 09aaf8d

Browse files
committed
v2.0 conversion to FS17
1 parent 800d93e commit 09aaf8d

9 files changed

Lines changed: 52 additions & 97 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# KeyboardSteer for Farming Simulator 2015
1+
# KeyboardSteer for Farming Simulator 2017
22

33
## Motivation
44
Although I have a steering wheel, but almost always play with the keyboard. On winding roads, I am again and again landed in the ditch in front of nights or power poles.

deploy.bat

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,2 @@
11
@echo "mods"
2-
@xcopy zzzKeyboardSteer.zip "C:\Users\d027464\Documents\My Games\FarmingSimulator2015\mods" /R/U/Y/Q
3-
@echo "mods_mig"
4-
@xcopy zzzKeyboardSteer.zip "C:\Users\d027464\Documents\My Games\FarmingSimulator2015\mods_mig" /R/U/Y/Q
5-
@echo "mods_holz"
6-
@xcopy zzzKeyboardSteer.zip "C:\Users\d027464\Documents\My Games\FarmingSimulator2015\mods_holz" /R/U/Y/Q
7-
@echo "mods_wild"
8-
@xcopy zzzKeyboardSteer.zip "C:\Users\d027464\Documents\My Games\FarmingSimulator2015\mods_wild" /R/U/Y/Q
9-
@echo "mods_lim"
10-
@xcopy zzzKeyboardSteer.zip "C:\Users\d027464\Documents\My Games\FarmingSimulator2015\mods_lim" /R/U/Y/Q
2+
@xcopy zzzKeyboardSteer.zip "C:\Users\d027464\Documents\My Games\FarmingSimulator2017\mods" /R/U/Y/Q

zzzKeyboardSteer.zip

-185 Bytes
Binary file not shown.

zzzKeyboardSteer/keyboardSteerMogli.lua

Lines changed: 11 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ function keyboardSteerMogli:isValidCam( index, createIfMissing )
127127
return false
128128
end
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

378373
function 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 )
529513
end
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
686670
end
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-
699672
function keyboardSteerMogli:ksmOnSetFactor( old, new, noEventSend )
700673
self.ksmExponent = new
701674
self.ksmFactor = 1.1 ^ new

zzzKeyboardSteer/modDesc.xml

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8" standalone="no" ?>
2-
<modDesc descVersion="23">
2+
<modDesc descVersion="32">
33
<author>mogli</author>
44
<title>
55
<en>keyboardSteer</en>
@@ -15,25 +15,24 @@
1515
</description>
1616
<multiplayer supported="true"/>
1717
<iconFilename>store.dds</iconFilename>
18-
<version>1.9.0.1</version>
18+
<version>2.0.0.0</version>
1919
<l10n filenamePrefix="modDesc_l10n">
2020
<text name="ksmVERSION">
21-
<de>keyboardSteer v1.9 rc1</de>
22-
<en>keyboardSteer v1.9 rc1</en>
21+
<de>keyboardSteer v2.0</de>
22+
<en>keyboardSteer v2.0</en>
2323
</text>
2424
</l10n>
2525
<inputBindings>
26-
<input name="ksmENABLE" key1="KEY_lshift KEY_e" button="" category="VEHICLE" />
27-
<input name="ksmCAMERA" key1="KEY_lshift KEY_c" button="" category="VEHICLE" />
28-
<input name="ksmREVERSE" key1="KEY_lshift KEY_r" button="" category="VEHICLE" />
29-
<input name="ksmANALOG" key1="KEY_lshift KEY_lctrl KEY_c" button="" category="VEHICLE" />
30-
<input name="ksmPLUS" key1="KEY_lctrl KEY_e" button="" category="VEHICLE" />
31-
<input name="ksmMINUS" key1="KEY_lctrl KEY_c" button="" category="VEHICLE" />
32-
<input name="ksmMIRROR" key1="KEY_lctrl KEY_r" button="" category="VEHICLE" />
33-
<input name="ksmUP" key1="KEY_rshift KEY_up" button="" category="VEHICLE" />
34-
<input name="ksmDOWN" key1="KEY_rshift KEY_down" button="" category="VEHICLE" />
35-
<input name="ksmLEFT" key1="KEY_rshift KEY_left" button="" category="VEHICLE" />
36-
<input name="ksmRIGHT" key1="KEY_rshift KEY_right" button="" category="VEHICLE" />
26+
<input name="ksmENABLE" hidden="true" key1="KEY_lshift KEY_e" button="" category="VEHICLE" />
27+
<input name="ksmCAMERA" hidden="true" key1="KEY_lshift KEY_c" button="" category="VEHICLE" />
28+
<input name="ksmREVERSE" hidden="true" key1="KEY_lshift KEY_r" button="" category="VEHICLE" />
29+
<input name="ksmANALOG" hidden="true" key1="KEY_lshift KEY_lctrl KEY_c" button="" category="VEHICLE" />
30+
<input name="ksmPLUS" hidden="true" key1="KEY_lctrl KEY_e" button="" category="VEHICLE" />
31+
<input name="ksmMINUS" hidden="true" key1="KEY_lctrl KEY_c" button="" category="VEHICLE" />
32+
<input name="ksmUP" hidden="true" key1="KEY_rshift KEY_up" button="" category="VEHICLE" />
33+
<input name="ksmDOWN" hidden="true" key1="KEY_rshift KEY_down" button="" category="VEHICLE" />
34+
<input name="ksmLEFT" hidden="true" key1="KEY_rshift KEY_left" button="" category="VEHICLE" />
35+
<input name="ksmRIGHT" hidden="true" key1="KEY_rshift KEY_right" button="" category="VEHICLE" />
3736
</inputBindings>
3837
<extraSourceFiles>
3938
<sourceFile filename="register.lua" />

zzzKeyboardSteer/modDesc_l10n_de.xml

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,16 @@
1212
<text name="ksmANALOG_OFF" text="Analog Controller [aus]"/>
1313
<text name="ksmREVERSE_ON" text="Zurückblicken [an]"/>
1414
<text name="ksmREVERSE_OFF" text="Zurückblicken [aus]"/>
15-
<text name="ksmPLUS" text="Geschwindigkeitsabh. +"/>
16-
<text name="ksmMINUS" text="Geschwindigkeitsabh. -"/>
17-
<text name="ksmMIRROR_ON" text="Spiegel [an]"/>
18-
<text name="ksmMIRROR_OFF" text="Spiegel [aus]"/>
1915

20-
<text name="ksmENABLE" text="keyboardSteerMogli: Lenkung"/>
21-
<text name="ksmCAMERA" text="keyboardSteerMogli: Kamerabewegung"/>
22-
<text name="ksmREVERSE" text="keyboardSteerMogli: Zurückblicken"/>
23-
<text name="ksmANALOG" text="keyboardSteerMogli: Analog Controller"/>
24-
<text name="ksmMIRROR" text="keyboardSteerMogli: Spiegel"/>
25-
26-
<text name="ksmUP" text="keyboardSteerMogli: Nach vorne schauen"/>
27-
<text name="ksmDOWN" text="keyboardSteerMogli: Nach hinten schauen"/>
28-
<text name="ksmLEFT" text="keyboardSteerMogli: Nach links schauen"/>
29-
<text name="ksmRIGHT" text="keyboardSteerMogli: Nach rechts schauen"/>
16+
<text name="input_ksmENABLE" text="keyboardSteerMogli: Lenkung"/>
17+
<text name="input_ksmCAMERA" text="keyboardSteerMogli: Kamerabewegung"/>
18+
<text name="input_ksmREVERSE" text="keyboardSteerMogli: Zurückblicken"/>
19+
<text name="input_ksmANALOG" text="keyboardSteerMogli: Analog Controller"/>
20+
<text name="input_ksmPLUS" text="Geschwindigkeitsabh. +"/>
21+
<text name="input_ksmMINUS" text="Geschwindigkeitsabh. -"/>
22+
<text name="input_ksmUP" text="keyboardSteerMogli: Nach vorne schauen"/>
23+
<text name="input_ksmDOWN" text="keyboardSteerMogli: Nach hinten schauen"/>
24+
<text name="input_ksmLEFT" text="keyboardSteerMogli: Nach links schauen"/>
25+
<text name="input_ksmRIGHT" text="keyboardSteerMogli: Nach rechts schauen"/>
3026
</texts>
3127
</l10n>

zzzKeyboardSteer/modDesc_l10n_en.xml

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,16 @@
1212
<text name="ksmANALOG_OFF" text="analogue controller [off]"/>
1313
<text name="ksmREVERSE_ON" text="look backwards [on]"/>
1414
<text name="ksmREVERSE_OFF" text="look backwards [off]"/>
15-
<text name="ksmPLUS" text="speed sensitivity +"/>
16-
<text name="ksmMINUS" text="speed sensitivity -"/>
17-
<text name="ksmMIRROR_ON" text="mirrors [on]"/>
18-
<text name="ksmMIRROR_OFF" text="mirrors [off]"/>
1915

20-
<text name="ksmENABLE" text="keyboardSteerMogli: steering"/>
21-
<text name="ksmCAMERA" text="keyboardSteerMogli: camera movement"/>
22-
<text name="ksmREVERSE" text="keyboardSteerMogli: look backwards"/>
23-
<text name="ksmANALOG" text="keyboardSteerMogli: analogue controller"/>
24-
<text name="ksmMIRROR" text="keyboardSteerMogli: mirrors"/>
25-
26-
<text name="ksmUP" text="keyboardSteerMogli: look fwd"/>
27-
<text name="ksmDOWN" text="keyboardSteerMogli: look back"/>
28-
<text name="ksmLEFT" text="keyboardSteerMogli: look left"/>
29-
<text name="ksmRIGHT" text="keyboardSteerMogli: look right"/>
16+
<text name="input_ksmENABLE" text="keyboardSteerMogli: steering"/>
17+
<text name="input_ksmCAMERA" text="keyboardSteerMogli: camera movement"/>
18+
<text name="input_ksmREVERSE" text="keyboardSteerMogli: look backwards"/>
19+
<text name="input_ksmANALOG" text="keyboardSteerMogli: analogue controller"/>
20+
<text name="input_ksmPLUS" text="speed sensitivity +"/>
21+
<text name="input_ksmMINUS" text="speed sensitivity -"/>
22+
<text name="input_ksmUP" text="keyboardSteerMogli: look fwd"/>
23+
<text name="input_ksmDOWN" text="keyboardSteerMogli: look back"/>
24+
<text name="input_ksmLEFT" text="keyboardSteerMogli: look left"/>
25+
<text name="input_ksmRIGHT" text="keyboardSteerMogli: look right"/>
3026
</texts>
3127
</l10n>

zzzKeyboardSteer/mogliBase.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@
1313
-- 3.04 hide warnings of missing input bindings
1414
-- 3.05 string support in globalsLoad
1515
-- 3.06 degrees support in globalsLoad
16+
-- 3.10 FS17 version
1617

1718
-- Usage: source(Utils.getFilename("mogliBase.lua", g_currentModDirectory));
1819
-- _G[g_currentModDirectory.."mogliBase"].newClass( "AutoCombine", "acParameters" )
1920

20-
local mogliBaseVersion = 3.06
21+
local mogliBaseVersion = 3.10
2122
local mogliBaseClass = g_currentModName..".mogliBase"
2223
local mogliEventClass = g_currentModName..".mogliEvent"
2324
--local mogliEventClass_mt = g_currentModDirectory.."mogliEvent_mt"
@@ -231,7 +232,7 @@ else
231232
--********************************
232233
-- load
233234
--********************************
234-
function _newClass_:load(xmlFile)
235+
function _newClass_:load(savegame)
235236
-- should always be overwritten
236237
_newClass_.registerState( self, "mogliBasicsDummy", false, _newClass_.debugEvent )
237238
end

zzzKeyboardSteer/register.lua

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,8 @@ function keyboardSteerMogli_Register:loadMap(name)
3636
g_i18n.globalI18N.texts["ksmREVERSE_OFF"] = g_i18n:getText("ksmREVERSE_OFF");
3737
g_i18n.globalI18N.texts["ksmANALOG_ON"] = g_i18n:getText("ksmANALOG_ON");
3838
g_i18n.globalI18N.texts["ksmANALOG_OFF"] = g_i18n:getText("ksmANALOG_OFF");
39-
g_i18n.globalI18N.texts["ksmPLUS"] = g_i18n:getText("ksmPLUS");
40-
g_i18n.globalI18N.texts["ksmMINUS"] = g_i18n:getText("ksmMINUS");
41-
g_i18n.globalI18N.texts["ksmMIRROR_ON"] = g_i18n:getText("ksmMIRROR_ON");
42-
g_i18n.globalI18N.texts["ksmMIRROR_OFF"] = g_i18n:getText("ksmMIRROR_OFF");
39+
g_i18n.globalI18N.texts["input_ksmPLUS"] = g_i18n:getText("input_ksmPLUS");
40+
g_i18n.globalI18N.texts["input_ksmMINUS"] = g_i18n:getText("input_ksmMINUS");
4341
end;
4442
end;
4543

0 commit comments

Comments
 (0)