-
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.
add exclusion zone via zeus module (#57)
depends on ZEN which lets you add area markers as Zeus
- Loading branch information
1 parent
5f0aec8
commit b407396
Showing
7 changed files
with
68 additions
and
26 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) pushBackUnique _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
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(POPULATION_ZONES) pushBack _area; | ||
|
||
GVAR(POPULATION_ZONES) pushBack _trigger; | ||
|
||
INFO_2("added population zone %1 at %2", triggerArea _trigger, getPos _trigger); | ||
INFO_1("added population 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,51 @@ | ||
#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 "_minDistanceAndIndex") exitWith { | ||
systemChat format["no area marker at position %1", _clickPos]; | ||
}; | ||
private _marker = _areaMarkersAtPos select (_minDistanceAndIndex#1); | ||
|
||
[_marker] call FUNC(addExclusionZone); | ||
_marker setMarkerBrushLocal "BORDER"; | ||
_marker setMarkerColorLocal "ColorUNKNOWN"; | ||
} | ||
] call zen_custom_modules_fnc_register; | ||
|
||
["GRAD-CIVS","ADD POPULATION 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 "_minDistanceAndIndex") exitWith { | ||
systemChat format["no area marker at position %1", _clickPos]; | ||
}; | ||
private _marker = _areaMarkersAtPos select (_minDistanceAndIndex#1); | ||
|
||
[_marker] call FUNC(addPopulationZone); | ||
_marker setMarkerBrushLocal "BORDER"; | ||
_marker setMarkerColorLocal "ColorCIV"; | ||
} | ||
] call zen_custom_modules_fnc_register; |
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,5 +1,5 @@ | ||
#include "..\..\component.hpp" | ||
|
||
ASSERT_SERVER(""); | ||
ASSERT_SERVER("radio channel must be created on server"); | ||
|
||
radioChannelCreate [[0.96, 0.34, 0.13, 0.8], "grad-civs info", "%CHANNEL_LABEL:", [], true]; |