mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Bring component up-to-date, cleanup
This commit is contained in:
parent
b1e518e1a2
commit
c7b82a51f3
@ -14,7 +14,7 @@ if (hasInterface) then {
|
|||||||
params ["_target", "_player", "_params"];
|
params ["_target", "_player", "_params"];
|
||||||
private _camera = _player getVariable [QGVAR(missileCamera), objNull];
|
private _camera = _player getVariable [QGVAR(missileCamera), objNull];
|
||||||
private _projectile = _camera getVariable [QGVAR(missile), objNull];
|
private _projectile = _camera getVariable [QGVAR(missile), objNull];
|
||||||
!([] call FUNC(camera_userInCamera)) && { !(_camera isEqualTo objNull); } && { !(_projectile isEqualTo objNull) }
|
!([] call FUNC(camera_userInCamera)) && { !isNull _camera } && { !isNull _projectile }
|
||||||
}/*, {
|
}/*, {
|
||||||
params ["_target", "_player", "_params"];
|
params ["_target", "_player", "_params"];
|
||||||
// insert children
|
// insert children
|
||||||
@ -24,4 +24,3 @@ if (hasInterface) then {
|
|||||||
GVAR(activeCamera) = objNull;
|
GVAR(activeCamera) = objNull;
|
||||||
GVAR(projectileHashMap) = createHashMap; // used in the seeker to get the namespace for the associated projectile
|
GVAR(projectileHashMap) = createHashMap; // used in the seeker to get the namespace for the associated projectile
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#include "script_component.hpp"
|
#include "..\script_component.hpp"
|
||||||
/*
|
/*
|
||||||
* Author: Dani (TCVM)
|
* Author: Dani (TCVM)
|
||||||
* Decreases zoom of current camera
|
* Decreases zoom of current camera
|
||||||
@ -31,4 +31,3 @@ if (_increase) then {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
[_cameraNamespace, _zoomIndex] call FUNC(camera_setZoom);
|
[_cameraNamespace, _zoomIndex] call FUNC(camera_setZoom);
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#include "script_component.hpp"
|
#include "..\script_component.hpp"
|
||||||
/*
|
/*
|
||||||
* Author: Dani (TCVM)
|
* Author: Dani (TCVM)
|
||||||
* Cycles camera thermal mode (if avaliable)
|
* Cycles camera thermal mode (if avaliable)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#include "script_component.hpp"
|
#include "..\script_component.hpp"
|
||||||
/*
|
/*
|
||||||
* Author: Dani (TCVM)
|
* Author: Dani (TCVM)
|
||||||
* Destroys camera attaches to projectile
|
* Destroys camera attaches to projectile
|
||||||
@ -18,10 +18,10 @@
|
|||||||
params ["_cameraNamespace"];
|
params ["_cameraNamespace"];
|
||||||
|
|
||||||
private _userInThisCamera = [_cameraNamespace] call FUNC(camera_userInCamera);
|
private _userInThisCamera = [_cameraNamespace] call FUNC(camera_userInCamera);
|
||||||
private _userCamera = ACE_PLAYER getVariable [QGVAR(missileCamera), objNull];
|
private _userCamera = ACE_player getVariable [QGVAR(missileCamera), objNull];
|
||||||
|
|
||||||
if (_userInThisCamera || { _userCamera isEqualTo _cameraNamespace }) then {
|
if (_userInThisCamera || { _userCamera isEqualTo _cameraNamespace }) then {
|
||||||
ACE_PLAYER setVariable [QGVAR(missileCamera), objNull];
|
ACE_player setVariable [QGVAR(missileCamera), objNull];
|
||||||
};
|
};
|
||||||
|
|
||||||
[_cameraNamespace] call FUNC(camera_switchAway);
|
[_cameraNamespace] call FUNC(camera_switchAway);
|
||||||
@ -35,4 +35,3 @@ private _camera = _cameraNamespace getVariable QGVAR(camera);
|
|||||||
camDestroy _camera;
|
camDestroy _camera;
|
||||||
|
|
||||||
_cameraNamespace call CBA_fnc_deleteNamespace;
|
_cameraNamespace call CBA_fnc_deleteNamespace;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#include "script_component.hpp"
|
#include "..\script_component.hpp"
|
||||||
/*
|
/*
|
||||||
* Author: Dani (TCVM)
|
* Author: Dani (TCVM)
|
||||||
* Updates camera with inputs
|
* Updates camera with inputs
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#include "script_component.hpp"
|
#include "..\script_component.hpp"
|
||||||
/*
|
/*
|
||||||
* Author: Dani (TCVM)
|
* Author: Dani (TCVM)
|
||||||
* Initializes camera for player to view missile from its nose
|
* Initializes camera for player to view missile from its nose
|
||||||
@ -83,4 +83,3 @@ if (_switchOnFire && _switchOnFireInit) then {
|
|||||||
};
|
};
|
||||||
|
|
||||||
_activeCameraNamespace
|
_activeCameraNamespace
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#include "script_component.hpp"
|
#include "..\script_component.hpp"
|
||||||
/*
|
/*
|
||||||
* Author: Dani (TCVM)
|
* Author: Dani (TCVM)
|
||||||
* Cycles camera thermal mode (if avaliable)
|
* Cycles camera thermal mode (if avaliable)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#include "script_component.hpp"
|
#include "..\script_component.hpp"
|
||||||
/*
|
/*
|
||||||
* Author: Dani (TCVM)
|
* Author: Dani (TCVM)
|
||||||
* Decreases zoom of current camera
|
* Decreases zoom of current camera
|
||||||
@ -22,4 +22,3 @@ _cameraNamespace setVariable [QGVAR(targetFOV), _zoomArray select _zoomIndex];
|
|||||||
_cameraNamespace setVariable [QGVAR(fovChanged), true];
|
_cameraNamespace setVariable [QGVAR(fovChanged), true];
|
||||||
_cameraNamespace setVariable [QGVAR(fovChangedTime), CBA_missionTime];
|
_cameraNamespace setVariable [QGVAR(fovChangedTime), CBA_missionTime];
|
||||||
_cameraNamespace setVariable [QGVAR(startingFov), _cameraNamespace getVariable QGVAR(currentFOV)];
|
_cameraNamespace setVariable [QGVAR(startingFov), _cameraNamespace getVariable QGVAR(currentFOV)];
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#include "script_component.hpp"
|
#include "..\script_component.hpp"
|
||||||
/*
|
/*
|
||||||
* Author: Dani (TCVM)
|
* Author: Dani (TCVM)
|
||||||
* Switches away from the currently controlled camera
|
* Switches away from the currently controlled camera
|
||||||
@ -24,4 +24,3 @@ _camera cameraEffect ["terminate", "back"];
|
|||||||
GVAR(activeCamera) = objNull;
|
GVAR(activeCamera) = objNull;
|
||||||
|
|
||||||
QGVAR(camera_hud) cutText ["", "PLAIN"];
|
QGVAR(camera_hud) cutText ["", "PLAIN"];
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#include "script_component.hpp"
|
#include "..\script_component.hpp"
|
||||||
/*
|
/*
|
||||||
* Author: Dani (TCVM)
|
* Author: Dani (TCVM)
|
||||||
* Switches to the currently controlled camera
|
* Switches to the currently controlled camera
|
||||||
@ -50,4 +50,3 @@ _cameraNamespace setVariable [QGVAR(reticleLeft), (uiNameSpace getVariable _uiNa
|
|||||||
_cameraNamespace setVariable [QGVAR(reticleRight), (uiNameSpace getVariable _uiNamespaceDialogVariable) displayCtrl _rightGate];
|
_cameraNamespace setVariable [QGVAR(reticleRight), (uiNameSpace getVariable _uiNamespaceDialogVariable) displayCtrl _rightGate];
|
||||||
_cameraNamespace setVariable [QGVAR(reticleTop), (uiNameSpace getVariable _uiNamespaceDialogVariable) displayCtrl _topGate];
|
_cameraNamespace setVariable [QGVAR(reticleTop), (uiNameSpace getVariable _uiNamespaceDialogVariable) displayCtrl _topGate];
|
||||||
_cameraNamespace setVariable [QGVAR(reticleBottom), (uiNameSpace getVariable _uiNamespaceDialogVariable) displayCtrl _bottomGate];
|
_cameraNamespace setVariable [QGVAR(reticleBottom), (uiNameSpace getVariable _uiNamespaceDialogVariable) displayCtrl _bottomGate];
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#include "script_component.hpp"
|
#include "..\script_component.hpp"
|
||||||
/*
|
/*
|
||||||
* Author: Dani (TCVM)
|
* Author: Dani (TCVM)
|
||||||
* Updates camera to be on a fixed point
|
* Updates camera to be on a fixed point
|
||||||
@ -20,7 +20,7 @@ _cameraArray params ["_hasCamera", "", "", "", "", "", "", "", "_viewData", "_gi
|
|||||||
_viewData params ["_lookDir", "_groundPos", "_pointPos", "_movingCameraX", "_movingCameraY"];
|
_viewData params ["_lookDir", "_groundPos", "_pointPos", "_movingCameraX", "_movingCameraY"];
|
||||||
_gimbalData params ["_hasGimbal", "_maxGimbalX", "_maxGimbalY", "_gimbalSpeedX", "_gimbalSpeedY", "", "", "_gimbalZoomSpeedModifiers", "_stabilizeWhenMoving", "_designateWhenStationary", "_trackLockedPosition"];
|
_gimbalData params ["_hasGimbal", "_maxGimbalX", "_maxGimbalY", "_gimbalSpeedX", "_gimbalSpeedY", "", "", "_gimbalZoomSpeedModifiers", "_stabilizeWhenMoving", "_designateWhenStationary", "_trackLockedPosition"];
|
||||||
|
|
||||||
if (!_hasCamera || { _cameraNamespace isEqualTo objNull }) exitWith {};
|
if (!_hasCamera || { isNull _cameraNamespace }) exitWith {};
|
||||||
|
|
||||||
if ([_cameraNamespace] call FUNC(camera_userInCamera)) then {
|
if ([_cameraNamespace] call FUNC(camera_userInCamera)) then {
|
||||||
cameraEffectEnableHUD true;
|
cameraEffectEnableHUD true;
|
||||||
@ -238,5 +238,3 @@ _cameraArray set [8, _viewData];
|
|||||||
_camera camCommit 0;
|
_camera camCommit 0;
|
||||||
|
|
||||||
[_cameraNamespace, _cameraArray] call FUNC(camera_updateTargetingGate);
|
[_cameraNamespace, _cameraArray] call FUNC(camera_updateTargetingGate);
|
||||||
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
#include "script_component.hpp"
|
#include "..\script_component.hpp"
|
||||||
/*
|
/*
|
||||||
* Author: Dani (TCVM)
|
* Author: Dani (TCVM)
|
||||||
* Switches away from the currently controlled camera
|
* Switches away from the currently controlled camera
|
||||||
@ -21,7 +21,7 @@ _viewData params ["_lookDir", "_groundPos", "_pointPos", "_movingCameraX", "_mov
|
|||||||
_gimbalData params ["_hasGimbal", "_maxGimbalX", "_maxGimbalY", "_gimbalSpeedX", "_gimbalSpeedY", "", "", "_gimbalZoomSpeedModifiers"];
|
_gimbalData params ["_hasGimbal", "_maxGimbalX", "_maxGimbalY", "_gimbalSpeedX", "_gimbalSpeedY", "", "", "_gimbalZoomSpeedModifiers"];
|
||||||
_reticleData params ["", "", "", "", "", "", "", "", "", "_reticleMovesWithTrack"];
|
_reticleData params ["", "", "", "", "", "", "", "", "", "_reticleMovesWithTrack"];
|
||||||
|
|
||||||
if !(([_cameraNamespace] call FUNC(camera_userInCamera))) exitWith {};
|
if !([_cameraNamespace] call FUNC(camera_userInCamera)) exitWith {};
|
||||||
|
|
||||||
private _seekerTargetPos = _cameraNamespace getVariable [QGVAR(seekerTargetPos), [0, 0, 0]];
|
private _seekerTargetPos = _cameraNamespace getVariable [QGVAR(seekerTargetPos), [0, 0, 0]];
|
||||||
private _seekerTargetInfo = _cameraNamespace getVariable [QGVAR(seekerTargetInfo), [false, [0, 0], [0, 0]]];
|
private _seekerTargetInfo = _cameraNamespace getVariable [QGVAR(seekerTargetInfo), [false, [0, 0], [0, 0]]];
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#include "script_component.hpp"
|
#include "..\script_component.hpp"
|
||||||
/*
|
/*
|
||||||
* Author: Dani (TCVM)
|
* Author: Dani (TCVM)
|
||||||
* Switches away from the currently controlled camera
|
* Switches away from the currently controlled camera
|
||||||
@ -19,5 +19,4 @@ params [["_cameraNamespace", objNull]];
|
|||||||
|
|
||||||
if (isNil QGVAR(activeCamera)) exitWith { false };
|
if (isNil QGVAR(activeCamera)) exitWith { false };
|
||||||
|
|
||||||
(GVAR(activeCamera) isNotEqualTo objNull) && { (_cameraNamespace isEqualTo objNull) || (_cameraNamespace isEqualTo GVAR(activeCamera)) };
|
(!isNull GVAR(activeCamera)) && { isNull _cameraNamespace || (_cameraNamespace isEqualTo GVAR(activeCamera)) };
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#include "script_component.hpp"
|
#include "..\script_component.hpp"
|
||||||
/*
|
/*
|
||||||
* Author: Dani (TCVM)
|
* Author: Dani (TCVM)
|
||||||
* Return the position of a potential EO target via a "edge detection" algorithm. Compares object bounding boxes to see what we are most likely hitting
|
* Return the position of a potential EO target via a "edge detection" algorithm. Compares object bounding boxes to see what we are most likely hitting
|
||||||
@ -122,4 +122,3 @@ if (_nearObjects isNotEqualTo []) then {
|
|||||||
};
|
};
|
||||||
|
|
||||||
_seekerTargetPos
|
_seekerTargetPos
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#include "script_component.hpp"
|
#include "..\script_component.hpp"
|
||||||
/*
|
/*
|
||||||
* Author: Dani (TCVM)
|
* Author: Dani (TCVM)
|
||||||
* Handle key presses
|
* Handle key presses
|
||||||
@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
params ["_key", "_down"];
|
params ["_key", "_down"];
|
||||||
|
|
||||||
if ((currentWeapon ACE_PLAYER) != QGVAR(launcher)) exitWith {};
|
if ((currentWeapon ACE_player) != QGVAR(launcher)) exitWith {};
|
||||||
|
|
||||||
if (_key == SPIKE_KEY_DESIGNATE) then {
|
if (_key == SPIKE_KEY_DESIGNATE) then {
|
||||||
if (cameraView == "GUNNER") then {
|
if (cameraView == "GUNNER") then {
|
||||||
|
@ -1,9 +1,8 @@
|
|||||||
#include "script_component.hpp"
|
#include "..\script_component.hpp"
|
||||||
/*
|
/*
|
||||||
* Author: Dani (TCVM)
|
* Author: Dani (TCVM)
|
||||||
* Handles the map helper's draw event
|
* Handles the map helper's draw event
|
||||||
* Resets arguments if not run recently
|
* Resets arguments if not run recently and starts a watchdog to detect when weapon display unloaded
|
||||||
* And starts a watchdog to detect when weapon display unloaded
|
|
||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
* None
|
* None
|
||||||
@ -98,4 +97,3 @@ if (cameraView isEqualTo "GUNNER") then {
|
|||||||
__SPIKE_RETICLE ctrlShow false;
|
__SPIKE_RETICLE ctrlShow false;
|
||||||
(__SPIKE_DISPLAY displayCtrl 241000) ctrlShow false;
|
(__SPIKE_DISPLAY displayCtrl 241000) ctrlShow false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#include "script_component.hpp"
|
#include "..\script_component.hpp"
|
||||||
/*
|
/*
|
||||||
* Author: Dani (TCVM)
|
* Author: Dani (TCVM)
|
||||||
* Condition to switch to next navigation profile
|
* Condition to switch to next navigation profile
|
||||||
@ -19,4 +19,3 @@ _stateParams params ["", "", "", "","_navigationParams"];
|
|||||||
|
|
||||||
_navigationParams params ["_state"];
|
_navigationParams params ["_state"];
|
||||||
_state isEqualTo STAGE_TERMINAL
|
_state isEqualTo STAGE_TERMINAL
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#include "script_component.hpp"
|
#include "..\script_component.hpp"
|
||||||
/*
|
/*
|
||||||
* Author: Dani (TCVM)
|
* Author: Dani (TCVM)
|
||||||
* Sets up a top-attack profile. If we don't have a target: coast
|
* Sets up a top-attack profile. If we don't have a target: coast
|
||||||
@ -113,4 +113,3 @@ drawIcon3D ["\a3\ui_f\data\IGUI\Cfg\Cursors\selectover_ca.paa", [1,1,0,1], (ASLt
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
_projectile vectorModelToWorldVisual _cmdAccel
|
_projectile vectorModelToWorldVisual _cmdAccel
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#include "script_component.hpp"
|
#include "..\script_component.hpp"
|
||||||
/*
|
/*
|
||||||
* Author: Dani (TCVM)
|
* Author: Dani (TCVM)
|
||||||
* Initialises SPIKE camera
|
* Initialises SPIKE camera
|
||||||
@ -22,7 +22,7 @@ private _missileGuidanceConfig = (configOf _projectile) >> "ace_missileguidance"
|
|||||||
// Setup camera array
|
// Setup camera array
|
||||||
private _cameraConfig = _missileGuidanceConfig >> "camera";
|
private _cameraConfig = _missileGuidanceConfig >> "camera";
|
||||||
private _cameraArray = [false];
|
private _cameraArray = [false];
|
||||||
if (!(_cameraConfig isEqualTo configNull) && { (getNumber (_cameraConfig >> "enabled")) == 1 }) then {
|
if (!isNull _cameraConfig && { (getNumber (_cameraConfig >> "enabled")) == 1 }) then {
|
||||||
_cameraArray set [0, true];
|
_cameraArray set [0, true];
|
||||||
_cameraArray set [1, getArray (_cameraConfig >> "fovLevels")];
|
_cameraArray set [1, getArray (_cameraConfig >> "fovLevels")];
|
||||||
_cameraArray set [2, getNumber (_cameraConfig >> "initialFOV")];
|
_cameraArray set [2, getNumber (_cameraConfig >> "initialFOV")];
|
||||||
@ -68,8 +68,8 @@ if (!(_cameraConfig isEqualTo configNull) && { (getNumber (_cameraConfig >> "ena
|
|||||||
_cameraArray set [12, (getNumber (_cameraConfig >> "canStopDesignating")) == 1];
|
_cameraArray set [12, (getNumber (_cameraConfig >> "canStopDesignating")) == 1];
|
||||||
};
|
};
|
||||||
|
|
||||||
private _preTarget = +(ACE_PLAYER getVariable [QGVAR(target), [0, 0, 0]]);
|
private _preTarget = +(ACE_player getVariable [QGVAR(target), [0, 0, 0]]);
|
||||||
ACE_PLAYER setVariable [QGVAR(target), [0, 0, 0]];
|
ACE_player setVariable [QGVAR(target), [0, 0, 0]];
|
||||||
private _camera = [_projectile, _cameraArray, _shooter, _preTarget isEqualTo [0, 0, 0]] call FUNC(camera_init);
|
private _camera = [_projectile, _cameraArray, _shooter, _preTarget isEqualTo [0, 0, 0]] call FUNC(camera_init);
|
||||||
GVAR(projectileHashMap) set [hashValue _projectile, [_camera, _preTarget]];
|
GVAR(projectileHashMap) set [hashValue _projectile, [_camera, _preTarget]];
|
||||||
[{
|
[{
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#include "script_component.hpp"
|
#include "..\script_component.hpp"
|
||||||
/*
|
/*
|
||||||
* Author: Dani (TCVM)
|
* Author: Dani (TCVM)
|
||||||
* Seeker Type: Spike Optical
|
* Seeker Type: Spike Optical
|
||||||
@ -74,4 +74,3 @@ _seekerStateParams set [0, _lastPositions];
|
|||||||
_seekerStateParams set [2, _velocity];
|
_seekerStateParams set [2, _velocity];
|
||||||
|
|
||||||
_seekerTargetPos
|
_seekerTargetPos
|
||||||
|
|
||||||
|
@ -1 +0,0 @@
|
|||||||
#include "\z\ace\addons\spike\script_component.hpp"
|
|
Loading…
Reference in New Issue
Block a user