Pullrequest/door management (#1694)

* Added doorManagement

* Rename FNC_check_owner --> FNC_check_owner_friends

* Fixed typo

* Fixed bug in FNC_check_owner_friends which allowed every user to manage
every plot and door.

* Removed unused DZE_doorManagementHarderPenalty from configVariables.sqf

* Now checking if _playerUID is in _friendlies for both cases.

* DZE_plotforLife should be DZE_permanentPlot

* Fixed case where DZE_permanentPlot is false.

* Forgot to add STR_EPOCH_CANCEL

* Changed translations to suggested string by ebaydayz.

* Renamed EyeScanner to DoorAccess.

* Reworked access rights for door management.

* DZE_doorManagementMustBeClose = true; //Players must be within 10m of
door to be added as a door friend.

* Fixed copy-paste error.

* Replace count with if

* Remove redundant test.

* Also replaced count in door management admins check.

* Change plotManagement and doorManagement to be consistent to
DayZ_UseSteamID (get UID from FNC_GetPlayerUID).

* Use _playerUID and _characterID more consistent.

* Added german translation to
STR_EPOCH_PLOTMANAGEMENT_ADDFRIEND_ALREADYONTHELIST.
This commit is contained in:
Bruce-LXXVI
2016-06-16 00:22:01 +02:00
committed by ebaydayz
parent 035a94646b
commit 5e53a71e88
21 changed files with 680 additions and 65 deletions

View File

@@ -299,7 +299,7 @@ class Land_DZE_WoodDoor: Land_DZE_WoodDoor_Base {
{
class Open_Door
{
displayName="Open Door";
displayName=$STR_EPOCH_DOORS_OPEN;
onlyforplayer = true;
position="Door_knopf";
radius=3; /* visibility distance of the entry */
@@ -308,7 +308,7 @@ class Land_DZE_WoodDoor: Land_DZE_WoodDoor_Base {
};
class Close_Door : Open_Door
{
displayName="Close Door";
displayName=$STR_EPOCH_DOORS_CLOSE;
condition="this animationPhase ""Open_door"" >= 0.5";
statement="this animate [""Open_door"", 0];";
};
@@ -340,7 +340,7 @@ class Land_DZE_WoodDoorLocked: Land_DZE_WoodDoorLocked_Base {
{
class Open_Door
{
displayName="Open Door";
displayName=$STR_EPOCH_DOORS_OPEN;
onlyforplayer = true;
position="Door_knopf";
radius=3; /* visibility distance of the entry */
@@ -350,31 +350,31 @@ class Land_DZE_WoodDoorLocked: Land_DZE_WoodDoorLocked_Base {
};
class Close_Door : Open_Door
{
displayName="Close Door";
displayName=$STR_EPOCH_DOORS_CLOSE;
//condition="(this animationPhase ""Open_door"" == 1) and (this animationPhase ""Open_hinge"" == 1)";
condition="(this animationPhase ""Open_door"" == 1) and (this animationPhase ""Open_hinge"" == 1)";
statement="this animate [""Open_door"", 0]";
};
class Lock_Door : Open_Door
{
displayName="Lock Door";
displayName=$STR_EPOCH_DOORS_LOCK;
//condition="(this animationPhase ""Open_door"" == 0) and (this animationPhase ""Open_hinge"" == 1)";
condition="( !keypadCancel and DZE_Lock_Door == (this getvariable['CharacterID','0'])) and (this animationPhase ""Open_door"" == 0) and (this animationPhase ""Open_hinge"" == 1)";
statement="this animate [""Open_hinge"", 0]";
};
class Unlock_Door : Open_Door
{
displayName="Unlock Door";
displayName=$STR_EPOCH_DOORS_UNLOCK;
//condition="(this animationPhase ""Open_door"" == 0) and (this animationPhase ""Open_hinge"" == 0)";
condition="( !keypadCancel and DZE_Lock_Door == (this getvariable['CharacterID','0'])) and (this animationPhase ""Open_door"" == 0) and (this animationPhase ""Open_hinge"" == 0)";
statement="this animate [""Open_hinge"", 1]";
};
class Unlock_Door_Dialog : Open_Door
{
displayName="Unlock Door";
displayName=$STR_EPOCH_DOORS_UNLOCK;
//condition="(this animationPhase ""Open_door"" == 0) and (this animationPhase ""Open_hinge"" == 0)";
condition=" !keypadCancel and DZE_Lock_Door != (this getvariable['CharacterID','0'])";
statement="dayz_selectedDoor = this;DZE_topCombo = 0;DZE_midCombo = 0;DZE_botCombo = 0;createdialog ""ComboLockUI""";
statement="dayz_selectedDoor = this;DZE_topCombo = 0;DZE_midCombo = 0;DZE_botCombo = 0;if(DZE_doorManagement) then {createdialog ""DoorAccess"";} else {createdialog ""ComboLockUI"";};";
};
};
};
@@ -399,7 +399,7 @@ class Land_DZE_LargeWoodDoor: Land_DZE_WoodDoor_Base {
{
class Open_Door
{
displayName="Open Door";
displayName=$STR_EPOCH_DOORS_OPEN;
onlyforplayer = true;
position="Door_knopf";
radius=3; /* visibility distance of the entry */
@@ -408,7 +408,7 @@ class Land_DZE_LargeWoodDoor: Land_DZE_WoodDoor_Base {
};
class Close_Door : Open_Door
{
displayName="Close Door";
displayName=$STR_EPOCH_DOORS_CLOSE;
condition="this animationPhase ""Open_door"" >= 0.5";
statement="this animate [""Open_door"", 0]";
};
@@ -440,7 +440,7 @@ class Land_DZE_LargeWoodDoorLocked: Land_DZE_WoodDoorLocked_Base {
{
class Open_Door
{
displayName="Open Door";
displayName=$STR_EPOCH_DOORS_OPEN;
onlyforplayer = true;
position="Door_knopf";
radius=3; /* visibility distance of the entry */
@@ -450,31 +450,31 @@ class Land_DZE_LargeWoodDoorLocked: Land_DZE_WoodDoorLocked_Base {
};
class Close_Door : Open_Door
{
displayName="Close Door";
displayName=$STR_EPOCH_DOORS_CLOSE;
//condition="(this animationPhase ""Open_door"" == 1) and (this animationPhase ""Open_hinge"" == 1)";
condition="(this animationPhase ""Open_door"" == 1) and (this animationPhase ""Open_hinge"" == 1)";
statement="this animate [""Open_door"", 0]";
};
class Lock_Door : Open_Door
{
displayName="Lock Door";
displayName=$STR_EPOCH_DOORS_LOCK;
//condition="(this animationPhase ""Open_door"" == 0) and (this animationPhase ""Open_hinge"" == 1)";
condition="( !keypadCancel and DZE_Lock_Door == (this getvariable['CharacterID','0'])) and (this animationPhase ""Open_door"" == 0) and (this animationPhase ""Open_hinge"" == 1)";
statement="this animate [""Open_hinge"", 0]";
};
class Unlock_Door : Open_Door
{
displayName="Unlock Door";
displayName=$STR_EPOCH_DOORS_UNLOCK;
//condition="(this animationPhase ""Open_door"" == 0) and (this animationPhase ""Open_hinge"" == 0)";
condition="( !keypadCancel and DZE_Lock_Door == (this getvariable['CharacterID','0'])) and (this animationPhase ""Open_door"" == 0) and (this animationPhase ""Open_hinge"" == 0)";
statement="this animate [""Open_hinge"", 1]";
};
class Unlock_Door_Dialog : Open_Door
{
displayName="Unlock Door";
displayName=$STR_EPOCH_DOORS_UNLOCK;
//condition="(this animationPhase ""Open_door"" == 0) and (this animationPhase ""Open_hinge"" == 0)";
condition=" !keypadCancel and DZE_Lock_Door != (this getvariable['CharacterID','0'])";
statement="dayz_selectedDoor = this;DZE_topCombo = 0;DZE_midCombo = 0;DZE_botCombo = 0;createdialog ""ComboLockUI""";
statement="dayz_selectedDoor = this;DZE_topCombo = 0;DZE_midCombo = 0;DZE_botCombo = 0;if(DZE_doorManagement) then {createdialog ""DoorAccess"";} else {createdialog ""ComboLockUI"";};";
};
};
};
@@ -499,7 +499,7 @@ class Land_DZE_GarageWoodDoor: Land_DZE_WoodDoor_Base {
{
class Open_Door
{
displayName="Open Door";
displayName=$STR_EPOCH_DOORS_OPEN;
onlyforplayer = true;
position="Door_knopf";
radius=3; /* visibility distance of the entry */
@@ -508,7 +508,7 @@ class Land_DZE_GarageWoodDoor: Land_DZE_WoodDoor_Base {
};
class Close_Door : Open_Door
{
displayName="Close Door";
displayName=$STR_EPOCH_DOORS_CLOSE;
condition="this animationPhase ""Open_door"" >= 0.5";
statement="this animate [""Open_door"", 0]";
};
@@ -540,7 +540,7 @@ class Land_DZE_GarageWoodDoorLocked: Land_DZE_WoodDoorLocked_Base {
{
class Open_Door
{
displayName="Open Door";
displayName=$STR_EPOCH_DOORS_OPEN;
onlyforplayer = true;
position="Door_knopf";
radius=3; /* visibility distance of the entry */
@@ -550,31 +550,31 @@ class Land_DZE_GarageWoodDoorLocked: Land_DZE_WoodDoorLocked_Base {
};
class Close_Door : Open_Door
{
displayName="Close Door";
displayName=$STR_EPOCH_DOORS_CLOSE;
//condition="(this animationPhase ""Open_door"" == 1) and (this animationPhase ""Open_hinge"" == 1)";
condition="(this animationPhase ""Open_door"" == 1) and (this animationPhase ""Open_hinge"" == 1)";
statement="this animate [""Open_door"", 0]";
};
class Lock_Door : Open_Door
{
displayName="Lock Door";
displayName=$STR_EPOCH_DOORS_LOCK;
//condition="(this animationPhase ""Open_door"" == 0) and (this animationPhase ""Open_hinge"" == 1)";
condition="( !keypadCancel and DZE_Lock_Door == (this getvariable['CharacterID','0'])) and (this animationPhase ""Open_door"" == 0) and (this animationPhase ""Open_hinge"" == 1)";
statement="this animate [""Open_hinge"", 0]";
};
class Unlock_Door : Open_Door
{
displayName="Unlock Door";
displayName=$STR_EPOCH_DOORS_UNLOCK;
//condition="(this animationPhase ""Open_door"" == 0) and (this animationPhase ""Open_hinge"" == 0)";
condition="( !keypadCancel and DZE_Lock_Door == (this getvariable['CharacterID','0'])) and (this animationPhase ""Open_door"" == 0) and (this animationPhase ""Open_hinge"" == 0)";
statement="this animate [""Open_hinge"", 1]";
};
class Unlock_Door_Dialog : Open_Door
{
displayName="Unlock Door";
displayName=$STR_EPOCH_DOORS_UNLOCK;
//condition="(this animationPhase ""Open_door"" == 0) and (this animationPhase ""Open_hinge"" == 0)";
condition=" !keypadCancel and DZE_Lock_Door != (this getvariable['CharacterID','0'])";
statement="dayz_selectedDoor = this;DZE_topCombo = 0;DZE_midCombo = 0;DZE_botCombo = 0;createdialog ""ComboLockUI""";
statement="dayz_selectedDoor = this;DZE_topCombo = 0;DZE_midCombo = 0;DZE_botCombo = 0;if(DZE_doorManagement) then {createdialog ""DoorAccess"";} else {createdialog ""ComboLockUI"";};";
};
};
};
@@ -605,7 +605,7 @@ class CinderWallDoorLocked_DZ: CinderWallDoorLocked_DZ_Base {
{
class Open_Door
{
displayName="Open Door";
displayName=$STR_EPOCH_DOORS_OPEN;
onlyforplayer = true;
position="Door_knopf";
radius=3; /* visibility distance of the entry */
@@ -615,31 +615,31 @@ class CinderWallDoorLocked_DZ: CinderWallDoorLocked_DZ_Base {
};
class Close_Door : Open_Door
{
displayName="Close Door";
displayName=$STR_EPOCH_DOORS_CLOSE;
//condition="(this animationPhase ""Open_door"" == 1) and (this animationPhase ""Open_hinge"" == 1)";
condition="(this animationPhase ""Open_door"" == 1) and (this animationPhase ""Open_latch"" == 1)";
statement="this animate [""Open_door"", 0]";
};
class Lock_Door : Open_Door
{
displayName="Lock Door";
displayName=$STR_EPOCH_DOORS_LOCK;
//condition="(this animationPhase ""Open_door"" == 0) and (this animationPhase ""Open_hinge"" == 1)";
condition="( !keypadCancel and DZE_Lock_Door == (this getvariable['CharacterID','0'])) and (this animationPhase ""Open_door"" == 0) and (this animationPhase ""Open_latch"" == 1)";
statement="this animate [""Open_latch"", 0]";
};
class Unlock_Door : Open_Door
{
displayName="Unlock Door";
displayName=$STR_EPOCH_DOORS_UNLOCK;
//condition="(this animationPhase ""Open_door"" == 0) and (this animationPhase ""Open_hinge"" == 0)";
condition="( !keypadCancel and DZE_Lock_Door == (this getvariable['CharacterID','0'])) and (this animationPhase ""Open_door"" == 0) and (this animationPhase ""Open_latch"" == 0)";
statement="this animate [""Open_latch"", 1]";
};
class Unlock_Door_Dialog : Open_Door
{
displayName="Unlock Door";
displayName=$STR_EPOCH_DOORS_UNLOCK;
//condition="(this animationPhase ""Open_door"" == 0) and (this animationPhase ""Open_hinge"" == 0)";
condition=" !keypadCancel and DZE_Lock_Door != (this getvariable['CharacterID','0'])";
statement="dayz_selectedDoor = this;DZE_topCombo = 0;DZE_midCombo = 0;DZE_botCombo = 0;createdialog ""ComboLockUI""";
statement="dayz_selectedDoor = this;DZE_topCombo = 0;DZE_midCombo = 0;DZE_botCombo = 0;if(DZE_doorManagement) then {createdialog ""DoorAccess"";} else {createdialog ""ComboLockUI"";};";
};
};
};
@@ -665,7 +665,7 @@ class CinderWallDoor_DZ: CinderWallDoor_DZ_Base {
{
class Open_Door
{
displayName="Open Door";
displayName=$STR_EPOCH_DOORS_OPEN;
onlyforplayer = true;
position="Door_knopf";
radius=3; /* visibility distance of the entry */
@@ -674,7 +674,7 @@ class CinderWallDoor_DZ: CinderWallDoor_DZ_Base {
};
class Close_Door : Open_Door
{
displayName="Close Door";
displayName=$STR_EPOCH_DOORS_CLOSE;
condition="this animationPhase ""Open_door"" >= 0.5";
statement="this animate [""Open_door"", 0]";
};
@@ -708,7 +708,7 @@ class CinderWallDoorSmallLocked_DZ: CinderWallDoorLocked_DZ_Base {
{
class Open_Door
{
displayName="Open Door";
displayName=$STR_EPOCH_DOORS_OPEN;
onlyforplayer = true;
position="Door_knopf";
radius=3; /* visibility distance of the entry */
@@ -718,31 +718,31 @@ class CinderWallDoorSmallLocked_DZ: CinderWallDoorLocked_DZ_Base {
};
class Close_Door : Open_Door
{
displayName="Close Door";
displayName=$STR_EPOCH_DOORS_CLOSE;
//condition="(this animationPhase ""Open_door"" == 1) and (this animationPhase ""Open_hinge"" == 1)";
condition="(this animationPhase ""Open_door"" == 1) and (this animationPhase ""Open_latch"" == 1)";
statement="this animate [""Open_door"", 0]";
};
class Lock_Door : Open_Door
{
displayName="Lock Door";
displayName=$STR_EPOCH_DOORS_LOCK;
//condition="(this animationPhase ""Open_door"" == 0) and (this animationPhase ""Open_hinge"" == 1)";
condition="( !keypadCancel and DZE_Lock_Door == (this getvariable['CharacterID','0'])) and (this animationPhase ""Open_door"" == 0) and (this animationPhase ""Open_latch"" == 1)";
statement="this animate [""Open_latch"", 0]";
};
class Unlock_Door : Open_Door
{
displayName="Unlock Door";
displayName=$STR_EPOCH_DOORS_UNLOCK;
//condition="(this animationPhase ""Open_door"" == 0) and (this animationPhase ""Open_hinge"" == 0)";
condition="( !keypadCancel and DZE_Lock_Door == (this getvariable['CharacterID','0'])) and (this animationPhase ""Open_door"" == 0) and (this animationPhase ""Open_latch"" == 0)";
statement="this animate [""Open_latch"", 1]";
};
class Unlock_Door_Dialog : Open_Door
{
displayName="Unlock Door";
displayName=$STR_EPOCH_DOORS_UNLOCK;
//condition="(this animationPhase ""Open_door"" == 0) and (this animationPhase ""Open_hinge"" == 0)";
condition=" !keypadCancel and DZE_Lock_Door != (this getvariable['CharacterID','0'])";
statement="dayz_selectedDoor = this;DZE_topCombo = 0;DZE_midCombo = 0;DZE_botCombo = 0;createdialog ""ComboLockUI""";
statement="dayz_selectedDoor = this;DZE_topCombo = 0;DZE_midCombo = 0;DZE_botCombo = 0;if(DZE_doorManagement) then {createdialog ""DoorAccess"";} else {createdialog ""ComboLockUI"";};";
};
};
};
@@ -765,10 +765,10 @@ class CinderWallDoorSmall_DZ: CinderWallDoor_DZ_Base {
/* The entry to the actionmenu */
class UserActions
{
{
class Open_Door
{
displayName="Open Door";
displayName=$STR_EPOCH_DOORS_OPEN;
onlyforplayer = true;
position="Door_knopf";
radius=3; /* visibility distance of the entry */
@@ -777,7 +777,7 @@ class CinderWallDoorSmall_DZ: CinderWallDoor_DZ_Base {
};
class Close_Door : Open_Door
{
displayName="Close Door";
displayName=$STR_EPOCH_DOORS_CLOSE;
condition="this animationPhase ""Open_door"" >= 0.5";
statement="this animate [""Open_door"", 0]";
};

View File

@@ -0,0 +1,85 @@
class DoorAccess
{
idd = 61144;
movingenable = 0;
onLoad = "keypadCancel = true;";
onUnload = "if(keypadCancel) then {DZE_Lock_Door = ''; [] spawn keyPadReset;} else {DZE_Lock_Door = dayz_playerUID;};";
class Controls
{
class ZupaBackground_1
{
access = 0;
type = 0;
colorText[] = {0.8784,0.8471,0.651,1};
text = "";
fixedWidth = 0;
style = 0;
shadow = 2;
font = "Zeppelin32";
SizeEx = 0.03921;
idc = -1;
x = 0.35 * safezoneW + safezoneX;
y = 0.30 * safezoneH + safezoneY;
w = 0.20 * safezoneW;
h = 0.50 * safezoneH;
colorBackground[] = {0,0,0,0.8};
};
class ZupaHeader_2: ZSC_RscTextT
{
idc = -1;
x = 0.35 * safezoneW + safezoneX;
y = 0.30 * safezoneH + safezoneY;
w = 0.20 * safezoneW;
h = 0.05 * safezoneH;
text = $STR_EPOCH_DOORACCESS_TITLE;
colorBackground[] = {0,0,0,0.8};
colorText[] = {1,1,1,1};
};
class ZupaButton_1 : ZSC_RscButtonMenuBlue
{
idc = -1;
text = $STR_EPOCH_DOORACCESS_SCAN;
x = 0.40 * safezoneW + safezoneX;
y = 0.40 * safezoneH + safezoneY;
style = 2;
w = 0.20;
onButtonClick = "keypadCancel = false; call player_unlockDoor";
};
class ZupaButton_4 : ZSC_RscButtonMenuBlue
{
idc = -1;
text = $STR_EPOCH_DOORACCESS_MANUAL;
x = 0.40 * safezoneW + safezoneX;
y = 0.50 * safezoneH + safezoneY;
style = 2;
w = 0.20;
onButtonClick = "call player_enterCode";
};
class ZupaButton_2: ZSC_RscButtonMenuBlue
{
idc = -1;
text = $STR_EPOCH_CANCEL;
x = 0.40 * safezoneW + safezoneX;
y = 0.70 * safezoneH + safezoneY;
w = 0.20;
onButtonClick = "((ctrlParent (_this select 0)) closeDisplay 3000);";
};
class ZupaButton_3: ZSC_RscButtonMenuBlue
{
idc = -1;
text = $STR_EPOCH_ACTIONS_MANAGEDOOR;
x = 0.40 * safezoneW + safezoneX;
y = 0.60 * safezoneH + safezoneY;
w = 0.20;
onButtonClick = "[] call player_manageDoor";
};
};
};

View File

@@ -0,0 +1,97 @@
class DoorManagement
{
idd = 711195;
onLoad = "uiNamespace setVariable ['DoorManagement', _this select 0]";
class Controls {
class RscText_7100: ZSC_RscTextT
{
idc = 7100;
x = 0.30 * safezoneW + safezoneX;
y = 0.30 * safezoneH + safezoneY;
w = 0.30 * safezoneW;
h = 0.5 * safezoneH;
colorBackground[] = {0,0,0,0.8};
};
class RscListbox_7101: RscListbox
{
idc = 7101;
x = 0.31* safezoneW + safezoneX;
y = 0.41 * safezoneH + safezoneY;
w = 0.13 * safezoneW;
h = 0.30 * safezoneH;
soundSelect[] = {"",0.1,1};
colorBackground[] = {0.1,0.1,0.1,0.8};
};
class RscListbox_7102: RscListbox
{
idc = 7102;
x = 0.45 * safezoneW + safezoneX;
y = 0.41* safezoneH + safezoneY;
w = 0.13 * safezoneW;
h = 0.30 * safezoneH;
soundSelect[] = {"",0.1,1};
colorBackground[] = {0.1,0.1,0.1,0.8};
};
class RscShortcutButton_7104: ZSC_RscButtonMenuBlue
{
idc = 7104;
text = $STR_EPOCH_ADD;
x = 0.33 * safezoneW + safezoneX;
y = 0.70 * safezoneH + safezoneY;
w = 0.08 * safezoneW;
//h = 0.06 * safezoneH;
onButtonClick = "[(lbCurSel 7101)] call DoorAddFriend;";
};
class RscShortcutButton_7105: ZSC_RscButtonMenuBlue
{
idc = 7105;
text = $STR_EPOCH_DELETE;
x = 0.47 * safezoneW + safezoneX;
y = 0.70 * safezoneH + safezoneY;
w = 0.08 * safezoneW;
//h = 0.06 * safezoneH;
onButtonClick = "[(lbCurSel 7102)] call DoorRemoveFriend;";
};
class RscShortcutButton_7106: ZSC_RscButtonMenuBlue
{
idc = 7106;
text = $STR_UI_CLOSE;
x = 0.40 * safezoneW + safezoneX;
y = 0.74 * safezoneH + safezoneY;
w = 0.08 * safezoneW;
//h = 0.06 * safezoneH;
onButtonClick = "((ctrlParent (_this select 0)) closeDisplay 9000);";
};
class RscText_7107: ZSC_RscTextT
{
idc = 7107;
text = $STR_EPOCH_DOORMANAGEMENT_TITLE;
x = 0.30 * safezoneW + safezoneX;
y = 0.30 * safezoneH + safezoneY;
w = 0.30 * safezoneW;
h = 0.05 * safezoneH;
colorBackground[] = {0,0,0,0.8};
colorText[] = {1,1,1,1};
};
class RscText_7108: ZSC_RscTextT
{
idc = 7108;
text = $STR_EPOCH_HUMANS_NEARBY;
x = 0.31 * safezoneW + safezoneX;
y = 0.38 * safezoneH + safezoneY;
w = 0.13 * safezoneW;
h = 0.03 * safezoneH;
colorText[] = {1,1,1,1};
};
class RscText_7103: ZSC_RscTextT
{
idc = 71103;
text = $STR_EPOCH_DOORMANAGEMENT_FRIENDS;
x = 0.45 * safezoneW + safezoneX;
y = 0.38 * safezoneH + safezoneY;
w = 0.13 * safezoneW;
h = 0.03 * safezoneH;
colorText[] = {1,1,1,1};
};
};
};