ACE3/addons/atragmx/functions/fnc_update_result.sqf

66 lines
2.3 KiB
Plaintext
Raw Normal View History

#include "script_component.hpp"
private ["_elevationAbs", "_elevationRel", "_elevationCur", "_windageAbs", "_windageRel", "_windageCur", "_lead", "_elevationScopeStep", "_windageScopeStep"];
2015-04-08 09:05:28 +00:00
_elevationAbs = (GVAR(elevationOutput) select GVAR(currentTarget));
_windageAbs = (GVAR(windageOutput) select GVAR(currentTarget));
2015-04-08 09:05:28 +00:00
_elevationCur = (GVAR(workingMemory) select GVAR(currentTarget)) select 10;
_windageCur = (GVAR(workingMemory) select GVAR(currentTarget)) select 11;
_elevationRel = _elevationAbs - _elevationCur;
_windageRel = _windageAbs - _windageCur;
2015-04-08 09:05:28 +00:00
_lead = (GVAR(leadOutput) select GVAR(currentTarget));
2015-04-08 09:05:28 +00:00
switch ((GVAR(currentScopeUnit) select GVAR(currentTarget))) do
{
case 0:
{
2015-04-07 20:44:26 +00:00
_elevationAbs = _elevationAbs / 3.38;
_windageAbs = _windageAbs / 3.38;
_elevationRel = _elevationRel / 3.38;
_windageRel = _windageRel / 3.38;
_elevationCur = _elevationCur / 3.38;
_windageCur = _windageCur / 3.38;
};
2015-04-07 20:44:26 +00:00
case 2:
{
2015-04-07 20:44:26 +00:00
_elevationAbs = _elevationAbs * 1.047;
_windageAbs = _windageAbs * 1.047;
_elevationRel = _elevationRel * 1.047;
_windageRel = _windageRel * 1.047;
_elevationCur = _elevationCur * 1.047;
_windageCur = _windageCur * 1.047;
};
2015-04-07 20:44:26 +00:00
case 3:
{
2015-04-08 09:05:28 +00:00
_elevationScopeStep = ((GVAR(workingMemory) select GVAR(currentTarget)) select 7);
_windageScopeStep = ((GVAR(workingMemory) select GVAR(currentTarget)) select 8);
2015-04-07 20:44:26 +00:00
_elevationAbs = Round(_elevationAbs / _elevationScopeStep);
_windageAbs = Round(_windageAbs / _windageScopeStep);
_elevationRel = Round(_elevationRel / _elevationScopeStep);
_windageRel = Round(_windageRel / _windageScopeStep);
_elevationCur = Round(_elevationCur / _elevationScopeStep);
_windageCur = Round(_windageCur / _windageScopeStep);
};
};
ctrlSetText [400, Str(Round(_elevationAbs * 100) / 100)];
ctrlSetText [401, Str(Round(_elevationRel * 100) / 100)];
ctrlSetText [402, Str(Round(_elevationCur * 100) / 100)];
ctrlSetText [410, Str(Round(_windageAbs * 100) / 100)];
ctrlSetText [411, Str(Round(_windageRel * 100) / 100)];
ctrlSetText [412, Str(Round(_windageCur * 100) / 100)];
ctrlSetText [420, Str(Round(_lead * 100) / 100)];