2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2015-04-11 21:40:46 +00:00
|
|
|
/*
|
|
|
|
* Author: Ruthberg
|
|
|
|
* Updates the result input and output fields
|
|
|
|
*
|
|
|
|
* Arguments:
|
2017-06-08 13:31:51 +00:00
|
|
|
* None
|
2015-04-11 21:40:46 +00:00
|
|
|
*
|
|
|
|
* Return Value:
|
2017-06-08 13:31:51 +00:00
|
|
|
* None
|
2015-04-11 21:40:46 +00:00
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* call ace_atragmx_fnc_update_result
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
2015-04-06 13:51:59 +00:00
|
|
|
|
2017-10-10 14:39:59 +00:00
|
|
|
private _elevationAbs = GVAR(elevationOutput) select GVAR(currentTarget);
|
|
|
|
private _elevationRel = 0;
|
|
|
|
private _elevationCur = 0;
|
|
|
|
private _windageAbs = GVAR(windage1Output) select GVAR(currentTarget);
|
|
|
|
private _windageRel = 0;
|
|
|
|
private _windageCur = 0;
|
2015-04-18 13:08:54 +00:00
|
|
|
|
2017-10-10 14:39:59 +00:00
|
|
|
private _wind2 = GVAR(windage2Output) select GVAR(currentTarget);
|
2015-04-06 13:51:59 +00:00
|
|
|
|
2016-11-02 12:56:59 +00:00
|
|
|
if (GVAR(showCoriolis)) then {
|
|
|
|
_elevationRel = GVAR(verticalCoriolisOutput) select GVAR(currentTarget);
|
|
|
|
_windageRel = GVAR(horizontalCoriolisOutput) select GVAR(currentTarget);
|
2017-06-08 13:31:51 +00:00
|
|
|
|
2016-11-02 12:56:59 +00:00
|
|
|
_windageCur = GVAR(spinDriftOutput) select GVAR(currentTarget);
|
|
|
|
} else {
|
|
|
|
_elevationCur = GVAR(workingMemory) select 10;
|
|
|
|
_windageCur = GVAR(workingMemory) select 11;
|
2015-04-06 13:51:59 +00:00
|
|
|
|
2016-11-02 12:56:59 +00:00
|
|
|
_elevationRel = _elevationAbs - _elevationCur;
|
|
|
|
_windageRel = _windageAbs - _windageCur;
|
|
|
|
};
|
2015-04-06 13:51:59 +00:00
|
|
|
|
2017-10-10 14:39:59 +00:00
|
|
|
private _lead = GVAR(leadOutput) select GVAR(currentTarget);
|
2015-04-06 13:51:59 +00:00
|
|
|
|
2015-04-17 22:11:53 +00:00
|
|
|
switch (GVAR(currentScopeUnit)) do {
|
|
|
|
case 0: {
|
2017-10-28 19:42:03 +00:00
|
|
|
_elevationAbs = MOA_TO_MRAD(_elevationAbs);
|
|
|
|
_windageAbs = MOA_TO_MRAD(_windageAbs);
|
2016-05-03 00:32:44 +00:00
|
|
|
|
2017-10-28 19:42:03 +00:00
|
|
|
_wind2 = MOA_TO_MRAD(_wind2);
|
2016-05-03 00:32:44 +00:00
|
|
|
|
2017-10-28 19:42:03 +00:00
|
|
|
_elevationRel = MOA_TO_MRAD(_elevationRel);
|
|
|
|
_windageRel = MOA_TO_MRAD(_windageRel);
|
2016-05-03 00:32:44 +00:00
|
|
|
|
2017-10-28 19:42:03 +00:00
|
|
|
_elevationCur = MOA_TO_MRAD(_elevationCur);
|
|
|
|
_windageCur = MOA_TO_MRAD(_windageCur);
|
2015-04-06 13:51:59 +00:00
|
|
|
};
|
2015-04-17 22:11:53 +00:00
|
|
|
case 2: {
|
2015-04-07 20:44:26 +00:00
|
|
|
_elevationAbs = _elevationAbs * 1.047;
|
|
|
|
_windageAbs = _windageAbs * 1.047;
|
2016-05-03 00:32:44 +00:00
|
|
|
|
2015-04-18 13:08:54 +00:00
|
|
|
_wind2 = _wind2 / 1.047;
|
2016-05-03 00:32:44 +00:00
|
|
|
|
2015-04-07 20:44:26 +00:00
|
|
|
_elevationRel = _elevationRel * 1.047;
|
|
|
|
_windageRel = _windageRel * 1.047;
|
2016-05-03 00:32:44 +00:00
|
|
|
|
2015-04-07 20:44:26 +00:00
|
|
|
_elevationCur = _elevationCur * 1.047;
|
|
|
|
_windageCur = _windageCur * 1.047;
|
2015-04-06 13:51:59 +00:00
|
|
|
};
|
2015-04-17 22:11:53 +00:00
|
|
|
case 3: {
|
2017-10-28 19:42:03 +00:00
|
|
|
private _clickSize = [1, 1 / 1.047, MRAD_TO_MOA(1)] select (GVAR(workingMemory) select 7);
|
2017-10-10 14:39:59 +00:00
|
|
|
private _clickNumber = GVAR(workingMemory) select 8;
|
|
|
|
private _clickInterval = _clickSize / _clickNumber;
|
2016-05-03 00:32:44 +00:00
|
|
|
|
2015-04-21 13:01:23 +00:00
|
|
|
_elevationAbs = Round(_elevationAbs / _clickInterval);
|
|
|
|
_windageAbs = Round(_windageAbs / _clickInterval);
|
2016-05-03 00:32:44 +00:00
|
|
|
|
2015-04-21 13:01:23 +00:00
|
|
|
_wind2 = Round(_wind2 / _clickInterval);
|
2016-05-03 00:32:44 +00:00
|
|
|
|
2015-04-21 13:01:23 +00:00
|
|
|
_elevationRel = Round(_elevationRel / _clickInterval);
|
|
|
|
_windageRel = Round(_windageRel / _clickInterval);
|
2016-05-03 00:32:44 +00:00
|
|
|
|
2015-04-21 13:01:23 +00:00
|
|
|
_elevationCur = Round(_elevationCur / _clickInterval);
|
|
|
|
_windageCur = Round(_windageCur / _clickInterval);
|
2015-04-06 13:51:59 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2015-04-18 13:08:54 +00:00
|
|
|
if (GVAR(showWind2)) then {
|
|
|
|
ctrlSetText [42, "Wind2"];
|
|
|
|
} else {
|
|
|
|
ctrlSetText [42, "Lead"];
|
|
|
|
};
|
|
|
|
|
2015-04-21 13:46:53 +00:00
|
|
|
_elevationAbs = Round(_elevationAbs * 100) / 100;
|
|
|
|
if (_elevationAbs > 0) then {
|
2024-02-04 17:50:24 +00:00
|
|
|
ctrlSetText [400, str abs _elevationAbs];
|
2015-04-21 13:46:53 +00:00
|
|
|
} else {
|
|
|
|
if (_elevationAbs < 0) then {
|
|
|
|
ctrlSetText [400, format["%1D", abs(_elevationAbs)]];
|
|
|
|
} else {
|
|
|
|
ctrlSetText [400, "0.0"];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
_elevationRel = Round(_elevationRel * 100) / 100;
|
|
|
|
if (_elevationRel > 0) then {
|
2024-02-04 17:50:24 +00:00
|
|
|
ctrlSetText [401, str abs _elevationRel];
|
2015-04-21 13:46:53 +00:00
|
|
|
} else {
|
|
|
|
if (_elevationRel < 0) then {
|
|
|
|
ctrlSetText [401, format["%1D", abs(_elevationRel)]];
|
|
|
|
} else {
|
|
|
|
ctrlSetText [401, "0.0"];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
_elevationCur = Round(_elevationCur * 100) / 100;
|
|
|
|
if (_elevationCur > 0) then {
|
2024-02-04 17:50:24 +00:00
|
|
|
ctrlSetText [402, str abs _elevationCur];
|
2015-04-21 13:46:53 +00:00
|
|
|
} else {
|
|
|
|
if (_elevationCur < 0) then {
|
|
|
|
ctrlSetText [402, format["%1D", abs(_elevationCur)]];
|
|
|
|
} else {
|
|
|
|
ctrlSetText [402, "0.0"];
|
|
|
|
};
|
|
|
|
};
|
2015-04-06 13:51:59 +00:00
|
|
|
|
2015-04-21 13:46:53 +00:00
|
|
|
_windageAbs = Round(_windageAbs * 100) / 100;
|
|
|
|
if (_windageAbs > 0) then {
|
|
|
|
ctrlSetText [410, format["%1R", abs(_windageAbs)]];
|
|
|
|
} else {
|
|
|
|
if (_windageAbs < 0) then {
|
|
|
|
ctrlSetText [410, format["%1L", abs(_windageAbs)]];
|
|
|
|
} else {
|
|
|
|
ctrlSetText [410, "0.0"];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
_windageRel = Round(_windageRel * 100) / 100;
|
|
|
|
if (_windageRel > 0) then {
|
|
|
|
ctrlSetText [411, format["%1R", abs(_windageRel)]];
|
|
|
|
} else {
|
|
|
|
if (_windageRel < 0) then {
|
|
|
|
ctrlSetText [411, format["%1L", abs(_windageRel)]];
|
|
|
|
} else {
|
|
|
|
ctrlSetText [411, "0.0"];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
_windageCur = Round(_windageCur * 100) / 100;
|
|
|
|
if (_windageCur > 0) then {
|
|
|
|
ctrlSetText [412, format["%1R", abs(_windageCur)]];
|
|
|
|
} else {
|
|
|
|
if (_windageCur < 0) then {
|
|
|
|
ctrlSetText [412, format["%1L", abs(_windageCur)]];
|
|
|
|
} else {
|
|
|
|
ctrlSetText [412, "0.0"];
|
|
|
|
};
|
|
|
|
};
|
2015-04-06 13:51:59 +00:00
|
|
|
|
2015-04-18 13:08:54 +00:00
|
|
|
if (GVAR(showWind2)) then {
|
2015-04-21 13:46:53 +00:00
|
|
|
_wind2 = Round(_wind2 * 100) / 100;
|
|
|
|
if (_wind2 > 0) then {
|
|
|
|
ctrlSetText [420, format["%1R", abs(_wind2)]];
|
|
|
|
} else {
|
|
|
|
if (_wind2 < 0) then {
|
|
|
|
ctrlSetText [420, format["%1L", abs(_wind2)]];
|
|
|
|
} else {
|
|
|
|
ctrlSetText [420, "0.0"];
|
|
|
|
};
|
|
|
|
};
|
2015-04-18 13:08:54 +00:00
|
|
|
} else {
|
2015-04-21 13:46:53 +00:00
|
|
|
_lead = Round(_lead * 100) / 100;
|
|
|
|
if (_lead > 0) then {
|
|
|
|
if ((GVAR(targetSpeedDirection) select GVAR(currentTarget)) == 1) then {
|
|
|
|
ctrlSetText [420, format["%1R", abs(_lead)]];
|
|
|
|
} else {
|
|
|
|
ctrlSetText [420, format["%1L", abs(_lead)]];
|
|
|
|
};
|
|
|
|
} else {
|
|
|
|
ctrlSetText [420, "0.0"];
|
|
|
|
};
|
2016-05-03 00:32:44 +00:00
|
|
|
};
|