adds default bases + allows mms to set custom waypoints for microdagr
This commit is contained in:
@@ -22,10 +22,12 @@ class PREFIX {
|
||||
class DOUBLES(PREFIX,client) {
|
||||
class functions {
|
||||
file = "framework\client\functions";
|
||||
class bindEmptyGroupGarbageCleanup { postInit = 1; };
|
||||
class bindEventHandlers { postInit = 1; };
|
||||
class bindVehicleActions { postInit = 1; };
|
||||
class addZenModules {postInit = 1;};
|
||||
class initClient {};
|
||||
class addMicroDAGRWaypoints {};
|
||||
class addZenModules {};
|
||||
class bindEmptyGroupGarbageCleanup {};
|
||||
class bindEventHandlers {};
|
||||
class bindVehicleActions {};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
59
framework/client/functions/fn_addMicroDAGRWaypoints.sqf
Normal file
59
framework/client/functions/fn_addMicroDAGRWaypoints.sqf
Normal file
@@ -0,0 +1,59 @@
|
||||
#include "..\script_component.hpp"
|
||||
|
||||
// adds default base locations to players' microDAGR as waypoints
|
||||
|
||||
if (!hasInterface) exitWith {};
|
||||
|
||||
[{!isNull player}, {
|
||||
|
||||
// add base locations (respawn modules)
|
||||
{
|
||||
private _wpName = [_x] call EFUNC(common,getNameOfBase);
|
||||
private _posASL = getPosASL _x;
|
||||
[_wpName, _posASL] call ace_microdagr_fnc_deviceAddWaypoint;
|
||||
} forEach GVARMAIN(baseObjects);
|
||||
|
||||
// add custom waypoints from mission_settings.hpp
|
||||
private _customWaypoints = [missionConfigFile >> "custom_microdagr_waypoints", "ARRAY", []] call CBA_fnc_getConfigEntry;
|
||||
{
|
||||
_x params [
|
||||
["_wpName", ""],
|
||||
["_pos", [0, 0, 0], [[], ""]],
|
||||
["_object", "", [""]]
|
||||
];
|
||||
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 object was provided, process and override any pos
|
||||
if (count _object > 0) then {
|
||||
// object is provided as a string variable name
|
||||
private _realObject = missionNamespace getVariable _object;
|
||||
if (isNull _realObject) then {
|
||||
[
|
||||
LEVEL_WARNING,
|
||||
QUOTE(COMPONENT),
|
||||
format["Invalid object for custom microDAGR waypoint: %1", _wpName],
|
||||
[["name", _wpName], ["pos", _pos], ["object", _object]]] call EFUNC(common,log);
|
||||
continue;
|
||||
};
|
||||
_realPos = getPosASL (missionNamespace getVariable _object);
|
||||
};
|
||||
if (isNil "_realPos") then {
|
||||
[
|
||||
LEVEL_WARNING,
|
||||
QUOTE(COMPONENT),
|
||||
format["Invalid waypoint position for custom microDAGR waypoint: %1", _wpName],
|
||||
[["name", _wpName], ["pos", _pos], ["object", _object]]] call EFUNC(common,log);
|
||||
continue;
|
||||
};
|
||||
|
||||
[_wpName, _realPos] call ace_microdagr_fnc_deviceAddWaypoint;
|
||||
} forEach _customWaypoints;
|
||||
}] call CBA_fnc_waitUntilAndExecute;
|
||||
|
||||
nil;
|
||||
21
framework/client/functions/fn_initClient.sqf
Normal file
21
framework/client/functions/fn_initClient.sqf
Normal file
@@ -0,0 +1,21 @@
|
||||
#include "..\script_component.hpp"
|
||||
|
||||
|
||||
if (!hasInterface) exitWith {};
|
||||
|
||||
call FUNC(addMicroDAGRWaypoints);
|
||||
call FUNC(addZenModules);
|
||||
call FUNC(bindEmptyGroupGarbageCleanup);
|
||||
call FUNC(bindEventHandlers);
|
||||
call FUNC(bindVehicleActions);
|
||||
|
||||
[
|
||||
LEVEL_DEBUG,
|
||||
QUOTE(COMPONENT),
|
||||
"initClient complete",
|
||||
[]
|
||||
] call EFUNC(common,log);
|
||||
|
||||
localNamespace setVariable [QGVAR(complete), true];
|
||||
|
||||
nil;
|
||||
@@ -23,6 +23,7 @@ EGVAR(common,diaryRecords) = createHashMap;
|
||||
|
||||
|
||||
// initialize other modules
|
||||
call EFUNC(client,initClient);
|
||||
call EFUNC(mapcopy,initClient);
|
||||
call EFUNC(reinsert,initClient);
|
||||
call EFUNC(resupply,initClient);
|
||||
|
||||
Reference in New Issue
Block a user