summaryrefslogtreecommitdiffstats
path: root/Client/Functions/Client_MarkerAnim.sqf
blob: beb85b25ddf2c172ce90e7be49f00d6cc2c5525d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
Private ["_additionalErase","_direction","_expand","_markerColor","_markerMax","_markerMin","_markerName","_markerPosition","_markerSize","_markerType"];
_markerName = _this select 0;
_markerPosition = _this select 1;
_markerType = _this select 2;
_markerSize = _this select 3;
_markerColor = _this select 4;
_markerMin = _this select 5;
_markerMax = _this select 6;
_additionalErase = "";
if (count _this > 7) then {_additionalErase = _this select 7};

deleteMarkerLocal _markerName;
CreateMarkerLocal [_markerName,_markerPosition];
_markerName setMarkerTypeLocal _markerType;
_markerName setMarkerColorLocal _markerColor;
_markerName setMarkerSizeLocal [_markerSize,_markerSize];

_difference = (_markerMax - _markerMin)/10;
_direction = 0;
_expand = true;
activeAnimMarker = true;

if (_additionalErase != "") then {
	Private ["_pr"];
	_pr = 'WFBE_PATROLRANGE' Call GetNamespace;
	createMarkerLocal [_additionalErase,_markerPosition];
	_additionalErase setMarkerShapeLocal "Ellipse";
	_additionalErase setMarkerColorLocal _markerColor;
	_additionalErase setMarkerSizeLocal [_pr,_pr];
};

while {activeAnimMarker} do {
	sleep 0.03;

	_direction = (_direction + 1) % 360;
	_markerName setMarkerDirLocal _direction;
	_markerName setMarkerSizeLocal [_markerSize,_markerSize];

	if (_markerSize > _markerMax) then {_expand = false};
	if (_markerSize < _markerMin) then {_expand = true};
	if (_expand) then {_markerSize = _markerSize + _difference} else {_markerSize = _markerSize - _difference};
};

deleteMarkerLocal _markerName;
if (_additionalErase != "") then {deleteMarkerLocal _additionalErase};