From b5b54bd5137c347f92985662043e049d378a0c3f Mon Sep 17 00:00:00 2001 From: vbawol Date: Thu, 23 Mar 2017 15:38:19 -0500 Subject: [PATCH] more fixes and cleanup --- .../compile/building/EPOCH_isBuildAllowed.sqf | 4 ++-- .../gui/scripts/group/EPOCH_Group_BtnInvite.sqf | 12 +++++++----- .../gui/scripts/group/EPOCH_Group_BtnKick.sqf | 7 ++++--- .../gui/scripts/group/EPOCH_Group_BtnLeave.sqf | 2 +- .../gui/scripts/group/EPOCH_Group_BtnMod.sqf | 5 +++-- .../gui/scripts/group/EPOCH_Group_Combo.sqf | 2 +- .../gui/scripts/group/EPOCH_Group_onLoad.sqf | 2 +- 7 files changed, 19 insertions(+), 15 deletions(-) diff --git a/Sources/epoch_code/compile/building/EPOCH_isBuildAllowed.sqf b/Sources/epoch_code/compile/building/EPOCH_isBuildAllowed.sqf index 1098bc01..f828094d 100644 --- a/Sources/epoch_code/compile/building/EPOCH_isBuildAllowed.sqf +++ b/Sources/epoch_code/compile/building/EPOCH_isBuildAllowed.sqf @@ -103,9 +103,9 @@ if !(_jammer isEqualTo []) then { ["_leaderName",""], ["_groupSize",0], ["_modArray",[]], - ["_memberArray",[]], + ["_memberArray",[]] ]; - _membercount = count _modArray + count _memberArray + _membercount = count _modArray + count _memberArray; _storageCountLimit = _storageCountLeader + (_storageCountPerMember * _membercount); _buildingCountLimit = _buildingCountLeader + (_buildingCountPerMember * _membercount); }; diff --git a/Sources/epoch_code/gui/scripts/group/EPOCH_Group_BtnInvite.sqf b/Sources/epoch_code/gui/scripts/group/EPOCH_Group_BtnInvite.sqf index 73fdefcf..2007c34d 100644 --- a/Sources/epoch_code/gui/scripts/group/EPOCH_Group_BtnInvite.sqf +++ b/Sources/epoch_code/gui/scripts/group/EPOCH_Group_BtnInvite.sqf @@ -24,7 +24,7 @@ Epoch_my_Group params [ ["_leaderName",""], ["_groupSize",0], ["_modArray",[]], - ["_memberArray",[]], + ["_memberArray",[]] ]; if (_playerUID == Epoch_my_GroupUID || {_x select 0 == _playerUID}count (_modArray) > 0) then { @@ -35,10 +35,11 @@ if (_playerUID == Epoch_my_GroupUID || {_x select 0 == _playerUID}count (_modArr _playerName = _InvitePlayerCombo lbText (lbCurSel _InvitePlayerCombo); if (_playerUID != "" && _playerName != "" && ({_playerUID in _x} count (_modArray) == 0) && ({_playerUID in _x} count (_memberArray) == 0) && !(_playerUID == Epoch_my_GroupUID)) then { _txt = format["Do you want to add %1 to your Group?",_playerName]; - [_playerUID,_txt] spawn { - _ret = [_this select 1,"Epoch Group Menu",true,true] call BIS_fnc_GUImessage; + [_playerUID,_txt,_groupName] spawn { + params ["_playerUID","_txt","_groupName"]; + _ret = [_txt,"Epoch Group Menu",true,true] call BIS_fnc_GUImessage; if (_ret) then { - [_this select 0,Epoch_my_GroupUID,_groupName,player,Epoch_personalToken] remoteExec ["EPOCH_server_invitePlayer",2]; + [_playerUID,Epoch_my_GroupUID,_groupName,player,Epoch_personalToken] remoteExec ["EPOCH_server_invitePlayer",2]; }; }; }; @@ -50,7 +51,8 @@ if (_playerUID == Epoch_my_GroupUID || {_x select 0 == _playerUID}count (_modArr _upgradeSlots = EPOCH_group_upgrade_lvl select (_found+2); _txt = format["Do you want to upgrade your group from %1 to %2 slots for %3 Krypto?",_groupSize,_upgradeSlots,_upgradePrice]; [_txt,_upgradePrice] spawn { - _ret = [_this select 0,"Epoch Group Menu",true,true] call BIS_fnc_GUImessage; + params ["_txt","_upgradePrice"]; + _ret = [_txt,"Epoch Group Menu",true,true] call BIS_fnc_GUImessage; if (_ret) then { [Epoch_my_GroupUID,player,Epoch_personalToken] remoteExec ["EPOCH_server_upgradeGroup",2]; }; diff --git a/Sources/epoch_code/gui/scripts/group/EPOCH_Group_BtnKick.sqf b/Sources/epoch_code/gui/scripts/group/EPOCH_Group_BtnKick.sqf index 9d8ed2c6..9945a743 100644 --- a/Sources/epoch_code/gui/scripts/group/EPOCH_Group_BtnKick.sqf +++ b/Sources/epoch_code/gui/scripts/group/EPOCH_Group_BtnKick.sqf @@ -25,7 +25,7 @@ Epoch_my_Group params [ ["_leaderName",""], ["_groupSize",0], ["_modArray",[]], - ["_memberArray",[]], + ["_memberArray",[]] ]; if (_playerUID == Epoch_my_GroupUID || {_x select 0 == _playerUID}count (_modArray) > 0) then { @@ -37,9 +37,10 @@ if (_playerUID == Epoch_my_GroupUID || {_x select 0 == _playerUID}count (_modArr if (_playerUID != "" && _playerName != "") then { _txt = format["Do you want to kick %1 from your Group?",_playerName]; [_playerUID,_txt] spawn { - _ret = [_this select 1,"Epoch Group Menu",true,true] call BIS_fnc_GUImessage; + params ["_playerUID","_txt"]; + _ret = [_txt,"Epoch Group Menu",true,true] call BIS_fnc_GUImessage; if (_ret) then { - [Epoch_my_GroupUID,_this select 0,false,false,player,Epoch_personalToken] remoteExec ["EPOCH_server_updatePlayerGroup",2]; + [Epoch_my_GroupUID,_playerUID,false,false,player,Epoch_personalToken] remoteExec ["EPOCH_server_updatePlayerGroup",2]; }; }; }; diff --git a/Sources/epoch_code/gui/scripts/group/EPOCH_Group_BtnLeave.sqf b/Sources/epoch_code/gui/scripts/group/EPOCH_Group_BtnLeave.sqf index a4a20a75..b9f3724f 100644 --- a/Sources/epoch_code/gui/scripts/group/EPOCH_Group_BtnLeave.sqf +++ b/Sources/epoch_code/gui/scripts/group/EPOCH_Group_BtnLeave.sqf @@ -22,7 +22,7 @@ Epoch_my_Group params [ ["_leaderName",""], ["_groupSize",0], ["_modArray",[]], - ["_memberArray",[]], + ["_memberArray",[]] ]; if (getPlayerUID player == Epoch_my_GroupUID) then { _BtnLeave ctrlSetText "Delete Group"; diff --git a/Sources/epoch_code/gui/scripts/group/EPOCH_Group_BtnMod.sqf b/Sources/epoch_code/gui/scripts/group/EPOCH_Group_BtnMod.sqf index 60664860..378891c7 100644 --- a/Sources/epoch_code/gui/scripts/group/EPOCH_Group_BtnMod.sqf +++ b/Sources/epoch_code/gui/scripts/group/EPOCH_Group_BtnMod.sqf @@ -30,9 +30,10 @@ if (getPlayerUID player == Epoch_my_GroupUID) then { }; [_playerUID,_isMember,_txt] spawn { - _ret = [_this select 2,"Epoch Group Menu",true,true] call BIS_fnc_GUImessage; + params ["_playerUID","_isMember","_txt"]; + _ret = [_txt,"Epoch Group Menu",true,true] call BIS_fnc_GUImessage; if (_ret) then { - [Epoch_my_GroupUID,_this select 0,true,_this select 1,player,Epoch_personalToken] remoteExec ["EPOCH_server_updatePlayerGroup",2]; + [Epoch_my_GroupUID,_playerUID,true,_isMember,player,Epoch_personalToken] remoteExec ["EPOCH_server_updatePlayerGroup",2]; }; }; }; diff --git a/Sources/epoch_code/gui/scripts/group/EPOCH_Group_Combo.sqf b/Sources/epoch_code/gui/scripts/group/EPOCH_Group_Combo.sqf index cb72de55..76f04b48 100644 --- a/Sources/epoch_code/gui/scripts/group/EPOCH_Group_Combo.sqf +++ b/Sources/epoch_code/gui/scripts/group/EPOCH_Group_Combo.sqf @@ -22,7 +22,7 @@ Epoch_my_Group params [ ["_leaderName",""], ["_groupSize",0], ["_modArray",[]], - ["_memberArray",[]], + ["_memberArray",[]] ]; _ctrl = _this select 0; diff --git a/Sources/epoch_code/gui/scripts/group/EPOCH_Group_onLoad.sqf b/Sources/epoch_code/gui/scripts/group/EPOCH_Group_onLoad.sqf index d5d451a4..8334b4c7 100644 --- a/Sources/epoch_code/gui/scripts/group/EPOCH_Group_onLoad.sqf +++ b/Sources/epoch_code/gui/scripts/group/EPOCH_Group_onLoad.sqf @@ -27,7 +27,7 @@ Epoch_my_Group params [ ["_leaderName",""], ["_groupSize",0], ["_modArray",[]], - ["_memberArray",[]], + ["_memberArray",[]] ]; _currentMaxMember = count(_modArray) + count(_memberArray) + 1;