From b35b49bd90e04515aee1004cc676cc3ad7090e6c Mon Sep 17 00:00:00 2001 From: ebayShopper Date: Tue, 5 Dec 2017 17:26:11 -0500 Subject: [PATCH] Only refresh group menu player list for changes --- SQF/dayz_code/groups/invite.sqf | 4 +++- SQF/dayz_code/groups/open.sqf | 29 ++++++++++++++++++----------- SQF/dayz_code/groups/pickPlayer.sqf | 1 + 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/SQF/dayz_code/groups/invite.sqf b/SQF/dayz_code/groups/invite.sqf index 04e943a55..846fd90de 100644 --- a/SQF/dayz_code/groups/invite.sqf +++ b/SQF/dayz_code/groups/invite.sqf @@ -5,7 +5,9 @@ _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 {}; +if (isNull _recipient or player != leader group player or count (units group _recipient) > 1) exitWith { + dayz_oldPlayerCount = 0; //Force player list refresh +}; _hasInvite = false; { diff --git a/SQF/dayz_code/groups/open.sqf b/SQF/dayz_code/groups/open.sqf index eca0e9077..772516f10 100644 --- a/SQF/dayz_code/groups/open.sqf +++ b/SQF/dayz_code/groups/open.sqf @@ -1,10 +1,11 @@ if (!isNull findDisplay 80000) exitWith {}; -private ["_disbandButton","_display","_group","_index","_inviteButton","_inviter","_inviterUID","_kickButton","_leader","_leaveButton","_myGroup","_playerList","_promoteButton","_uid"]; +private ["_disbandButton","_display","_group","_index","_inviteButton","_inviter","_inviterUID","_kickButton","_leader","_leaveButton","_myGroup","_newCount","_playerList","_promoteButton","_uid"]; disableSerialization; createDialog "DZ_GroupDialog"; _display = findDisplay 80000; _uid = getPlayerUID player; +dayz_oldPlayerCount = 0; _playerList = _display displayCtrl 1; _myGroup = _display displayCtrl 2; _inviteButton = _display displayCtrl 3; @@ -64,16 +65,22 @@ while {!isNull findDisplay 80000} do { {_x ctrlShow false} count [_inviteText,_joinButton,_rejectButton]; }; - //Fill player list - lbClear _playerList; - { - 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; + _newCount = playersNumber west; + + if (dayz_oldPlayerCount != _newCount) then { + //Refresh player list + lbClear _playerList; + { + 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; }; \ No newline at end of file diff --git a/SQF/dayz_code/groups/pickPlayer.sqf b/SQF/dayz_code/groups/pickPlayer.sqf index 751e8a86c..492231973 100644 --- a/SQF/dayz_code/groups/pickPlayer.sqf +++ b/SQF/dayz_code/groups/pickPlayer.sqf @@ -11,4 +11,5 @@ if (player == leader group player && {!isNull _target} && {count (units group _t _inviteButton ctrlShow true; } else { _inviteButton ctrlShow false; + dayz_oldPlayerCount = 0; //Force player list refresh }; \ No newline at end of file