Hide group buttons on use

This commit is contained in:
ebaydayz
2016-10-29 15:08:46 -04:00
parent 127be2472d
commit 07525388a6
14 changed files with 58 additions and 59 deletions

View File

@@ -1,9 +1,7 @@
private "_group";
_group = group player;
if (count (units _group) == 1 or (!isNil "dayz_groupDisbandThread" && {!scriptDone dayz_groupDisbandThread})) exitWith {
_this ctrlShow false;
};
if (count (units _group) == 1 or (!isNil "dayz_groupDisbandThread" && {!scriptDone dayz_groupDisbandThread})) exitWith {};
dayz_groupDisbanded = nil;
PVDZ_Server_UpdateGroup = [4,player];
@@ -13,9 +11,6 @@ dayz_groupDisbandThread = _group spawn {
//Wait for response from server to confirm group finished updating in DB
waitUntil {!isNil "dayz_groupDisbanded"};
{
[_x] join grpNull;
} count (units _this);
{[_x] join grpNull} count (units _this);
deleteGroup _this;
};

View File

@@ -8,8 +8,7 @@ if (!visibleMap && count _group > 1 && cameraView in ["INTERNAL","EXTERNAL","GUN
_display = uiNamespace getVariable "DZ_GroupIcons";
_index = 0;
{
_pos = getPosATL _x;
if (surfaceIsWater _pos) then {_pos = getPosASL _x;};
_pos = [_x] call FNC_GetPos;
_distance = _pos distance player;
_icon = _display displayCtrl (100 + _index);
if (_distance > 1 && _distance < 2500) then {

View File

@@ -1,5 +1,5 @@
// Two second loop
private ["_count","_group","_hasGPS","_index","_marker","_markBody","_markGroup","_markSelf","_pos","_self","_vehicle"];
private ["_count","_found","_group","_hasGPS","_index","_marker","_markBody","_markGroup","_markSelf","_pos","_self","_vehicle"];
_group = player call dayz_filterGroup;
@@ -20,9 +20,8 @@ if (visibleMap or !isNull findDisplay 88890) then {
{
_self = _x == player;
_vehicle = vehicle _x;
if ((_self or _markGroup) && (!_self or _markSelf) && (driver _vehicle == _x)) then {
_pos = getPosATL _x;
if (surfaceIsWater _pos) then {_pos = getPosASL _x;};
if ((_self or _markGroup) && (!_self or _markSelf) && (effectiveCommander _vehicle == _x)) then {
_pos = [_x] call FNC_GetPos;
deleteMarkerLocal format["groupMember%1",_index];
_marker = createMarkerLocal [format["groupMember%1",_index],_pos];
_marker setMarkerTypeLocal "DestroyedVehicle";
@@ -42,15 +41,20 @@ if (visibleMap or !isNull findDisplay 88890) then {
dayz_oldMemberCount = _count;
if (_markBody) then {
_found = false;
{
if (_x getVariable["bodyName",""] == name player) then {
//Only mark closest body to player's current position (allDead is sorted by distance)
if (_x getVariable["bodyName",""] == name player) exitWith {
_found = true;
_pos = [_x] call FNC_GetPos;
deleteMarkerLocal "MyBody";
_marker = createMarkerLocal ["MyBody",getPosATL _x];
_marker = createMarkerLocal ["MyBody",_pos];
_marker setMarkerTypeLocal "DestroyedVehicle";
_marker setMarkerTextLocal localize "STR_EPOCH_RIP";
_marker setMarkerColorLocal "ColorRed";
};
} count allDead;
if (!_found) then {deleteMarkerLocal "MyBody";}; //Body was deleted or hidden
} else {
deleteMarkerLocal "MyBody";
};

View File

@@ -5,9 +5,7 @@ _playerList = findDisplay 80000 displayCtrl 1;
_uid = _playerList lbData (lbCurSel _playerList);
_recipient = _uid call dayz_getPlayer;
if (isNull _recipient or player != leader group player or count (units group _recipient) > 1) exitWith {
_this ctrlShow false;
};
if (isNull _recipient or player != leader group player or count (units group _recipient) > 1) exitWith {};
_hasInvite = false;
{

View File

@@ -1,4 +1,9 @@
private ["_inviter","_inviterUID","_oldGroup","_uid"];
private ["_display","_inviter","_inviteText","_inviterUID","_oldGroup","_rejectButton","_uid"];
_display = findDisplay 80000;
_rejectButton = _display displayCtrl 8;
_inviteText = _display displayCtrl 9;
{_x ctrlShow false} count [_inviteText,_rejectButton];
_inviterUID = "0";
_uid = getPlayerUID player;
@@ -22,13 +27,10 @@ if (!isNull _inviter) then {
_oldGroup = group player;
[player] join (group _inviter);
if (count (units _oldGroup) == 0) then {deleteGroup _oldGroup;};
[] spawn {
uiSleep 1; //Required for group change to update on server
// Update saved group in DB
PVDZ_Server_UpdateGroup = [1,player];
publicVariableServer "PVDZ_Server_UpdateGroup";
};
// Update saved group in DB
PVDZ_Server_UpdateGroup = [1,player];
publicVariableServer "PVDZ_Server_UpdateGroup";
} else {
_this ctrlShow false;
systemChat localize "STR_EPOCH_INVITE_EXPIRED";
};

View File

@@ -5,13 +5,11 @@ _myGroup = findDisplay 80000 displayCtrl 2;
_targetUID = _myGroup lbData (lbCurSel _myGroup);
_target = _targetUID call dayz_getPlayer;
if (isNull _target or _target == player or player != leader group player) exitWith {
_this ctrlShow false;
};
if (isNull _target or _target == player or player != leader group player) exitWith {};
[_target] join grpNull;
PVDZ_Server_UpdateGroup = [2,player,_targetUID];
publicVariableServer "PVDZ_Server_UpdateGroup";
_myGroup call dayz_selectGroupMember; //update lbCurSel change
call dayz_selectGroupMember; //update lbCurSel change

View File

@@ -1,15 +1,13 @@
private "_group";
_group = units group player;
if (count _group == 1 or (!isNil "dayz_groupLeftThread" && {!scriptDone dayz_groupLeftThread})) exitWith {
_this ctrlShow false;
};
if (count _group == 1 or (!isNil "dayz_groupLeaveThread" && {!scriptDone dayz_groupLeaveThread})) exitWith {};
dayz_groupLeft = nil;
PVDZ_Server_UpdateGroup = [3,player];
publicVariableServer "PVDZ_Server_UpdateGroup";
dayz_groupLeftThread = [] spawn {
dayz_groupLeaveThread = [] spawn {
//Wait for response from server to confirm group finished updating in DB
waitUntil {!isNil "dayz_groupLeft"};
[player] join grpNull;

View File

@@ -32,8 +32,10 @@ while {!isNull findDisplay 80000} do {
lbSort _myGroup;
if (lbSize _myGroup > 1) then {
_leaveButton ctrlShow true;
if (player == _leader) then {_disbandButton ctrlShow true};
if (isNil "dayz_groupLeaveThread" or {scriptDone dayz_groupLeaveThread}) then {_leaveButton ctrlShow true;};
if (player == _leader && (isNil "dayz_groupDisbandThread" or {scriptDone dayz_groupDisbandThread})) then {
_disbandButton ctrlShow true;
};
} else {
{_x ctrlShow false} count [_disbandButton,_leaveButton,_kickButton,_promoteButton];
};

View File

@@ -5,7 +5,6 @@ _display = findDisplay 80000;
_myGroup = _display displayCtrl 2;
_kickButton = _display displayCtrl 4;
_disbandButton = _display displayCtrl 5;
_promoteButton = _this;
_uid = _myGroup lbData (lbCurSel _myGroup);
_group = group player;
@@ -13,7 +12,5 @@ _target = _uid call dayz_getPlayer;
if (player == leader _group && {!isNull _target} && {_target != player}) then {
_group selectLeader _target;
{_x ctrlShow false} count [_disbandButton,_kickButton,_promoteButton];
} else {
_promoteButton ctrlShow false;
{_x ctrlShow false} count [_disbandButton,_kickButton];
};

View File

@@ -1,4 +1,10 @@
private "_uid";
private ["_display","_inviteText","_joinButton","_uid"];
_display = findDisplay 80000;
_joinButton = _display displayCtrl 7;
_inviteText = _display displayCtrl 9;
{_x ctrlShow false} count [_inviteText,_joinButton];
_uid = getPlayerUID player;
//Remove all invites to this player
@@ -9,8 +15,6 @@ _uid = getPlayerUID player;
} forEach dayz_activeInvites;
dayz_activeInvites = dayz_activeInvites - ["delete"];
_this ctrlShow false;
//Sync change to all remote machines (less data than sending whole array)
PVDZ_groupInvite = [false,_uid];
publicVariableServer "PVDZ_groupInvite";

View File

@@ -2,14 +2,14 @@ private ["_display","_kickButton","_myGroup","_promoteButton","_target","_uid"];
disableSerialization;
_display = findDisplay 80000;
_myGroup = _this;
_myGroup = _display displayCtrl 2;
_kickButton = _display displayCtrl 4;
_promoteButton = _display displayCtrl 10;
_uid = _myGroup lbData (lbCurSel _myGroup);
_target = _uid call dayz_getPlayer;
if (player == leader group player && {!isNull _target} && {_target != player}) then {
{_x ctrlShow true;} count [_kickButton,_promoteButton];
{_x ctrlShow true} count [_kickButton,_promoteButton];
} else {
{_x ctrlShow false;} count [_kickButton,_promoteButton];
{_x ctrlShow false} count [_kickButton,_promoteButton];
};

View File

@@ -1,8 +1,9 @@
private ["_inviteButton","_playerList","_target","_uid"];
private ["_display","_inviteButton","_playerList","_target","_uid"];
disableSerialization;
_playerList = _this;
_inviteButton = findDisplay 80000 displayCtrl 3;
_display = findDisplay 80000;
_playerList = _display displayCtrl 1;
_inviteButton = _display displayCtrl 3;
_uid = _playerList lbData (lbCurSel _playerList);
_target = _uid call dayz_getPlayer;