From 4df1bf31ddeae06bed2f04f156136ea3ee4019b9 Mon Sep 17 00:00:00 2001 From: "DESKTOP-UH65DCE\\MusTanG" Date: Mon, 24 Jul 2017 08:56:34 -0500 Subject: [PATCH] Exile Snap Mode Rotation Correction --- .../ExileClient_gui_hud_event_onKeyDown.sqf | 70 +++++++++++++++---- 1 file changed, 56 insertions(+), 14 deletions(-) diff --git a/eXile.MAPNAME/eXpochVectorBldg/ExileClient_gui_hud_event_onKeyDown.sqf b/eXile.MAPNAME/eXpochVectorBldg/ExileClient_gui_hud_event_onKeyDown.sqf index ff04ab7..11c2b41 100644 --- a/eXile.MAPNAME/eXpochVectorBldg/ExileClient_gui_hud_event_onKeyDown.sqf +++ b/eXile.MAPNAME/eXpochVectorBldg/ExileClient_gui_hud_event_onKeyDown.sqf @@ -75,26 +75,68 @@ switch (_keyCode) do { if (ExileClientIsInConstructionMode) then { - _step = 1; - if(_shiftState)then{_step = 3;}; - if(_controlState)then{_step = 0.5;}; - if(_altState)then{ _step = 0.25;}; - BuildVecYaw = (((BuildVecYaw - _step)min 360) max -360); - [] call ExileClient_gui_constructionMode_update; - _stopPropagation = true; + if!(ExileClientConstructionMode isEqualTo 3)then + { + _step = 1; + if(_shiftState)then{_step = 3;}; + if(_controlState)then{_step = 0.5;}; + if(_altState)then{ _step = 0.25;}; + BuildVecYaw = (((BuildVecYaw - _step)min 360) max -360); + [] call ExileClient_gui_constructionMode_update; + _stopPropagation = true; + } + else + { + _step = 45; + if (_shiftState) then + { + _step = 90; + } + else + { + if (_controlState) then + { + _step = 22.5; + }; + }; + ExileClientConstructionRotation = (ExileClientConstructionRotation - _step + 360) % 360; + [] call ExileClient_gui_constructionMode_update; + _stopPropagation = true; + }; }; }; case 0x12: { if (ExileClientIsInConstructionMode) then { - _step = 1; - if(_shiftState)then{_step = 3;}; - if(_controlState)then{_step = 0.5;}; - if(_altState)then{ _step = 0.25;}; - BuildVecYaw = (((BuildVecYaw + _step)min 360) max -360); - [] call ExileClient_gui_constructionMode_update; - _stopPropagation = true; + if!(ExileClientConstructionMode isEqualTo 3)then + { + _step = 1; + if(_shiftState)then{_step = 3;}; + if(_controlState)then{_step = 0.5;}; + if(_altState)then{ _step = 0.25;}; + BuildVecYaw = (((BuildVecYaw + _step)min 360) max -360); + [] call ExileClient_gui_constructionMode_update; + _stopPropagation = true; + } + else + { + _step = 45; + if (_shiftState) then + { + _step = 90; + } + else + { + if (_controlState) then + { + _step = 22.5; + }; + }; + ExileClientConstructionRotation = (ExileClientConstructionRotation + _step + 360) % 360; + [] call ExileClient_gui_constructionMode_update; + _stopPropagation = true; + }; }; }; case 0x47: