-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
depends on ZEN which lets you add area markers as Zeus
- Loading branch information
1 parent
5f0aec8
commit 7e19c66
Showing
4 changed files
with
29 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,7 @@ | ||
#include "..\..\component.hpp" | ||
|
||
_this params [ | ||
["_trigger", objNull] | ||
]; | ||
params ["_area"]; | ||
|
||
if (isNull _trigger) exitWith { | ||
ERROR("got NULL instead of a trigger as parameter"); | ||
}; | ||
GVAR(EXCLUSION_ZONES) pushBack _area; | ||
|
||
GVAR(EXCLUSION_ZONES) pushBack _trigger; | ||
|
||
INFO_2("added exclusion zone %1 at %2", triggerArea _trigger, getPos _trigger); | ||
INFO_1("added exclusion zone %1", _area); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#include "..\..\component.hpp" | ||
|
||
["GRAD-CIVS","ADD EXCLUSION ZONE (click within existing area marker!)", | ||
{ | ||
params [ | ||
["_clickPos", [0, 0, 0]] | ||
]; | ||
private _areaMarkersAtPos = allMapMarkers select { | ||
(["RECTANGLE", "ELLIPSE"] find (markerShape _x)) > -1 | ||
} select { | ||
_clickPos inArea _x | ||
}; | ||
|
||
private _distances = _areaMarkersAtPos apply { (markerPos _x) distance _clickPos }; | ||
private _minDistanceAndIndex = _distances call CBA_fnc_findMin; | ||
|
||
if (isNil "_minValueAndIndex") exitWith { | ||
[format["no area marker at position %1", _clickPos]] call grad_civs_fnc_showCivHint; | ||
}; | ||
private _marker = _areaMarkersAtPos select (_minDistanceAndIndex#1); | ||
|
||
[_marker] call FUNC(addExclusionZone) | ||
} | ||
] call zen_custom_modules_fnc_register; |