rework PFH to client module, triageIcons and vehicleFlags point there
This commit is contained in:
10
framework/client/functions/fn_addDraw3DPFH.sqf
Normal file
10
framework/client/functions/fn_addDraw3DPFH.sqf
Normal file
@@ -0,0 +1,10 @@
|
||||
#include "..\script_component.hpp"
|
||||
|
||||
|
||||
if (!isNil QGVAR(draw3DPFH)) then {
|
||||
[GVAR(draw3DPFH)] call CBA_fnc_removePerFrameHandler;
|
||||
};
|
||||
// add pfh that processes queued code
|
||||
GVAR(draw3DPFH) = [{
|
||||
{call _x; true;} count (localNamespace getVariable [QGVAR(pfhCode), []]);
|
||||
}, 0] call CBA_fnc_addPerFrameHandler;
|
||||
17
framework/client/functions/fn_addGetNearMenPFH.sqf
Normal file
17
framework/client/functions/fn_addGetNearMenPFH.sqf
Normal file
@@ -0,0 +1,17 @@
|
||||
#include "..\script_component.hpp"
|
||||
|
||||
// subroutine to gather nearest 50 units every 5 seconds and store in GVAR(nearMen)
|
||||
// cleanup
|
||||
if (!isNil QGVAR(getNearMenPFH)) then {
|
||||
[GVAR(getNearMenPFH)] call CBA_fnc_removePerFrameHandler;
|
||||
};
|
||||
// add pfh
|
||||
GVAR(getNearMenPFH) = [{
|
||||
localNamespace setVariable [
|
||||
QGVAR(nearMen),
|
||||
(nearestObjects [player,["Man"],50,false]) select {
|
||||
!isNull _x &&
|
||||
player isNotEqualTo _x
|
||||
}
|
||||
];
|
||||
}, 1] call CBA_fnc_addPerFrameHandler;
|
||||
@@ -23,11 +23,27 @@ if (!hasInterface) exitWith {};
|
||||
];
|
||||
private _realPos = nil;
|
||||
// if pos was provided, process
|
||||
if (count _pos > 0) then {
|
||||
if (typeName _pos == "STRING") then {
|
||||
_realPos = [_pos, true] call ACE_common_fnc_getMapPosFromGrid;
|
||||
_realPos set [2, getTerrainHeightASL _realPos];
|
||||
} else {_realPos = _pos;};
|
||||
if (count _pos >= 2) then {
|
||||
switch (typeName _pos) do {
|
||||
case "ARRAY": {
|
||||
// pos is provided as an array
|
||||
_realPos = _pos select [0, 2];
|
||||
_realPos set [2, getTerrainHeightASL _realPos];
|
||||
};
|
||||
case "STRING": {
|
||||
// pos is provided as a string
|
||||
_realPos = [_pos, true] call ACE_common_fnc_getMapPosFromGrid;
|
||||
_realPos set [2, getTerrainHeightASL _realPos];
|
||||
};
|
||||
default {
|
||||
[
|
||||
LEVEL_WARNING,
|
||||
QUOTE(COMPONENT),
|
||||
format["Invalid position for custom microDAGR waypoint: %1", _wpName],
|
||||
[["name", _wpName], ["pos", _pos], ["object", _object]]] call EFUNC(common,log);
|
||||
continue;
|
||||
};
|
||||
};
|
||||
};
|
||||
// if object was provided, process and override any pos
|
||||
if (count _object > 0) then {
|
||||
@@ -53,7 +69,8 @@ if (!hasInterface) exitWith {};
|
||||
};
|
||||
|
||||
[_wpName, _realPos] call ace_microdagr_fnc_deviceAddWaypoint;
|
||||
} forEach _customWaypoints;
|
||||
true;
|
||||
} count _customWaypoints;
|
||||
}] call CBA_fnc_waitUntilAndExecute;
|
||||
|
||||
nil;
|
||||
9
framework/client/functions/fn_addPFHCode.sqf
Normal file
9
framework/client/functions/fn_addPFHCode.sqf
Normal file
@@ -0,0 +1,9 @@
|
||||
#include "..\script_component.hpp"
|
||||
|
||||
params [["_code", {}, [{}]]];
|
||||
|
||||
private _pfhCode = localNamespace getVariable [QGVAR(pfhCode), []];
|
||||
_pfhCode pushBack _code;
|
||||
localNamespace setVariable [QGVAR(pfhCode), _pfhCode];
|
||||
|
||||
count _pfhCode;
|
||||
5
framework/client/functions/fn_clearPFHCode.sqf
Normal file
5
framework/client/functions/fn_clearPFHCode.sqf
Normal file
@@ -0,0 +1,5 @@
|
||||
#include "..\script_component.hpp"
|
||||
|
||||
localNamespace setVariable [QGVAR(pfhCode), []];
|
||||
|
||||
count [];
|
||||
@@ -8,6 +8,11 @@ call FUNC(addZenModules);
|
||||
call FUNC(bindEventHandlers);
|
||||
call FUNC(bindVehicleActions);
|
||||
|
||||
localNamespace setVariable [QGVAR(nearMen), []];
|
||||
call FUNC(addGetNearMenPFH);
|
||||
localNamespace setVariable [QGVAR(pfhCode), []];
|
||||
call FUNC(addDraw3DPFH);
|
||||
|
||||
// add listener that tracks when the player goes unconscious and saves a variable with time
|
||||
call FUNC(bindUnconsciousListener);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user