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 1d4c2aa4..a69a6222 100644 --- a/Sources/epoch_code/compile/interface_event_handlers/EPOCH_KeyDown.sqf +++ b/Sources/epoch_code/compile/interface_event_handlers/EPOCH_KeyDown.sqf @@ -107,7 +107,7 @@ if (_dikCode == EPOCH_keysAction) then { // Player only code if (vehicle player == player) then { - if (_dikCode == EPOCH_keysBuildMode1 && EPOCH_buildMode > 0) then { + if ((_dikCode == EPOCH_keysBuildMode1 && !EPOCH_favBar_itemConsumed) && EPOCH_buildMode > 0) then { EPOCH_buildMode = 0; ["Build Mode: Disabled", 5] call Epoch_message; EPOCH_Target = objNull; @@ -231,6 +231,8 @@ if (vehicle player == player) then { }; // end player only code +EPOCH_favBar_itemConsumed = false; + if (_dikCode in (actionKeys "Salute")) then { if (_ctrl) then { player playactionNow "GestureFinger"; diff --git a/Sources/epoch_code/gui/scripts/favBar/epoch_favBar_action.sqf b/Sources/epoch_code/gui/scripts/favBar/epoch_favBar_action.sqf index 2b113e9a..1bc58adc 100644 --- a/Sources/epoch_code/gui/scripts/favBar/epoch_favBar_action.sqf +++ b/Sources/epoch_code/gui/scripts/favBar/epoch_favBar_action.sqf @@ -27,24 +27,28 @@ _tileIdx = switch (_kee) do { _item = rmx_var_favBar_current select _tileIdx; _itemHasInteraction = str(missionConfigFile >> "CfgItemInteractions" >> _item) != ""; -if (_itemHasInteraction) then { - EPOCH_InteractedItem = ["",_item,""]; - [] call EPOCH_consumeItem; -} else { - _slot = _item call epoch_itemTypeSlot; - _force = if (_slot in [3,4,5,7,8,10,11,16]) then {true} else {false}; //see how it works with other items, definitely keep true for weapons - _errorCode = [_item,EPOCH_fav_DropIfOverflow,_force] call epoch_equip; - player selectWeapon _item; +if (EPOCH_buildMode == 0) then { + if (_itemHasInteraction) then { + EPOCH_InteractedItem = ["",_item,""]; + [] call EPOCH_consumeItem; + EPOCH_favBar_itemConsumed = true; + } else { + _slot = _item call epoch_itemTypeSlot; + _force = if (_slot in [3,4,5,7,8,10,11,16]) then {true} else {false}; //see how it works with other items, definitely keep true for weapons + _errorCode = [_item,EPOCH_fav_DropIfOverflow,_force] call epoch_equip; + player selectWeapon _item; - if (_slot in [3,4,5]) then { - _curSlot = _item call epoch_itemTypeSlot; - if (_curSlot == _slot && !EPOCH_fav_FastWeaponSwitching && _errorCode in [1,2]) then {player playAction "reloadMagazine";}; + if (_slot in [3,4,5]) then { + _curSlot = _item call epoch_itemTypeSlot; + if (_curSlot == _slot && !EPOCH_fav_FastWeaponSwitching && _errorCode in [1,2]) then {player playAction "reloadMagazine";}; + }; + + if (_errorCode isEqualTo 2) then {"Not enough space, item dropped on the ground!" call epoch_message;}; + if (_errorCode isEqualTo 4 && _item != (currentWeapon player)) then {"Not enough space!" call epoch_message;}; + if (_errorCode isEqualTo 3) then {"Item not found!" call epoch_message;}; + if (_errorCode isEqualTo 5) then {"No compatible weapon found!" call epoch_message;}; }; - - if (_errorCode isEqualTo 2) then {"Not enough space, item dropped on the ground!" call epoch_message;}; - if (_errorCode isEqualTo 4 && _item != (currentWeapon player)) then {"Not enough space!" call epoch_message;}; - if (_errorCode isEqualTo 3) then {"Item not found!" call epoch_message;}; - if (_errorCode isEqualTo 5) then {"No compatible weapon found!" call epoch_message;}; +} else { + "Can't use while in building mode!" call epoch_message; }; - true diff --git a/Sources/epoch_code/init/client_init.sqf b/Sources/epoch_code/init/client_init.sqf index f6d4e494..d1871306 100644 --- a/Sources/epoch_code/init/client_init.sqf +++ b/Sources/epoch_code/init/client_init.sqf @@ -62,6 +62,7 @@ rmx_var_dynamicHUD_groups = []; rmx_var_dynamicHUD_groupCTRL = []; //Favorites bar +EPOCH_favBar_itemConsumed = false; rmx_var_favBar_Item = ""; EPOCH_modKeys = [false,false,false];