change root level folder name to framework, update resupply+vehicleflags
tested locally
This commit is contained in:
5
framework/map/fn_copyMapFromPlayer.sqf
Normal file
5
framework/map/fn_copyMapFromPlayer.sqf
Normal file
@@ -0,0 +1,5 @@
|
||||
params ["_sourcePlayer","_destinationPlayer"];
|
||||
|
||||
hint format["Copying map markers from %1", name _sourcePlayer];
|
||||
|
||||
[_destinationPlayer] remoteExecCall ["milsim_fnc_getPlayerMapMarkers",_sourcePlayer];
|
||||
16
framework/map/fn_getPlayerMapMarkers.sqf
Normal file
16
framework/map/fn_getPlayerMapMarkers.sqf
Normal file
@@ -0,0 +1,16 @@
|
||||
params ["_destinationPlayer"];
|
||||
|
||||
_markerData = [];
|
||||
|
||||
hint format["Your map is being copied by %1", name _destinationPlayer];
|
||||
|
||||
{
|
||||
_marker = toArray _x;
|
||||
_marker resize 15;
|
||||
if ( toString _marker == "_USER_DEFINED #" ) then {
|
||||
_marker = _x call milsim_fnc_mapMarkerToString;
|
||||
_markerData pushBack _marker;
|
||||
};
|
||||
} forEach allMapMarkers;
|
||||
|
||||
[_markerData] remoteExecCall ["milsim_fnc_loadMapMarkers",_destinationPlayer];
|
||||
17
framework/map/fn_initMapCopy.sqf
Normal file
17
framework/map/fn_initMapCopy.sqf
Normal file
@@ -0,0 +1,17 @@
|
||||
_map_copy_condition =
|
||||
{
|
||||
('ItemMap' in (assignedItems _player)) && ('ItemMap' in (assignedItems _target)) && ([_player, _target, []] call ace_common_fnc_canInteractWith)
|
||||
};
|
||||
|
||||
_map_copy_action =
|
||||
[
|
||||
"MilSimCopyMap",
|
||||
"Copy Map",
|
||||
"\a3\ui_f\data\igui\cfg\actions\talk_ca.paa",
|
||||
{
|
||||
[_target,_player] call milsim_fnc_copyMapFromPlayer
|
||||
},
|
||||
_map_copy_condition
|
||||
] call ace_interact_menu_fnc_createAction;
|
||||
|
||||
["Man", 0, ["ACE_MainActions"], _map_copy_action, true] call ace_interact_menu_fnc_addActionToClass;
|
||||
10
framework/map/fn_loadMapMarkers.sqf
Normal file
10
framework/map/fn_loadMapMarkers.sqf
Normal file
@@ -0,0 +1,10 @@
|
||||
params ["_markerList"];
|
||||
|
||||
if ('ItemMap' in (assignedItems player)) then {
|
||||
{
|
||||
_x call milsim_fnc_stringToMapMarker;
|
||||
} foreach _markerList;
|
||||
hint format["Map copied!"];
|
||||
} else {
|
||||
hint format["You need a map to copy onto!"];
|
||||
};
|
||||
52
framework/map/fn_mapMarkerToString.sqf
Normal file
52
framework/map/fn_mapMarkerToString.sqf
Normal file
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
Author:
|
||||
Killzone_Kid, modified by LAxemann
|
||||
|
||||
Description:
|
||||
Serializes marker to string for storage
|
||||
|
||||
Parameter(s):
|
||||
0: STRING - existing marker name
|
||||
1: STRING (Optional) - a single data delimiter character. Default "|"
|
||||
|
||||
Returns:
|
||||
STRING - serialized marker to be used with BIS_fnc_stringToMarker or BIS_fnc_stringToMarkerLocal
|
||||
or
|
||||
"" on error
|
||||
|
||||
Example:
|
||||
["marker_0"] call RR_mapStuff_fnc_markerToString;
|
||||
["marker_1", ":"] call RR_mapStuff_fnc_markerToString;
|
||||
*/
|
||||
|
||||
params [["_markerName", "", [""]], ["_delimiter", "|", [""]]];
|
||||
|
||||
private _markerShape = markerShape _markerName;
|
||||
private _polyLineArray = [];
|
||||
private _markerType = "none";
|
||||
if (_markerShape isEqualTo "POLYLINE") then {
|
||||
_polyLineArray = markerPolyline _markerName;
|
||||
} else {
|
||||
_markerType = markerType _markerName;
|
||||
};
|
||||
|
||||
|
||||
|
||||
toFixed 4;
|
||||
private _markerPosition = str markerPos [_markerName, true];
|
||||
toFixed -1;
|
||||
|
||||
[
|
||||
"",
|
||||
_markerName,
|
||||
_markerPosition,
|
||||
_markerType,
|
||||
_markerShape,
|
||||
markerSize _markerName,
|
||||
markerDir _markerName,
|
||||
markerBrush _markerName,
|
||||
markerColor _markerName,
|
||||
markerAlpha _markerName,
|
||||
str _polyLineArray,
|
||||
markerText _markerName
|
||||
] joinString _delimiter;
|
||||
70
framework/map/fn_stringToMapMarker.sqf
Normal file
70
framework/map/fn_stringToMapMarker.sqf
Normal file
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
Author:
|
||||
Killzone_Kid, modified by LAxemann
|
||||
|
||||
Description:
|
||||
Creates marker from serialized data
|
||||
|
||||
Parameter(s):
|
||||
0: STRING - marker data from BIS_fnc_markerToString
|
||||
|
||||
Returns:
|
||||
STRING - created marker
|
||||
or
|
||||
"" on error or if marker exists
|
||||
|
||||
Example:
|
||||
["|marker_0|[4359.1,4093.51,0]|mil_objective|ICON|[1,1]|0|Solid|Default|1|An objective"] call RR_mapStuff_fnc_stringToMarker;
|
||||
*/
|
||||
|
||||
params [["_markerData","",[""]]];
|
||||
|
||||
if (_markerData isEqualTo "") exitWith
|
||||
{
|
||||
["Marker data is empty"] call BIS_fnc_error;
|
||||
""
|
||||
};
|
||||
|
||||
_markerData splitString (_markerData select [0,1]) params
|
||||
[
|
||||
"_markerName",
|
||||
"_markerPos",
|
||||
"_markerType",
|
||||
"_markerShape",
|
||||
"_markerSize",
|
||||
"_markerDir",
|
||||
"_markerBrush",
|
||||
"_markerColor",
|
||||
"_markerAlpha",
|
||||
"_polyLineArray",
|
||||
["_markerText",""]
|
||||
];
|
||||
|
||||
if ((count _polyLineArray) > 0) then {
|
||||
_polyLineArray = parseSimpleArray _polyLineArray;
|
||||
};
|
||||
|
||||
_markerNameData = _markerName splitString "#" select 1;
|
||||
_markerNameData splitString "/" params ["_markerCreator", "_markerID", "_markerChannel"];
|
||||
|
||||
_markerName = "_USER_DEFINED #" + _markerCreator + "/" + _markerCreator + _markerID + "/" + _markerChannel;
|
||||
|
||||
|
||||
private _marker = createMarkerLocal [_markerName, parseSimpleArray _markerPos];
|
||||
|
||||
_marker setMarkerColorLocal _markerColor;
|
||||
_marker setMarkerShapeLocal _markerShape;
|
||||
_marker setMarkerAlphaLocal parseNumber _markerAlpha;
|
||||
|
||||
|
||||
if ((count _polyLineArray) > 0) then {
|
||||
_marker setMarkerPolylineLocal _polyLineArray;
|
||||
} else {
|
||||
_marker setMarkerTypeLocal _markerType;
|
||||
_marker setMarkerSizeLocal parseSimpleArray _markerSize;
|
||||
_marker setMarkerBrushLocal _markerBrush;
|
||||
_marker setMarkerTextLocal _markerText;
|
||||
_marker setMarkerDirLocal parseNumber _markerDir;
|
||||
};
|
||||
|
||||
_marker
|
||||
Reference in New Issue
Block a user