├── .gitattributes ├── .gitignore ├── Documents ├── diff.pdn ├── fs17_screenshot.jpg ├── fs19_screenshot_1_0__1.png ├── fs19_screenshot_1_0__2.png ├── fs19_screenshot_1_0__3.png ├── fs19_screenshot_1_0__4.png ├── fs19_screenshot_1_0__5.png ├── fs19_screenshot_1_0__6.png ├── fs19_screenshot_1_0__7.png ├── fs19_screenshot_1_1_1__4.png ├── fs19_screenshot_1_1__1.png ├── fs19_screenshot_1_1__2.png ├── fs19_screenshot_1_1__3.png ├── fs19_screenshot_1_1__4.png ├── fs19_screenshot_1_1__5.png ├── fs19_screenshot_1_1__6.png ├── fs19_screenshot_1_1__7.png ├── fs19_screenshot_1_2__1.png ├── fs19_screenshot_1_2__2.png ├── fs19_screenshot_1_2__3.png ├── fs19_screenshot_1_2__4.png ├── fs19_screenshot_1_2__5.png ├── fs19_screenshot_1_2__6.png ├── fs19_screenshot_1_2__7.png ├── fs22_screenshot_1_1__1.png ├── fs22_screenshot_1_1__2.png ├── fs22_screenshot_1_1__3.png ├── fs22_screenshot_1_1__4.png ├── fs22_screenshot_1_1__5.png ├── fs22_screenshot_1_1__6.png ├── gears.xlsx ├── icons.pdn ├── ideas_more_complex_transmission.txt ├── loadCurve.xlsx ├── modHubIconBlank.png ├── modIcon.pdn ├── modhoster.docx ├── ownTransmission.png ├── parameter.xlsx ├── pitchExponent.xlsx ├── profiles.csv ├── profiles.xlsx ├── screen_shot_fs17_2_2__1.png ├── screen_shot_fs17_2_2__2.png ├── snapCurve.xlsx ├── store.pdn ├── store.png ├── store2.pdn ├── store3.pdn ├── store4.pdn ├── store_fs22.png ├── tab_uv.txt └── torqueCurveX.xlsx ├── FS19_VehicleControlAddon.zip ├── FS19_VehicleControlAddon ├── GPS_off.ogg ├── GPS_on.ogg ├── arrow_down_gray.dds ├── arrow_down_white.dds ├── arrow_up_gray.dds ├── arrow_up_white.dds ├── auto_hold.dds ├── auto_hold_down.dds ├── auto_hold_up.dds ├── blowOffVentil.ogg ├── diff_back.dds ├── diff_front.dds ├── diff_middle.dds ├── diff_wheels.dds ├── grinding.ogg ├── gui │ ├── guiProfiles.xml │ ├── icons.dds │ ├── vehicleControlAddonDialog1.lua │ ├── vehicleControlAddonDialog1.xml │ ├── vehicleControlAddonDialog2.lua │ ├── vehicleControlAddonDialog2.xml │ ├── vehicleControlAddonFrame.lua │ ├── vehicleControlAddonFrame1.lua │ ├── vehicleControlAddonFrame1.xml │ ├── vehicleControlAddonFrame2.lua │ ├── vehicleControlAddonFrame2.xml │ ├── vehicleControlAddonFrame3.lua │ ├── vehicleControlAddonFrame3.xml │ ├── vehicleControlAddonFrame4.lua │ ├── vehicleControlAddonFrame4.xml │ ├── vehicleControlAddonFrame5.lua │ ├── vehicleControlAddonFrame5.xml │ ├── vehicleControlAddonFrame6.lua │ ├── vehicleControlAddonFrame6.xml │ ├── vehicleControlAddonMenu.lua │ └── vehicleControlAddonMenu.xml ├── hand_brake.dds ├── hand_brake_down.dds ├── hand_brake_up.dds ├── modDesc.xml ├── modDesc_l10n_br.xml ├── modDesc_l10n_da.xml ├── modDesc_l10n_de.xml ├── modDesc_l10n_en.xml ├── modDesc_l10n_es.xml ├── modDesc_l10n_fr.xml ├── modDesc_l10n_it.xml ├── modDesc_l10n_nl.xml ├── modDesc_l10n_pl.xml ├── modDesc_l10n_pt.xml ├── modDesc_l10n_ru.xml ├── mogliBase.lua ├── mogliScreen.lua ├── shift.ogg ├── shift2.ogg ├── store.dds ├── vehicleControlAddon.lua ├── vehicleControlAddonConfig.xml ├── vehicleControlAddonRegister.lua └── vehicleControlAddonTransmissions.lua ├── FS22_VehicleControlAddon.zip ├── FS22_VehicleControlAddon ├── dds │ ├── diff_back.dds │ ├── diff_bg.dds │ ├── diff_front.dds │ ├── diff_middle.dds │ ├── diff_wheels_fl.dds │ ├── diff_wheels_fr.dds │ ├── diff_wheels_rl.dds │ ├── diff_wheels_rr.dds │ ├── gear_bg.dds │ ├── help_camera_en.dds │ ├── help_diff_en.dds │ ├── help_gps_en.dds │ ├── help_intro.dds │ ├── help_steering_en.dds │ └── help_throttle_en.dds ├── gui │ ├── guiProfiles.xml │ ├── vehicleControlAddonConfig.lua │ ├── vehicleControlAddonConfig.xml │ ├── vehicleControlAddonMenu.lua │ └── vehicleControlAddonMenu.xml ├── l10n │ ├── modDesc_l10n_br.xml │ ├── modDesc_l10n_cz.xml │ ├── modDesc_l10n_da.xml │ ├── modDesc_l10n_de.xml │ ├── modDesc_l10n_en.xml │ ├── modDesc_l10n_es.xml │ ├── modDesc_l10n_fr.xml │ ├── modDesc_l10n_it.xml │ ├── modDesc_l10n_nl.xml │ ├── modDesc_l10n_pl.xml │ ├── modDesc_l10n_pt.xml │ ├── modDesc_l10n_ru.xml │ └── modDesc_l10n_tr.xml ├── modDesc.xml ├── modIcon.dds ├── ogg │ ├── GPS_off.ogg │ └── GPS_on.ogg ├── vehicleControlAddon.lua ├── vehicleControlAddonConfig.lua ├── vehicleControlAddonEvent.lua └── vehicleControlAddonRegister.lua ├── FS25_VehicleControlAddon.zip ├── FS25_VehicleControlAddon ├── dds │ ├── diff_back.dds │ ├── diff_bg.dds │ ├── diff_front.dds │ ├── diff_middle.dds │ ├── diff_wheels_fl.dds │ ├── diff_wheels_fr.dds │ ├── diff_wheels_rl.dds │ ├── diff_wheels_rr.dds │ └── gear_bg.dds ├── l10n │ ├── modDesc_l10n_br.xml │ ├── modDesc_l10n_cz.xml │ ├── modDesc_l10n_da.xml │ ├── modDesc_l10n_de.xml │ ├── modDesc_l10n_en.xml │ ├── modDesc_l10n_es.xml │ ├── modDesc_l10n_fr.xml │ ├── modDesc_l10n_it.xml │ ├── modDesc_l10n_nl.xml │ ├── modDesc_l10n_pl.xml │ ├── modDesc_l10n_pt.xml │ ├── modDesc_l10n_ru.xml │ └── modDesc_l10n_tr.xml ├── lua │ ├── vehicleControlAddon.lua │ ├── vehicleControlAddonConfig.lua │ ├── vehicleControlAddonEvent.lua │ └── vehicleControlAddonRegister.lua ├── modDesc.xml ├── modIcon.dds └── ogg │ ├── GPS_off.ogg │ └── GPS_on.ogg ├── README.md ├── allInOne.bat ├── build.bat ├── deploy.bat └── modsSettings └── FS19_VehicleControlAddon ├── config.xml └── transmissions.xml /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | *.sln merge=union 7 | *.csproj merge=union 8 | *.vbproj merge=union 9 | *.fsproj merge=union 10 | *.dbproj merge=union 11 | 12 | # Standard to msysgit 13 | *.doc diff=astextplain 14 | *.DOC diff=astextplain 15 | *.docx diff=astextplain 16 | *.DOCX diff=astextplain 17 | *.dot diff=astextplain 18 | *.DOT diff=astextplain 19 | *.pdf diff=astextplain 20 | *.PDF diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Windows image file caches 2 | Thumbs.db 3 | ehthumbs.db 4 | 5 | # Folder config file 6 | Desktop.ini 7 | 8 | # Recycle Bin used on file shares 9 | $RECYCLE.BIN/ 10 | 11 | # Windows Installer files 12 | *.cab 13 | *.msi 14 | *.msm 15 | *.msp 16 | 17 | # ========================= 18 | # Operating System Files 19 | # ========================= 20 | 21 | # OSX 22 | # ========================= 23 | 24 | .DS_Store 25 | .AppleDouble 26 | .LSOverride 27 | 28 | # Icon must ends with two \r. 29 | Icon 30 | 31 | # Thumbnails 32 | ._* 33 | 34 | # Files that might appear on external disk 35 | .Spotlight-V100 36 | .Trashes 37 | 38 | # local batch files 39 | *.bat 40 | -------------------------------------------------------------------------------- /Documents/diff.pdn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/Documents/diff.pdn -------------------------------------------------------------------------------- /Documents/fs17_screenshot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/Documents/fs17_screenshot.jpg -------------------------------------------------------------------------------- /Documents/fs19_screenshot_1_0__1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/Documents/fs19_screenshot_1_0__1.png -------------------------------------------------------------------------------- /Documents/fs19_screenshot_1_0__2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/Documents/fs19_screenshot_1_0__2.png -------------------------------------------------------------------------------- /Documents/fs19_screenshot_1_0__3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/Documents/fs19_screenshot_1_0__3.png -------------------------------------------------------------------------------- /Documents/fs19_screenshot_1_0__4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/Documents/fs19_screenshot_1_0__4.png -------------------------------------------------------------------------------- /Documents/fs19_screenshot_1_0__5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/Documents/fs19_screenshot_1_0__5.png -------------------------------------------------------------------------------- /Documents/fs19_screenshot_1_0__6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/Documents/fs19_screenshot_1_0__6.png -------------------------------------------------------------------------------- /Documents/fs19_screenshot_1_0__7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/Documents/fs19_screenshot_1_0__7.png -------------------------------------------------------------------------------- /Documents/fs19_screenshot_1_1_1__4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/Documents/fs19_screenshot_1_1_1__4.png -------------------------------------------------------------------------------- /Documents/fs19_screenshot_1_1__1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/Documents/fs19_screenshot_1_1__1.png -------------------------------------------------------------------------------- /Documents/fs19_screenshot_1_1__2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/Documents/fs19_screenshot_1_1__2.png -------------------------------------------------------------------------------- /Documents/fs19_screenshot_1_1__3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/Documents/fs19_screenshot_1_1__3.png -------------------------------------------------------------------------------- /Documents/fs19_screenshot_1_1__4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/Documents/fs19_screenshot_1_1__4.png -------------------------------------------------------------------------------- /Documents/fs19_screenshot_1_1__5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/Documents/fs19_screenshot_1_1__5.png -------------------------------------------------------------------------------- /Documents/fs19_screenshot_1_1__6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/Documents/fs19_screenshot_1_1__6.png -------------------------------------------------------------------------------- /Documents/fs19_screenshot_1_1__7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/Documents/fs19_screenshot_1_1__7.png -------------------------------------------------------------------------------- /Documents/fs19_screenshot_1_2__1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/Documents/fs19_screenshot_1_2__1.png -------------------------------------------------------------------------------- /Documents/fs19_screenshot_1_2__2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/Documents/fs19_screenshot_1_2__2.png -------------------------------------------------------------------------------- /Documents/fs19_screenshot_1_2__3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/Documents/fs19_screenshot_1_2__3.png -------------------------------------------------------------------------------- /Documents/fs19_screenshot_1_2__4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/Documents/fs19_screenshot_1_2__4.png -------------------------------------------------------------------------------- /Documents/fs19_screenshot_1_2__5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/Documents/fs19_screenshot_1_2__5.png -------------------------------------------------------------------------------- /Documents/fs19_screenshot_1_2__6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/Documents/fs19_screenshot_1_2__6.png -------------------------------------------------------------------------------- /Documents/fs19_screenshot_1_2__7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/Documents/fs19_screenshot_1_2__7.png -------------------------------------------------------------------------------- /Documents/fs22_screenshot_1_1__1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/Documents/fs22_screenshot_1_1__1.png -------------------------------------------------------------------------------- /Documents/fs22_screenshot_1_1__2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/Documents/fs22_screenshot_1_1__2.png -------------------------------------------------------------------------------- /Documents/fs22_screenshot_1_1__3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/Documents/fs22_screenshot_1_1__3.png -------------------------------------------------------------------------------- /Documents/fs22_screenshot_1_1__4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/Documents/fs22_screenshot_1_1__4.png -------------------------------------------------------------------------------- /Documents/fs22_screenshot_1_1__5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/Documents/fs22_screenshot_1_1__5.png -------------------------------------------------------------------------------- /Documents/fs22_screenshot_1_1__6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/Documents/fs22_screenshot_1_1__6.png -------------------------------------------------------------------------------- /Documents/gears.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/Documents/gears.xlsx -------------------------------------------------------------------------------- /Documents/icons.pdn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/Documents/icons.pdn -------------------------------------------------------------------------------- /Documents/ideas_more_complex_transmission.txt: -------------------------------------------------------------------------------- 1 | Ideas more complex transmission 2 | 3 | - new sub-class of vehicleControlAddonTransmissionBase 4 | - list of forward gear ratios 5 | - optional list of reverse gear ratios 6 | - optoinal list of forward range ratios 7 | - optional list of reverse range ratios 8 | - gear names, upshift and downshift times, ... 9 | - same for ranges 10 | 11 | - copy of own transmission screen 12 | - comma separated list of gear ratios 13 | - comma separated list of reverse gear ratios; empty means same as forward 14 | - same for ranges 15 | - same for gear and range texts 16 | - same for gear and range upshift times, no value => 0 => power shift 17 | - different layout? 18 | - explanation text shows final gear speeds? 19 | 20 | - button to save transmission to config.xml with popup for name -------------------------------------------------------------------------------- /Documents/loadCurve.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/Documents/loadCurve.xlsx -------------------------------------------------------------------------------- /Documents/modHubIconBlank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/Documents/modHubIconBlank.png -------------------------------------------------------------------------------- /Documents/modIcon.pdn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/Documents/modIcon.pdn -------------------------------------------------------------------------------- /Documents/modhoster.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/Documents/modhoster.docx -------------------------------------------------------------------------------- /Documents/ownTransmission.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/Documents/ownTransmission.png -------------------------------------------------------------------------------- /Documents/parameter.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/Documents/parameter.xlsx -------------------------------------------------------------------------------- /Documents/pitchExponent.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/Documents/pitchExponent.xlsx -------------------------------------------------------------------------------- /Documents/profiles.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/Documents/profiles.xlsx -------------------------------------------------------------------------------- /Documents/screen_shot_fs17_2_2__1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/Documents/screen_shot_fs17_2_2__1.png -------------------------------------------------------------------------------- /Documents/screen_shot_fs17_2_2__2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/Documents/screen_shot_fs17_2_2__2.png -------------------------------------------------------------------------------- /Documents/snapCurve.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/Documents/snapCurve.xlsx -------------------------------------------------------------------------------- /Documents/store.pdn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/Documents/store.pdn -------------------------------------------------------------------------------- /Documents/store.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/Documents/store.png -------------------------------------------------------------------------------- /Documents/store2.pdn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/Documents/store2.pdn -------------------------------------------------------------------------------- /Documents/store3.pdn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/Documents/store3.pdn -------------------------------------------------------------------------------- /Documents/store4.pdn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/Documents/store4.pdn -------------------------------------------------------------------------------- /Documents/store_fs22.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/Documents/store_fs22.png -------------------------------------------------------------------------------- /Documents/tab_uv.txt: -------------------------------------------------------------------------------- 1 | InGameMenu.TAB_UV is a table (table: 0x01fce3a35810) with 14 elements 2 | InGameMenu.TAB_UV.FARMS is a table (table: 0x01fce3a36ef8) with 4 elements 3 | InGameMenu.TAB_UV.FARMS[1] = 585 (number) 4 | InGameMenu.TAB_UV.FARMS[2] = 144 (number) 5 | InGameMenu.TAB_UV.FARMS[3] = 65 (number) 6 | InGameMenu.TAB_UV.FARMS[4] = 65 (number) 7 | InGameMenu.TAB_UV.CONTRACTS is a table (table: 0x01fce3a36998) with 4 elements 8 | InGameMenu.TAB_UV.CONTRACTS[1] = 260 (number) 9 | InGameMenu.TAB_UV.CONTRACTS[2] = 209 (number) 10 | InGameMenu.TAB_UV.CONTRACTS[3] = 65 (number) 11 | InGameMenu.TAB_UV.CONTRACTS[4] = 65 (number) 12 | InGameMenu.TAB_UV.USERS is a table (table: 0x01fce3a36f68) with 4 elements 13 | InGameMenu.TAB_UV.USERS[1] = 910 (number) 14 | InGameMenu.TAB_UV.USERS[2] = 144 (number) 15 | InGameMenu.TAB_UV.USERS[3] = 65 (number) 16 | InGameMenu.TAB_UV.USERS[4] = 65 (number) 17 | InGameMenu.TAB_UV.ANIMALS is a table (table: 0x01fce3a35970) with 4 elements 18 | InGameMenu.TAB_UV.ANIMALS[1] = 195 (number) 19 | InGameMenu.TAB_UV.ANIMALS[2] = 144 (number) 20 | InGameMenu.TAB_UV.ANIMALS[3] = 65 (number) 21 | InGameMenu.TAB_UV.ANIMALS[4] = 65 (number) 22 | InGameMenu.TAB_UV.TUTORIAL is a table (table: 0x01fce3a36fd8) with 4 elements 23 | InGameMenu.TAB_UV.TUTORIAL[1] = 325 (number) 24 | InGameMenu.TAB_UV.TUTORIAL[2] = 209 (number) 25 | InGameMenu.TAB_UV.TUTORIAL[3] = 65 (number) 26 | InGameMenu.TAB_UV.TUTORIAL[4] = 65 (number) 27 | InGameMenu.TAB_UV.VEHICLES is a table (table: 0x01fce3a35900) with 4 elements 28 | InGameMenu.TAB_UV.VEHICLES[1] = 130 (number) 29 | InGameMenu.TAB_UV.VEHICLES[2] = 144 (number) 30 | InGameMenu.TAB_UV.VEHICLES[3] = 65 (number) 31 | InGameMenu.TAB_UV.VEHICLES[4] = 65 (number) 32 | InGameMenu.TAB_UV.MAP is a table (table: 0x01fce3a35858) with 4 elements 33 | InGameMenu.TAB_UV.MAP[1] = 0 (number) 34 | InGameMenu.TAB_UV.MAP[2] = 144 (number) 35 | InGameMenu.TAB_UV.MAP[3] = 65 (number) 36 | InGameMenu.TAB_UV.MAP[4] = 65 (number) 37 | InGameMenu.TAB_UV.GENERAL_SETTINGS is a table (table: 0x01fce3a36a78) with 4 elements 38 | InGameMenu.TAB_UV.GENERAL_SETTINGS[1] = 65 (number) 39 | InGameMenu.TAB_UV.GENERAL_SETTINGS[2] = 209 (number) 40 | InGameMenu.TAB_UV.GENERAL_SETTINGS[3] = 65 (number) 41 | InGameMenu.TAB_UV.GENERAL_SETTINGS[4] = 65 (number) 42 | InGameMenu.TAB_UV.PRICES is a table (table: 0x01fce3a36b40) with 4 elements 43 | InGameMenu.TAB_UV.PRICES[1] = 325 (number) 44 | InGameMenu.TAB_UV.PRICES[2] = 144 (number) 45 | InGameMenu.TAB_UV.PRICES[3] = 65 (number) 46 | InGameMenu.TAB_UV.PRICES[4] = 65 (number) 47 | InGameMenu.TAB_UV.CONTROLS_SETTINGS is a table (table: 0x01fce3a36e88) with 4 elements 48 | InGameMenu.TAB_UV.CONTROLS_SETTINGS[1] = 130 (number) 49 | InGameMenu.TAB_UV.CONTROLS_SETTINGS[2] = 209 (number) 50 | InGameMenu.TAB_UV.CONTROLS_SETTINGS[3] = 65 (number) 51 | InGameMenu.TAB_UV.CONTROLS_SETTINGS[4] = 65 (number) 52 | InGameMenu.TAB_UV.GAME_SETTINGS is a table (table: 0x01fce3a36bb0) with 4 elements 53 | InGameMenu.TAB_UV.GAME_SETTINGS[1] = 0 (number) 54 | InGameMenu.TAB_UV.GAME_SETTINGS[2] = 209 (number) 55 | InGameMenu.TAB_UV.GAME_SETTINGS[3] = 65 (number) 56 | InGameMenu.TAB_UV.GAME_SETTINGS[4] = 65 (number) 57 | InGameMenu.TAB_UV.STATISTICS is a table (table: 0x01fce3a36c90) with 4 elements 58 | InGameMenu.TAB_UV.STATISTICS[1] = 520 (number) 59 | InGameMenu.TAB_UV.STATISTICS[2] = 144 (number) 60 | InGameMenu.TAB_UV.STATISTICS[3] = 65 (number) 61 | InGameMenu.TAB_UV.STATISTICS[4] = 65 (number) 62 | InGameMenu.TAB_UV.FINANCES is a table (table: 0x01fce3a36a08) with 4 elements 63 | InGameMenu.TAB_UV.FINANCES[1] = 260 (number) 64 | InGameMenu.TAB_UV.FINANCES[2] = 144 (number) 65 | InGameMenu.TAB_UV.FINANCES[3] = 65 (number) 66 | InGameMenu.TAB_UV.FINANCES[4] = 65 (number) 67 | InGameMenu.TAB_UV.HELP is a table (table: 0x01fce3a36c20) with 4 elements 68 | InGameMenu.TAB_UV.HELP[1] = 455 (number) 69 | InGameMenu.TAB_UV.HELP[2] = 144 (number) 70 | InGameMenu.TAB_UV.HELP[3] = 65 (number) 71 | InGameMenu.TAB_UV.HELP[4] = 65 (number) 72 | 73 | ModHubScreen.TAB_UV is a table (table: 0x0268f29cb7b0) with 9 elements 74 | ModHubScreen.TAB_UV.DLCS is a table (table: 0x0268f29cba58) with 4 elements 75 | ModHubScreen.TAB_UV.DLCS[1] = 73 (number) 76 | ModHubScreen.TAB_UV.DLCS[2] = 4 (number) 77 | ModHubScreen.TAB_UV.DLCS[3] = 65 (number) 78 | ModHubScreen.TAB_UV.DLCS[4] = 65 (number) 79 | ModHubScreen.TAB_UV.UPDATES is a table (table: 0x0268f29cb9e8) with 4 elements 80 | ModHubScreen.TAB_UV.UPDATES[1] = 73 (number) 81 | ModHubScreen.TAB_UV.UPDATES[2] = 73 (number) 82 | ModHubScreen.TAB_UV.UPDATES[3] = 65 (number) 83 | ModHubScreen.TAB_UV.UPDATES[4] = 65 (number) 84 | ModHubScreen.TAB_UV.LATEST is a table (table: 0x0268f29cb910) with 4 elements 85 | ModHubScreen.TAB_UV.LATEST[1] = 280 (number) 86 | ModHubScreen.TAB_UV.LATEST[2] = 4 (number) 87 | ModHubScreen.TAB_UV.LATEST[3] = 65 (number) 88 | ModHubScreen.TAB_UV.LATEST[4] = 65 (number) 89 | ModHubScreen.TAB_UV.CATEGORIES is a table (table: 0x0268f29cb7f8) with 4 elements 90 | ModHubScreen.TAB_UV.CATEGORIES[1] = 4 (number) 91 | ModHubScreen.TAB_UV.CATEGORIES[2] = 4 (number) 92 | ModHubScreen.TAB_UV.CATEGORIES[3] = 65 (number) 93 | ModHubScreen.TAB_UV.CATEGORIES[4] = 65 (number) 94 | ModHubScreen.TAB_UV.BEST is a table (table: 0x0268f29cbc00) with 4 elements 95 | ModHubScreen.TAB_UV.BEST[1] = 142 (number) 96 | ModHubScreen.TAB_UV.BEST[2] = 4 (number) 97 | ModHubScreen.TAB_UV.BEST[3] = 65 (number) 98 | ModHubScreen.TAB_UV.BEST[4] = 65 (number) 99 | ModHubScreen.TAB_UV.CONTEST is a table (table: 0x0268f29cbce0) with 4 elements 100 | ModHubScreen.TAB_UV.CONTEST[1] = 349 (number) 101 | ModHubScreen.TAB_UV.CONTEST[2] = 4 (number) 102 | ModHubScreen.TAB_UV.CONTEST[3] = 65 (number) 103 | ModHubScreen.TAB_UV.CONTEST[4] = 65 (number) 104 | ModHubScreen.TAB_UV.MOST_DOWNLOADED is a table (table: 0x0268f29cbc70) with 4 elements 105 | ModHubScreen.TAB_UV.MOST_DOWNLOADED[1] = 211 (number) 106 | ModHubScreen.TAB_UV.MOST_DOWNLOADED[2] = 4 (number) 107 | ModHubScreen.TAB_UV.MOST_DOWNLOADED[3] = 65 (number) 108 | ModHubScreen.TAB_UV.MOST_DOWNLOADED[4] = 65 (number) 109 | ModHubScreen.TAB_UV.INSTALLED is a table (table: 0x0268f29cb8a0) with 4 elements 110 | ModHubScreen.TAB_UV.INSTALLED[1] = 142 (number) 111 | ModHubScreen.TAB_UV.INSTALLED[2] = 73 (number) 112 | ModHubScreen.TAB_UV.INSTALLED[3] = 65 (number) 113 | ModHubScreen.TAB_UV.INSTALLED[4] = 65 (number) 114 | ModHubScreen.TAB_UV.DOWNLOADS is a table (table: 0x0268f29cbb90) with 4 elements 115 | ModHubScreen.TAB_UV.DOWNLOADS[1] = 4 (number) 116 | ModHubScreen.TAB_UV.DOWNLOADS[2] = 73 (number) 117 | ModHubScreen.TAB_UV.DOWNLOADS[3] = 65 (number) 118 | ModHubScreen.TAB_UV.DOWNLOADS[4] = 65 (number) 119 | 120 | ShopMenu.TAB_UV is a table (table: 0x0268f2940788) with 8 elements 121 | ShopMenu.TAB_UV.GARAGE is a table (table: 0x0268f2940c48) with 4 elements 122 | ShopMenu.TAB_UV.GARAGE[1] = 128 (number) 123 | ShopMenu.TAB_UV.GARAGE[2] = 144 (number) 124 | ShopMenu.TAB_UV.GARAGE[3] = 65 (number) 125 | ShopMenu.TAB_UV.GARAGE[4] = 65 (number) 126 | ShopMenu.TAB_UV.TOOLS is a table (table: 0x0268f29409c0) with 4 elements 127 | ShopMenu.TAB_UV.TOOLS[1] = 715 (number) 128 | ShopMenu.TAB_UV.TOOLS[2] = 144 (number) 129 | ShopMenu.TAB_UV.TOOLS[3] = 65 (number) 130 | ShopMenu.TAB_UV.TOOLS[4] = 65 (number) 131 | ShopMenu.TAB_UV.LANDSCAPING is a table (table: 0x0268f2940bd8) with 4 elements 132 | ShopMenu.TAB_UV.LANDSCAPING[1] = 0 (number) 133 | ShopMenu.TAB_UV.LANDSCAPING[2] = 0 (number) 134 | ShopMenu.TAB_UV.LANDSCAPING[3] = 64 (number) 135 | ShopMenu.TAB_UV.LANDSCAPING[4] = 64 (number) 136 | ShopMenu.TAB_UV.ANIMALS is a table (table: 0x0268f2940878) with 4 elements 137 | ShopMenu.TAB_UV.ANIMALS[1] = 195 (number) 138 | ShopMenu.TAB_UV.ANIMALS[2] = 144 (number) 139 | ShopMenu.TAB_UV.ANIMALS[3] = 65 (number) 140 | ShopMenu.TAB_UV.ANIMALS[4] = 65 (number) 141 | ShopMenu.TAB_UV.BRANDS is a table (table: 0x0268f29408e8) with 4 elements 142 | ShopMenu.TAB_UV.BRANDS[1] = 780 (number) 143 | ShopMenu.TAB_UV.BRANDS[2] = 144 (number) 144 | ShopMenu.TAB_UV.BRANDS[3] = 65 (number) 145 | ShopMenu.TAB_UV.BRANDS[4] = 65 (number) 146 | ShopMenu.TAB_UV.OBJECTS is a table (table: 0x0268f2940a30) with 4 elements 147 | ShopMenu.TAB_UV.OBJECTS[1] = 650 (number) 148 | ShopMenu.TAB_UV.OBJECTS[2] = 144 (number) 149 | ShopMenu.TAB_UV.OBJECTS[3] = 65 (number) 150 | ShopMenu.TAB_UV.OBJECTS[4] = 65 (number) 151 | ShopMenu.TAB_UV.PLACEABLES is a table (table: 0x0268f2940b68) with 4 elements 152 | ShopMenu.TAB_UV.PLACEABLES[1] = 585 (number) 153 | ShopMenu.TAB_UV.PLACEABLES[2] = 144 (number) 154 | ShopMenu.TAB_UV.PLACEABLES[3] = 65 (number) 155 | ShopMenu.TAB_UV.PLACEABLES[4] = 65 (number) 156 | ShopMenu.TAB_UV.VEHICLES is a table (table: 0x0268f29407d0) with 4 elements 157 | ShopMenu.TAB_UV.VEHICLES[1] = 130 (number) 158 | ShopMenu.TAB_UV.VEHICLES[2] = 144 (number) 159 | ShopMenu.TAB_UV.VEHICLES[3] = 65 (number) 160 | ShopMenu.TAB_UV.VEHICLES[4] = 65 (number) 161 | 162 | -------------------------------------------------------------------------------- /Documents/torqueCurveX.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/Documents/torqueCurveX.xlsx -------------------------------------------------------------------------------- /FS19_VehicleControlAddon.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/FS19_VehicleControlAddon.zip -------------------------------------------------------------------------------- /FS19_VehicleControlAddon/GPS_off.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/FS19_VehicleControlAddon/GPS_off.ogg -------------------------------------------------------------------------------- /FS19_VehicleControlAddon/GPS_on.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/FS19_VehicleControlAddon/GPS_on.ogg -------------------------------------------------------------------------------- /FS19_VehicleControlAddon/arrow_down_gray.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/FS19_VehicleControlAddon/arrow_down_gray.dds -------------------------------------------------------------------------------- /FS19_VehicleControlAddon/arrow_down_white.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/FS19_VehicleControlAddon/arrow_down_white.dds -------------------------------------------------------------------------------- /FS19_VehicleControlAddon/arrow_up_gray.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/FS19_VehicleControlAddon/arrow_up_gray.dds -------------------------------------------------------------------------------- /FS19_VehicleControlAddon/arrow_up_white.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/FS19_VehicleControlAddon/arrow_up_white.dds -------------------------------------------------------------------------------- /FS19_VehicleControlAddon/auto_hold.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/FS19_VehicleControlAddon/auto_hold.dds -------------------------------------------------------------------------------- /FS19_VehicleControlAddon/auto_hold_down.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/FS19_VehicleControlAddon/auto_hold_down.dds -------------------------------------------------------------------------------- /FS19_VehicleControlAddon/auto_hold_up.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/FS19_VehicleControlAddon/auto_hold_up.dds -------------------------------------------------------------------------------- /FS19_VehicleControlAddon/blowOffVentil.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/FS19_VehicleControlAddon/blowOffVentil.ogg -------------------------------------------------------------------------------- /FS19_VehicleControlAddon/diff_back.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/FS19_VehicleControlAddon/diff_back.dds -------------------------------------------------------------------------------- /FS19_VehicleControlAddon/diff_front.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/FS19_VehicleControlAddon/diff_front.dds -------------------------------------------------------------------------------- /FS19_VehicleControlAddon/diff_middle.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/FS19_VehicleControlAddon/diff_middle.dds -------------------------------------------------------------------------------- /FS19_VehicleControlAddon/diff_wheels.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/FS19_VehicleControlAddon/diff_wheels.dds -------------------------------------------------------------------------------- /FS19_VehicleControlAddon/grinding.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/FS19_VehicleControlAddon/grinding.ogg -------------------------------------------------------------------------------- /FS19_VehicleControlAddon/gui/guiProfiles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | -------------------------------------------------------------------------------- /FS19_VehicleControlAddon/gui/icons.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/FS19_VehicleControlAddon/gui/icons.dds -------------------------------------------------------------------------------- /FS19_VehicleControlAddon/gui/vehicleControlAddonDialog1.lua: -------------------------------------------------------------------------------- 1 | VehicleControlAddonDialog1 = {} 2 | 3 | VehicleControlAddonDialog1.CONTROLS = { 4 | "title", 5 | "presets", 6 | } 7 | 8 | local VehicleControlAddonDialog1_mt = Class(VehicleControlAddonDialog1, DialogElement) 9 | 10 | function VehicleControlAddonDialog1:new(target, custom_mt) 11 | local self = DialogElement:new(target, custom_mt or VehicleControlAddonDialog1_mt) 12 | 13 | self:registerControls(VehicleControlAddonDialog1.CONTROLS) 14 | 15 | self.vcaCallback = NO_CALLBACK 16 | 17 | return self 18 | end 19 | 20 | function VehicleControlAddonDialog1:onClickOk(...) 21 | self.vcaCallback( self.presets:getState() ) 22 | self:close() 23 | return false -- event used 24 | end 25 | 26 | function VehicleControlAddonDialog1:setTitle( title ) 27 | self.title:setText( title ) 28 | end 29 | 30 | function VehicleControlAddonDialog1:setCallback( func ) 31 | self.vcaCallback = func 32 | 33 | local texts = {} 34 | for i,preset in pairs( vehicleControlAddonTransmissionBase.ownTransPresets ) do 35 | texts[i] = string.format( "%d: ", preset.index )..preset.name 36 | end 37 | 38 | self.presets:setTexts( texts ) 39 | end -------------------------------------------------------------------------------- /FS19_VehicleControlAddon/gui/vehicleControlAddonDialog1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /FS19_VehicleControlAddon/gui/vehicleControlAddonDialog2.lua: -------------------------------------------------------------------------------- 1 | VehicleControlAddonDialog2 = {} 2 | 3 | VehicleControlAddonDialog2.CONTROLS = { 4 | "title", 5 | "input", 6 | } 7 | 8 | local VehicleControlAddonDialog2_mt = Class(VehicleControlAddonDialog2, DialogElement) 9 | 10 | function VehicleControlAddonDialog2:new(target, custom_mt) 11 | local self = DialogElement:new(target, custom_mt or VehicleControlAddonDialog2_mt) 12 | 13 | self:registerControls(VehicleControlAddonDialog2.CONTROLS) 14 | 15 | self.vcaCallback = NO_CALLBACK 16 | 17 | return self 18 | end 19 | 20 | function VehicleControlAddonDialog2:onClickOk(...) 21 | self.vcaCallback( self.input:getText() ) 22 | self:close() 23 | return false -- event used 24 | end 25 | 26 | function VehicleControlAddonDialog2:setTitle( title ) 27 | self.title:setText( title ) 28 | end 29 | function VehicleControlAddonDialog2:setText( text ) 30 | self.input:setText( text ) 31 | end 32 | function VehicleControlAddonDialog2:setCallback( func ) 33 | self.vcaCallback = func 34 | end -------------------------------------------------------------------------------- /FS19_VehicleControlAddon/gui/vehicleControlAddonDialog2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /FS19_VehicleControlAddon/gui/vehicleControlAddonFrame1.lua: -------------------------------------------------------------------------------- 1 | VehicleControlAddonFrame1 = {} 2 | 3 | local VehicleControlAddonFrame1_mt = Class(VehicleControlAddonFrame1, VehicleControlAddonFrame) 4 | 5 | VehicleControlAddonFrame1.CONTROLS = { 6 | VCACAMROTINSIDE = "vcaCamRotInside", 7 | -- = "", 8 | -- = "", 9 | -- = "", 10 | -- = "", 11 | -- = "", 12 | -- = "", 13 | -- = "", 14 | -- = "", 15 | -- = "", 16 | -- = "", 17 | -- = "", 18 | -- = "", 19 | -- = "", 20 | } 21 | 22 | function VehicleControlAddonFrame1:new(menu) 23 | local self = VehicleControlAddonFrame:new(menu, VehicleControlAddonFrame1.CONTROLS, nil, VehicleControlAddonFrame1_mt) 24 | return self 25 | end 26 | 27 | function VehicleControlAddonFrame1:vcaUpdateMenuButtons() 28 | table.insert(self.menuButtonInfo, { inputAction = InputAction.MENU_EXTRA_2, 29 | text = g_i18n:getText( "vcaButtonSnapWidth" ), 30 | callback = self:vcaMakeCallback( VehicleControlAddonFrame1.onClickMagic ) } ) 31 | table.insert(self.menuButtonInfo, { inputAction = InputAction.MENU_EXTRA_1, 32 | text = g_i18n:getText( "vcaButtonSnapOffset" ), 33 | callback = self:vcaMakeCallback( VehicleControlAddonFrame1.onClickSwap ) } ) 34 | end 35 | 36 | function VehicleControlAddonFrame1:onClickMagic( vehicle ) 37 | local d, o, p = vehicle:vcaGetSnapDistance() 38 | vehicle:vcaSetState( "vcaSnapDistance", d ) 39 | vehicle:vcaSetState( "vcaSnapOffset1", o ) 40 | vehicle:vcaSetState( "vcaSnapOffset2", p ) 41 | 42 | self.vcaElements.vcaSnapDistance.element:setText( vehicleControlAddon.vcaUIGetvcaSnapDistance( vehicle ) ) 43 | self.vcaElements.vcaSnapOffset1.element:setText( vehicleControlAddon.vcaUIGetvcaSnapOffset1( vehicle ) ) 44 | self.vcaElements.vcaSnapOffset2.element:setText( vehicleControlAddon.vcaUIGetvcaSnapOffset2( vehicle ) ) 45 | end 46 | 47 | function VehicleControlAddonFrame1:onClickSwap( vehicle ) 48 | local o, p = vehicle.vcaSnapOffset2, vehicle.vcaSnapOffset1 49 | vehicle:vcaSetState( "vcaSnapOffset1", o ) 50 | vehicle:vcaSetState( "vcaSnapOffset2", p ) 51 | 52 | self.vcaElements.vcaSnapDistance.element:setText( vehicleControlAddon.vcaUIGetvcaSnapDistance( vehicle ) ) 53 | self.vcaElements.vcaSnapOffset1.element:setText( vehicleControlAddon.vcaUIGetvcaSnapOffset1( vehicle ) ) 54 | self.vcaElements.vcaSnapOffset2.element:setText( vehicleControlAddon.vcaUIGetvcaSnapOffset2( vehicle ) ) 55 | end -------------------------------------------------------------------------------- /FS19_VehicleControlAddon/gui/vehicleControlAddonFrame1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 125 | 126 | 127 | 128 | 131 | 132 | 133 | 134 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | -------------------------------------------------------------------------------- /FS19_VehicleControlAddon/gui/vehicleControlAddonFrame2.lua: -------------------------------------------------------------------------------- 1 | VehicleControlAddonFrame2 = {} 2 | 3 | local VehicleControlAddonFrame2_mt = Class(VehicleControlAddonFrame2, VehicleControlAddonFrame) 4 | 5 | VehicleControlAddonFrame2.CONTROLS = { 6 | CONTAINER = "container", 7 | } 8 | 9 | function VehicleControlAddonFrame2:new(menu) 10 | local self = VehicleControlAddonFrame:new(menu, VehicleControlAddonFrame2.CONTROLS, nil, VehicleControlAddonFrame2_mt) 11 | return self 12 | end -------------------------------------------------------------------------------- /FS19_VehicleControlAddon/gui/vehicleControlAddonFrame2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | -------------------------------------------------------------------------------- /FS19_VehicleControlAddon/gui/vehicleControlAddonFrame3.lua: -------------------------------------------------------------------------------- 1 | 2 | VehicleControlAddonFrame3 = {} 3 | 4 | local VehicleControlAddonFrame3_mt = Class(VehicleControlAddonFrame3, VehicleControlAddonFrame) 5 | 6 | VehicleControlAddonFrame3.CONTROLS = { 7 | CONTAINER = "container" 8 | } 9 | 10 | function VehicleControlAddonFrame3:new(menu) 11 | local self = VehicleControlAddonFrame:new(menu, VehicleControlAddonFrame3.CONTROLS, nil, VehicleControlAddonFrame3_mt) 12 | return self 13 | end -------------------------------------------------------------------------------- /FS19_VehicleControlAddon/gui/vehicleControlAddonFrame3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 31 | 32 | 33 | 34 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | -------------------------------------------------------------------------------- /FS19_VehicleControlAddon/gui/vehicleControlAddonFrame4.lua: -------------------------------------------------------------------------------- 1 | VehicleControlAddonFrame4 = {} 2 | 3 | local VehicleControlAddonFrame4_mt = Class(VehicleControlAddonFrame4, VehicleControlAddonFrame) 4 | 5 | VehicleControlAddonFrame4.CONTROLS = { 6 | CONTAINER = "container" 7 | } 8 | 9 | function VehicleControlAddonFrame4:new(menu) 10 | local self = VehicleControlAddonFrame:new(menu, VehicleControlAddonFrame4.CONTROLS, nil, VehicleControlAddonFrame4_mt) 11 | self.vcaBackup = {} 12 | for n,v in pairs( VCAGlobals ) do 13 | self.vcaBackup[n] = v 14 | end 15 | return self 16 | end 17 | 18 | function VehicleControlAddonFrame4:vcaGetValues( force ) 19 | if self.vcaState.vcaGetValues then 20 | return 21 | end 22 | if not ( force or self.vcaIsDirty ) then 23 | return 24 | end 25 | 26 | if force then 27 | local x = g_currentMission.inGameMenu.hud.speedMeter.gaugeCenterX 28 | local y = g_currentMission.inGameMenu.hud.speedMeter.gaugeCenterY + g_currentMission.inGameMenu.hud.speedMeter.fuelGaugeRadiusY * 1.6 29 | local l = getCorrectTextSize(0.02) 30 | y = y + l * 1.2 31 | self.vcaSnapAngleHudX = x 32 | self.vcaSnapAngleHudY = y 33 | 34 | self.vcaTexts = {} 35 | 36 | if VCAGlobals.snapAngleHudX >= 0 then 37 | x = VCAGlobals.snapAngleHudX 38 | end 39 | if VCAGlobals.snapAngleHudY >= 0 then 40 | y = VCAGlobals.snapAngleHudY 41 | end 42 | self.vcaTexts.snapAngleHudX = string.format( "%d", math.floor( x * g_screenWidth ) ) 43 | self.vcaTexts.snapAngleHudY = string.format( "%d", math.floor( y * g_screenHeight ) ) 44 | end 45 | 46 | self.vcaState.vcaGetValues = true 47 | 48 | local vehicle = g_currentMission.controlledVehicle 49 | 50 | if force then 51 | for n,v in pairs( VCAGlobals ) do 52 | self.vcaBackup[n] = v 53 | end 54 | end 55 | 56 | for name,s in pairs( self.vcaElements ) do 57 | local element = s.element 58 | if name:sub(1,4) == "VCA_" then 59 | local n = name:sub(5) 60 | --if force then print(n..': '..tostring(VCAGlobals[n])) end 61 | if VCADefaults[n] ~= nil then 62 | local v = VCAGlobals[n] 63 | if n == "transmission" then 64 | if force and vehicle ~= nil then 65 | element:setTexts( vehicle.vcaUI.vcaTransmission ) 66 | end 67 | element:setState( v + 1 ) 68 | elseif n == "hiredWorker" then 69 | if force and vehicle ~= nil then 70 | element:setTexts( vehicle.vcaUI.vcaHiredWorker ) 71 | end 72 | element:setState( v + 1 ) 73 | elseif n == "g27Mode" then 74 | if force and vehicle ~= nil then 75 | element:setTexts( vehicle.vcaUI.vcaG27Mode ) 76 | end 77 | element:setState( v + 1 ) 78 | elseif n == "brakeForceFactor" then 79 | element:setState( math.floor( v * 20 + 0.5 ) + 1 ) 80 | elseif element.typeName == "textInput" and not ( element.isCapturingInput ) then 81 | element:setText( self.vcaTexts[n] ) 82 | elseif VCADefaults[n].tp == "bool" then 83 | element:setIsChecked( v ) 84 | end 85 | end 86 | end 87 | end 88 | 89 | self.vcaState.vcaGetValues = false 90 | 91 | self.vcaIsDirty = false 92 | end 93 | 94 | function VehicleControlAddonFrame4:vcaSetValues( force ) 95 | if self.menu == nil then 96 | print("VCA Frame: no menu") 97 | return 98 | end 99 | if not ( self.menu.vcaInputEnabled ) then 100 | --print("VCA Frame not yet input enabled") 101 | return 102 | end 103 | if self.vcaState.vcaSetValues then 104 | return 105 | end 106 | 107 | self.vcaState.vcaSetValues = true 108 | 109 | local isDirty = false 110 | for name,s in pairs( self.vcaElements ) do 111 | local element = s.element 112 | if name:sub(1,4) == "VCA_" then 113 | local n = name:sub(5) 114 | local v = nil 115 | if VCADefaults[n] ~= nil then 116 | if n == "transmission" then 117 | v = element:getState() - 1 118 | elseif n == "hiredWorker" then 119 | v = element:getState() - 1 120 | elseif n == "g27Mode" then 121 | v = element:getState() - 1 122 | elseif n == "brakeForceFactor" then 123 | v = 0.05 * ( element:getState() - 1 ) 124 | elseif VCADefaults[n].tp == "bool" then 125 | v = element:getIsChecked() 126 | end 127 | if v ~= nil then 128 | VCAGlobals[n] = v 129 | if v ~= VCADefaults[n].v then 130 | isDirty = true 131 | end 132 | end 133 | end 134 | end 135 | end 136 | 137 | local isDirty2 = false 138 | if force then 139 | for n,v in pairs( VCAGlobals ) do 140 | if not vehicleControlAddon.mbCompare( self.vcaBackup[n], v ) then 141 | --print( n..': "'..tostring( self.vcaBackup[n] )..'" ~= "'..tostring( v )..'"' ) 142 | isDirty2 = true 143 | end 144 | end 145 | end 146 | if isDirty2 and ( isDirty or fileExists( vehicleControlAddon._globals_.fileUsr ) ) then 147 | vehicleControlAddon.globalsCreateNew() 148 | end 149 | 150 | self.vcaState.vcaSetValues = false 151 | end 152 | 153 | function VehicleControlAddonFrame4:vcaOnEnterPressed( element ) 154 | self:vcaOnTextChanged( element, element:getText() ) 155 | end 156 | 157 | function VehicleControlAddonFrame4:vcaOnTextChanged( element, text ) 158 | if self.vcaState.vcaOnTextChanged or self.vcaState.vcaGetValues then 159 | return 160 | end 161 | 162 | if element == nil then 163 | print("Invalid element: ") 164 | return 165 | end 166 | 167 | if element.id == nil or element.typeName == nil or element.typeName ~= "textInput" then 168 | print("Invalid element: '"..tostring(element.id).."'") 169 | return 170 | end 171 | 172 | self.vcaState.vcaOnTextChanged = true 173 | 174 | if element.id:sub(1,4) ~= "VCA_" then 175 | print("Invalid element: '"..tostring(element.id).."'") 176 | return 177 | end 178 | local name = element.id:sub(5) 179 | 180 | local n = tonumber( text ) 181 | 182 | if name == "snapAngleHudX" then 183 | if n ~= nil and n >= 0 then 184 | x = n / g_screenWidth 185 | if math.abs( self.vcaSnapAngleHudX - x ) * g_screenWidth < 1 then 186 | VCAGlobals.snapAngleHudX = -1 187 | x = self.vcaSnapAngleHudX 188 | else 189 | VCAGlobals.snapAngleHudX = x 190 | end 191 | else 192 | VCAGlobals.snapAngleHudX = -1 193 | x = self.vcaSnapAngleHudX 194 | end 195 | self.vcaTexts.snapAngleHudX = string.format( "%d", math.floor( x * g_screenWidth ) ) 196 | elseif name == "snapAngleHudY" then 197 | if n ~= nil and n >= 0 then 198 | y = n / g_screenHeight 199 | if math.abs( self.vcaSnapAngleHudY - y ) * g_screenHeight < 1 then 200 | VCAGlobals.snapAngleHudY = -1 201 | y = self.vcaSnapAngleHudY 202 | else 203 | VCAGlobals.snapAngleHudY = y 204 | end 205 | else 206 | VCAGlobals.snapAngleHudY = -1 207 | y = self.vcaSnapAngleHudY 208 | end 209 | self.vcaTexts.snapAngleHudY = string.format( "%d", math.floor( y * g_screenHeight ) ) 210 | end 211 | 212 | element:setText( self.vcaTexts[name] ) 213 | 214 | self.vcaIsDirty = true 215 | self.vcaState.vcaOnTextChanged = false 216 | end 217 | -------------------------------------------------------------------------------- /FS19_VehicleControlAddon/gui/vehicleControlAddonFrame4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | -------------------------------------------------------------------------------- /FS19_VehicleControlAddon/gui/vehicleControlAddonFrame5.lua: -------------------------------------------------------------------------------- 1 | VehicleControlAddonFrame5 = {} 2 | 3 | local VehicleControlAddonFrame5_mt = Class(VehicleControlAddonFrame5, VehicleControlAddonFrame) 4 | 5 | VehicleControlAddonFrame5.CONTROLS = { 6 | CONTAINER = "container" 7 | } 8 | 9 | function VehicleControlAddonFrame5:new(menu) 10 | local self = VehicleControlAddonFrame:new(menu, VehicleControlAddonFrame5.CONTROLS, nil, VehicleControlAddonFrame5_mt) 11 | return self 12 | end 13 | 14 | function VehicleControlAddonFrame5:onFrameOpen() 15 | VehicleControlAddonFrame5:superClass().onFrameOpen(self) 16 | 17 | if vehicleControlAddonTransmissionBase.ownTransPresets == nil then 18 | vehicleControlAddonTransmissionBase.loadOwnTransPresets() 19 | self:updateMenuButtons() 20 | end 21 | end 22 | 23 | function VehicleControlAddonFrame5:vcaUpdateMenuButtons() 24 | if vehicleControlAddonTransmissionBase.ownTransPresets ~= nil then 25 | if #vehicleControlAddonTransmissionBase.ownTransPresets > 0 then 26 | table.insert(self.menuButtonInfo, { inputAction = InputAction.MENU_ACCEPT, 27 | text = g_i18n:getText( "vcaButtonLoadPreset" ), 28 | callback = self:vcaMakeCallback( VehicleControlAddonFrame5.onClickLoad ) } ) 29 | table.insert(self.menuButtonInfo, { inputAction = InputAction.MENU_ACTIVATE, 30 | text = g_i18n:getText( "vcaButtonDelPreset" ), 31 | callback = self:vcaMakeCallback( VehicleControlAddonFrame5.onClickDelete ) } ) 32 | end 33 | 34 | if vehicleControlAddonTransmissionBase.ownTransPresetNextID < 100 then 35 | table.insert(self.menuButtonInfo, { inputAction = InputAction.MENU_EXTRA_2, 36 | text = g_i18n:getText( "vcaButtonSavePreset" ), 37 | callback = self:vcaMakeCallback( VehicleControlAddonFrame5.onClickSave ) } ) 38 | end 39 | end 40 | 41 | table.insert(self.menuButtonInfo, { inputAction = InputAction.MENU_EXTRA_1, 42 | text = g_i18n:getText( "vcaGEARRGMODE" ), 43 | callback = self:vcaMakeCallback( VehicleControlAddonFrame5.onClickSwap ) } ) 44 | end 45 | 46 | function VehicleControlAddonFrame5:onClickLoad( vehicle ) 47 | local dialog = g_gui:showDialog("vehicleControlAddonDialog1") 48 | if dialog ~= nil then 49 | dialog.target:setTitle( g_i18n:getText( "vcaButtonLoadPreset" ) ) 50 | dialog.target:setCallback( function(...) self:onClickLoadOK( vehicle, ... ) end ) 51 | end 52 | end 53 | 54 | function VehicleControlAddonFrame5:onClickLoadOK( vehicle, state ) 55 | 56 | local preset = vehicleControlAddonTransmissionBase.ownTransPresets[state] 57 | 58 | if preset == nil then return end 59 | 60 | vehicle:vcaSetState( "vcaMaxSpeed" , preset.maxSpeed ) 61 | vehicle:vcaSetState( "vcaOwnGearFactor" , preset.gearFactor ) 62 | vehicle:vcaSetState( "vcaOwnRangeFactor", preset.rangeFactor ) 63 | vehicle:vcaSetState( "vcaOwnRange1st1st", preset.range1st1st ) 64 | vehicle:vcaSetState( "vcaOwnGears" , preset.gears ) 65 | vehicle:vcaSetState( "vcaOwnRanges" , preset.ranges ) 66 | vehicle:vcaSetState( "vcaOwnGearTime" , preset.gearTime ) 67 | vehicle:vcaSetState( "vcaOwnRangeTime" , preset.rangeTime ) 68 | vehicle:vcaSetState( "vcaOwnAutoGears" , preset.autoGears ) 69 | vehicle:vcaSetState( "vcaOwnAutoRange" , preset.autoRange ) 70 | vehicle:vcaSetState( "vcaOwnSplitG27" , preset.splitG27 ) 71 | vehicle:vcaSetState( "vcaOwnRevRatio" , preset.revRatio ) 72 | vehicle:vcaSetState( "vcaClutchMode" , preset.clutchMode ) 73 | vehicle:vcaSetState( "vcaG27Mode" , preset.g27Mode ) 74 | vehicle:vcaSetState( "vcaOwnRevGears" , preset.revGears ) 75 | vehicle:vcaSetState( "vcaOwnRevRange" , preset.revRange ) 76 | 77 | self:vcaGetValues( true ) 78 | end 79 | 80 | function VehicleControlAddonFrame5:onClickDelete( vehicle ) 81 | local dialog = g_gui:showDialog("vehicleControlAddonDialog1") 82 | if dialog ~= nil then 83 | dialog.target:setTitle( g_i18n:getText( "vcaButtonDelPreset" ) ) 84 | dialog.target:setCallback( function(...) self:onClickDeleteOk( vehicle, ... ) end ) 85 | end 86 | end 87 | 88 | function VehicleControlAddonFrame5:onClickDeleteOk( vehicle, state ) 89 | 90 | local preset = vehicleControlAddonTransmissionBase.ownTransPresets[state] 91 | 92 | if preset ~= nil then 93 | vehicleControlAddonTransmissionBase.ownTransPresets[state] = nil 94 | vehicleControlAddonTransmissionBase.deleteOwnTransPreset( state ) 95 | if state < vehicleControlAddonTransmissionBase.ownTransPresetNextID then 96 | vehicleControlAddonTransmissionBase.ownTransPresetNextID = state 97 | end 98 | end 99 | 100 | self:updateMenuButtons() 101 | end 102 | 103 | function VehicleControlAddonFrame5:onClickSave( vehicle ) 104 | local dialog = g_gui:showDialog("vehicleControlAddonDialog2") 105 | if dialog ~= nil then 106 | dialog.target:setTitle( g_i18n:getText( "vcaButtonSavePreset" ) ) 107 | dialog.target:setText( "own "..tostring(vehicleControlAddonTransmissionBase.ownTransPresetNextID) ) 108 | dialog.target:setCallback( function(...) self:onClickSaveOk( vehicle, ... ) end ) 109 | end 110 | end 111 | 112 | function VehicleControlAddonFrame5:onClickSaveOk( vehicle, text ) 113 | vehicleControlAddonTransmissionBase.saveOwnTransPreset( nil 114 | , text 115 | , vehicle.vcaMaxSpeed 116 | , vehicle.vcaOwnGearFactor 117 | , vehicle.vcaOwnRangeFactor 118 | , vehicle.vcaOwnRange1st1st 119 | , vehicle.vcaOwnGears 120 | , vehicle.vcaOwnRanges 121 | , vehicle.vcaOwnGearTime 122 | , vehicle.vcaOwnRangeTime 123 | , vehicle.vcaOwnAutoGears 124 | , vehicle.vcaOwnAutoRange 125 | , vehicle.vcaOwnSplitG27 126 | , vehicle.vcaOwnRevRatio 127 | , vehicle.vcaClutchMode 128 | , vehicle.vcaG27Mode 129 | , vehicle.vcaOwnRevGears 130 | , vehicle.vcaOwnRevRange ) 131 | 132 | self:updateMenuButtons() 133 | end 134 | 135 | function VehicleControlAddonFrame5:onClickSwap( vehicle ) 136 | 137 | local g = vehicleControlAddon.mbClamp( vehicle.vcaOwnGearFactor, 0.001, 0.99 ) ^ ( 1 / math.max( 1, vehicle.vcaOwnGears - 1 ) ) 138 | local r = vehicleControlAddon.mbClamp( vehicle.vcaOwnRangeFactor, 0.001, 0.99 ) 139 | 140 | vehicle:vcaSetState( "vcaOwnRangeFactor", g ) 141 | vehicle:vcaSetState( "vcaOwnGearFactor", r ^ math.max( 1, vehicle.vcaOwnRanges - 1 ) ) 142 | 143 | g = vehicle.vcaOwnGears 144 | r = vehicle.vcaOwnRanges 145 | vehicle:vcaSetState( "vcaOwnRanges", g ) 146 | vehicle:vcaSetState( "vcaOwnGears", r ) 147 | 148 | g = vehicle.vcaOwnGearTime 149 | r = vehicle.vcaOwnRangeTime 150 | vehicle:vcaSetState( "vcaOwnRangeTime", g ) 151 | vehicle:vcaSetState( "vcaOwnGearTime", r ) 152 | 153 | g = vehicle.vcaOwnAutoGears 154 | r = vehicle.vcaOwnAutoRange 155 | vehicle:vcaSetState( "vcaOwnAutoRange", g ) 156 | vehicle:vcaSetState( "vcaOwnAutoGears", r ) 157 | 158 | g = vehicle.vcaOwnRevGears 159 | r = vehicle.vcaOwnRevRange 160 | vehicle:vcaSetState( "vcaOwnRevRange", g ) 161 | vehicle:vcaSetState( "vcaOwnRevGears", r ) 162 | 163 | self:vcaGetValues( true ) 164 | end -------------------------------------------------------------------------------- /FS19_VehicleControlAddon/gui/vehicleControlAddonFrame5.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 22 | 23 | 24 | 25 | 28 | 29 | 30 | 31 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 54 | 55 | 56 | 57 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 79 | 80 | 81 | 82 | 85 | 86 | 87 | 88 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 111 | 112 | 113 | 114 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | -------------------------------------------------------------------------------- /FS19_VehicleControlAddon/gui/vehicleControlAddonFrame6.lua: -------------------------------------------------------------------------------- 1 | VehicleControlAddonFrame6 = {} 2 | 3 | local VehicleControlAddonFrame6_mt = Class(VehicleControlAddonFrame6, VehicleControlAddonFrame) 4 | 5 | VehicleControlAddonFrame6.CONTROLS = { 6 | CONTAINER = "container" 7 | } 8 | 9 | function VehicleControlAddonFrame6:new(menu) 10 | local self = VehicleControlAddonFrame:new(menu, VehicleControlAddonFrame6.CONTROLS, nil, VehicleControlAddonFrame6_mt) 11 | return self 12 | end -------------------------------------------------------------------------------- /FS19_VehicleControlAddon/gui/vehicleControlAddonFrame6.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 64 | 65 | 66 | 69 | 70 | 71 | 72 | 75 | 76 | 77 | 78 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /FS19_VehicleControlAddon/gui/vehicleControlAddonMenu.lua: -------------------------------------------------------------------------------- 1 | 2 | VehicleControlAddonMenu = {} 3 | 4 | local VehicleControlAddonMenu_mt = Class(VehicleControlAddonMenu, TabbedMenu) 5 | 6 | --- Page tab UV coordinates for display elements. 7 | VehicleControlAddonMenu.TAB_UV = { 8 | SETTINGS = { 0, 209, 65, 65 }, 9 | GENERAL = {844, 144, 65, 65}, 10 | ENVIRONMENT = {65, 209, 65, 65}, 11 | PLAYER = {454, 209, 65, 65}, 12 | FIELD = {432, 96, 48, 48}, 13 | VEHICLES = {130, 144, 65, 65}, 14 | USERS = {910, 144, 65, 65}, 15 | GLOBAL = {0, 144, 65, 65}, 16 | } 17 | 18 | VehicleControlAddonMenu.CONTROLS = { 19 | BACKGROUND = "inGameBackgroundElement", 20 | FRAME1 = "vcaFrame1", 21 | FRAME2 = "vcaFrame2", 22 | FRAME3 = "vcaFrame3", 23 | FRAME4 = "vcaFrame4", 24 | FRAME5 = "vcaFrame5", 25 | FRAME6 = "vcaFrame6", 26 | } 27 | 28 | local alwaysVisiblePredicate = function() return true end 29 | local frame3VisiblePredicate = function() 30 | if g_currentMission.controlledVehicle == nil or g_currentMission.controlledVehicle.rmtIsOn then 31 | return false 32 | end 33 | return true 34 | end 35 | local frame4VisiblePredicate = function() 36 | if g_vehicleControlAddon.isMP then 37 | return g_currentMission.isMasterUser 38 | end 39 | return g_server ~= nil 40 | end 41 | local frame5VisiblePredicate = function() 42 | return g_currentMission.controlledVehicle.vcaTransmission == vehicleControlAddonTransmissionBase.ownTransmission 43 | end 44 | 45 | VehicleControlAddonMenu.FRAMES = { 46 | { name = "vcaFrame1", iconUVs = {0,0,65,65}, predicate=alwaysVisiblePredicate, uiFilename=Utils.getFilename("gui/icons.dds",g_currentModDirectory) }, 47 | { name = "vcaFrame2", iconUVs = {66,0,65,65}, predicate=alwaysVisiblePredicate, uiFilename=Utils.getFilename("gui/icons.dds",g_currentModDirectory) }, 48 | { name = "vcaFrame3", iconUVs = {132,0,65,65},predicate=frame3VisiblePredicate, uiFilename=Utils.getFilename("gui/icons.dds",g_currentModDirectory) }, 49 | { name = "vcaFrame6", iconUVs = {200,0,65,65},predicate=alwaysVisiblePredicate, uiFilename=Utils.getFilename("gui/icons.dds",g_currentModDirectory) }, 50 | { name = "vcaFrame4", iconUVs = VehicleControlAddonMenu.TAB_UV.GLOBAL, predicate=frame4VisiblePredicate }, 51 | { name = "vcaFrame5", iconUVs = VehicleControlAddonMenu.TAB_UV.PLAYER }, 52 | } 53 | 54 | VehicleControlAddonMenu.L10N_SYMBOL = { 55 | BUTTON_BACK = "button_back", 56 | } 57 | 58 | function VehicleControlAddonMenu:new(messageCenter, i18n, inputManager) 59 | local self = TabbedMenu:new(nil, VehicleControlAddonMenu_mt, messageCenter, i18n, inputManager) 60 | self:registerControls(VehicleControlAddonMenu.CONTROLS) 61 | self.vcaInactiveFrames = {} 62 | return self 63 | end 64 | 65 | function VehicleControlAddonMenu:vcaSetIsFrameVisible( name, visible ) 66 | self.vcaInactiveFrames[name] = not visible 67 | end 68 | 69 | function VehicleControlAddonMenu:vcaGetIsFrameVisible( name ) 70 | if self.vcaInactiveFrames[name] then 71 | return false 72 | end 73 | return true 74 | end 75 | 76 | function VehicleControlAddonMenu:onGuiSetupFinished() 77 | VehicleControlAddonMenu:superClass().onGuiSetupFinished(self) 78 | 79 | self.clickBackCallback = self:makeSelfCallback(self.onButtonBack) 80 | 81 | 82 | for i,f in pairs(VehicleControlAddonMenu.FRAMES) do 83 | if f.name ~= nil and type( self[f.name] ) == "table" and type( self[f.name].initialize ) == "function" then 84 | local frame = self[f.name] 85 | frame:initialize() 86 | local predicate = f.predicate 87 | if predicate == nil then 88 | predicate = function() return self:vcaGetIsFrameVisible( f.name ) end 89 | end 90 | self:registerPage( frame, i, Utils.getNoNil( f.predicate, predicate ) ) 91 | self:addPageTab( frame, Utils.getNoNil( f.uiFilename, g_baseUIFilename), getNormalizedUVs( f.iconUVs ) ) 92 | else 93 | print("ERROR: "..tostring(f.name).."; "..type( self[f.name] ) == "table") 94 | end 95 | end 96 | end 97 | 98 | function VehicleControlAddonMenu:onMenuOpened() 99 | VehicleControlAddonMenu:superClass().onMenuOpened(self) 100 | 101 | self:updatePages() 102 | 103 | self.vcaInputEnabled = true 104 | end 105 | 106 | 107 | function VehicleControlAddonMenu:onClose() 108 | VehicleControlAddonMenu:superClass().onClose(self) 109 | 110 | self.vcaInputEnabled = false 111 | end 112 | 113 | function VehicleControlAddonMenu:setupMenuButtonInfo() 114 | VehicleControlAddonMenu:superClass().setupMenuButtonInfo(self) 115 | 116 | self.defaultMenuButtonInfo = {{ inputAction = InputAction.MENU_BACK, 117 | text = self.l10n:getText(VehicleControlAddonMenu.L10N_SYMBOL.BUTTON_BACK), 118 | callback = self.clickBackCallback }, 119 | } 120 | 121 | self.defaultMenuButtonInfoByActions[InputAction.MENU_BACK] = self.defaultMenuButtonInfo[1] 122 | 123 | self.defaultButtonActionCallbacks = { [InputAction.MENU_BACK] = self.clickBackCallback } 124 | end 125 | 126 | function VehicleControlAddonMenu:setShowOwnTransmission( enabled ) 127 | if not type( enabled ) == "number" then return end 128 | 129 | local b1 = self:vcaGetIsFrameVisible( "vcaFrame5" ) 130 | 131 | self:vcaSetIsFrameVisible( "vcaFrame5", enabled ) 132 | 133 | local b2 = self:vcaGetIsFrameVisible( "vcaFrame5" ) 134 | 135 | if ( b1 ~= b2 or b3 ~= b4 ) and self.vcaInputEnabled then 136 | self:updatePages() 137 | end 138 | end 139 | 140 | function VehicleControlAddonMenu:onPageChange(pageIndex, pageMappingIndex, element, skipTabVisualUpdate) 141 | local f = VehicleControlAddonMenu:superClass().onPageChange 142 | local state, result = pcall( f, self,pageIndex, pageMappingIndex, element, skipTabVisualUpdate ) 143 | if not state then 144 | print("Error: "..tostring(result)) 145 | self.currentPage = nil 146 | end 147 | end 148 | 149 | 150 | -------------------------------------------------------------------------------- /FS19_VehicleControlAddon/gui/vehicleControlAddonMenu.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /FS19_VehicleControlAddon/hand_brake.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/FS19_VehicleControlAddon/hand_brake.dds -------------------------------------------------------------------------------- /FS19_VehicleControlAddon/hand_brake_down.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/FS19_VehicleControlAddon/hand_brake_down.dds -------------------------------------------------------------------------------- /FS19_VehicleControlAddon/hand_brake_up.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/FS19_VehicleControlAddon/hand_brake_up.dds -------------------------------------------------------------------------------- /FS19_VehicleControlAddon/modDesc_l10n_da.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /FS19_VehicleControlAddon/shift.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/FS19_VehicleControlAddon/shift.ogg -------------------------------------------------------------------------------- /FS19_VehicleControlAddon/shift2.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/FS19_VehicleControlAddon/shift2.ogg -------------------------------------------------------------------------------- /FS19_VehicleControlAddon/store.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/FS19_VehicleControlAddon/store.dds -------------------------------------------------------------------------------- /FS19_VehicleControlAddon/vehicleControlAddonConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /FS22_VehicleControlAddon.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/FS22_VehicleControlAddon.zip -------------------------------------------------------------------------------- /FS22_VehicleControlAddon/dds/diff_back.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/FS22_VehicleControlAddon/dds/diff_back.dds -------------------------------------------------------------------------------- /FS22_VehicleControlAddon/dds/diff_bg.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/FS22_VehicleControlAddon/dds/diff_bg.dds -------------------------------------------------------------------------------- /FS22_VehicleControlAddon/dds/diff_front.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/FS22_VehicleControlAddon/dds/diff_front.dds -------------------------------------------------------------------------------- /FS22_VehicleControlAddon/dds/diff_middle.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/FS22_VehicleControlAddon/dds/diff_middle.dds -------------------------------------------------------------------------------- /FS22_VehicleControlAddon/dds/diff_wheels_fl.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/FS22_VehicleControlAddon/dds/diff_wheels_fl.dds -------------------------------------------------------------------------------- /FS22_VehicleControlAddon/dds/diff_wheels_fr.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/FS22_VehicleControlAddon/dds/diff_wheels_fr.dds -------------------------------------------------------------------------------- /FS22_VehicleControlAddon/dds/diff_wheels_rl.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/FS22_VehicleControlAddon/dds/diff_wheels_rl.dds -------------------------------------------------------------------------------- /FS22_VehicleControlAddon/dds/diff_wheels_rr.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/FS22_VehicleControlAddon/dds/diff_wheels_rr.dds -------------------------------------------------------------------------------- /FS22_VehicleControlAddon/dds/gear_bg.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/FS22_VehicleControlAddon/dds/gear_bg.dds -------------------------------------------------------------------------------- /FS22_VehicleControlAddon/dds/help_camera_en.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/FS22_VehicleControlAddon/dds/help_camera_en.dds -------------------------------------------------------------------------------- /FS22_VehicleControlAddon/dds/help_diff_en.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/FS22_VehicleControlAddon/dds/help_diff_en.dds -------------------------------------------------------------------------------- /FS22_VehicleControlAddon/dds/help_gps_en.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/FS22_VehicleControlAddon/dds/help_gps_en.dds -------------------------------------------------------------------------------- /FS22_VehicleControlAddon/dds/help_intro.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/FS22_VehicleControlAddon/dds/help_intro.dds -------------------------------------------------------------------------------- /FS22_VehicleControlAddon/dds/help_steering_en.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/FS22_VehicleControlAddon/dds/help_steering_en.dds -------------------------------------------------------------------------------- /FS22_VehicleControlAddon/dds/help_throttle_en.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/FS22_VehicleControlAddon/dds/help_throttle_en.dds -------------------------------------------------------------------------------- /FS22_VehicleControlAddon/gui/guiProfiles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | -------------------------------------------------------------------------------- /FS22_VehicleControlAddon/gui/vehicleControlAddonConfig.lua: -------------------------------------------------------------------------------- 1 | VehicleControlAddonConfig = {} 2 | VehicleControlAddonConfig.CONTROLS = { 3 | "backButton", 4 | "saveButton", 5 | } 6 | 7 | local VehicleControlAddonConfig_mt = Class(VehicleControlAddonConfig, ScreenElement) 8 | 9 | function VehicleControlAddonConfig.new(target, custom_mt) 10 | local self = DialogElement.new(target, custom_mt or VehicleControlAddonConfig_mt) 11 | self.vcaBackup = {} 12 | for n,v in pairs( VCAGlobals ) do 13 | self.vcaBackup[n] = v 14 | end 15 | self.isCloseAllowed = true 16 | self.vcaElements = {} 17 | self.vcaIsDirty = true 18 | self.vcaState = {} 19 | self:registerControls(VehicleControlAddonConfig.CONTROLS) 20 | self.isBackAllowed = false 21 | return self 22 | end 23 | 24 | function VehicleControlAddonConfig:copyAttributes(src) 25 | VehicleControlAddonConfig:superClass().copyAttributes(self, src) 26 | self.vcaElements = src.vcaElements 27 | end 28 | 29 | function VehicleControlAddonConfig:update(dt) 30 | VehicleControlAddonConfig:superClass().update(self, dt) 31 | 32 | self:vcaSetValues() 33 | self:vcaGetValues() 34 | end 35 | 36 | function VehicleControlAddonConfig:onCreate() 37 | local f = VehicleControlAddonConfig:superClass().onCreate 38 | if type( f ) == "function" then 39 | f(self) 40 | end 41 | end 42 | 43 | function VehicleControlAddonConfig:onOpen() 44 | VehicleControlAddonConfig:superClass().onOpen(self) 45 | 46 | for n,v in pairs( VCAGlobals ) do 47 | self.vcaBackup[n] = v 48 | end 49 | 50 | self.vcaInputEnabled = true 51 | self:vcaGetValues( true ) 52 | 53 | return false 54 | end 55 | 56 | function VehicleControlAddonConfig:onClickBack() 57 | self:vcaSetValues( true ) 58 | self.vcaInputEnabled = false 59 | self:vcaSetValues( true ) 60 | self.vcaInputEnabled = false 61 | 62 | local isDirty = false 63 | for n,v in pairs( self.vcaBackup ) do 64 | if v ~= nil and v ~= VCAGlobals[n] then 65 | isDirty = true 66 | local o = VCAGlobals[n] 67 | VCAGlobals[n] = v 68 | 69 | for _, vehicle in pairs(g_currentMission.vehicles) do 70 | if type( vehicle.vcaSetNewDefault ) == "function" then 71 | vehicle:vcaSetNewDefault( n, o, v, true ) 72 | end 73 | end 74 | end 75 | end 76 | 77 | if isDirty then 78 | if g_server ~= nil then 79 | g_server:broadcastEvent( vehicleControlAddonConfigEvent.new(false) ) 80 | else 81 | g_client:getServerConnection():sendEvent( vehicleControlAddonConfigEvent.new(false) ) 82 | end 83 | end 84 | 85 | self:changeScreen(nil) 86 | end 87 | 88 | function VehicleControlAddonConfig:vcaGetValues( force ) 89 | if self.vcaState.vcaGetValues then 90 | return 91 | end 92 | if not ( force or self.vcaIsDirty ) then 93 | return 94 | end 95 | 96 | if force then 97 | local x = g_currentMission.inGameMenu.hud.speedMeter.gaugeCenterX 98 | local y = g_currentMission.inGameMenu.hud.speedMeter.gaugeCenterY + g_currentMission.inGameMenu.hud.speedMeter.fuelGaugeRadiusY * 1.6 99 | local l = getCorrectTextSize(0.02) 100 | y = y + l * 1.2 101 | self.vcaSnapAngleHudX = x 102 | self.vcaSnapAngleHudY = y 103 | 104 | self.vcaTexts = {} 105 | 106 | if self.vcaBackup.snapAngleHudX >= 0 then 107 | x = self.vcaBackup.snapAngleHudX 108 | end 109 | if self.vcaBackup.snapAngleHudY >= 0 then 110 | y = self.vcaBackup.snapAngleHudY 111 | end 112 | self.vcaTexts.snapAngleHudX = string.format( "%d", math.floor( x * g_screenWidth ) ) 113 | self.vcaTexts.snapAngleHudY = string.format( "%d", math.floor( y * g_screenHeight ) ) 114 | end 115 | 116 | self.vcaState.vcaGetValues = true 117 | 118 | local vehicle = g_currentMission.controlledVehicle 119 | 120 | for n,s in pairs( self.vcaElements ) do 121 | local element = s.element 122 | if self.vcaBackup[n] ~= nil then 123 | local v = self.vcaBackup[n] 124 | if s.parameter == "camRotation" then 125 | element:setState( v + 1 ) 126 | elseif s.parameter == "adaptiveSteering" then 127 | if v == vehicleControlAddon.steeringTrue then 128 | element:setState( 2 ) 129 | elseif v == vehicleControlAddon.steeringSoft then 130 | element:setState( 3 ) 131 | else 132 | element:setState( 1 ) 133 | end 134 | elseif s.parameter == "percent5" then 135 | element:setState( math.floor( v * 20 + 0.5 ) + 1 ) 136 | elseif s.parameter == "percent10" then 137 | element:setState( math.floor( v * 10 + 0.5 ) + 1 ) 138 | elseif element.typeName == "checkedOption" then 139 | element:setIsChecked( v ) 140 | elseif element.typeName == "textInput" and not ( element.isCapturingInput ) then 141 | element:setText( self.vcaTexts[n] ) 142 | end 143 | end 144 | end 145 | 146 | self.vcaState.vcaGetValues = false 147 | 148 | self.vcaIsDirty = false 149 | end 150 | 151 | function VehicleControlAddonConfig:vcaSetValues( force ) 152 | 153 | if self.vcaState.vcaSetValues then 154 | return 155 | end 156 | 157 | self.vcaState.vcaSetValues = true 158 | 159 | local isDirty = false 160 | for n,s in pairs( self.vcaElements ) do 161 | local element = s.element 162 | local v = nil 163 | if self.vcaBackup[n] ~= nil then 164 | if s.parameter == "camRotation" then 165 | v = element:getState() - 1 166 | elseif s.parameter == "adaptiveSteering" then 167 | local i = element:getState() 168 | if i == 2 then 169 | v = vehicleControlAddon.steeringTrue 170 | elseif i == 3 then 171 | v = vehicleControlAddon.steeringSoft 172 | else 173 | v = vehicleControlAddon.steeringFalse 174 | end 175 | elseif s.parameter == "percent5" then 176 | v = 0.05 * ( element:getState() - 1 ) 177 | elseif s.parameter == "percent10" then 178 | v = 0.1 * ( element:getState() - 1 ) 179 | elseif element.typeName == "checkedOption" then 180 | v = element:getIsChecked() 181 | end 182 | if v ~= nil and v ~= self.vcaBackup[n] then 183 | self.vcaBackup[n] = v 184 | isDirty = true 185 | end 186 | end 187 | end 188 | 189 | self.vcaState.vcaSetValues = false 190 | end 191 | 192 | function VehicleControlAddonConfig:vcaOnEnterPressed( element ) 193 | self:vcaOnTextChanged( element, element:getText() ) 194 | end 195 | 196 | function VehicleControlAddonConfig:vcaOnTextChanged( element, text ) 197 | if self.vcaState.vcaOnTextChanged or self.vcaState.vcaGetValues then 198 | return 199 | end 200 | 201 | if element == nil then 202 | print("Invalid element: ") 203 | return 204 | end 205 | 206 | if element.id == nil or element.typeName == nil or element.typeName ~= "textInput" then 207 | print("Invalid element: '"..tostring(element.id).."'") 208 | return 209 | end 210 | 211 | self.vcaState.vcaOnTextChanged = true 212 | 213 | local name = element.id 214 | 215 | local n = tonumber( text ) 216 | 217 | if name == "snapAngleHudX" then 218 | if n ~= nil and n >= 0 then 219 | x = n / g_screenWidth 220 | if math.abs( self.vcaSnapAngleHudX - x ) * g_screenWidth < 1 then 221 | self.vcaBackup.snapAngleHudX = -1 222 | x = self.vcaSnapAngleHudX 223 | else 224 | self.vcaBackup.snapAngleHudX = x 225 | end 226 | else 227 | self.vcaBackup.snapAngleHudX = -1 228 | x = self.vcaSnapAngleHudX 229 | end 230 | self.vcaTexts.snapAngleHudX = string.format( "%d", math.floor( x * g_screenWidth ) ) 231 | elseif name == "snapAngleHudY" then 232 | if n ~= nil and n >= 0 then 233 | y = n / g_screenHeight 234 | if math.abs( self.vcaSnapAngleHudY - y ) * g_screenHeight < 1 then 235 | self.vcaBackup.snapAngleHudY = -1 236 | y = self.vcaSnapAngleHudY 237 | else 238 | self.vcaBackup.snapAngleHudY = y 239 | end 240 | else 241 | self.vcaBackup.snapAngleHudY = -1 242 | y = self.vcaSnapAngleHudY 243 | end 244 | self.vcaTexts.snapAngleHudY = string.format( "%d", math.floor( y * g_screenHeight ) ) 245 | end 246 | 247 | element:setText( self.vcaTexts[name] ) 248 | 249 | self.vcaIsDirty = true 250 | self.vcaState.vcaOnTextChanged = false 251 | end 252 | 253 | function VehicleControlAddonConfig:onCreateSubElement( element, parameter ) 254 | if element == nil or element.typeName == nil then 255 | print("Invalid element.typeName: ") 256 | return 257 | end 258 | local checked = true 259 | if element.id == nil then 260 | checked = false 261 | end 262 | if element.typeName == "multiTextOption" then 263 | if parameter == nil 264 | or parameter == "bool" then 265 | parameter = "bool" 266 | elseif parameter == "camRotation" then 267 | element:setTexts( { vehicleControlAddon.getText("vcaValueOff", "OFF"), 268 | vehicleControlAddon.getText("vcaValueLight", "LIGHT"), 269 | vehicleControlAddon.getText("vcaValueNormal", "NORMAL"), 270 | vehicleControlAddon.getText("vcaValueStrong", "STRONG"), 271 | } ) 272 | elseif parameter == "adaptiveSteering" then 273 | element:setTexts( { vehicleControlAddon.getText("vcaValueOff", "OFF"), 274 | vehicleControlAddon.getText("vcaValueStrong", "STRONG"), 275 | vehicleControlAddon.getText("vcaValueLight", "LIGHT"), 276 | } ) 277 | elseif parameter == "percent10" then 278 | local texts = {} 279 | for i=0,10 do 280 | table.insert( texts, string.format("%d%%",i*10) ) 281 | end 282 | element:setTexts(texts) 283 | elseif parameter == "percent5" then 284 | local texts = {} 285 | for i=0,20 do 286 | table.insert( texts, string.format("%d%%",i*5) ) 287 | end 288 | element:setTexts(texts) 289 | else 290 | print("Invalid MultiTextOptionElement parameter: "..tostring(parameter)) 291 | checked = false 292 | end 293 | end 294 | if checked then 295 | self.vcaElements[element.id] = { element=element, parameter=Utils.getNoNil( parameter, "" ) } 296 | else 297 | print("Error inserting UI element with ID: "..tostring(element.id)) 298 | end 299 | end 300 | -------------------------------------------------------------------------------- /FS22_VehicleControlAddon/gui/vehicleControlAddonConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | -------------------------------------------------------------------------------- /FS22_VehicleControlAddon/gui/vehicleControlAddonMenu.lua: -------------------------------------------------------------------------------- 1 | 2 | VehicleControlAddonMenu = {} 3 | 4 | VehicleControlAddonMenu.CONTROLS = { 5 | "backButton", 6 | "magicButton", 7 | "swapButton", 8 | } 9 | 10 | local VehicleControlAddonMenu_mt = Class(VehicleControlAddonMenu, ScreenElement) 11 | 12 | function VehicleControlAddonMenu.new(target, custom_mt) 13 | local self = DialogElement.new(target, custom_mt or VehicleControlAddonMenu_mt) 14 | self.isCloseAllowed = true 15 | self.vcaElements = {} 16 | self.vcaIsDirty = true 17 | self.vcaState = {} 18 | self:registerControls(VehicleControlAddonMenu.CONTROLS) 19 | self.isBackAllowed = false 20 | return self 21 | end 22 | 23 | function VehicleControlAddonMenu:copyAttributes(src) 24 | VehicleControlAddonMenu:superClass().copyAttributes(self, src) 25 | self.vcaElements = src.vcaElements 26 | end 27 | 28 | function VehicleControlAddonMenu:update(dt) 29 | VehicleControlAddonMenu:superClass().update(self, dt) 30 | 31 | self:vcaSetValues() 32 | self:vcaGetValues() 33 | self:vcaSetVisibility() 34 | end 35 | 36 | function VehicleControlAddonMenu:onCreate() 37 | local f = VehicleControlAddonMenu:superClass().onCreate 38 | if type( f ) == "function" then 39 | f(self) 40 | end 41 | end 42 | 43 | function VehicleControlAddonMenu:onOpen() 44 | VehicleControlAddonMenu:superClass().onOpen(self) 45 | 46 | self.vcaInputEnabled = true 47 | self:vcaGetValues( true ) 48 | self:vcaSetVisibility( true ) 49 | 50 | return false 51 | end 52 | 53 | function VehicleControlAddonMenu:onClickBack() 54 | self:vcaSetValues( true ) 55 | self.vcaInputEnabled = false 56 | self:changeScreen(nil) 57 | end 58 | 59 | function VehicleControlAddonMenu:vcaGetValues( force ) 60 | if self.vcaState.vcaGetValues then 61 | return 62 | end 63 | if g_currentMission.controlledVehicle == nil 64 | or g_currentMission.controlledVehicle.spec_vcaUI == nil 65 | or g_currentMission.controlledVehicle.spec_vca == nil 66 | or not ( g_currentMission.controlledVehicle.spec_vca.isInitialized ) then 67 | return 68 | end 69 | local vehicle = g_currentMission.controlledVehicle 70 | 71 | if not ( force or self.vcaIsDirty ) then 72 | for name,s in pairs( self.vcaElements ) do 73 | local element = s.element 74 | if element.typeName == "textInput" and element.blockTime > 0 and element.isCapturingInput then 75 | local getter = vehicleControlAddon["vcaUIGet"..name] 76 | if type( getter ) == "function" then 77 | element:setText( getter( vehicle, false ) ) 78 | end 79 | end 80 | end 81 | return 82 | end 83 | 84 | self.vcaState.vcaGetValues = true 85 | 86 | for name,s in pairs( self.vcaElements ) do 87 | 88 | if s.parameter == "callback" then 89 | local getter = vehicleControlAddon["vcaUIDraw"..name] 90 | local texts = getter( vehicle ) 91 | s.element:setTexts(texts) 92 | elseif s.parameter == "list" or s.parameter == "list0" then 93 | if type( vehicle.spec_vcaUI[name] ) == "table" then 94 | s.element:setTexts(vehicle.spec_vcaUI[name]) 95 | else 96 | s.element:setTexts({""}) 97 | end 98 | end 99 | 100 | local element = s.element 101 | 102 | local getter = nil 103 | if type( vehicleControlAddon["vcaUIGet"..name] ) == "function" then 104 | getter = vehicleControlAddon["vcaUIGet"..name] 105 | else 106 | getter = function( vehicle ) return vehicleControlAddon.vcaGetState( vehicle, name ) end 107 | end 108 | 109 | if getter == nil then 110 | print("Invalid UI element ID: "..tostring(name)) 111 | elseif element.typeName == "text" then 112 | element:setText( getter( vehicle, false ) ) 113 | elseif element.typeName == "textInput" and not ( element.isCapturingInput ) then -- and ( force or self.vcaIsDirty ) 114 | element:setText( getter( vehicle, true ) ) 115 | else 116 | local value = getter( vehicle ) 117 | 118 | if value == nli then 119 | print( "Value is nil: "..tostring(name) ) 120 | elseif element.typeName == "checkedOption" then 121 | local b = value 122 | if s.parameter == "inverted" then 123 | b = not b 124 | end 125 | element:setIsChecked( b ) 126 | elseif element.typeName == "multiTextOption" then 127 | local i = 1 128 | if s.parameter == "percent10" then 129 | i = math.floor( value * 10 + 0.5 ) + 1 130 | elseif s.parameter == "percent5" then 131 | i = math.floor( value * 20 + 0.5 ) + 1 132 | elseif s.parameter == "list0" then 133 | i = value + 1 134 | elseif s.parameter == "bool" then 135 | if value then i = 2 end 136 | else 137 | i = value 138 | end 139 | element:setState( i ) 140 | end 141 | end 142 | end 143 | 144 | self.vcaState.vcaGetValues = false 145 | 146 | self.vcaIsDirty = false 147 | end 148 | 149 | function VehicleControlAddonMenu:vcaSetValues( force ) 150 | if self.vcaState.vcaSetValues then 151 | return 152 | end 153 | 154 | self.vcaState.vcaSetValues = true 155 | 156 | if g_currentMission.controlledVehicle ~= nil 157 | and g_currentMission.controlledVehicle.spec_vca ~= nil 158 | and g_currentMission.controlledVehicle.spec_vca.isInitialized then 159 | local vehicle = g_currentMission.controlledVehicle 160 | 161 | for name,s in pairs( self.vcaElements ) do 162 | 163 | local element = s.element 164 | 165 | local getter 166 | if force then 167 | -- no dirty flag 168 | getter = nil 169 | elseif type( vehicleControlAddon["vcaUIGet"..name] ) == "function" then 170 | getter = vehicleControlAddon["vcaUIGet"..name] 171 | else 172 | getter = function( vehicle ) return vehicleControlAddon.vcaGetState( vehicle, name ) end 173 | end 174 | 175 | local setter 176 | if type( vehicleControlAddon["vcaUISet"..name] ) == "function" then 177 | setter = vehicleControlAddon["vcaUISet"..name] 178 | else 179 | setter = function( vehicle, value ) vehicleControlAddon.vcaSetState( vehicle, name, value ) end 180 | end 181 | 182 | -- dirty flag 183 | if getter ~= nil and setter ~= nil then 184 | local realSetter = setter 185 | setter = function( vehicle, value ) 186 | local v = getter( vehicle ) 187 | if v == nil or value ~= v then 188 | self.vcaIsDirty = true 189 | realSetter( vehicle, value ) 190 | end 191 | end 192 | end 193 | 194 | if setter == nil then 195 | print("Invalid UI element ID: "..tostring(name)) 196 | elseif element.typeName == "checkedOption" then 197 | local b = element:getIsChecked() 198 | if s.parameter == "inverted" then 199 | b = not b 200 | end 201 | setter( vehicle, b ) 202 | elseif element.typeName == "multiTextOption" then 203 | local i = element:getState() 204 | local value = i 205 | if s.parameter == "percent10" then 206 | value = (i-1) * 0.1 207 | elseif s.parameter == "percent5" then 208 | value = (i-1) * 0.05 209 | elseif s.parameter == "list0" then 210 | value = i - 1 211 | elseif s.parameter == "bool" then 212 | value = ( i > 1 ) 213 | end 214 | 215 | setter( vehicle, value ) 216 | elseif element.typeName == "textInput" and force then 217 | local t = element:getText() 218 | setter( vehicle, t ) 219 | end 220 | end 221 | end 222 | 223 | self.vcaState.vcaSetValues = false 224 | end 225 | 226 | function VehicleControlAddonMenu:vcaSetVisibility( force ) 227 | if g_currentMission.controlledVehicle ~= nil 228 | and g_currentMission.controlledVehicle.spec_vca ~= nil 229 | and g_currentMission.controlledVehicle.spec_vca.isInitialized then 230 | local vehicle = g_currentMission.controlledVehicle 231 | 232 | for name,s in pairs( self.vcaElements ) do 233 | local element = s.element 234 | if type( vehicleControlAddon["vcaUIShow"..name] ) == "function" then 235 | local getter = vehicleControlAddon["vcaUIShow"..name] 236 | local disabled = true 237 | if getter( vehicle ) then 238 | disabled = false 239 | end 240 | if force or element.disabled ~= disabled then 241 | element:setDisabled( disabled ) 242 | end 243 | end 244 | end 245 | end 246 | end 247 | 248 | function VehicleControlAddonMenu:vcaOnEnterPressed( element ) 249 | self:vcaOnTextChanged( element, element:getText() ) 250 | end 251 | 252 | function VehicleControlAddonMenu:vcaOnTextChanged( element, text ) 253 | if self.vcaState.vcaOnTextChanged or self.vcaState.vcaGetValues then 254 | return 255 | end 256 | 257 | vcaDebugPrint( "onEnterPressed: "..tostring( element.id ).." isCapturingInput: "..tostring( element.isCapturingInput ) ) 258 | 259 | if element == nil then 260 | print("Invalid element: ") 261 | return 262 | end 263 | 264 | if element.id == nil or element.typeName == nil or element.typeName ~= "textInput" then 265 | print("Invalid element: '"..tostring(element.id).."'") 266 | return 267 | end 268 | 269 | self.vcaState.vcaOnTextChanged = true 270 | 271 | local vehicle = g_currentMission.controlledVehicle 272 | local name = element.id 273 | 274 | local setter 275 | if type( vehicleControlAddon["vcaUISet"..name] ) == "function" then 276 | setter = vehicleControlAddon["vcaUISet"..name] 277 | else 278 | setter = function( vehicle, value ) vehicleControlAddon.vcaSetState( vehicle, name, value ) end 279 | end 280 | 281 | if setter == nil then 282 | print("Invalid UI element ID: "..tostring(name)) 283 | else 284 | setter( vehicle, text ) 285 | end 286 | 287 | self.vcaIsDirty = true 288 | self.vcaState.vcaOnTextChanged = false 289 | end 290 | 291 | function VehicleControlAddonMenu:onCreateSubElement( element, parameter ) 292 | if element == nil or element.typeName == nil then 293 | print("Invalid element.typeName: ") 294 | return 295 | end 296 | local checked = true 297 | if element.id == nil then 298 | checked = false 299 | end 300 | if element.typeName == "multiTextOption" then 301 | if parameter == nil 302 | or parameter == "bool" then 303 | parameter = "bool" 304 | --if table.getn(element.texts) ~= 2 then 305 | -- element:setTexts({g_i18n:getText("ui_off"), g_i18n:getText("ui_on")}) 306 | --end 307 | elseif parameter == "list" 308 | or parameter == "list0" then 309 | element:setTexts({"vehicle is "}) 310 | elseif parameter == "percent10" then 311 | local texts = {} 312 | for i=0,10 do 313 | table.insert( texts, string.format("%d%%",i*10) ) 314 | end 315 | element:setTexts(texts) 316 | elseif parameter == "percent5" then 317 | local texts = {} 318 | for i=0,20 do 319 | table.insert( texts, string.format("%d%%",i*5) ) 320 | end 321 | element:setTexts(texts) 322 | elseif parameter == "callback" then 323 | if type( vehicleControlAddon["vcaUIDraw"..element.id] ) == "function" then 324 | element:setTexts({"vehicle is "}) 325 | else 326 | print("Invalid MultiTextOptionElement callback: ".."vcaUIDraw"..tostring(element.id)) 327 | checked = false 328 | end 329 | else 330 | print("Invalid MultiTextOptionElement parameter: "..tostring(parameter)) 331 | checked = false 332 | end 333 | end 334 | if checked then 335 | self.vcaElements[element.id] = { element=element, parameter=Utils.getNoNil( parameter, "" ) } 336 | else 337 | print("Error inserting UI element with ID: "..tostring(element.id)) 338 | end 339 | end 340 | 341 | 342 | function VehicleControlAddonMenu:onClickMagic( ) 343 | if g_currentMission.controlledVehicle ~= nil 344 | and g_currentMission.controlledVehicle.spec_vca ~= nil 345 | and g_currentMission.controlledVehicle.spec_vca.isInitialized then 346 | local vehicle = g_currentMission.controlledVehicle 347 | local d, o, p = vehicle:vcaGetSnapDistance() 348 | vehicle:vcaSetState( "snapDistance", d ) 349 | vehicle:vcaSetState( "snapOffset", o ) 350 | vehicle:vcaSetState( "snapInvert", p ) 351 | 352 | self.vcaElements.snapDistance.element:setText( vehicleControlAddon.vcaUIGetsnapDistance( vehicle ) ) 353 | self.vcaElements.snapOffset.element:setText( vehicleControlAddon.vcaUIGetsnapOffset( vehicle ) ) 354 | end 355 | end 356 | 357 | 358 | 359 | 360 | -------------------------------------------------------------------------------- /FS22_VehicleControlAddon/modIcon.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/FS22_VehicleControlAddon/modIcon.dds -------------------------------------------------------------------------------- /FS22_VehicleControlAddon/ogg/GPS_off.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/FS22_VehicleControlAddon/ogg/GPS_off.ogg -------------------------------------------------------------------------------- /FS22_VehicleControlAddon/ogg/GPS_on.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/FS22_VehicleControlAddon/ogg/GPS_on.ogg -------------------------------------------------------------------------------- /FS22_VehicleControlAddon/vehicleControlAddonConfig.lua: -------------------------------------------------------------------------------- 1 | -- 2 | -- vehicleControlAddonConfig 3 | -- 4 | 5 | local function compareSimple( a, b ) 6 | return a==b 7 | end 8 | local function compareFloat( a, b ) 9 | return math.abs( a - b ) < 1e-4 10 | end 11 | 12 | VCAValueType = {} 13 | VCAValueType.bool = { valueType = XMLValueType.BOOL, emptyValue = false,streamRead=streamReadBool , streamWrite=streamWriteBool , getXML=getXMLBool , setXML=setXMLBool , compare=compareSimple } 14 | VCAValueType.int16 = { valueType = XMLValueType.INT, emptyValue = 0 ,streamRead=streamReadInt16 , streamWrite=streamWriteInt16 , getXML=getXMLInt , setXML=setXMLInt , compare=compareSimple } 15 | VCAValueType.float = { valueType = XMLValueType.FLOAT, emptyValue = 0.0 ,streamRead=streamReadFloat32, streamWrite=streamWriteFloat32, getXML=getXMLFloat , setXML=setXMLFloat , compare=compareFloat } 16 | VCAValueType.string = { valueType = XMLValueType.STRING, emptyValue = "" ,streamRead=streamReadString , streamWrite=streamWriteString , getXML=getXMLString, setXML=setXMLString, compare=compareSimple } 17 | 18 | local ConfigItems = {} 19 | local ConfigItemIndex = {} 20 | VCAGlobals = {} 21 | 22 | local function addConfigItem( name, configType, value ) 23 | table.insert( ConfigItemIndex, name ) 24 | ConfigItems[name] = { configType = configType, value = value } 25 | VCAGlobals[name] = value 26 | end 27 | 28 | local function init() 29 | addConfigItem( "debugPrint" , VCAValueType.bool , false ) 30 | 31 | addConfigItem( "cameraRotFactor" , VCAValueType.float , 0.5 ) 32 | addConfigItem( "cameraRotFactorRev" , VCAValueType.float , 0.3 ) 33 | addConfigItem( "cameraRotTime" , VCAValueType.float , 0.001 ) 34 | addConfigItem( "limitThrottle" , VCAValueType.int16 , 15 ) -- 9 => 90%/100% 15 => 100%/75% --> 35 | addConfigItem( "snapAngle" , VCAValueType.int16 , 3 ) -- 45° --> 36 | addConfigItem( "brakeForceFactor" , VCAValueType.float , 1.0 ) 37 | addConfigItem( "snapAngleHudX" , VCAValueType.float , -1 ) -- any value >= 0 => position of bottom left corner / -1 above HUD --> 38 | addConfigItem( "snapAngleHudY" , VCAValueType.float , -1 ) -- any value >= 0 => position of bottom left corner / -1 above HUD --> 39 | addConfigItem( "drawHud" , VCAValueType.bool , true ) 40 | addConfigItem( "mouseAutoRotateBack" , VCAValueType.bool , true ) 41 | addConfigItem( "analogSteering" , VCAValueType.bool , false ) 42 | addConfigItem( "rotateHeadTracking" , VCAValueType.bool , true ) 43 | addConfigItem( "turnOffAWDSpeed" , VCAValueType.int16 , 30 ) -- km/h --> 44 | -- defaults -- 45 | addConfigItem( "adaptiveSteering" , VCAValueType.string, "false" ) 46 | addConfigItem( "camOutsideRotation" , VCAValueType.int16 , 0 ) 47 | addConfigItem( "camInsideRotation" , VCAValueType.int16 , 0 ) 48 | addConfigItem( "camReverseRotation" , VCAValueType.bool , false ) 49 | addConfigItem( "camRevOutRotation" , VCAValueType.bool , false ) 50 | addConfigItem( "peekLeftRight" , VCAValueType.bool , true ) 51 | addConfigItem( "hiredWorker2" , VCAValueType.bool , false ) -- differential for hired worker --> 52 | addConfigItem( "rotSpeedOut" , VCAValueType.float , 0.5 ) 53 | addConfigItem( "rotSpeedIn" , VCAValueType.float , 0.5 ) 54 | addConfigItem( "idleThrottle" , VCAValueType.bool , false ) 55 | end 56 | init() 57 | 58 | function vcaDebugPrint( ... ) 59 | if VCAGlobals.debugPrint then 60 | print( ... ) 61 | end 62 | end 63 | 64 | vehicleControlAddonConfig = {} 65 | local vehicleControlAddonConfig_mt = Class(vehicleControlAddonConfig) 66 | 67 | function vehicleControlAddonConfig.new() 68 | self = {} 69 | setmetatable(self, vehicleControlAddonConfig_mt) 70 | return self 71 | end 72 | 73 | local function loadConfig( fileName ) 74 | if fileName == nil or fileName == "" or not fileExists(fileName) then 75 | return false 76 | end 77 | vcaDebugPrint("VCA config: "..tostring(fileName)) 78 | local xmlFile = loadXMLFile( "vehicleControlAddon", fileName, "vehicleControlAddon" ) 79 | local i = 0 80 | while true do 81 | local xmlKey = string.format("vehicleControlAddon.configuration(%d)", i) 82 | i = i + 1 83 | local name = getXMLString( xmlFile, xmlKey.."#name" ) 84 | if name == nil then 85 | break 86 | end 87 | item = ConfigItems[name] 88 | if item ~= nil then 89 | local value = item.configType.getXML( xmlFile, xmlKey.."#value" ) 90 | if value ~= nil then 91 | vcaDebugPrint("VCAGlobals."..tostring(name).." = "..tostring(value)) 92 | VCAGlobals[name] = value 93 | end 94 | end 95 | end 96 | delete( xmlFile ) 97 | return true 98 | end 99 | 100 | local function saveConfig( fileName ) 101 | if fileName == nil or fileName == "" then 102 | return false 103 | end 104 | vcaDebugPrint("VCA config: "..tostring(fileName)) 105 | --if fileExists(fileName) then 106 | -- getfenv(0).deleteFile(fileName) 107 | --end 108 | local xmlFile = createXMLFile( "vehicleControlAddon", fileName, "vehicleControlAddon" ) 109 | local i = 0 110 | for name,item in pairs(ConfigItems) do 111 | if not item.configType.compare( VCAGlobals[name], item.value ) then 112 | vcaDebugPrint("VCAGlobals."..tostring(name).." = "..tostring(VCAGlobals[name])) 113 | local xmlKey = string.format("vehicleControlAddon.configuration(%d)", i) 114 | i = i + 1 115 | setXMLString( xmlFile, xmlKey.."#name", name ) 116 | item.configType.setXML( xmlFile, xmlKey.."#value", VCAGlobals[name] ) 117 | end 118 | end 119 | saveXMLFile(xmlFile) 120 | delete( xmlFile ) 121 | if fileExists(fileName) then 122 | vcaDebugPrint("VCA config saved") 123 | return true 124 | end 125 | return false 126 | end 127 | 128 | function vehicleControlAddonConfig:getSavegameFileName() 129 | if g_careerScreen and g_careerScreen.currentSavegame ~= nil and g_careerScreen.currentSavegame.savegameDirectory ~= nil then 130 | return g_careerScreen.currentSavegame.savegameDirectory .. "/vehicleControlAddon.xml" 131 | end 132 | end 133 | 134 | function vehicleControlAddonConfig:getModSettingsFileName() 135 | return getUserProfileAppPath().. "modSettings/vehicleControlAddon.xml" 136 | end 137 | 138 | function vehicleControlAddonConfig:load() 139 | if not loadConfig( self:getSavegameFileName() ) and g_dedicatedServerInfo == nil then 140 | loadConfig( self:getModSettingsFileName() ) 141 | end 142 | end 143 | 144 | function vehicleControlAddonConfig:save() 145 | if g_server == nil then 146 | return 147 | end 148 | 149 | saveConfig( self:getSavegameFileName() ) 150 | if g_dedicatedServerInfo == nil then 151 | saveConfig( self:getModSettingsFileName() ) 152 | end 153 | end 154 | 155 | 156 | vehicleControlAddonConfigEvent = {} 157 | vehicleControlAddonConfigEvent_mt = Class(vehicleControlAddonConfigEvent, Event) 158 | InitEventClass(vehicleControlAddonConfigEvent, "vehicleControlAddonConfigEvent") 159 | function vehicleControlAddonConfigEvent.emptyNew() 160 | local self = Event.new(vehicleControlAddonConfigEvent_mt) 161 | self.check1 = 244 162 | self.check2 = 108 163 | return self 164 | end 165 | function vehicleControlAddonConfigEvent.new(init) 166 | local self = vehicleControlAddonConfigEvent.emptyNew() 167 | return self 168 | end 169 | function vehicleControlAddonConfigEvent:readStream(streamId, connection) 170 | local check1 = streamReadUInt8(streamId) 171 | self.globals = {} 172 | for i,name in pairs( ConfigItemIndex ) do 173 | local item = ConfigItems[name] 174 | self.globals[name] = item.configType.streamRead( streamId ) 175 | vcaDebugPrint("Info: vehicleControlAddonConfigEvent received value "..tostring(self.globals[name]).." for state "..tostring(name)) 176 | end 177 | local check2 = streamReadUInt8(streamId) 178 | 179 | if check1 ~= self.check1 then 180 | print("Error in vehicleControlAddonConfigEvent: Event has wrong start marker. Check other mods.") 181 | elseif check2 ~= self.check2 then 182 | print("Error in vehicleControlAddonConfigEvent: Event has wrong end marker. ") 183 | else 184 | self:run(connection) 185 | end 186 | end 187 | function vehicleControlAddonConfigEvent:writeStream(streamId, connection) 188 | streamWriteUInt8(streamId, self.check1 ) 189 | for i,name in pairs( ConfigItemIndex ) do 190 | local item = ConfigItems[name] 191 | item.configType.streamWrite( streamId, VCAGlobals[name] ) 192 | end 193 | streamWriteUInt8(streamId, self.check2 ) 194 | end 195 | function vehicleControlAddonConfigEvent:run(connection) 196 | if type( self.globals ) == "table" then 197 | for name, value in pairs( self.globals ) do 198 | local old = VCAGlobals[name] 199 | VCAGlobals[name] = value 200 | local item = ConfigItems[name] 201 | if not item.configType.compare( old, value ) then 202 | for _, vehicle in pairs(g_currentMission.vehicles) do 203 | if type( vehicle.vcaSetNewDefault ) == "function" then 204 | vehicle:vcaSetNewDefault( name, old, value, true ) 205 | end 206 | end 207 | end 208 | end 209 | end 210 | if not connection:getIsServer() then 211 | g_server:broadcastEvent( vehicleControlAddonConfigEvent.new(self.save), nil, connection, nil ) 212 | end 213 | end 214 | -------------------------------------------------------------------------------- /FS22_VehicleControlAddon/vehicleControlAddonEvent.lua: -------------------------------------------------------------------------------- 1 | -- 2 | -- vehicleControlAddonEvent 3 | -- 4 | vehicleControlAddonEvent = {} 5 | vehicleControlAddonEvent_mt = Class(vehicleControlAddonEvent, Event) 6 | InitEventClass(vehicleControlAddonEvent, "vehicleControlAddonEvent") 7 | function vehicleControlAddonEvent.emptyNew() 8 | local self = Event.new(vehicleControlAddonEvent_mt) 9 | self.check1 = 178 10 | self.check2 = 142 11 | return self 12 | end 13 | function vehicleControlAddonEvent.new(object,name,value) 14 | local self = vehicleControlAddonEvent.emptyNew() 15 | self.object = object 16 | self.name = name 17 | self.value = value 18 | return self 19 | end 20 | function vehicleControlAddonEvent:readStream(streamId, connection) 21 | local check1 = streamReadUInt8(streamId) 22 | self.object = NetworkUtil.readNodeObject( streamId ) 23 | self.name = streamReadString(streamId) 24 | if vehicleControlAddon.properties ~= nil and vehicleControlAddon.properties[self.name] ~= nil then 25 | local prop = vehicleControlAddon.properties[self.name] 26 | self.value = prop.func.streamRead(streamId) 27 | vcaDebugPrint("Info: vehicleControlAddonEvent received value "..tostring(self.value).." for state "..tostring(self.name)) 28 | else 29 | print("Error in vehicleControlAddonEvent: invalid property '"..tostring(self.name).."'") 30 | end 31 | local check2 = streamReadUInt8(streamId) 32 | 33 | if check1 ~= self.check1 then 34 | print("Error in vehicleControlAddonEvent: Event has wrong start marker. Check other mods.") 35 | elseif check2 ~= self.check2 then 36 | print("Error in vehicleControlAddonEvent: Event has wrong end marker. ") 37 | else 38 | self:run(connection) 39 | end 40 | end 41 | function vehicleControlAddonEvent:writeStream(streamId, connection) 42 | streamWriteUInt8(streamId, self.check1 ) 43 | NetworkUtil.writeNodeObject( streamId, self.object ) 44 | streamWriteString(streamId,self.name) 45 | if vehicleControlAddon.properties ~= nil and vehicleControlAddon.properties[self.name] ~= nil then 46 | local prop = vehicleControlAddon.properties[self.name] 47 | prop.func.streamWrite(streamId, Utils.getNoNil( self.value, prop.emptyValue )) 48 | else 49 | print("Error in vehicleControlAddonEvent: invalid property '"..tostring(self.name).."'") 50 | end 51 | streamWriteUInt8(streamId, self.check2 ) 52 | end 53 | function vehicleControlAddonEvent:run(connection) 54 | if self.object == nil then 55 | return 56 | end 57 | vehicleControlAddon.vcaSetState( self.object, self.name, self.value, true ) 58 | if not connection:getIsServer() then 59 | g_server:broadcastEvent(vehicleControlAddonEvent.new(self.object,self.name,self.value), nil, connection, self.object) 60 | end 61 | end 62 | -------------------------------------------------------------------------------- /FS25_VehicleControlAddon.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/FS25_VehicleControlAddon.zip -------------------------------------------------------------------------------- /FS25_VehicleControlAddon/dds/diff_back.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/FS25_VehicleControlAddon/dds/diff_back.dds -------------------------------------------------------------------------------- /FS25_VehicleControlAddon/dds/diff_bg.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/FS25_VehicleControlAddon/dds/diff_bg.dds -------------------------------------------------------------------------------- /FS25_VehicleControlAddon/dds/diff_front.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/FS25_VehicleControlAddon/dds/diff_front.dds -------------------------------------------------------------------------------- /FS25_VehicleControlAddon/dds/diff_middle.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/FS25_VehicleControlAddon/dds/diff_middle.dds -------------------------------------------------------------------------------- /FS25_VehicleControlAddon/dds/diff_wheels_fl.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/FS25_VehicleControlAddon/dds/diff_wheels_fl.dds -------------------------------------------------------------------------------- /FS25_VehicleControlAddon/dds/diff_wheels_fr.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/FS25_VehicleControlAddon/dds/diff_wheels_fr.dds -------------------------------------------------------------------------------- /FS25_VehicleControlAddon/dds/diff_wheels_rl.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/FS25_VehicleControlAddon/dds/diff_wheels_rl.dds -------------------------------------------------------------------------------- /FS25_VehicleControlAddon/dds/diff_wheels_rr.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/FS25_VehicleControlAddon/dds/diff_wheels_rr.dds -------------------------------------------------------------------------------- /FS25_VehicleControlAddon/dds/gear_bg.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/FS25_VehicleControlAddon/dds/gear_bg.dds -------------------------------------------------------------------------------- /FS25_VehicleControlAddon/lua/vehicleControlAddonConfig.lua: -------------------------------------------------------------------------------- 1 | -- 2 | -- vehicleControlAddonConfig 3 | -- 4 | 5 | local function compareSimple( a, b ) 6 | return a==b 7 | end 8 | local function compareFloat( a, b ) 9 | return math.abs( a - b ) < 1e-4 10 | end 11 | 12 | VCAValueType = {} 13 | VCAValueType.bool = { valueType = XMLValueType.BOOL, emptyValue = false,streamRead=streamReadBool , streamWrite=streamWriteBool , getXML=getXMLBool , setXML=setXMLBool , compare=compareSimple } 14 | VCAValueType.int16 = { valueType = XMLValueType.INT, emptyValue = 0 ,streamRead=streamReadInt16 , streamWrite=streamWriteInt16 , getXML=getXMLInt , setXML=setXMLInt , compare=compareSimple } 15 | VCAValueType.float = { valueType = XMLValueType.FLOAT, emptyValue = 0.0 ,streamRead=streamReadFloat32, streamWrite=streamWriteFloat32, getXML=getXMLFloat , setXML=setXMLFloat , compare=compareFloat } 16 | VCAValueType.string = { valueType = XMLValueType.STRING, emptyValue = "" ,streamRead=streamReadString , streamWrite=streamWriteString , getXML=getXMLString, setXML=setXMLString, compare=compareSimple } 17 | 18 | local ConfigItems = {} 19 | local ConfigItemIndex = {} 20 | VCAGlobals = {} 21 | 22 | local function addConfigItem( name, configType, value ) 23 | table.insert( ConfigItemIndex, name ) 24 | ConfigItems[name] = { configType = configType, value = value } 25 | VCAGlobals[name] = value 26 | end 27 | 28 | local function init() 29 | addConfigItem( "debugPrint" , VCAValueType.bool , false ) 30 | 31 | addConfigItem( "cameraRotFactor" , VCAValueType.float , 0.5 ) 32 | addConfigItem( "cameraRotFactorRev" , VCAValueType.float , 0.3 ) 33 | addConfigItem( "cameraRotTime" , VCAValueType.float , 0.001 ) 34 | addConfigItem( "limitThrottle" , VCAValueType.int16 , 15 ) -- 9 => 90%/100% 15 => 100%/75% --> 35 | addConfigItem( "snapAngle" , VCAValueType.int16 , 3 ) -- 45° --> 36 | addConfigItem( "brakeForceFactor" , VCAValueType.float , 1.0 ) 37 | addConfigItem( "snapAngleHudX" , VCAValueType.float , -1 ) -- any value >= 0 => position of bottom left corner / -1 above HUD --> 38 | addConfigItem( "snapAngleHudY" , VCAValueType.float , -1 ) -- any value >= 0 => position of bottom left corner / -1 above HUD --> 39 | addConfigItem( "drawHud" , VCAValueType.bool , true ) 40 | addConfigItem( "mouseAutoRotateBack" , VCAValueType.bool , true ) 41 | addConfigItem( "analogSteering" , VCAValueType.bool , false ) 42 | addConfigItem( "rotateHeadTracking" , VCAValueType.bool , true ) 43 | addConfigItem( "turnOffAWDSpeed" , VCAValueType.int16 , 30 ) -- km/h --> 44 | -- defaults -- 45 | addConfigItem( "adaptiveSteering" , VCAValueType.string, "false" ) 46 | addConfigItem( "camOutsideRotation" , VCAValueType.int16 , 0 ) 47 | addConfigItem( "camInsideRotation" , VCAValueType.int16 , 0 ) 48 | addConfigItem( "camReverseRotation" , VCAValueType.bool , false ) 49 | addConfigItem( "camRevOutRotation" , VCAValueType.bool , false ) 50 | addConfigItem( "peekLeftRight" , VCAValueType.bool , true ) 51 | addConfigItem( "hiredWorker2" , VCAValueType.bool , false ) -- differential for hired worker --> 52 | addConfigItem( "rotSpeedOut" , VCAValueType.float , 0.5 ) 53 | addConfigItem( "rotSpeedIn" , VCAValueType.float , 0.5 ) 54 | addConfigItem( "idleThrottle" , VCAValueType.bool , false ) 55 | end 56 | init() 57 | 58 | function vcaDebugPrint( ... ) 59 | if VCAGlobals.debugPrint then 60 | print( ... ) 61 | end 62 | end 63 | 64 | vehicleControlAddonConfig = {} 65 | local vehicleControlAddonConfig_mt = Class(vehicleControlAddonConfig) 66 | 67 | function vehicleControlAddonConfig.new() 68 | self = {} 69 | setmetatable(self, vehicleControlAddonConfig_mt) 70 | return self 71 | end 72 | 73 | local function loadConfig( fileName ) 74 | if fileName == nil or fileName == "" or not fileExists(fileName) then 75 | return false 76 | end 77 | vcaDebugPrint("VCA config: "..tostring(fileName)) 78 | local xmlFile = loadXMLFile( "vehicleControlAddon", fileName, "vehicleControlAddon" ) 79 | local i = 0 80 | while true do 81 | local xmlKey = string.format("vehicleControlAddon.configuration(%d)", i) 82 | i = i + 1 83 | local name = getXMLString( xmlFile, xmlKey.."#name" ) 84 | if name == nil then 85 | break 86 | end 87 | item = ConfigItems[name] 88 | if item ~= nil then 89 | local value = item.configType.getXML( xmlFile, xmlKey.."#value" ) 90 | if value ~= nil then 91 | vcaDebugPrint("VCAGlobals."..tostring(name).." = "..tostring(value)) 92 | VCAGlobals[name] = value 93 | end 94 | end 95 | end 96 | delete( xmlFile ) 97 | return true 98 | end 99 | 100 | local function saveConfig( fileName ) 101 | if fileName == nil or fileName == "" then 102 | return false 103 | end 104 | vcaDebugPrint("VCA config: "..tostring(fileName)) 105 | --if fileExists(fileName) then 106 | -- getfenv(0).deleteFile(fileName) 107 | --end 108 | local xmlFile = createXMLFile( "vehicleControlAddon", fileName, "vehicleControlAddon" ) 109 | local i = 0 110 | for name,item in pairs(ConfigItems) do 111 | if not item.configType.compare( VCAGlobals[name], item.value ) then 112 | vcaDebugPrint("VCAGlobals."..tostring(name).." = "..tostring(VCAGlobals[name])) 113 | local xmlKey = string.format("vehicleControlAddon.configuration(%d)", i) 114 | i = i + 1 115 | setXMLString( xmlFile, xmlKey.."#name", name ) 116 | item.configType.setXML( xmlFile, xmlKey.."#value", VCAGlobals[name] ) 117 | end 118 | end 119 | saveXMLFile(xmlFile) 120 | delete( xmlFile ) 121 | if fileExists(fileName) then 122 | vcaDebugPrint("VCA config saved") 123 | return true 124 | end 125 | return false 126 | end 127 | 128 | function vehicleControlAddonConfig:getSavegameFileName() 129 | if g_careerScreen and g_careerScreen.currentSavegame ~= nil and g_careerScreen.currentSavegame.savegameDirectory ~= nil then 130 | return g_careerScreen.currentSavegame.savegameDirectory .. "/vehicleControlAddon.xml" 131 | end 132 | end 133 | 134 | function vehicleControlAddonConfig:getModSettingsFileName() 135 | return getUserProfileAppPath().. "modSettings/vehicleControlAddon.xml" 136 | end 137 | 138 | function vehicleControlAddonConfig:load() 139 | if not loadConfig( self:getSavegameFileName() ) and g_dedicatedServerInfo == nil then 140 | loadConfig( self:getModSettingsFileName() ) 141 | end 142 | end 143 | 144 | function vehicleControlAddonConfig:save() 145 | if g_server == nil then 146 | return 147 | end 148 | 149 | saveConfig( self:getSavegameFileName() ) 150 | if g_dedicatedServerInfo == nil then 151 | saveConfig( self:getModSettingsFileName() ) 152 | end 153 | end 154 | 155 | 156 | vehicleControlAddonConfigEvent = {} 157 | vehicleControlAddonConfigEvent_mt = Class(vehicleControlAddonConfigEvent, Event) 158 | InitEventClass(vehicleControlAddonConfigEvent, "vehicleControlAddonConfigEvent") 159 | function vehicleControlAddonConfigEvent.emptyNew() 160 | local self = Event.new(vehicleControlAddonConfigEvent_mt) 161 | self.check1 = 244 162 | self.check2 = 108 163 | return self 164 | end 165 | function vehicleControlAddonConfigEvent.new(init) 166 | local self = vehicleControlAddonConfigEvent.emptyNew() 167 | return self 168 | end 169 | function vehicleControlAddonConfigEvent:readStream(streamId, connection) 170 | local check1 = streamReadUInt8(streamId) 171 | self.globals = {} 172 | for i,name in pairs( ConfigItemIndex ) do 173 | local item = ConfigItems[name] 174 | self.globals[name] = item.configType.streamRead( streamId ) 175 | vcaDebugPrint("Info: vehicleControlAddonConfigEvent received value "..tostring(self.globals[name]).." for state "..tostring(name)) 176 | end 177 | local check2 = streamReadUInt8(streamId) 178 | 179 | if check1 ~= self.check1 then 180 | print("Error in vehicleControlAddonConfigEvent: Event has wrong start marker. Check other mods.") 181 | elseif check2 ~= self.check2 then 182 | print("Error in vehicleControlAddonConfigEvent: Event has wrong end marker. ") 183 | else 184 | self:run(connection) 185 | end 186 | end 187 | function vehicleControlAddonConfigEvent:writeStream(streamId, connection) 188 | streamWriteUInt8(streamId, self.check1 ) 189 | for i,name in pairs( ConfigItemIndex ) do 190 | local item = ConfigItems[name] 191 | item.configType.streamWrite( streamId, VCAGlobals[name] ) 192 | end 193 | streamWriteUInt8(streamId, self.check2 ) 194 | end 195 | function vehicleControlAddonConfigEvent:run(connection) 196 | if type( self.globals ) == "table" then 197 | for name, value in pairs( self.globals ) do 198 | local old = VCAGlobals[name] 199 | VCAGlobals[name] = value 200 | local item = ConfigItems[name] 201 | if not item.configType.compare( old, value ) then 202 | for _, vehicle in pairs(g_currentMission.vehicles) do 203 | if type( vehicle.vcaSetNewDefault ) == "function" then 204 | vehicle:vcaSetNewDefault( name, old, value, true ) 205 | end 206 | end 207 | end 208 | end 209 | end 210 | if not connection:getIsServer() then 211 | g_server:broadcastEvent( vehicleControlAddonConfigEvent.new(self.save), nil, connection, nil ) 212 | end 213 | end 214 | -------------------------------------------------------------------------------- /FS25_VehicleControlAddon/lua/vehicleControlAddonEvent.lua: -------------------------------------------------------------------------------- 1 | -- 2 | -- vehicleControlAddonEvent 3 | -- 4 | vehicleControlAddonEvent = {} 5 | vehicleControlAddonEvent_mt = Class(vehicleControlAddonEvent, Event) 6 | InitEventClass(vehicleControlAddonEvent, "vehicleControlAddonEvent") 7 | function vehicleControlAddonEvent.emptyNew() 8 | local self = Event.new(vehicleControlAddonEvent_mt) 9 | self.check1 = 178 10 | self.check2 = 142 11 | return self 12 | end 13 | function vehicleControlAddonEvent.new(object,name,value) 14 | local self = vehicleControlAddonEvent.emptyNew() 15 | self.object = object 16 | self.name = name 17 | self.value = value 18 | return self 19 | end 20 | function vehicleControlAddonEvent:readStream(streamId, connection) 21 | local check1 = streamReadUInt8(streamId) 22 | self.object = NetworkUtil.readNodeObject( streamId ) 23 | self.name = streamReadString(streamId) 24 | if vehicleControlAddon.properties ~= nil and vehicleControlAddon.properties[self.name] ~= nil then 25 | local prop = vehicleControlAddon.properties[self.name] 26 | self.value = prop.func.streamRead(streamId) 27 | vcaDebugPrint("Info: vehicleControlAddonEvent received value "..tostring(self.value).." for state "..tostring(self.name)) 28 | else 29 | print("Error in vehicleControlAddonEvent: invalid property '"..tostring(self.name).."'") 30 | end 31 | local check2 = streamReadUInt8(streamId) 32 | 33 | if check1 ~= self.check1 then 34 | print("Error in vehicleControlAddonEvent: Event has wrong start marker. Check other mods.") 35 | elseif check2 ~= self.check2 then 36 | print("Error in vehicleControlAddonEvent: Event has wrong end marker. ") 37 | else 38 | self:run(connection) 39 | end 40 | end 41 | function vehicleControlAddonEvent:writeStream(streamId, connection) 42 | streamWriteUInt8(streamId, self.check1 ) 43 | NetworkUtil.writeNodeObject( streamId, self.object ) 44 | streamWriteString(streamId,self.name) 45 | if vehicleControlAddon.properties ~= nil and vehicleControlAddon.properties[self.name] ~= nil then 46 | local prop = vehicleControlAddon.properties[self.name] 47 | prop.func.streamWrite(streamId, Utils.getNoNil( self.value, prop.emptyValue )) 48 | else 49 | print("Error in vehicleControlAddonEvent: invalid property '"..tostring(self.name).."'") 50 | end 51 | streamWriteUInt8(streamId, self.check2 ) 52 | end 53 | function vehicleControlAddonEvent:run(connection) 54 | if self.object == nil then 55 | return 56 | end 57 | vehicleControlAddon.vcaSetState( self.object, self.name, self.value, true ) 58 | if not connection:getIsServer() then 59 | g_server:broadcastEvent(vehicleControlAddonEvent.new(self.object,self.name,self.value), nil, connection, self.object) 60 | end 61 | end 62 | -------------------------------------------------------------------------------- /FS25_VehicleControlAddon/lua/vehicleControlAddonRegister.lua: -------------------------------------------------------------------------------- 1 | 2 | local directory = g_currentModDirectory 3 | local modName = g_currentModName 4 | local specName = "zzzVehicleControlAddon" 5 | 6 | vehicleControlAddonRegister = {} 7 | 8 | local vehicleControlAddonRegister_mt = Class(vehicleControlAddonRegister) 9 | 10 | function vehicleControlAddonRegister.new( i18n ) 11 | self = {} 12 | setmetatable(self, vehicleControlAddonRegister_mt) 13 | self.vcaDirectory = directory 14 | self.vcaModName = modName 15 | self.vcaSpecName = specName 16 | self.i18n = i18n 17 | 18 | return self 19 | end 20 | 21 | local function beforeFinalizeTypes( typeManager ) 22 | 23 | if vehicleControlAddon == nil then 24 | print("Failed to add specialization vehicleControlAddon") 25 | else 26 | local allTypes = typeManager:getTypes( ) 27 | for k, typeDef in pairs(allTypes) do 28 | if typeDef ~= nil and k ~= "locomotive" and k ~= "woodCrusherTrailerDrivable" then 29 | local isDrivable = false 30 | local isEnterable = false 31 | local hasMotor = false 32 | local hasLights = false 33 | local hasWheels = false 34 | local isAttachable = false 35 | local isAiVehicle = false 36 | local hasNotVCA = true 37 | for name, spec in pairs(typeDef.specializationsByName) do 38 | if name == "drivable" then 39 | isDrivable = true 40 | elseif name == "motorized" then 41 | hasMotor = true 42 | elseif name == "enterable" then 43 | isEnterable = true 44 | elseif name == "lights" then 45 | hasLights = true 46 | elseif name == "wheels" then 47 | hasWheels = true 48 | elseif name == "attachable" then 49 | isAttachable = true 50 | elseif name == "aiVehicle" then 51 | isAiVehicle = true 52 | elseif name == specName then 53 | hasNotVCA = false 54 | end 55 | end 56 | if hasNotVCA and isDrivable and isEnterable and hasMotor and hasLights and hasWheels and ( isAiVehicle or not isAttachable ) then 57 | print(" adding vehicleControlAddon to vehicleType '"..tostring(k).."'") 58 | typeDef.specializationsByName[specName] = vehicleControlAddon 59 | table.insert(typeDef.specializationNames, specName) 60 | table.insert(typeDef.specializations, vehicleControlAddon) 61 | end 62 | end 63 | end 64 | end 65 | end 66 | 67 | local function postLoadMissionFinished( mission, node ) 68 | local state, result = pcall( vehicleControlAddonRegister.postLoadMission, g_vehicleControlAddon, mission ) 69 | if state then 70 | return result 71 | else 72 | print("Error calling vehicleControlAddonRegister.postLoadMission :"..tostring(result)) 73 | end 74 | end 75 | 76 | local vcaGetText 77 | 78 | function vehicleControlAddonRegister:postLoadMission(mission) 79 | self.postLoadMissionDone = true 80 | print("--- loading "..self.i18n:getText("vcaVERSION").." by mogli ---") 81 | 82 | if g_languageShort ~= "en" then 83 | l10nXmlFile = loadXMLFile("modL10n", Utils.getFilename("l10n/modDesc_l10n_en.xml",self.vcaDirectory)) 84 | 85 | if l10nXmlFile ~= nil then 86 | local textI = 0 87 | 88 | while true do 89 | local key = string.format("l10n.texts.text(%d)", textI) 90 | 91 | if not hasXMLProperty(l10nXmlFile, key) then 92 | break 93 | end 94 | 95 | local name = getXMLString(l10nXmlFile, key .. "#name") 96 | local text = getXMLString(l10nXmlFile, key .. "#text") 97 | 98 | if name ~= nil and text ~= nil then 99 | if not g_i18n:hasModText(name) then 100 | print("Info (VCA): text "..tostring(name).." is not translated yet. Using English text.") 101 | g_i18n:setText(name, text:gsub("\r\n", "\n")) 102 | end 103 | end 104 | 105 | textI = textI + 1 106 | end 107 | 108 | delete(l10nXmlFile) 109 | end 110 | end 111 | end; 112 | 113 | function vehicleControlAddonRegister:loadMap(name) 114 | if g_server ~= nil then 115 | self.isDedi = g_dedicatedServerInfo ~= nil 116 | if self.isDedi then 117 | self.isMP = true 118 | elseif g_currentMission.missionDynamicInfo ~= nil and g_currentMission.missionDynamicInfo.isMultiplayer then 119 | self.isMP = true 120 | else 121 | self.isMP = false 122 | end 123 | else 124 | self.isMP = true 125 | end 126 | 127 | self.configuration = vehicleControlAddonConfig.new() 128 | if g_server ~= nil then 129 | self.configuration:load() 130 | end 131 | vehicleControlAddon.initSpecialization() 132 | end; 133 | 134 | function vehicleControlAddonRegister:deleteMap() 135 | 136 | end; 137 | 138 | function vehicleControlAddonRegister:keyEvent(unicode, sym, modifier, isDown) 139 | 140 | end; 141 | 142 | function vehicleControlAddonRegister:mouseEvent(posX, posY, isDown, isUp, button) 143 | 144 | end; 145 | 146 | function vehicleControlAddonRegister:update(dt) 147 | 148 | end 149 | 150 | function vehicleControlAddonRegister:draw() 151 | 152 | end; 153 | 154 | local function beforeLoadMission(mission) 155 | assert( g_vehicleControlAddon == nil ) 156 | local base = vehicleControlAddonRegister.new( g_i18n ) 157 | getfenv(0)["g_vehicleControlAddon"] = base 158 | addModEventListener(base); 159 | end 160 | 161 | local function afterConnectionFinishedLoading(mission, connection, x,y,z, viewDistanceCoeff) 162 | -- call on server after a client connected to the server 163 | -- send event with settings from server to new client 164 | connection:sendEvent(vehicleControlAddonConfigEvent.new(true)) 165 | end 166 | 167 | local function afterMissionInfoSaveToXMLFile() 168 | if g_server ~= nil then 169 | g_vehicleControlAddon.configuration:save() 170 | end 171 | end 172 | 173 | local function init() 174 | Mission00.load = Utils.prependedFunction(Mission00.load, beforeLoadMission) 175 | Mission00.loadMission00Finished = Utils.appendedFunction(Mission00.loadMission00Finished, postLoadMissionFinished) 176 | FSBaseMission.onConnectionFinishedLoading = Utils.appendedFunction( FSBaseMission.onConnectionFinishedLoading, afterConnectionFinishedLoading ) 177 | TypeManager.finalizeTypes = Utils.prependedFunction(TypeManager.finalizeTypes, beforeFinalizeTypes) 178 | FSCareerMissionInfo.saveToXMLFile = Utils.appendedFunction( FSCareerMissionInfo.saveToXMLFile, afterMissionInfoSaveToXMLFile ) 179 | end 180 | 181 | init() 182 | 183 | -------------------------------------------------------------------------------- /FS25_VehicleControlAddon/modIcon.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/FS25_VehicleControlAddon/modIcon.dds -------------------------------------------------------------------------------- /FS25_VehicleControlAddon/ogg/GPS_off.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/FS25_VehicleControlAddon/ogg/GPS_off.ogg -------------------------------------------------------------------------------- /FS25_VehicleControlAddon/ogg/GPS_on.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Mogli12/VehicleControlAddon/1d025d630a393628a1c6bd94f8a22c96e21757e2/FS25_VehicleControlAddon/ogg/GPS_on.ogg -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # VehicleControlAddon for Farming Simulator 2025 2 | 3 | ## Status 4 | 5 | First FS25 version... 6 | 7 | ## Developer version 8 | Please be aware you're using a developer version, which may and will contain errors, bugs, mistakes and unfinished code. 9 | 10 | You have been warned. 11 | 12 | If you're still ok with this, please remember to post possible issues that you find in the developer version. 13 | That's the only way we can find sources of error and fix them. 14 | Be as specific as possible: 15 | 16 | * tell us the version number 17 | * only use the vehicles necessary, not 10 other ones at a time 18 | * which vehicles are involved, what is the intended action? 19 | * Post! The! Log! to [Gist](https://gist.github.com/) or [PasteBin](http://pastebin.com/) 20 | 21 | ## Known errors, warnings and problems 22 | Many... 23 | 24 | ## Newest features 25 | Snap direction has been renamed to **lane guidance**. 26 | It is possible to swtich to left or right reverse guidance lane. Here are the lane guidance key bindings: 27 | * LCtrl+W: (de-)activate lane guidane on nearest lane 28 | * LCtrl+LAlt+W: detect width and offset of attached implements 29 | * LAlt+W: Disable lane guidance 30 | * LCtrl+A / LCtrl+D: shift by one lane to the left / right 31 | * LAlt+A / LAlt+D: switch to left / right reverse lane. You can specify the number of lanes to skip in the settings menu. There is no need to deactivate lane guidance for the turn. If you change direction, then the vehicle should steer into the right direction. If you deactivated guidance steering, then you can use LCtrl+S to reactivate it. 32 | * LCtrl+S: Reactivate last guidance lane 33 | 34 | ## Some settings are display only in MP 35 | 36 | In multiplayer games only the master user (aka administrator) can change global settings with key combination LCtrl+LAtr+C. 37 | 38 | ## modSettings 39 | 40 | Global settings are stored in the savegame and in modSettings/vehicleControlAddon.xml. Dedi servers will save the global settings in the savegame only. 41 | 42 | ## Motivation 43 | 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. 44 | 45 | ## Description 46 | tbd 47 | 48 | ## Credits 49 | * Stefan Biedenstein 50 | -------------------------------------------------------------------------------- /allInOne.bat: -------------------------------------------------------------------------------- 1 | @call build.bat 2 | @call deploy.bat -------------------------------------------------------------------------------- /build.bat: -------------------------------------------------------------------------------- 1 | del FS25_VehicleControlAddon.zip 2 | cd FS25_VehicleControlAddon 3 | tar -a -c -f ..\FS25_VehicleControlAddon.zip *.* 4 | cd .. 5 | -------------------------------------------------------------------------------- /deploy.bat: -------------------------------------------------------------------------------- 1 | @echo "mods" 2 | @xcopy FS25_VehicleControlAddon.zip "C:\Users\stefa\OneDrive\Dokumente\My Games\FarmingSimulator2025\mods" /R/U/Y/Q 3 | -------------------------------------------------------------------------------- /modsSettings/FS19_VehicleControlAddon/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /modsSettings/FS19_VehicleControlAddon/transmissions.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | --------------------------------------------------------------------------------