diff --git a/addons/common/XEH_postInit.sqf b/addons/common/XEH_postInit.sqf index eaf9c38ab..a06f9d6ff 100644 --- a/addons/common/XEH_postInit.sqf +++ b/addons/common/XEH_postInit.sqf @@ -141,6 +141,11 @@ [QGVAR(doWatch), { params ["_unit", "_target"]; _unit doWatch _target; + { + if !(_x checkAIFeature "ANIM") then { + _x setDir (_x getDir _target); + }; + } forEach flatten [_unit]; }] call CBA_fnc_addEventHandler; [QGVAR(doTarget), { @@ -199,6 +204,17 @@ _unit selectWeapon _muzzle; }] call CBA_fnc_addEventHandler; +[QGVAR(switchWeapon), { + params ["_unit", "_muzzle"]; + _unit selectWeapon _muzzle; + if (_muzzle == secondaryWeapon _unit) then { + _unit playMove "amovpercmstpsraswlnrdnon"; + _unit disableAI "ANIM"; + } else { + _unit enableAI "ANIM"; + }; +}] call CBA_fnc_addEventHandler; + [QGVAR(selectWeaponTurret), { params ["_vehicle", "_weapon", "_turretPath", ["_muzzle", ""], ["_fireMode", ""]]; _vehicle selectWeaponTurret [_weapon, _turretPath, _muzzle, _fireMode]; diff --git a/addons/context_actions/CfgContext.hpp b/addons/context_actions/CfgContext.hpp index 6c0bc798c..0da9ed277 100644 --- a/addons/context_actions/CfgContext.hpp +++ b/addons/context_actions/CfgContext.hpp @@ -261,15 +261,20 @@ class EGVAR(context_menu,actions) { icon = "\a3\ui_f\data\GUI\Rsc\RscDisplayArsenal\primaryWeapon_ca.paa"; args = 0; }; + class Launcher: Primary { + displayName = "$STR_A3_RSCDisplayArsenal_Tab_SecondaryWeapon"; + icon = "\a3\ui_f\data\GUI\Rsc\RscDisplayArsenal\secondaryWeapon_ca.paa"; + args = 1; + }; class Handgun: Primary { displayName = "$STR_A3_RSCDisplayArsenal_Tab_Handgun"; icon = "\a3\ui_f\data\GUI\Rsc\RscDisplayArsenal\handgun_ca.paa"; - args = 1; + args = 2; }; class Binoculars: Primary { displayName = "$STR_A3_RSCDisplayArsenal_Tab_Binoculars"; icon = "\a3\ui_f\data\GUI\Rsc\RscDisplayArsenal\binoculars_ca.paa"; - args = 2; + args = 3; }; }; }; diff --git a/addons/context_actions/functions/fnc_switchWeapon.sqf b/addons/context_actions/functions/fnc_switchWeapon.sqf index 1071852ff..b290e048e 100644 --- a/addons/context_actions/functions/fnc_switchWeapon.sqf +++ b/addons/context_actions/functions/fnc_switchWeapon.sqf @@ -18,5 +18,6 @@ params ["_unit", "_weaponIndex"]; -private _weapon = [primaryWeapon _unit, handgunWeapon _unit, binocular _unit] select _weaponIndex; -[QEGVAR(common,selectWeapon), [_unit, _weapon], _unit] call CBA_fnc_targetEvent; +private _weapon = [primaryWeapon _unit, secondaryWeapon _unit, handgunWeapon _unit, binocular _unit] select _weaponIndex; + +[QEGVAR(common,switchWeapon), [_unit, _weapon], _unit] call CBA_fnc_targetEvent; diff --git a/addons/context_actions/functions/fnc_switchWeaponModifier.sqf b/addons/context_actions/functions/fnc_switchWeaponModifier.sqf index fc34d8233..2411e94a2 100644 --- a/addons/context_actions/functions/fnc_switchWeaponModifier.sqf +++ b/addons/context_actions/functions/fnc_switchWeaponModifier.sqf @@ -22,6 +22,7 @@ _actionParams params ["", "", "", "", "", "_hoveredEntity"]; private _weapon = [ primaryWeapon _hoveredEntity, + secondaryWeapon _hoveredEntity, handgunWeapon _hoveredEntity, binocular _hoveredEntity ] select _args;