ACE3/addons/atragmx/functions/fnc_change_gun.sqf
ulteq e35d3dab49 Overworked the ATragMX target slot logic:
*Added missing privates
*Solutions are now automatically calculated on target/gun selection
2015-04-16 18:14:32 +02:00

39 lines
916 B
Plaintext

/*
* Author: Ruthberg
* Selects a new gun profile and updates the gun column and the result input/output fields
*
* Arguments:
* gunID <number>
*
* Return Value:
* Nothing
*
* Example:
* call ace_atragmx_change_gun
*
* Public: No
*/
#include "script_component.hpp"
if (_this < 0 || _this > (count GVAR(gunList)) - 1) exitWith {};
GVAR(workingMemory) = +(GVAR(gunList) select _this);
GVAR(currentGun) = _this;
lbSetCurSel [6000, GVAR(currentGun)];
if ((GVAR(scopeUnits) select GVAR(currentScopeUnit)) != "Clicks") then
{
GVAR(currentScopeUnit) = GVAR(workingMemory) select 6;
};
[] call FUNC(update_gun);
GVAR(elevationOutput) set [GVAR(currentTarget), 0];
GVAR(windageOutput) set [GVAR(currentTarget), 0];
GVAR(leadOutput) set [GVAR(currentTarget), 0];
GVAR(tofOutput) set [GVAR(currentTarget), 0];
GVAR(velocityOutput) set [GVAR(currentTarget), 0];
[] call FUNC(calculate_target_solution);