Update groups, add player name on group message

This commit is contained in:
A Man
2020-05-13 16:12:31 +02:00
parent 11ac55acd6
commit 396d0313b3
8 changed files with 68 additions and 64 deletions

View File

@@ -1,6 +1,6 @@
if (!isNull findDisplay 80000) exitWith {};
private ["_disbandButton","_display","_group","_index","_inviteButton","_inviter","_inviterUID","_kickButton","_leader","_leaveButton","_myGroup","_newCount","_playerList","_promoteButton","_uid"];
private ["_disbandButton","_display","_group","_index","_inviteButton","_inviter","_inviterUID","_kickButton","_leader","_leaveButton","_myGroup","_newCount","_playerList","_promoteButton","_uid","_joinButton","_rejectButton","_inviteText","_hasInvite"];
disableSerialization;
createDialog "DZ_GroupDialog";
_display = findDisplay 80000;
@@ -24,21 +24,21 @@ while {!isNull findDisplay 80000} do {
_leader = leader _group;
lbClear _myGroup;
{
if (alive _x && isPlayer _x) then {
if (alive _x && {isPlayer _x}) then {
_index = _myGroup lbAdd (name _x);
_myGroup lbSetData [_index,getPlayerUID _x];
_myGroup lbSetPicture [_index, if (_x == _leader) then {"\ca\ui\data\icon_unit_teamleader_ca.paa"} else {"\ca\ui\data\map_bush_ca.paa"}];
};
} count (units _group);
lbSort _myGroup;
if (lbSize _myGroup > 1) then {
if (scriptDone dayz_groupLeaveThread) then {
_leaveButton ctrlShow true;
} else {
_leaveButton ctrlShow false;
};
if (player == _leader && scriptDone dayz_groupDisbandThread) then {
if (player == _leader && {scriptDone dayz_groupDisbandThread}) then {
_disbandButton ctrlShow true;
} else {
_disbandButton ctrlShow false;
@@ -46,7 +46,7 @@ while {!isNull findDisplay 80000} do {
} else {
{_x ctrlShow false} count [_disbandButton,_leaveButton,_kickButton,_promoteButton];
};
_hasInvite = false;
{
if (_x select 1 == _uid) then {
@@ -54,33 +54,33 @@ while {!isNull findDisplay 80000} do {
_inviterUID = _x select 0; //Take most recent invite
};
} forEach dayz_activeInvites;
if (_hasInvite) then {
{_x ctrlShow true} count [_inviteText,_joinButton,_rejectButton];
_inviter = _inviterUID call dayz_getPlayer;
_inviter = _inviterUID call dayz_getPlayer;
if (!isNull _inviter) then {
_inviteText ctrlSetStructuredText parseText (format ["%1<br/>%2",localize "STR_EPOCH_INVITE_FROM",name _inviter]);
};
} else {
{_x ctrlShow false} count [_inviteText,_joinButton,_rejectButton];
};
_newCount = playersNumber west;
if (dayz_oldPlayerCount != _newCount) then {
//Refresh player list
lbClear _playerList;
{
if (isPlayer _x && _x != player) then {
if (isPlayer _x && {_x != player}) then {
_index = _playerList lbAdd (name _x);
_playerList lbSetData [_index, getPlayerUID _x];
_playerList lbSetPicture [_index, if (count (units group _x) > 1) then {"\ca\ui\data\ui_task_failed_ca.paa"} else {"\ca\ui\data\ui_task_done_ca.paa"}];
};
};
} count allUnits;
lbSort _playerList;
};
dayz_oldPlayerCount = _newCount;
uiSleep 1;
};
};