Skip to content

Commit

Permalink
water base support
Browse files Browse the repository at this point in the history
  • Loading branch information
raymix committed Aug 15, 2014
1 parent 3780b42 commit 977ee29
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
3 changes: 2 additions & 1 deletion README.md
@@ -1,7 +1,7 @@
# ![alt text](https://dl.dropboxusercontent.com/u/14423790/snappro.png "Snap Building Pro")
___

## *Installation* `ver 1.3`
## *Installation* `ver 1.3.1`

Create and add new **compiles.sqf** file (you can reuse an old one if you already have it) and add this to **init.sqf** file:

Expand Down Expand Up @@ -65,6 +65,7 @@ To only show tutorial text once (per log-in), add this right before closing brac
## Changelog
|Notes |Date |Version |
| ------------------------------------------|:-----------------:| ---------:|
|Full support for water bases |15/08/2014 |1.3.1 |
|Fixed defines, adjustable snap ranges |09/08/2014 |1.3 |
|Anti-grief temporarily removed |23/07/2014 |1.2.1 |
|CMD menus removed and pushed to a new repo |21/07/2014 |1.2.0 |
Expand Down
10 changes: 6 additions & 4 deletions custom/snap_pro/snap_build.sqf
Expand Up @@ -3,7 +3,7 @@
// July 6 2014 |
//------------------|

private ["_object","_objectSnapGizmo","_objColorActive","_objColorInactive","_classname","_whitelist","_points","_cfg","_cnt","_pos","_findWhitelisted","_nearbyObject","_posNearby","_selectedAction","_newPos","_pointsNearby","_onWater"];
private ["_object","_objectSnapGizmo","_objColorActive","_objColorInactive","_classname","_whitelist","_points","_cfg","_cnt","_pos","_findWhitelisted","_nearbyObject","_posNearby","_selectedAction","_newPos","_pointsNearby","_onWater","_waterBase"];
//Args
snapActionState = _this select 3 select 0;
_object = _this select 3 select 1;
Expand Down Expand Up @@ -58,8 +58,10 @@ fnc_initSnapPoints = {

fnc_initSnapPointsNearby = {
_pos = getPosATL _object;
_findWhitelisted = []; _pointsNearby = [];
_findWhitelisted = nearestObjects [_pos,_whitelist,(_radius + DZE_snapExtraRange)]-[_object];
_findWhitelisted = []; _pointsNearby = []; _waterBase = 0;
_onWater = surfaceIsWater position player;
if (_onWater) then { _waterBase = (getPosATL player select 2);};
_findWhitelisted = nearestObjects [_pos,_whitelist,(_radius + DZE_snapExtraRange + _waterBase)]-[_object];
snapGizmosNearby = [];
{
_nearbyObject = _x;
Expand Down Expand Up @@ -199,7 +201,7 @@ fnc_initSnapTutorial = {

//Init Tutorial text
if (_bldTxtEnable) then {
_bldTxtStringTitle = format ["<t %1%2%3%4>Snap Building <t %5%6%7>Pro 1.3</t></t><br />",_bldTxtClrO,_bldTxtSz,_bldTxtShdw,_bldTxtAlgnL,_bldTxtClrW,_bldTxtUndrln,_bldTxtBold];
_bldTxtStringTitle = format ["<t %1%2%3%4>Snap Building <t %5%6%7>Pro 1.3.1</t></t><br />",_bldTxtClrO,_bldTxtSz,_bldTxtShdw,_bldTxtAlgnL,_bldTxtClrW,_bldTxtUndrln,_bldTxtBold];
_bldTxtStringSD = format["<t %1%4%5%6>[Snap]<t %2> Disabled:</t> <t %3>use action menu to enable.</t></t><br /><br />",_bldTxtClrC,_bldTxtClrR,_bldTxtClrW,_bldTxtSzT,_bldTxtShdw,_bldTxtAlgnL];
_bldTxtStringSE = format["<t %1%4%5%6>[Snap]<t %2> Enabled:</t> <t %3>use action menu to disable.</t></t><br /><br />",_bldTxtClrC,_bldTxtClrG,_bldTxtClrW,_bldTxtSzT,_bldTxtShdw,_bldTxtAlgnL];
_bldTxtStringSA = format["<t %1%3%4%5>[Snap Point]<t %2> AUTOMATIC: Automatic snap point detection.</t></t><br /><br />",_bldTxtClrC,_bldTxtClrW,_bldTxtSzT,_bldTxtShdw,_bldTxtAlgnL];
Expand Down

0 comments on commit 977ee29

Please sign in to comment.