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

@@ -160,7 +160,7 @@ class DZ_GroupDialog {
class controls {
class Players: DZ_GroupListBox {
idc = 1;
onLBSelChanged = "(_this select 0) call dayz_selectPlayer;";
onLBSelChanged = "call dayz_selectPlayer;";
x = .04;
y = .21;
w = .235;
@@ -168,7 +168,7 @@ class DZ_GroupDialog {
};
class MyGroup: DZ_GroupListBox {
idc = 2;
onLBSelChanged = "(_this select 0) call dayz_selectGroupMember;";
onLBSelChanged = "call dayz_selectGroupMember;";
x = .5;
y = .21;
w = .235;
@@ -184,43 +184,43 @@ class DZ_GroupDialog {
class Invite: DZ_GroupButton {
idc = 3;
text = $STR_EPOCH_INVITE;
onButtonClick = "(_this select 0) call dayz_inviteToGroup;";
onButtonClick = "(_this select 0) ctrlShow false; call dayz_inviteToGroup;";
y = .184;
};
class Kick: DZ_GroupButton {
idc = 4;
text = $STR_EPOCH_KICK;
onButtonClick = "(_this select 0) call dayz_kickFromGroup;";
onButtonClick = "(_this select 0) ctrlShow false; call dayz_kickFromGroup;";
y = .239;
};
class Disband: DZ_GroupButton {
idc = 5;
text = $STR_EPOCH_DISBAND;
onButtonClick = "(_this select 0) call dayz_disbandGroup;";
onButtonClick = "(_this select 0) ctrlShow false; call dayz_disbandGroup;";
y = .349;
};
class Promote: DZ_GroupButton {
idc = 10;
text = $STR_EPOCH_PROMOTE;
onButtonClick = "(_this select 0) call dayz_promotePlayer;";
onButtonClick = "(_this select 0) ctrlShow false; call dayz_promotePlayer;";
y = .294;
};
class Leave: DZ_GroupButton {
idc = 6;
text = $STR_EPOCH_LEAVE;
onButtonClick = "(_this select 0) call dayz_leaveGroup;";
onButtonClick = "(_this select 0) ctrlShow false; call dayz_leaveGroup;";
y = .405;
};
class Accept: DZ_GroupButton {
idc = 7;
text = $STR_EPOCH_ACCEPT;
onButtonClick = "(_this select 0) call dayz_joinGroup;";
onButtonClick = "(_this select 0) ctrlShow false; call dayz_joinGroup;";
y = .5265;
};
class Reject: DZ_GroupButton {
idc = 8;
text = $STR_EPOCH_REJECT;
onButtonClick = "(_this select 0) call dayz_rejectGroup;";
onButtonClick = "(_this select 0) ctrlShow false; call dayz_rejectGroup;";
y = .5765;
};
};

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;

View File

@@ -103,7 +103,8 @@ if (isServer) then {
"PVDZE_handleSafeGear" addPublicVariableEventHandler {(_this select 1) spawn server_handleSafeGear};
"PVDZE_fullobj_Publish" addPublicVariableEventHandler {(_this select 1) call server_publishFullObject}; // PlotForLife take base ownership
if (dayz_groupSystem) then {
"PVDZ_Server_UpdateGroup" addPublicVariableEventHandler {(_this select 1) call server_updateGroup};
//Use spawn instead of call because small delay is needed for group changes to propagate to server
"PVDZ_Server_UpdateGroup" addPublicVariableEventHandler {(_this select 1) spawn server_updateGroup};
};
//Added as part of the maintenance system to allow the server to replace the damaged model with a normal model.