Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ATragMX - Fixed UI (C1 vs. Distance interpolation) #5720

Merged
merged 1 commit into from
Nov 3, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions addons/atragmx/functions/fnc_change_target_slot.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@
*/
#include "script_component.hpp"

private _target = 0 max _this min 3;
GVAR(currentTarget) = 0 max _this min 3;

[] call FUNC(parse_input);
GVAR(targetRangeDirtyFlag) = true;

GVAR(currentTarget) = _target;
call FUNC(update_target_selection);
call FUNC(calculate_target_solution);
2 changes: 2 additions & 0 deletions addons/atragmx/functions/fnc_init.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ GVAR(truingDropMuzzleVelocity) = 0;

GVAR(targetSolutionInput) = nil;

GVAR(targetRangeDirtyFlag) = false;

GVAR(showMainPage) = true;
GVAR(showAddNewGun) = false;
GVAR(showAtmoEnvData) = false;
Expand Down
6 changes: 6 additions & 0 deletions addons/atragmx/functions/fnc_parse_input.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ if (GVAR(currentUnit) == 1) then {
} else {
_targetRange = 25 max _targetRange min 3700;
};
GVAR(targetRangeDirtyFlag) = GVAR(targetRangeDirtyFlag) || {_targetRange != GVAR(targetRange) select GVAR(currentTarget)};
GVAR(latitude) set [GVAR(currentTarget), -90 max Round(parseNumber(ctrlText 140000)) min 90];
GVAR(directionOfFire) set [GVAR(currentTarget), 0 max abs(Round(parseNumber(ctrlText 140010))) min 359];
GVAR(windSpeed1) set [GVAR(currentTarget), _windSpeed1];
Expand Down Expand Up @@ -173,6 +174,11 @@ if (_muzzleVelocity != GVAR(workingMemory) select 1) then {
GVAR(workingMemory) set [1, _muzzleVelocity];
GVAR(workingMemory) set [2, _zeroRange];

if (GVAR(targetRangeDirtyFlag) && missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then {
[false, false] call FUNC(recalculate_c1_ballistic_coefficient);
GVAR(targetRangeDirtyFlag) = false;
};

[] call FUNC(update_gun);
[] call FUNC(update_gun_ammo_data);
[] call FUNC(update_atmosphere);
Expand Down
2 changes: 2 additions & 0 deletions addons/atragmx/functions/fnc_sord.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ if (!GVAR(initialised)) exitWith {};

params ["_slopeDistance", "_azimuth", "_inclination"];

GVAR(targetRangeDirtyFlag) = (round(_slopeDistance) != (GVAR(targetRange) select GVAR(currentTarget)));

GVAR(inclinationAngle) set [GVAR(currentTarget), round(_inclination)];
GVAR(directionOfFire) set [GVAR(currentTarget), round(_azimuth)];
GVAR(targetRange) set [GVAR(currentTarget), round(_slopeDistance)];