mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
remove GPS files
This commit is contained in:
parent
af5f7d3a1e
commit
1270d17951
@ -1,247 +0,0 @@
|
||||
#include "\a3\ui_f\hpp\defineCommonGrids.inc"
|
||||
#include "\a3\ui_f\hpp\defineCommonColors.inc"
|
||||
#include "idc_defines.hpp"
|
||||
|
||||
class RscText;
|
||||
class RscEdit;
|
||||
class RscPicture;
|
||||
class RscButton;
|
||||
class ctrlXSliderH;
|
||||
|
||||
class GVAR(gpsAttackOptionsUI) {
|
||||
idd = -1;
|
||||
movingEnable = 1;
|
||||
enableSimulation = 1;
|
||||
onLoad = QUOTE(_this call FUNC(gps_onLoad));
|
||||
onUnload = QUOTE(call FUNC(gps_onUnload));
|
||||
class controlsBackground {
|
||||
class Header: RscText {
|
||||
idc = -1;
|
||||
text = CSTRING(GPS_ui_header);
|
||||
x = "13.5 * GUI_GRID_W + GUI_GRID_CENTER_X";
|
||||
y = "5 * GUI_GRID_H + GUI_GRID_CENTER_Y";
|
||||
w = "18 * GUI_GRID_W";
|
||||
h = "GUI_GRID_H";
|
||||
colorBackground[] = GUI_BCG_COLOR;
|
||||
moving = 1;
|
||||
};
|
||||
class Background: RscText {
|
||||
idd = -1;
|
||||
x = "13.5 * GUI_GRID_W + GUI_GRID_CENTER_X";
|
||||
y = "6.1 * GUI_GRID_H + GUI_GRID_CENTER_Y";
|
||||
w = "18 * GUI_GRID_W";
|
||||
h = "8.0 * GUI_GRID_H";
|
||||
colorBackground[] = {0, 0, 0, 0.8};
|
||||
};
|
||||
};
|
||||
class controls {
|
||||
class TOOButton: RscButton {
|
||||
idc = GPS_UI_TOO;
|
||||
text = CSTRING(GPS_ui_too);
|
||||
onButtonClick = QUOTE([GPS_UI_TOO] call FUNC(gps_modeSelect));
|
||||
x = "14 * GUI_GRID_W + GUI_GRID_CENTER_X";
|
||||
y = "6.3 * GUI_GRID_H + GUI_GRID_CENTER_Y";
|
||||
w = "10 * GUI_GRID_W";
|
||||
h = "GUI_GRID_H";
|
||||
colorActive[] = {0, 0, 0, 1};
|
||||
colorBackground[] = GUI_BCG_COLOR;
|
||||
colorFocused[] = {0, 0, 0, 0.8};
|
||||
};
|
||||
|
||||
class PPButton: RscButton {
|
||||
idc = GPS_UI_PB;
|
||||
text = CSTRING(GPS_ui_pp);
|
||||
onButtonClick = QUOTE([GPS_UI_PB] call FUNC(gps_modeSelect));
|
||||
x = "26 * GUI_GRID_W + GUI_GRID_CENTER_X";
|
||||
y = "6.3 * GUI_GRID_H + GUI_GRID_CENTER_Y";
|
||||
w = "5 * GUI_GRID_W";
|
||||
h = "GUI_GRID_H";
|
||||
colorActive[] = {0, 0, 0, 1};
|
||||
colorBackground[] = GUI_BCG_COLOR;
|
||||
colorFocused[] = {0, 0, 0, 0.8};
|
||||
};
|
||||
|
||||
class PPMission: RscText {
|
||||
idc = GPS_UI_PB_MISSION;
|
||||
text = CSTRING(GPS_ui_pp_short);
|
||||
onButtonClick = "";
|
||||
x = "27.5 * GUI_GRID_W + GUI_GRID_CENTER_X";
|
||||
y = "7.5 * GUI_GRID_H + GUI_GRID_CENTER_Y";
|
||||
w = "2 * GUI_GRID_W";
|
||||
h = "GUI_GRID_H";
|
||||
colorActive[] = {0, 0, 0, 1};
|
||||
colorBackground[] = {0, 0, 0, 1};
|
||||
colorFocused[] = {0, 0, 0, 0.8};
|
||||
align = "CENTER";
|
||||
style = 2;
|
||||
};
|
||||
|
||||
class PPMissionBackward: RscButton {
|
||||
idc = GPS_UI_PB_MISSION_BACKWARD;
|
||||
text = "<<";
|
||||
onButtonClick = QUOTE([-1] call FUNC(gps_pbModeCycle));
|
||||
x = "26 * GUI_GRID_W + GUI_GRID_CENTER_X";
|
||||
y = "7.5 * GUI_GRID_H + GUI_GRID_CENTER_Y";
|
||||
w = "1 * GUI_GRID_W";
|
||||
h = "GUI_GRID_H";
|
||||
colorActive[] = {0, 0, 0, 1};
|
||||
colorBackground[] = {0, 0, 0, 0.8};
|
||||
colorFocused[] = {0, 0, 0, 0.8};
|
||||
};
|
||||
|
||||
class PPMissionForward: RscButton {
|
||||
idc = GPS_UI_PB_MISSION_FORWARD;
|
||||
text = ">>";
|
||||
onButtonClick = QUOTE([1] call FUNC(gps_pbModeCycle));
|
||||
x = "30 * GUI_GRID_W + GUI_GRID_CENTER_X";
|
||||
y = "7.5 * GUI_GRID_H + GUI_GRID_CENTER_Y";
|
||||
w = "1 * GUI_GRID_W";
|
||||
h = "GUID_GRID_H";
|
||||
colorActive[] = {0, 0, 0, 1};
|
||||
colorBackground[] = {0, 0, 0, 0.8};
|
||||
colorFocused[] = {0, 0, 0, 0.8};
|
||||
};
|
||||
|
||||
class TargetPosXText: RscText {
|
||||
idc = -1;
|
||||
text = CSTRING(GPS_ui_easting);
|
||||
x = "14 * GUI_GRID_W + GUI_GRID_CENTER_X";
|
||||
y = "8.5 * GUI_GRID_H + GUI_GRID_CENTER_Y";
|
||||
w = "3 * GUI_GRID_W";
|
||||
h = "GUID_GRID_H";
|
||||
colorActive[] = {0, 0, 0, 1};
|
||||
colorBackground[] = {0, 0, 0, 0};
|
||||
colorFocused[] = {0, 0, 0, 0.8};
|
||||
maxChars = 10;
|
||||
};
|
||||
class TargetPosX: RscEdit {
|
||||
idc = GPS_UI_EASTING;
|
||||
text = "";
|
||||
x = "17.3 * GUI_GRID_W + GUI_GRID_CENTER_X";
|
||||
y = "8.5 * GUI_GRID_H + GUI_GRID_CENTER_Y";
|
||||
w = "2.5 * GUI_GRID_W";
|
||||
h = "GUID_GRID_H";
|
||||
colorActive[] = {0, 0, 0, 1};
|
||||
colorBackground[] = {0, 0, 0, 0.8};
|
||||
colorFocused[] = {0, 0, 0, 0.8};
|
||||
maxChars = 5;
|
||||
};
|
||||
|
||||
class TargetPosYText: RscText {
|
||||
idc = -1;
|
||||
text = CSTRING(GPS_ui_northing);
|
||||
x = "14 * GUI_GRID_W + GUI_GRID_CENTER_X";
|
||||
y = "9.7 * GUI_GRID_H + GUI_GRID_CENTER_Y";
|
||||
w = "3 * GUI_GRID_W";
|
||||
h = "GUID_GRID_H";
|
||||
colorActive[] = {0, 0, 0, 1};
|
||||
colorBackground[] = {0, 0, 0, 0};
|
||||
colorFocused[] = {0, 0, 0, 0.8};
|
||||
maxChars = 5;
|
||||
};
|
||||
class TargetPosY: TargetPosX {
|
||||
idc = GPS_UI_NORTHING;
|
||||
x = "17.3 * GUI_GRID_W + GUI_GRID_CENTER_X";
|
||||
y = "9.7 * GUI_GRID_H + GUI_GRID_CENTER_Y";
|
||||
};
|
||||
|
||||
class TargetPosHeightText: RscText {
|
||||
idc = -1;
|
||||
text = CSTRING(GPS_ui_altitude);
|
||||
x = "14 * GUI_GRID_W + GUI_GRID_CENTER_X";
|
||||
y = "11.7 * GUI_GRID_H + GUI_GRID_CENTER_Y";
|
||||
w = "3 * GUI_GRID_W";
|
||||
h = "GUID_GRID_H";
|
||||
colorActive[] = {0, 0, 0, 1};
|
||||
colorBackground[] = {0, 0, 0, 0};
|
||||
colorFocused[] = {0, 0, 0, 0.8};
|
||||
maxChars = 5;
|
||||
};
|
||||
class TargetPosHeight: TargetPosX {
|
||||
idc = GPS_UI_HEIGHT;
|
||||
x = "17.3 * GUI_GRID_W + GUI_GRID_CENTER_X";
|
||||
y = "11.7 * GUI_GRID_H + GUI_GRID_CENTER_Y";
|
||||
};
|
||||
class TargetPosHeightUnits: RscText {
|
||||
idc = -1;
|
||||
text = "m";
|
||||
x = "19.6 * GUI_GRID_W + GUI_GRID_CENTER_X";
|
||||
y = "11.7 * GUI_GRID_H + GUI_GRID_CENTER_Y";
|
||||
w = "1 * GUI_GRID_W";
|
||||
h = "GUID_GRID_H";
|
||||
colorActive[] = {0, 0, 0, 1};
|
||||
colorBackground[] = {0, 0, 0, 0};
|
||||
colorFocused[] = {0, 0, 0, 0.8};
|
||||
maxChars = 5;
|
||||
};
|
||||
|
||||
class ImpactAngleText: RscText {
|
||||
idc = -1;
|
||||
text = CSTRING(GPS_ui_impact_angle);
|
||||
x = "21 * GUI_GRID_W + GUI_GRID_CENTER_X";
|
||||
y = "9.7 * GUI_GRID_H + GUI_GRID_CENTER_Y";
|
||||
w = "4 * GUI_GRID_W";
|
||||
h = "GUID_GRID_H";
|
||||
colorActive[] = {0, 0, 0, 1};
|
||||
colorBackground[] = {0, 0, 0, 0};
|
||||
colorFocused[] = {0, 0, 0, 0.8};
|
||||
maxChars = 5;
|
||||
};
|
||||
class ImpactAngle: RscEdit {
|
||||
idc = GPS_UI_ANGLE;
|
||||
x = "26.3 * GUI_GRID_W + GUI_GRID_CENTER_X";
|
||||
y = "9.7 * GUI_GRID_H + GUI_GRID_CENTER_Y";
|
||||
w = "2 * GUI_GRID_W";
|
||||
h = "GUID_GRID_H";
|
||||
text = "";
|
||||
colorActive[] = {0, 0, 0, 1};
|
||||
colorBackground[] = {0, 0, 0, 0.8};
|
||||
colorFocused[] = {0, 0, 0, 0.8};
|
||||
maxChars = 2;
|
||||
};
|
||||
|
||||
class AttackHeadingText: RscText {
|
||||
idc = -1;
|
||||
text = CSTRING(GPS_ui_attack_heading);
|
||||
x = "21 * GUI_GRID_W + GUI_GRID_CENTER_X";
|
||||
y = "11 * GUI_GRID_H + GUI_GRID_CENTER_Y";
|
||||
w = "5 * GUI_GRID_W";
|
||||
h = "GUID_GRID_H";
|
||||
colorActive[] = {0, 0, 0, 1};
|
||||
colorBackground[] = {0, 0, 0, 0};
|
||||
colorFocused[] = {0, 0, 0, 0.8};
|
||||
maxChars = 5;
|
||||
};
|
||||
class AttackHeading: RscEdit {
|
||||
idc = GPS_UI_HEADING;
|
||||
x = "26.3 * GUI_GRID_W + GUI_GRID_CENTER_X";
|
||||
y = "11 * GUI_GRID_H + GUI_GRID_CENTER_Y";
|
||||
w = "2 * GUI_GRID_W";
|
||||
h = "GUID_GRID_H";
|
||||
text = "";
|
||||
colorActive[] = {0, 0, 0, 1};
|
||||
colorBackground[] = {0, 0, 0, 0.8};
|
||||
colorFocused[] = {0, 0, 0, 0.8};
|
||||
maxChars = 3;
|
||||
};
|
||||
|
||||
class CancelButton: RscButton {
|
||||
idc = -1;
|
||||
text = CSTRING(GPS_ui_cancel);
|
||||
onButtonClick = QUOTE(closeDialog 0);
|
||||
x = "13.5 * GUI_GRID_W + GUI_GRID_CENTER_X";
|
||||
y = "14.2 * GUI_GRID_H + GUI_GRID_CENTER_Y";
|
||||
w = "5 * GUI_GRID_W";
|
||||
h = "GUID_GRID_H";
|
||||
colorActive[] = {0, 0, 0, 1};
|
||||
colorBackground[] = {0, 0, 0, 0.8};
|
||||
colorFocused[] = {0, 0, 0, 0.8};
|
||||
};
|
||||
class ConfirmButton: CancelButton {
|
||||
idc = IDC_TIMER_CONFIRM;
|
||||
text = CSTRING(GPS_ui_confirm);
|
||||
onButtonClick = QUOTE([] call FUNC(gps_confirm));
|
||||
x = "27.5 * GUI_GRID_W + GUI_GRID_CENTER_X";
|
||||
};
|
||||
};
|
||||
};
|
@ -1,60 +0,0 @@
|
||||
#include "..\script_component.hpp"
|
||||
/*
|
||||
* Author: tcvm
|
||||
* Attack profile: JDAM
|
||||
* Uses LINE navigation type to guide projectile onto target
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Seeker Target PosASL <ARRAY>
|
||||
* 1: Guidance Arg Array <ARRAY>
|
||||
* 2: Seeker State <ARRAY>
|
||||
*
|
||||
* Return Value:
|
||||
* Missile Aim PosASL <ARRAY>
|
||||
*
|
||||
* Example:
|
||||
* [[1,2,3], [], []] call ace_missileguidance_fnc_attackProfile_jdam;
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
params ["_seekerTargetPos", "_args", "_attackProfileStateParams", "_timestep"];
|
||||
_args params ["_firedEH", "", "_flightParams", "", "", "_targetData"];
|
||||
_firedEH params ["_shooter","","","","","","_projectile"];
|
||||
_attackProfileStateParams params ["_gpsData", "_initialProjectileHeight", "_terminal"];
|
||||
_gpsData params ["", "_impactAngle", "_attackDirection"];
|
||||
_targetData params ["_directionToTarget", "", "_distanceToTarget"];
|
||||
_flightParams params ["_pitchRate", "_yawRate"];
|
||||
|
||||
if (_impactAngle <= 0) then {
|
||||
_impactAngle = 45; // immediate pitch over to attack
|
||||
};
|
||||
|
||||
if (_attackDirection < 0) then {
|
||||
_attackDirection = direction _projectile;
|
||||
_gpsData set [2, _attackDirection];
|
||||
};
|
||||
|
||||
private _projectilePos = getPosASLVisual _projectile;
|
||||
private _lineDir = [1, 180 + _attackDirection, _impactAngle] call CBA_fnc_polar2vect;
|
||||
|
||||
private _leadDistance = linearConversion [0, 1000, _projectilePos vectorDistance _seekerTargetPos, 5, 500, true];
|
||||
|
||||
private _missilePosProjected = _seekerTargetPos vectorAdd (_lineDir vectorMultiply ((_projectilePos vectorDistance _seekerTargetPos) - _leadDistance));
|
||||
// don't climb
|
||||
if (_missilePosProjected#2 > _projectilePos#2) then {
|
||||
_missilePosProjected set [2, _projectilePos#2];
|
||||
};
|
||||
_targetData set [2, (_projectilePos vectorDistance _missilePosProjected)];
|
||||
|
||||
if (GVAR(debug_drawGuidanceInfo)) then {
|
||||
private _projectilePitch = ((vectorDir _projectile) call CBA_fnc_vect2polar) select 2;
|
||||
//IGNORE_PRIVATE_WARNING ["_attackProfileName"];
|
||||
_attackProfileName = format ["JDAM [Pitch - %1 Impact Pitch - %2]", _projectilePitch, _impactAngle];
|
||||
drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,0,0,1], ASLtoAGL _missilePosProjected, 0.75, 0.75, 0, "P", 1, 0.025, "TahomaB"];
|
||||
private _desiredAngle = _lineDir vectorMultiply 5000;
|
||||
private _targetPosAGL = ASLtoAGL _seekerTargetPos;
|
||||
drawLine3D [_targetPosAGL, _targetPosAGL vectorAdd _desiredAngle, [1, 1, 1, 1]];
|
||||
};
|
||||
|
||||
_missilePosProjected
|
||||
|
@ -1,23 +0,0 @@
|
||||
#include "..\script_component.hpp"
|
||||
/*
|
||||
* Author: tcvm
|
||||
* Sets up wireGuided state arrays (called from missileGuidance's onFired).
|
||||
*
|
||||
* Arguments:
|
||||
* Guidance Arg Array <ARRAY>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [] call ace_missileguidance_fnc_wire_onFired
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
params ["_firedEH", "", "", "", "_stateParams", "", ""];
|
||||
_stateParams params ["", "", "_attackProfileStateParams"];
|
||||
_firedEH params ["_shooter","","","","_ammo","","_projectile"];
|
||||
|
||||
_attackProfileStateParams set [0, [] call FUNC(gps_getAttackData)];
|
||||
_attackProfileStateParams set [1, (getPosASL _projectile) select 2];
|
||||
_attackProfileStateParams set [2, false];
|
@ -1,21 +0,0 @@
|
||||
#include "..\script_component.hpp"
|
||||
/*
|
||||
* Author: tcvm
|
||||
* Confirm GPS weapon settings and serialize to variables
|
||||
*
|
||||
* Arguments:
|
||||
* Guidance Arg Array <ARRAY>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [] call ace_missileguidance_fnc_gps_confirm
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
if (GVAR(gps_mode) isEqualTo "pb") then {
|
||||
[GVAR(gps_pbMode)] call FUNC(gps_saveAttackSettings);
|
||||
};
|
||||
closeDialog 0;
|
||||
|
@ -1,30 +0,0 @@
|
||||
#include "..\script_component.hpp"
|
||||
/*
|
||||
* Author: tcvm
|
||||
* Returns attack data for GPS guided bomb
|
||||
*
|
||||
* Arguments:
|
||||
* None
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [] call ace_missileguidance_fnc_gps_getAttackData
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
|
||||
if (GVAR(gps_mode) isEqualTo "too") then {
|
||||
private _target = getPilotCameraTarget (vehicle ACE_PLAYER);
|
||||
_target params ["_tracking", "_position", "_object"];
|
||||
GVAR(gps_currentSettings) set [0, _position]
|
||||
};
|
||||
|
||||
// create a copy of this array to make sure values are not overwritten
|
||||
[
|
||||
GVAR(gps_currentSettings)#0,
|
||||
GVAR(gps_currentSettings)#1,
|
||||
GVAR(gps_currentSettings)#2
|
||||
]
|
||||
|
@ -1,53 +0,0 @@
|
||||
#include "..\script_component.hpp"
|
||||
/*
|
||||
* Author: tcvm
|
||||
* Saves all textboxes to whatever settings say for PB mode
|
||||
*
|
||||
* Arguments:
|
||||
* Current PB mode <NUMBER>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [] call ace_missileguidance_fnc_gps_saveAttackSettings
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
params ["_mode"];
|
||||
private _display = uiNamespace getVariable QGVAR(gpsAttackOptionDisplay);
|
||||
|
||||
private _settings = GVAR(gps_settings) get _mode;
|
||||
|
||||
_settings params ["_position", "_angle", "_heading"];
|
||||
private _height = _position select 2;
|
||||
|
||||
private _grid = [_position] call EFUNC(common,getMapGridFromPos);
|
||||
_grid params ["_easting", "_northing"];
|
||||
|
||||
if (_angle < 0) then {
|
||||
_angle = "";
|
||||
} else {
|
||||
_angle = str _angle;
|
||||
};
|
||||
|
||||
if (_heading < 0) then {
|
||||
_heading = "";
|
||||
} else {
|
||||
_heading = str _heading;
|
||||
};
|
||||
|
||||
if (0 == parseNumber _easting) then {
|
||||
_easting = "";
|
||||
};
|
||||
|
||||
if (0 == parseNumber _northing) then {
|
||||
_northing = "";
|
||||
};
|
||||
|
||||
(_display displayCtrl GPS_UI_EASTING) ctrlSetText _easting;
|
||||
(_display displayCtrl GPS_UI_NORTHING) ctrlSetText _northing;
|
||||
(_display displayCtrl GPS_UI_HEIGHT) ctrlSetText str _height;
|
||||
(_display displayCtrl GPS_UI_ANGLE) ctrlSetText _angle;
|
||||
(_display displayCtrl GPS_UI_HEADING) ctrlSetText _heading;
|
||||
|
@ -1,56 +0,0 @@
|
||||
#include "..\script_component.hpp"
|
||||
#include "\a3\ui_f\hpp\defineCommonColors.inc"
|
||||
/*
|
||||
* Author: tcvm
|
||||
* Select either TOO or PB mode. Disable anything that shouldnt be touched in TOO and renable in PB
|
||||
*
|
||||
* Arguments:
|
||||
* Mode to switch to <NUMBER>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [0] call ace_missileguidance_fnc_gps_modeSelect
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
params ["_mode", ["_onLoad", false]];
|
||||
private _display = uiNamespace getVariable QGVAR(gpsAttackOptionDisplay);
|
||||
|
||||
{
|
||||
// only TOO and PB modes modelled
|
||||
if (_mode == GPS_UI_TOO) then {
|
||||
// disable
|
||||
ctrlEnable [_x, false];
|
||||
} else {
|
||||
// enable
|
||||
ctrlEnable [_x, true];
|
||||
};
|
||||
} forEach CONTROLS_DISABLED_IN_TOO;
|
||||
|
||||
private _backgroundColour = [
|
||||
GUI_BCG_RGB_R call BIS_fnc_parseNumber,
|
||||
GUI_BCG_RGB_G call BIS_fnc_parseNumber,
|
||||
GUI_BCG_RGB_B call BIS_fnc_parseNumber,
|
||||
GUI_BCG_ALPHA call BIS_fnc_parseNumber
|
||||
];
|
||||
|
||||
private _selectedColour = [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1
|
||||
];
|
||||
|
||||
ctrlSetFocus (_display displayCtrl _mode);
|
||||
if (_mode == GPS_UI_TOO) then {
|
||||
GVAR(gps_mode) = "too";
|
||||
if !(_onLoad) then {
|
||||
[GVAR(gps_pbMode)] call FUNC(gps_saveAttackSettings);
|
||||
};
|
||||
} else {
|
||||
GVAR(gps_mode) = "pb";
|
||||
[GVAR(gps_pbMode)] call FUNC(gps_loadAttackSettings);
|
||||
};
|
||||
|
@ -1,53 +0,0 @@
|
||||
#include "..\script_component.hpp"
|
||||
/*
|
||||
* Author: tcvm
|
||||
* Called on load of GPS UI
|
||||
*
|
||||
* Arguments:
|
||||
* Display <NUMBER>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [1] call ace_missileguidance_fnc_gps_onLoad
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
[{
|
||||
params ["_display"];
|
||||
uiNamespace setVariable [QGVAR(gpsAttackOptionDisplay), _display];
|
||||
|
||||
private _mode = if (GVAR(gps_mode) isEqualTo "too") then {
|
||||
GPS_UI_TOO
|
||||
} else {
|
||||
GPS_UI_PB
|
||||
};
|
||||
|
||||
[_mode, true] call FUNC(gps_modeSelect);
|
||||
(_display displayCtrl GPS_UI_PB_MISSION) ctrlSetText format ["%1 %2", localize LSTRING(GPS_ui_pp_short), GVAR(gps_pbMode) + 1];
|
||||
|
||||
// update current settings
|
||||
GVAR(gps_uiPerFrameHandler) = [{
|
||||
if (GVAR(gps_mode) isEqualTo "too") then {
|
||||
// update coordinates based on TGP position
|
||||
private _target = getPilotCameraTarget (vehicle ACE_PLAYER);
|
||||
_target params ["_tracking", "_position", "_object"];
|
||||
|
||||
if (_position isNotEqualTo [0, 0, 0]) then {
|
||||
private _mapGrid = [_position] call EFUNC(common,getMapGridFromPos);
|
||||
_mapGrid params ["_easting", "_northing"];
|
||||
private _height = _position#2;
|
||||
|
||||
private _display = uiNamespace getVariable QGVAR(gpsAttackOptionDisplay);
|
||||
(_display displayCtrl GPS_UI_EASTING) ctrlSetText _easting;
|
||||
(_display displayCtrl GPS_UI_NORTHING) ctrlSetText _northing;
|
||||
(_display displayCtrl GPS_UI_HEIGHT) ctrlSetText str _height;
|
||||
};
|
||||
};
|
||||
|
||||
// info is read from text boxes, so if boxes are update this will be updated
|
||||
GVAR(gps_currentSettings) = [-1] call FUNC(gps_saveAttackSettings);
|
||||
}] call CBA_fnc_addPerFrameHandler;
|
||||
}, _this] call CBA_fnc_execNextFrame;
|
||||
|
@ -1,18 +0,0 @@
|
||||
#include "..\script_component.hpp"
|
||||
/*
|
||||
* Author: tcvm
|
||||
* Called on unload of GPS UI
|
||||
*
|
||||
* Arguments:
|
||||
* Display <NUMBER>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [] call ace_missileguidance_fnc_gps_onUnload
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
[GVAR(gps_uiPerFrameHandler)] call CBA_fnc_removePerFrameHandler;
|
||||
|
@ -1,36 +0,0 @@
|
||||
#include "..\script_component.hpp"
|
||||
/*
|
||||
* Author: tcvm
|
||||
* Cycle pre-briefed mission mode
|
||||
*
|
||||
* Arguments:
|
||||
* Direction <NUMBER>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [1] call ace_missileguidance_fnc_gps_pbModeCycle
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
params ["_direction"];
|
||||
private _display = uiNamespace getVariable QGVAR(gpsAttackOptionDisplay);
|
||||
|
||||
[GVAR(gps_pbMode)] call FUNC(gps_saveAttackSettings);
|
||||
|
||||
if (_direction > 0) then {
|
||||
// right
|
||||
GVAR(gps_pbMode) = (GVAR(gps_pbMode) + 1) % MAX_PB_MODES
|
||||
} else {
|
||||
// left
|
||||
GVAR(gps_pbMode) = (GVAR(gps_pbMode) - 1);
|
||||
if (GVAR(gps_pbMode) < 0) then {
|
||||
GVAR(gps_pbMode) = MAX_PB_MODES - 1;
|
||||
};
|
||||
GVAR(gps_pbMode) = GVAR(gps_pbMode) % MAX_PB_MODES;
|
||||
};
|
||||
|
||||
[GVAR(gps_pbMode)] call FUNC(gps_loadAttackSettings);
|
||||
(_display displayCtrl GPS_UI_PB_MISSION) ctrlSetText format ["%1 %2", localize LSTRING(GPS_ui_pp_short), GVAR(gps_pbMode) + 1];
|
||||
|
@ -1,65 +0,0 @@
|
||||
#include "..\script_component.hpp"
|
||||
/*
|
||||
* Author: tcvm
|
||||
* Saves all textboxes to whatever settings say for PB mode
|
||||
*
|
||||
* Arguments:
|
||||
* Current PB mode. If -1 no mode is used <NUMBER>
|
||||
*
|
||||
* Return Value:
|
||||
* current settings
|
||||
*
|
||||
* Example:
|
||||
* [-1] call ace_missileguidance_fnc_gps_saveAttackSettings
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
params ["_mode"];
|
||||
private _display = uiNamespace getVariable QGVAR(gpsAttackOptionDisplay);
|
||||
|
||||
private _easting = ctrlText (_display displayCtrl GPS_UI_EASTING);
|
||||
private _northing = ctrlText (_display displayCtrl GPS_UI_NORTHING);
|
||||
private _height = ctrlText (_display displayCtrl GPS_UI_HEIGHT);
|
||||
private _angle = ctrlText (_display displayCtrl GPS_UI_ANGLE);
|
||||
private _heading = ctrlText (_display displayCtrl GPS_UI_HEADING);
|
||||
|
||||
if (_height isEqualTo "") then {
|
||||
_height = 0
|
||||
} else {
|
||||
_height = parseNumber _height;
|
||||
};
|
||||
|
||||
if (_angle isEqualTo "") then {
|
||||
_angle = -1
|
||||
} else {
|
||||
_angle = parseNumber _angle;
|
||||
};
|
||||
|
||||
if (_heading isEqualTo "") then {
|
||||
_heading = -1
|
||||
} else {
|
||||
_heading = parseNumber _heading;
|
||||
};
|
||||
|
||||
private _minGridCount = (count _easting) min (count _northing);
|
||||
|
||||
private _grid = (_easting select [0, _minGridCount]) + (_northing select [0, _minGridCount]);
|
||||
private _position = if (_grid isEqualTo "") then {
|
||||
[0, 0, 0]
|
||||
} else {
|
||||
[_grid, false] call EFUNC(common,getMapPosFromGrid);
|
||||
};
|
||||
_position set [2, _height];
|
||||
|
||||
TRACE_3("settings gps pos",_position,_angle,_heading);
|
||||
|
||||
private _settings = [
|
||||
_position, // attack position
|
||||
_angle, // impact angle
|
||||
_heading // attack heading
|
||||
];
|
||||
|
||||
if (_mode != -1) then {
|
||||
GVAR(gps_settings) set [_mode, _settings];
|
||||
};
|
||||
_settings
|
@ -1,20 +0,0 @@
|
||||
#include "..\script_component.hpp"
|
||||
/*
|
||||
* Author: tcvm
|
||||
* Sets up wireGuided state arrays (called from missileGuidance's onFired).
|
||||
*
|
||||
* Arguments:
|
||||
* Guidance Arg Array <ARRAY>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [] call ace_missileguidance_fnc_wire_onFired
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
params ["", "", "", "", "_stateParams", "", ""];
|
||||
_stateParams params ["", "_seekerStateParams"];
|
||||
|
||||
_seekerStateParams set [0, [] call FUNC(gps_getAttackData)];
|
@ -1,52 +0,0 @@
|
||||
#include "..\script_component.hpp"
|
||||
/*
|
||||
* Author: tcvm
|
||||
* Adds interaction menu actions to configure GPS bombs
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Player <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* Nothing
|
||||
*
|
||||
* Example:
|
||||
* [player] call ace_missileguidance_fnc_gps_setupVehicle
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
params ["_player"];
|
||||
|
||||
private _vehicle = vehicle _player;
|
||||
private _turretPath = [-1];
|
||||
|
||||
if (_vehicle getVariable [QGVAR(gps_actionsAdded), false]) exitWith {};
|
||||
_vehicle setVariable [QGVAR(gps_actionsAdded), true];
|
||||
|
||||
private _condition = {
|
||||
params ["_target", "_player"];
|
||||
|
||||
private _turretPath = if (ACE_player == (driver _target)) then {[-1]} else {ACE_player call CBA_fnc_turretPath};
|
||||
private _hasJDAM = false;
|
||||
{
|
||||
private _magazines = getArray (configFile >> "CfgWeapons" >> _x >> "magazines");
|
||||
{
|
||||
private _ammo = getText (configFile >> "CfgMagazines" >> _x >> "ammo");
|
||||
private _ammoAttackProfiles = getArray (configFile >> "CfgAmmo" >> _ammo >> QUOTE(ADDON) >> "attackProfiles");
|
||||
_hasJDAM = "JDAM" in _ammoAttackProfiles;
|
||||
|
||||
if (_hasJDAM) exitWith { true };
|
||||
} forEach _magazines;
|
||||
|
||||
if (_hasJDAM) exitWith { true };
|
||||
} forEach (_target weaponsTurret _turretPath);
|
||||
|
||||
_hasJDAM
|
||||
};
|
||||
|
||||
private _statement = {
|
||||
createDialog QGVAR(gpsAttackOptionsUI);
|
||||
};
|
||||
|
||||
private _action = [QUOTE(ADDON), "JDAM settings", "", _statement, _condition] call EFUNC(interact_menu,createAction);
|
||||
[_vehicle, 1, ["ACE_SelfActions"], _action] call EFUNC(interact_menu,addActionToObject);
|
||||
|
@ -1,34 +0,0 @@
|
||||
#ifndef GPS_UI_TOO
|
||||
#define GPS_UI_TOO 1704211
|
||||
#endif
|
||||
#ifndef GPS_UI_PB
|
||||
#define GPS_UI_PB 1704112
|
||||
#endif
|
||||
#ifndef GPS_UI_PB_MISSION
|
||||
#define GPS_UI_PB_MISSION 1704113
|
||||
#endif
|
||||
#ifndef GPS_UI_PB_MISSION_BACKWARD
|
||||
#define GPS_UI_PB_MISSION_BACKWARD 1704114
|
||||
#endif
|
||||
#ifndef GPS_UI_PB_MISSION_FORWARD
|
||||
#define GPS_UI_PB_MISSION_FORWARD 1704115
|
||||
#endif
|
||||
#ifndef GPS_UI_EASTING
|
||||
#define GPS_UI_EASTING 1704116
|
||||
#endif
|
||||
#ifndef GPS_UI_NORTHING
|
||||
#define GPS_UI_NORTHING 1704117
|
||||
#endif
|
||||
#ifndef GPS_UI_HEIGHT
|
||||
#define GPS_UI_HEIGHT 1704118
|
||||
#endif
|
||||
#ifndef GPS_UI_ANGLE
|
||||
#define GPS_UI_ANGLE 1704119
|
||||
#endif
|
||||
#ifndef GPS_UI_HEADING
|
||||
#define GPS_UI_HEADING 1704120
|
||||
#endif
|
||||
#ifndef IDC_TIMER_CONFIRM
|
||||
#define IDC_TIMER_CONFIRM 1704121
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user