4 protected int m_iMaxColumnNumber;
6 [
Attribute(
"{17CCACBDA8CF5E32}UI/layouts/Menus/GroupSlection/GroupButton.layout")]
7 protected ResourceName m_ButtonLayout;
9 [
Attribute(
"#AR-PauseMenu_Continue", UIWidgets.LocaleEditBox)]
12 protected const string CREATE_GROUP =
"#AR_DeployMenu_AddNewGroup";
13 protected const string JOIN_GROUP =
"#AR-DeployMenu_JoinGroup";
14 protected const string ACCEPT_INVITE =
"#AR-DeployMenu_AcceptInvite";
18 protected Widget m_wGridWidget;
25 protected void InitGroups(SCR_PlayerControllerGroupComponent playerGroupController)
30 GetGame().GetCallqueue().Call(UpdateGroups, playerGroupController);
34 protected void UpdateGroups(SCR_PlayerControllerGroupComponent playerGroupController)
48 if (!playerGroupController)
52 m_AddGroupButton.SetEnabled(groupManager.CanCreateNewGroup(playerFaction));
53 Widget children = m_wGridWidget.GetChildren();
56 m_wGridWidget.RemoveChild(children);
57 children = m_wGridWidget.GetChildren();
61 SetNavigationButtonVisibile(m_GroupSettingsButton, playerGroupController.IsPlayerLeaderOwnGroup() && groupManager.CanPlayersChangeAttributes());
63 array<SCR_AIGroup> playableGroups = groupManager.GetPlayableGroupsByFaction(playerFaction);
67 int selectedGroupID = playerGroupController.GetSelectedGroupID();
69 if (playableGroups.IsIndexValid(selectedGroupID) && m_wMenuRoot)
71 ImageWidget privateIcon = ImageWidget.Cast(m_wMenuRoot.FindAnyWidget(
"PrivateIconDetail"));
73 privateIcon.SetVisible(playableGroups[selectedGroupID].IsPrivate());
76 int groupCount = playableGroups.Count();
78 for (
int i = 0; i < groupCount; i++)
80 Widget groupTile =
GetGame().GetWorkspace().CreateWidgets(m_ButtonLayout, m_wGridWidget);
84 ButtonWidget buttonWidget = ButtonWidget.Cast(groupTile.FindAnyWidget(
"Button"));
91 buttonComponent.SetGroupID(playableGroups[i].
GetGroupID());
92 buttonComponent.SetGroupFaction(playerFaction);
93 buttonComponent.SetJoinGroupButton(m_JoinGroupButton);
94 buttonComponent.InitiateGroupTile();
95 if (playerGroupController.GetGroupID() == -1 && i == 0 && playerGroupController.GetSelectedGroupID() < 0)
96 GetGame().GetCallqueue().CallLater(buttonComponent.RefreshPlayers, 1,
false);
97 if (selectedGroupID < 0 && playableGroups[i].
GetGroupID() == playerGroupController.GetGroupID() )
98 GetGame().GetCallqueue().CallLater(buttonComponent.RefreshPlayers, 1,
false);
99 if (selectedGroupID == playableGroups[i].
GetGroupID())
100 GetGame().GetCallqueue().CallLater(buttonComponent.RefreshPlayers, 1,
false);