mirror of
https://github.com/EpochModTeam/Epoch.git
synced 2024-08-30 18:22:13 +00:00
improve usage of Epoch_my_Group
This commit is contained in:
parent
3e2148e147
commit
4b3a72f970
@ -23,7 +23,7 @@
|
||||
BOOL
|
||||
*/
|
||||
//[[[cog import generate_private_arrays ]]]
|
||||
private ["_alljammer","_buildingAllowed","_buildingCountLeader","_buildingCountLimit","_buildingCountPerMember","_buildingJammerRange","_bypassJammer","_c","_cfgBaseBuilding","_config","_isAllowed","_jammer","_jammerPerGroup","_limitNearby","_maxBuildingHeight","_membercount","_minjammerdistance","_myPosATL","_nearestJammer","_obj","_objType","_objectCount","_ownedJammerExists","_range","_restricted","_restrictedArray","_restrictedLocations","_restrictedLocationsArray","_restrictedLocationsRange","_simulClass","_staticClass","_storageCountLeader","_storageCountPerMember","_scl","_gcl","_storageCountLimit","_useGroupCountLimits","_ghostClass"];
|
||||
private ["_alljammer","_buildingAllowed","_buildingCountLeader","_buildingCountLimit","_buildingCountPerMember","_buildingJammerRange","_bypassJammer","_c","_cfgBaseBuilding","_config","_ghostClass","_isAllowed","_jammer","_jammerGLOnly","_jammerPerGroup","_limitNearby","_maxBuildingHeight","_membercount","_minJammerDistance","_myPosATL","_nearestJammer","_obj","_objType","_objectscount","_ownedJammerExists","_range","_restricted","_restrictedArray","_restrictedLocations","_restrictedLocationsArray","_restrictedLocationsRange","_simulClass","_staticClass","_storageCountLeader","_storageCountLimit","_storageCountPerMember","_useGroupCountLimits","_useSplitCountLimits"];
|
||||
//[[[end]]]
|
||||
|
||||
_buildingAllowed = true;
|
||||
@ -83,7 +83,7 @@ if !(_jammer isEqualTo []) then {
|
||||
["Building Disallowed: Existing Jammer Signal", 5] call Epoch_message;
|
||||
};
|
||||
} foreach _jammer;
|
||||
}
|
||||
}
|
||||
else {
|
||||
{
|
||||
if (alive _x && (_x distance player) <= _buildingJammerRange) exitWith{
|
||||
@ -98,9 +98,14 @@ if !(_jammer isEqualTo []) then {
|
||||
_ownedJammerExists = true;
|
||||
if(_useGroupCountLimits)then{
|
||||
_membercount = 0;
|
||||
if(count Epoch_my_Group > 0)then{
|
||||
_membercount = count (Epoch_my_Group select 3) + count (Epoch_my_Group select 4)
|
||||
};
|
||||
Epoch_my_Group params [
|
||||
["_groupName",""],
|
||||
["_leaderName",""],
|
||||
["_groupSize",0],
|
||||
["_modArray",[]],
|
||||
["_memberArray",[]],
|
||||
];
|
||||
_membercount = count _modArray + count _memberArray
|
||||
_storageCountLimit = _storageCountLeader + (_storageCountPerMember * _membercount);
|
||||
_buildingCountLimit = _buildingCountLeader + (_buildingCountPerMember * _membercount);
|
||||
};
|
||||
|
@ -13,34 +13,42 @@
|
||||
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/gui/group/EPOCH_Group_BtnInvite.sqf
|
||||
*/
|
||||
//[[[cog import generate_private_arrays ]]]
|
||||
private ["_BtnInvite","_InvitePlayerCombo","_currentMaxMember","_currentMember","_found","_playerName","_playerUID","_ret","_txt","_upgradePrice","_upgradeSlots"];
|
||||
private ["_BtnInvite","_InvitePlayerCombo","_groupSize","_currentMember","_found","_playerName","_playerUID","_ret","_txt","_upgradePrice","_upgradeSlots"];
|
||||
//[[[end]]]
|
||||
disableSerialization;
|
||||
_BtnInvite = (findDisplay -1300) displayCtrl 30;
|
||||
_playerUID = getPlayerUID player;
|
||||
if (_playerUID == Epoch_my_GroupUID || {_x select 0 == _playerUID}count (Epoch_my_Group select 3) > 0) then {
|
||||
_currentMember = count(Epoch_my_Group select 3) + count(Epoch_my_Group select 4) + 1;
|
||||
_currentMaxMember = Epoch_my_Group select 2;
|
||||
if (_currentMember < _currentMaxMember) then {
|
||||
|
||||
Epoch_my_Group params [
|
||||
["_groupName",""],
|
||||
["_leaderName",""],
|
||||
["_groupSize",0],
|
||||
["_modArray",[]],
|
||||
["_memberArray",[]],
|
||||
];
|
||||
|
||||
if (_playerUID == Epoch_my_GroupUID || {_x select 0 == _playerUID}count (_modArray) > 0) then {
|
||||
_currentMember = count(_modArray) + count(_memberArray) + 1;
|
||||
if (_currentMember < _groupSize) then {
|
||||
_InvitePlayerCombo = (findDisplay -1300) displayCtrl 41;
|
||||
_playerUID = _InvitePlayerCombo lbData (lbCurSel _InvitePlayerCombo);
|
||||
_playerName = _InvitePlayerCombo lbText (lbCurSel _InvitePlayerCombo);
|
||||
if (_playerUID != "" && _playerName != "" && ({_playerUID in _x} count (Epoch_my_Group select 3) == 0) && ({_playerUID in _x} count (Epoch_my_Group select 4) == 0) && !(_playerUID == Epoch_my_GroupUID)) then {
|
||||
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;
|
||||
if (_ret) then {
|
||||
[_this select 0,Epoch_my_GroupUID,Epoch_my_Group select 0,player,Epoch_personalToken] remoteExec ["EPOCH_server_invitePlayer",2];
|
||||
[_this select 0,Epoch_my_GroupUID,_groupName,player,Epoch_personalToken] remoteExec ["EPOCH_server_invitePlayer",2];
|
||||
};
|
||||
};
|
||||
};
|
||||
} else {
|
||||
_found = EPOCH_group_upgrade_lvl find _currentMaxMember;
|
||||
_found = EPOCH_group_upgrade_lvl find _groupSize;
|
||||
if (count EPOCH_group_upgrade_lvl >= (_found+3)) then {
|
||||
_upgradePrice = parseNumber (EPOCH_group_upgrade_lvl select (_found+3));
|
||||
if ((EPOCH_playerCrypto-_upgradePrice) >= 0) then {
|
||||
_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?",_currentMaxMember,_upgradeSlots,_upgradePrice];
|
||||
_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;
|
||||
if (_ret) then {
|
||||
|
@ -19,7 +19,16 @@ disableSerialization;
|
||||
_BtnKick = (findDisplay -1300) displayCtrl 33;
|
||||
|
||||
_playerUID = getPlayerUID player;
|
||||
if (_playerUID == Epoch_my_GroupUID || {_x select 0 == _playerUID}count (Epoch_my_Group select 3) > 0) then {
|
||||
|
||||
Epoch_my_Group params [
|
||||
["_groupName",""],
|
||||
["_leaderName",""],
|
||||
["_groupSize",0],
|
||||
["_modArray",[]],
|
||||
["_memberArray",[]],
|
||||
];
|
||||
|
||||
if (_playerUID == Epoch_my_GroupUID || {_x select 0 == _playerUID}count (_modArray) > 0) then {
|
||||
_group = (findDisplay -1300) displayCtrl 40;
|
||||
_selected = lbCurSel _group;
|
||||
if (_selected >= 0) then {
|
||||
|
@ -17,9 +17,16 @@ private ["_BtnLeave","_ret","_txt"];
|
||||
//[[[end]]]
|
||||
disableSerialization;
|
||||
_BtnLeave = (findDisplay -1300) displayCtrl 31;
|
||||
Epoch_my_Group params [
|
||||
["_groupName",""],
|
||||
["_leaderName",""],
|
||||
["_groupSize",0],
|
||||
["_modArray",[]],
|
||||
["_memberArray",[]],
|
||||
];
|
||||
if (getPlayerUID player == Epoch_my_GroupUID) then {
|
||||
_BtnLeave ctrlSetText "Delete Group";
|
||||
_txt = format["Do you want to delete your Group called %1?",Epoch_my_Group select 0];
|
||||
_txt = format["Do you want to delete your Group called %1?",_groupName];
|
||||
_txt spawn {
|
||||
_ret = [_this,"Epoch Group Menu",true,true] call BIS_fnc_GUImessage;
|
||||
if (_ret) then {
|
||||
@ -27,7 +34,7 @@ if (getPlayerUID player == Epoch_my_GroupUID) then {
|
||||
};
|
||||
};
|
||||
} else {
|
||||
_txt = format["Do you want to leave the %1 Group?",Epoch_my_Group select 0];
|
||||
_txt = format["Do you want to leave the %1 Group?",_groupName];
|
||||
_txt spawn {
|
||||
_ret = [_this,"Epoch Group Menu",true,true] call BIS_fnc_GUImessage;
|
||||
if (_ret) then {
|
||||
|
@ -14,16 +14,24 @@
|
||||
*/
|
||||
disableSerialization;
|
||||
//[[[cog import generate_private_arrays ]]]
|
||||
private ["_BtnInvite","_ctrl","_currentMaxMember","_currentMember","_playerUID","_selected"];
|
||||
private ["_BtnInvite","_ctrl","_currentMember","_playerUID","_selected"];
|
||||
//[[[end]]]
|
||||
|
||||
Epoch_my_Group params [
|
||||
["_groupName",""],
|
||||
["_leaderName",""],
|
||||
["_groupSize",0],
|
||||
["_modArray",[]],
|
||||
["_memberArray",[]],
|
||||
];
|
||||
|
||||
_ctrl = _this select 0;
|
||||
_selected = _this select 1;
|
||||
_playerUID = getPlayerUID player;
|
||||
if (_playerUID == Epoch_my_GroupUID || {_x select 0 == _playerUID}count (Epoch_my_Group select 3) > 0) then {
|
||||
if (_playerUID == Epoch_my_GroupUID || {_x select 0 == _playerUID}count (_modArray) > 0) then {
|
||||
_BtnInvite = (findDisplay -1300) displayCtrl 30;
|
||||
_currentMember = count(Epoch_my_Group select 3) + count(Epoch_my_Group select 4) + 1;
|
||||
_currentMaxMember = Epoch_my_Group select 2;
|
||||
if (_currentMember < _currentMaxMember) then {
|
||||
_currentMember = count(_modArray) + count(_memberArray) + 1;
|
||||
if (_currentMember < _groupSize) then {
|
||||
_BtnInvite ctrlSetText format ["Invite %1",_ctrl lbtext _selected];
|
||||
};
|
||||
true
|
||||
|
@ -13,7 +13,7 @@
|
||||
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_code/gui/group/EPOCH_Group_onLoad.sqf
|
||||
*/
|
||||
//[[[cog import generate_private_arrays ]]]
|
||||
private ["_BtnInvite","_GroupMemberList","_InvitePlayerCombo","_currentMaxMember","_currentMember","_display","_found","_index","_myPlayerUID","_onlinePUID","_picture","_playerIsLeader","_playerIsMod","_playerUID","_players"];
|
||||
private ["_BtnInvite","_GroupMemberList","_InvitePlayerCombo","_currentMaxMember","_display","_found","_index","_myPlayerUID","_onlinePUID","_picture","_playerIsLeader","_playerIsMod","_playerUID","_players"];
|
||||
//[[[end]]]
|
||||
disableSerialization;
|
||||
_display = findDisplay -1300;
|
||||
@ -22,13 +22,21 @@ _BtnInvite = _display displayCtrl 30;
|
||||
_GroupMemberList = _display displayCtrl 40;
|
||||
_InvitePlayerCombo = _display displayCtrl 41;
|
||||
|
||||
_currentMaxMember = count(Epoch_my_Group select 3) + count(Epoch_my_Group select 4) + 1;
|
||||
_currentMember = Epoch_my_Group select 2;
|
||||
(_display displayCtrl 21) ctrlSetText format["Group Name: %1 (%2/%3 Slots)",Epoch_my_Group select 0,_currentMaxMember,_currentMember];
|
||||
Epoch_my_Group params [
|
||||
["_groupName",""],
|
||||
["_leaderName",""],
|
||||
["_groupSize",0],
|
||||
["_modArray",[]],
|
||||
["_memberArray",[]],
|
||||
];
|
||||
|
||||
_currentMaxMember = count(_modArray) + count(_memberArray) + 1;
|
||||
|
||||
(_display displayCtrl 21) ctrlSetText format["Group Name: %1 (%2/%3 Slots)",_groupName,_currentMaxMember,_groupSize];
|
||||
|
||||
_myPlayerUID = getPlayerUID player;
|
||||
_playerIsLeader = _myPlayerUID == Epoch_my_GroupUID;
|
||||
_playerIsMod = {_x select 0 == _myPlayerUID}count (Epoch_my_Group select 3) > 0;
|
||||
_playerIsMod = {_x select 0 == _myPlayerUID}count (_modArray) > 0;
|
||||
(_display displayCtrl 32) ctrlEnable false;
|
||||
(_display displayCtrl 33) ctrlEnable false;
|
||||
|
||||
@ -37,7 +45,7 @@ _onlinePUID = [];
|
||||
_onlinePUID pushBack (getPlayerUID _x);
|
||||
}forEach (units group player);
|
||||
|
||||
if (_currentMaxMember < _currentMember) then {
|
||||
if (_currentMaxMember < _groupSize) then {
|
||||
_players = player nearEntities [["Epoch_Male_F","Epoch_Female_F","LandVehicle","Ship","Air","Tank"], 10];
|
||||
|
||||
if (_playerIsLeader || _playerIsMod) then {
|
||||
@ -90,7 +98,7 @@ if (_currentMaxMember < _currentMember) then {
|
||||
}forEach _x;
|
||||
}forEach
|
||||
[
|
||||
[[Epoch_my_GroupUID,Epoch_my_Group select 1]],
|
||||
Epoch_my_Group select 3,
|
||||
Epoch_my_Group select 4
|
||||
[[Epoch_my_GroupUID,_leaderName]],
|
||||
_modArray,
|
||||
_memberArray
|
||||
];
|
||||
|
Loading…
Reference in New Issue
Block a user