mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Added target speed direction switch / Improved the solution result output
This commit is contained in:
parent
4833193860
commit
c27f3fb131
@ -1338,6 +1338,16 @@ class ATragMX_Display {
|
||||
idc=140050;
|
||||
y=0.265*safezoneH+safezoneY+0.480;
|
||||
};
|
||||
class TEXT_TARGET_DATA_TARGET_SPEED_DIRECTION: ATragMX_RscButton {
|
||||
idc=140051;
|
||||
colorBackground[]={0.15,0.21,0.23,0.3};
|
||||
colorFocused[]={0.15,0.21,0.23,0.2};
|
||||
w=0.0231;
|
||||
x=0.550*safezoneW+safezoneX+0.305;
|
||||
y=0.265*safezoneH+safezoneY+0.480;
|
||||
text=">";
|
||||
action=QUOTE(call FUNC(cycle_target_speed_direction));
|
||||
};
|
||||
class TEXT_TARGET_DATA_TARGET_RANGE: TEXT_TARGET_DATA_LATITUDE {
|
||||
idc=14006;
|
||||
y=0.265*safezoneH+safezoneY+0.520;
|
||||
|
@ -20,6 +20,7 @@ PREP(cycle_num_ticks_units);
|
||||
PREP(cycle_range_card_columns);
|
||||
PREP(cycle_scope_unit);
|
||||
PREP(cycle_target_size_units);
|
||||
PREP(cycle_target_speed_direction);
|
||||
PREP(delete_gun);
|
||||
PREP(init);
|
||||
PREP(parse_input);
|
||||
|
@ -36,6 +36,7 @@ profileNamespace setVariable ["ACE_ATragMX_windSpeed2", nil];
|
||||
profileNamespace setVariable ["ACE_ATragMX_windDirection", nil];
|
||||
profileNamespace setVariable ["ACE_ATragMX_inclinationAngle", nil];
|
||||
profileNamespace setVariable ["ACE_ATragMX_targetSpeed", nil];
|
||||
profileNamespace setVariable ["ACE_ATragMX_targetSpeedDirection", nil];
|
||||
profileNamespace setVariable ["ACE_ATragMX_targetRange", nil];
|
||||
|
||||
profileNamespace setVariable ["ACE_ATragMX_rangeCardStartRange", nil];
|
||||
|
@ -0,0 +1,22 @@
|
||||
/*
|
||||
* Author: Ruthberg
|
||||
* Cycles through the target directions left/right
|
||||
*
|
||||
* Arguments:
|
||||
* Nothing
|
||||
*
|
||||
* Return Value:
|
||||
* Nothing
|
||||
*
|
||||
* Example:
|
||||
* call ace_atragmx_cycle_target_direction
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
if ((ctrlText 140051) == ">") then {
|
||||
ctrlSetText [140051, "<"];
|
||||
} else {
|
||||
ctrlSetText [140051, ">"];
|
||||
};
|
@ -59,6 +59,7 @@ GVAR(windSpeed2) = [0, 0, 0, 0];
|
||||
GVAR(windDirection) = [12, 12, 12, 12];
|
||||
GVAR(inclinationAngle) = [0, 0, 0, 0];
|
||||
GVAR(targetSpeed) = [0, 0, 0, 0];
|
||||
GVAR(targetSpeedDirection) = [1, 1, 1, 1];
|
||||
GVAR(targetRange) = [0, 0, 0, 0];
|
||||
|
||||
GVAR(showWind2) = false;
|
||||
|
@ -40,7 +40,12 @@ if (_inclinationAngleDegree != GVAR(inclinationAngle) select GVAR(currentTarget)
|
||||
GVAR(inclinationAngle) set [GVAR(currentTarget), round(acos(_inclinationAngleCosine))];
|
||||
};
|
||||
};
|
||||
GVAR(targetSpeed) set [GVAR(currentTarget), -50 max abs(parseNumber(ctrlText 140050)) min 50];
|
||||
GVAR(targetSpeed) set [GVAR(currentTarget), 0 max abs(parseNumber(ctrlText 140050)) min 50];
|
||||
if ((ctrlText 140051) == ">") then {
|
||||
GVAR(targetSpeedDirection) set [GVAR(currentTarget), +1];
|
||||
} else {
|
||||
GVAR(targetSpeedDirection) set [GVAR(currentTarget), -1];
|
||||
};
|
||||
GVAR(targetRange) set [GVAR(currentTarget), 0 max abs(parseNumber(ctrlText 140060)) min 4000];
|
||||
if (GVAR(currentUnit) != 2) then {
|
||||
GVAR(windSpeed1) set [GVAR(currentTarget), (GVAR(windSpeed1) select GVAR(currentTarget)) * 0.44704];
|
||||
|
@ -33,6 +33,7 @@ GVAR(windSpeed2) = profileNamespace getVariable ["ACE_ATragMX_windSpeed2", [0, 0
|
||||
GVAR(windDirection) = profileNamespace getVariable ["ACE_ATragMX_windDirection", [12, 12, 12, 12]];
|
||||
GVAR(inclinationAngle) = profileNamespace getVariable ["ACE_ATragMX_inclinationAngle", [0, 0, 0, 0]];
|
||||
GVAR(targetSpeed) = profileNamespace getVariable ["ACE_ATragMX_targetSpeed", [0, 0, 0, 0]];
|
||||
GVAR(targetSpeedDirection) = profileNamespace getVariable ["ACE_ATragMX_targetSpeedDirection", [1, 1, 1, 1]];
|
||||
GVAR(targetRange) = profileNamespace getVariable ["ACE_ATragMX_targetRange", [0, 0, 0, 0]];
|
||||
|
||||
GVAR(rangeCardStartRange) = 0 max (profileNamespace getVariable ["ACE_ATragMX_rangeCardStartRange", 200]) min 3000;
|
||||
|
@ -17,7 +17,7 @@
|
||||
|
||||
GVAR(showTargetData) = _this;
|
||||
|
||||
{ctrlShow [_x, _this]} forEach [14000, 140000, 14001, 140010, 14002, 141020, 140020, 141021, 140021, 14003, 140030, 14004, 140040, 141040, 141041, 140041, 14005, 140050, 14006, 140060, 140061, 14007, 14008, 14009, 14010, 14011];
|
||||
{ctrlShow [_x, _this]} forEach [14000, 140000, 14001, 140010, 14002, 141020, 140020, 141021, 140021, 14003, 140030, 14004, 140040, 141040, 141041, 140041, 14005, 140050, 140051, 14006, 140060, 140061, 14007, 14008, 14009, 14010, 14011];
|
||||
|
||||
if (_this) then {
|
||||
[] call FUNC(update_target_data);
|
||||
|
@ -35,6 +35,7 @@ profileNamespace setVariable ["ACE_ATragMX_windSpeed2", GVAR(windSpeed2)];
|
||||
profileNamespace setVariable ["ACE_ATragMX_windDirection", GVAR(windDirection)];
|
||||
profileNamespace setVariable ["ACE_ATragMX_inclinationAngle", GVAR(inclinationAngle)];
|
||||
profileNamespace setVariable ["ACE_ATragMX_targetSpeed", GVAR(targetSpeed)];
|
||||
profileNamespace setVariable ["ACE_ATragMX_targetSpeedDirection", GVAR(targetSpeedDirection)];
|
||||
profileNamespace setVariable ["ACE_ATragMX_targetRange", GVAR(targetRange)];
|
||||
|
||||
profileNamespace setVariable ["ACE_ATragMX_rangeCardStartRange", GVAR(rangeCardStartRange)];
|
||||
|
@ -82,16 +82,88 @@ if (GVAR(showWind2)) then {
|
||||
ctrlSetText [42, "Lead"];
|
||||
};
|
||||
|
||||
ctrlSetText [400, Str(Round(_elevationAbs * 100) / 100)];
|
||||
ctrlSetText [401, Str(Round(_elevationRel * 100) / 100)];
|
||||
ctrlSetText [402, Str(Round(_elevationCur * 100) / 100)];
|
||||
_elevationAbs = Round(_elevationAbs * 100) / 100;
|
||||
if (_elevationAbs > 0) then {
|
||||
ctrlSetText [400, format["%1", abs(_elevationAbs)]];
|
||||
} 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 {
|
||||
ctrlSetText [401, format["%1", abs(_elevationRel)]];
|
||||
} 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 {
|
||||
ctrlSetText [402, format["%1", abs(_elevationCur)]];
|
||||
} else {
|
||||
if (_elevationCur < 0) then {
|
||||
ctrlSetText [402, format["%1D", abs(_elevationCur)]];
|
||||
} else {
|
||||
ctrlSetText [402, "0.0"];
|
||||
};
|
||||
};
|
||||
|
||||
ctrlSetText [410, Str(Round(_windageAbs * 100) / 100)];
|
||||
ctrlSetText [411, Str(Round(_windageRel * 100) / 100)];
|
||||
ctrlSetText [412, Str(Round(_windageCur * 100) / 100)];
|
||||
_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"];
|
||||
};
|
||||
};
|
||||
|
||||
if (GVAR(showWind2)) then {
|
||||
ctrlSetText [420, Str(Round(_wind2 * 100) / 100)];
|
||||
_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"];
|
||||
};
|
||||
};
|
||||
} else {
|
||||
ctrlSetText [420, Str(Round(_lead * 100) / 100)];
|
||||
_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"];
|
||||
};
|
||||
};
|
@ -32,6 +32,11 @@ if (GVAR(currentUnit) != 2) then {
|
||||
} else {
|
||||
ctrlSetText [140050, Str(Round((GVAR(targetSpeed) select GVAR(currentTarget)) * 100) / 100)];
|
||||
};
|
||||
if ((GVAR(targetSpeedDirection) select GVAR(currentTarget)) == 1) then {
|
||||
ctrlSetText [140051, ">"];
|
||||
} else {
|
||||
ctrlSetText [140051, "<"];
|
||||
};
|
||||
if (GVAR(currentUnit) == 1) then {
|
||||
ctrlSetText [140060, Str(Round((GVAR(targetRange) select GVAR(currentTarget)) * 1.0936133))];
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user