ACE3/addons/atragmx/functions/fnc_change_gun.sqf
ulteq 314b0d23d6 ATragMX Feature Expansion:
*Added Gun and Ammo Data Screen
*Added Atomospheric and Environmental Data Screen
*Added Target Data Screen
*Added support for coriolis- and spin drift
*Added a second option (AT) to enter atmospheric data
*Target data is now saved/restored in/from the profileNamespace
*Atmosphere data is now saved/restored in/from the profileNamespace
*Selected gun profile is now saved/restored in/from the profileNamespace
*Fixed several bugs in the dual-/imperial unit systems
*Minor bug fixes in the target range assist screen
*Minor bug fix in the target speed assist screen
2015-04-18 00:11:53 +02:00

46 lines
1.1 KiB
Plaintext

/*
* Author: Ruthberg
* Selects a new gun profile and updates the gun column and the result input/output fields
*
* Arguments:
* gunID <number>
* update solution <BOOL>
*
* Return Value:
* Nothing
*
* Example:
* call ace_atragmx_change_gun
*
* Public: No
*/
#include "script_component.hpp"
private ["_gunID", "_updateSolution"];
_gunID = _this select 0;
_updateSolution = _this select 1;
if (_gunID < 0 || _gunID > (count GVAR(gunList)) - 1) exitWith {};
GVAR(workingMemory) = +(GVAR(gunList) select _gunID);
GVAR(currentGun) = _gunID;
lbSetCurSel [6000, GVAR(currentGun)];
if ((GVAR(scopeUnits) select GVAR(currentScopeUnit)) != "Clicks") then {
GVAR(currentScopeUnit) = GVAR(workingMemory) select 6;
};
[] call FUNC(update_gun);
[] call FUNC(update_gun_ammo_data);
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];
if (_updateSolution) then {
[] call FUNC(calculate_target_solution);
};