From 1f8293ccc76052dd7bd2e80c1f109a58079dabdf Mon Sep 17 00:00:00 2001 From: He-Man Date: Sat, 7 Apr 2018 23:46:37 +0200 Subject: [PATCH] Config to restrict Vectorbuilding (max tilting) --- .../compile/interface_event_handlers/EPOCH_KeyDown.sqf | 8 ++++---- Sources/epoch_code/init/client_init.sqf | 2 ++ Sources/epoch_config/Configs/CfgEpochClient.hpp | 3 +++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Sources/epoch_code/compile/interface_event_handlers/EPOCH_KeyDown.sqf b/Sources/epoch_code/compile/interface_event_handlers/EPOCH_KeyDown.sqf index 395d0a2e..485e5ac9 100644 --- a/Sources/epoch_code/compile/interface_event_handlers/EPOCH_KeyDown.sqf +++ b/Sources/epoch_code/compile/interface_event_handlers/EPOCH_KeyDown.sqf @@ -161,10 +161,10 @@ if (vehicle player == player) then { }; if (Epoch_target iskindof 'Const_Ghost_EPOCH') then { switch (_dikCode) do { - case eXpoch_keysVectorTiltL: {_adj = 1;if(_shift)then{_adj = 2.5};if(_alt)then{_adj = 0.5};EPOCH_buildDirectionRoll = (EPOCH_buildDirectionRoll - _adj) max -180; EPOCH_doRotate = true; _handled = true }; - case eXpoch_keysVectorTiltR: {_adj = 1;if(_shift)then{_adj = 2.5};if(_alt)then{_adj = 0.5};EPOCH_buildDirectionRoll = (EPOCH_buildDirectionRoll + _adj) min 180; EPOCH_doRotate = true; _handled = true }; - case eXpoch_keysVectorTiltAwy: {_adj = 1;if(_shift)then{_adj = 2.5};if(_alt)then{_adj = 0.5};EPOCH_buildDirectionPitch = (EPOCH_buildDirectionPitch - _adj) max -180; EPOCH_doRotate = true; _handled = true }; - case eXpoch_keysVectorTiltTwd: {_adj = 1;if(_shift)then{_adj = 2.5};if(_alt)then{_adj = 0.5};EPOCH_buildDirectionPitch = (EPOCH_buildDirectionPitch + _adj) min 180; EPOCH_doRotate = true; _handled = true }; + case eXpoch_keysVectorTiltL: {_adj = 1;if(_shift)then{_adj = 2.5};if(_alt)then{_adj = 0.5};EPOCH_buildDirectionRoll = (EPOCH_buildDirectionRoll - _adj) max -EPOCH_MaxBuildingTiltLR; EPOCH_doRotate = true; _handled = true }; + case eXpoch_keysVectorTiltR: {_adj = 1;if(_shift)then{_adj = 2.5};if(_alt)then{_adj = 0.5};EPOCH_buildDirectionRoll = (EPOCH_buildDirectionRoll + _adj) min EPOCH_MaxBuildingTiltLR; EPOCH_doRotate = true; _handled = true }; + case eXpoch_keysVectorTiltAwy: {_adj = 1;if(_shift)then{_adj = 2.5};if(_alt)then{_adj = 0.5};EPOCH_buildDirectionPitch = (EPOCH_buildDirectionPitch - _adj) max -EPOCH_MaxBuildingTiltFB; EPOCH_doRotate = true; _handled = true }; + case eXpoch_keysVectorTiltTwd: {_adj = 1;if(_shift)then{_adj = 2.5};if(_alt)then{_adj = 0.5};EPOCH_buildDirectionPitch = (EPOCH_buildDirectionPitch + _adj) min EPOCH_MaxBuildingTiltFB; EPOCH_doRotate = true; _handled = true }; }; }; }; diff --git a/Sources/epoch_code/init/client_init.sqf b/Sources/epoch_code/init/client_init.sqf index 65a1686c..c3ef215a 100644 --- a/Sources/epoch_code/init/client_init.sqf +++ b/Sources/epoch_code/init/client_init.sqf @@ -83,6 +83,8 @@ EPOCH_keysActionPressed = false; //prevents EH spam // load some frequently used configs to variables EPOCH_maxBuildingHeight = ["CfgEpochClient", "maxBuildingHeight", 100] call EPOCH_fnc_returnConfigEntryV2; +EPOCH_MaxBuildingTiltLR = ["CfgEpochClient", "MaxBuildingTiltLR", 180] call EPOCH_fnc_returnConfigEntryV2; +EPOCH_MaxBuildingTiltFB = ["CfgEpochClient", "MaxBuildingTiltFB", 180] call EPOCH_fnc_returnConfigEntryV2; Epoch_NuisanceMulti = ["CfgEpochClient", "NuisanceMulti", 0.5] call EPOCH_fnc_returnConfigEntryV2; //ON INIT and RESPAWN diff --git a/Sources/epoch_config/Configs/CfgEpochClient.hpp b/Sources/epoch_config/Configs/CfgEpochClient.hpp index ab381640..8e5887d0 100644 --- a/Sources/epoch_config/Configs/CfgEpochClient.hpp +++ b/Sources/epoch_config/Configs/CfgEpochClient.hpp @@ -56,6 +56,9 @@ class CfgEpochClient maxdoors = 10; // Max allowed doors per Group maxgates = 5; // Max allowed Gates per Group + MaxBuildingTiltLR = 180; // Max degrees players can tilt building elements left / right + MaxBuildingTiltFB = 180; // Max degrees players can tilt building elements forward backward + AtmBlockedAtPlot = "true"; // Block ATM's in Plotpole-Range disableRemoteSensors = "true"; // disableRemoteSensors true/false