snap code optimization, vault points added

This commit is contained in:
raymix
2014-07-12 20:23:42 +01:00
parent 07b3f14c1b
commit 2355d6b18e
3 changed files with 29 additions and 6 deletions

View File

@@ -371,4 +371,20 @@ class SnapBuilding {
};
};
class WoodLadder_DZ: WoodLadder_Preview_DZ{};
class VaultStorageLocked {
snapTo[] = {
"VaultStorageLocked",
"VaultStorage"
};
points[] = {
{0,0,0,"Pivot"},
{0,0.284,0.615,"Back"},
{0,0,1.23,"Top"},
{-0.362,0,0.615,"Left"},
{0.362,0,0.615,"Right"}
};
};
class VaultStorage: VaultStorageLocked {};
};

View File

@@ -26,9 +26,9 @@ fnc_snapActionCleanup = {
_s1 = _this select 0;
_s2 = _this select 1;
_s3 = _this select 2;
player removeAction s_player_toggleSnap;
player removeAction s_player_toggleSnapSelect;
{player removeAction _x;} count s_player_toggleSnapSelectPoint;
player removeAction s_player_toggleSnap; s_player_toggleSnap = -1;
player removeAction s_player_toggleSnapSelect; s_player_toggleSnapSelect = -1;
if (count s_player_toggleSnapSelectPoint != 0) then {{player removeAction _x;} count s_player_toggleSnapSelectPoint; s_player_toggleSnapSelectPoint=[]; snapActions = -1;};
if (_s1 > 0) then {
s_player_toggleSnap = player addaction [format[("<t color=""#ffffff"">" + ("Snap: %1") +"</t>"),snapActionState],"\z\addons\dayz_code\actions\snap_build.sqf",[snapActionState,_object,_classname,_objectHelper],6,false,true];
};
@@ -58,7 +58,7 @@ fnc_initSnapPoints = {
fnc_initSnapPointsNearby = {
_pos = getPosATL _object;
_findWhitelisted = []; _pointsNearby = [];
_findWhitelisted = nearestObjects [_pos,_whitelist,15]-[_object];
_findWhitelisted = nearestObjects [_pos,_whitelist,10]-[_object];
snapGizmosNearby = [];
{
_nearbyObject = _x;
@@ -223,8 +223,8 @@ fnc_initSnapTutorial = {
[
_bldTxtFinal, //structured text
[0.73 * safezoneW + safezoneX], //number - x
[0.65 * safezoneH + safezoneY], //number - y
0.73 * safezoneW + safezoneX, //number - x
0.65 * safezoneH + safezoneY, //number - y
30, //number - duration
1, // number - fade in time
0, // number - delta y

View File

@@ -257,6 +257,10 @@ dayz_resetSelfActions = {
s_player_heli_lift = -1;
s_player_heli_detach = -1;
s_player_lockUnlock_crtl = -1;
s_player_toggleSnap = -1;
s_player_toggleSnapSelect = -1;
s_player_toggleSnapSelectPoint=[];
snapActions = -1;
};
call dayz_resetSelfActions;
@@ -534,6 +538,9 @@ if(isNil "DZE_StaticConstructionCount") then {
if (isNil "DZE_selfTransfuse_Values") then {
DZE_selfTransfuse_Values = [12000, 15, 300];
};
if (isNil "DZE_snapBuilding") then {
DZE_snapBuilding = false;
};
// needed on server
if(isNil "DZE_PlotPole") then {