summaryrefslogtreecommitdiffstats
path: root/src/core/ControllerConfig.cpp
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2021-02-11 16:16:01 +0100
committerSergeanur <s.anureev@yandex.ua>2021-02-11 16:16:01 +0100
commite4320c02cf695afdd48c6fa54f0d82273306cf53 (patch)
tree9ee7e163c0dc5c59438b495ff26b94e482ab31cc /src/core/ControllerConfig.cpp
parentFix black screen during credits (diff)
downloadre3-e4320c02cf695afdd48c6fa54f0d82273306cf53.tar
re3-e4320c02cf695afdd48c6fa54f0d82273306cf53.tar.gz
re3-e4320c02cf695afdd48c6fa54f0d82273306cf53.tar.bz2
re3-e4320c02cf695afdd48c6fa54f0d82273306cf53.tar.lz
re3-e4320c02cf695afdd48c6fa54f0d82273306cf53.tar.xz
re3-e4320c02cf695afdd48c6fa54f0d82273306cf53.tar.zst
re3-e4320c02cf695afdd48c6fa54f0d82273306cf53.zip
Diffstat (limited to 'src/core/ControllerConfig.cpp')
-rw-r--r--src/core/ControllerConfig.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/core/ControllerConfig.cpp b/src/core/ControllerConfig.cpp
index 2c79b6aa..72d31137 100644
--- a/src/core/ControllerConfig.cpp
+++ b/src/core/ControllerConfig.cpp
@@ -131,6 +131,9 @@ void CControllerConfigManager::LoadSettings(int32 file)
{
bool bValid = true;
int nVersion = 0;
+#ifdef BIND_VEHICLE_FIREWEAPON
+ bool skipVehicleFireWeapon = false;
+#endif
if (file)
{
@@ -148,11 +151,26 @@ void CControllerConfigManager::LoadSettings(int32 file)
if (bValid && nVersion >= 3)
{
ControlsManager.MakeControllerActionsBlank();
+#ifdef BIND_VEHICLE_FIREWEAPON
+ skipVehicleFireWeapon = nVersion < 4;
+ // Set the default settings of VEHICLE_FIREWEAPON
+ if (skipVehicleFireWeapon) {
+ SetControllerKeyAssociatedWithAction(VEHICLE_FIREWEAPON, rsPADINS, KEYBOARD);
+ SetControllerKeyAssociatedWithAction(VEHICLE_FIREWEAPON, rsLCTRL, OPTIONAL_EXTRA);
+ if (m_bMouseAssociated)
+ SetMouseButtonAssociatedWithAction(VEHICLE_FIREWEAPON, 1);
+ }
+#endif
for (int32 i = 0; i < MAX_CONTROLLERTYPES; i++)
{
for (int32 j = 0; j < MAX_CONTROLLERACTIONS; j++)
{
+#ifdef BIND_VEHICLE_FIREWEAPON
+ // Skip file read
+ if (skipVehicleFireWeapon && j == VEHICLE_FIREWEAPON)
+ continue;
+#endif
CFileMgr::Read(file, (char *)&ControlsManager.m_aSettings[j][i], sizeof(tControllerConfigBind));
}
}