mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Don't use uiNamespace to store PEFH
This commit is contained in:
@ -12,3 +12,4 @@ PREP(onOpticDraw);
|
|||||||
PREP(onOpticUnload);
|
PREP(onOpticUnload);
|
||||||
|
|
||||||
GVAR(isLockKeyDown) = false;
|
GVAR(isLockKeyDown) = false;
|
||||||
|
GVAR(pfehID) = -1;
|
||||||
|
@ -1,21 +1,17 @@
|
|||||||
//#define DEBUG_MODE_FULL
|
//#define DEBUG_MODE_FULL
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
PARAMS_7(_shooter,_weapon,_muzzle,_mode,_ammo,_magazine,_projectile);
|
PARAMS_2(_shooter,_weapon);
|
||||||
|
|
||||||
// Bail on not missile
|
// Bail on not missile or javelin PFEH not running
|
||||||
if( _shooter != ACE_player) exitWith { false };
|
if ((_shooter != ACE_player) || {(GVAR(pfehID) == -1)}) exitWith { false };
|
||||||
|
|
||||||
|
private ["_configs"];
|
||||||
|
|
||||||
_configs = configProperties [configFile >> "CfgWeapons" >> _weapon, QUOTE(configName _x == QUOTE(QGVAR(enabled))), false];
|
_configs = configProperties [configFile >> "CfgWeapons" >> _weapon, QUOTE(configName _x == QUOTE(QGVAR(enabled))), false];
|
||||||
if (((count _configs) < 1) || {(getNumber (_configs select 0)) != 1}) exitWith {};
|
if (((count _configs) < 1) || {(getNumber (_configs select 0)) != 1}) exitWith {};
|
||||||
|
|
||||||
_pfh_handle = uiNamespace getVariable ["ACE_RscOptics_javelin_PFH", nil];
|
|
||||||
if(!isNil "_pfh_handle") then {
|
|
||||||
//[_pfh_handle] call cba_fnc_removePerFrameHandler;
|
|
||||||
//uiNamespace setVariable["ACE_RscOptics_javelin_PFH", nil];
|
|
||||||
|
|
||||||
__JavelinIGUITargeting ctrlShow false;
|
__JavelinIGUITargeting ctrlShow false;
|
||||||
__JavelinIGUITargetingGate ctrlShow false;
|
__JavelinIGUITargetingGate ctrlShow false;
|
||||||
__JavelinIGUITargetingLines ctrlShow false;
|
__JavelinIGUITargetingLines ctrlShow false;
|
||||||
__JavelinIGUITargetingConstraints ctrlShow false;
|
__JavelinIGUITargetingConstraints ctrlShow false;
|
||||||
};
|
|
@ -56,7 +56,7 @@ if (((count _weaponConfig) < 1) || {(getNumber (_weaponConfig select 0)) != 1})
|
|||||||
};
|
};
|
||||||
|
|
||||||
[(_this select 1)] call cba_fnc_removePerFrameHandler;
|
[(_this select 1)] call cba_fnc_removePerFrameHandler;
|
||||||
uiNamespace setVariable["ACE_RscOptics_javelin_PFH", nil];
|
GVAR(pfehID) = -1;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Find a target within the optic range
|
// Find a target within the optic range
|
||||||
|
@ -18,6 +18,10 @@ __JavelinIGUITargetingConstrains ctrlShow false;
|
|||||||
__JavelinIGUITargetingGate ctrlShow false;
|
__JavelinIGUITargetingGate ctrlShow false;
|
||||||
__JavelinIGUITargetingLines ctrlShow false;
|
__JavelinIGUITargetingLines ctrlShow false;
|
||||||
|
|
||||||
|
if(GVAR(pfehID) != -1) then {
|
||||||
|
[] call FUNC(onOpticUnload); // Unload optic if it was already loaded
|
||||||
|
};
|
||||||
|
|
||||||
uiNameSpace setVariable [QGVAR(arguments),
|
uiNameSpace setVariable [QGVAR(arguments),
|
||||||
[
|
[
|
||||||
ACE_diagTime, // Last runtime
|
ACE_diagTime, // Last runtime
|
||||||
@ -30,11 +34,4 @@ uiNameSpace setVariable [QGVAR(arguments),
|
|||||||
]
|
]
|
||||||
];
|
];
|
||||||
|
|
||||||
|
GVAR(pfehID) = [FUNC(onOpticDraw), 0, []] call CBA_fnc_addPerFrameHandler;
|
||||||
|
|
||||||
_pfh_handle = uiNamespace getVariable ["ACE_RscOptics_javelin_PFH", nil];
|
|
||||||
if(!isNil "_pfh_handle") then {
|
|
||||||
[] call FUNC(onOpticUnload); // Unload optic if it was already loaded
|
|
||||||
};
|
|
||||||
_pfh_handle = [FUNC(onOpticDraw), 0, []] call CBA_fnc_addPerFrameHandler;
|
|
||||||
uiNamespace setVariable["ACE_RscOptics_javelin_PFH", _pfh_handle];
|
|
||||||
|
@ -1,14 +1,13 @@
|
|||||||
//#define DEBUG_MODE_FULL
|
//#define DEBUG_MODE_FULL
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
TRACE_1("enter", _this);
|
TRACE_1("enter", _this);
|
||||||
private["_args", "_disableFireEH", "_pfh"];
|
private["_args", "_disableFireEH"];
|
||||||
|
|
||||||
uiNameSpace setVariable ['ACE_RscOptics_javelin',nil];
|
// uiNameSpace setVariable ['ACE_RscOptics_javelin',nil];
|
||||||
|
|
||||||
_pfh = uiNamespace getVariable["ACE_RscOptics_javelin_PFH", nil ];
|
if(GVAR(pfehID) != -1) then {
|
||||||
if(!isNil "_pfh") then {
|
[GVAR(pfehID)] call CBA_fnc_removePerFrameHandler;
|
||||||
[_pfh] call CBA_fnc_removePerFrameHandler;
|
GVAR(pfehID) = -1;
|
||||||
uiNameSpace setVariable ['ACE_RscOptics_javelin_PFH',nil];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
_args = uiNamespace getVariable[QGVAR(arguments), nil ];
|
_args = uiNamespace getVariable[QGVAR(arguments), nil ];
|
||||||
|
Reference in New Issue
Block a user