5 [
Attribute(
"GroupList",
desc:
"Container for available groups' buttons")]
9 [
Attribute(
"{848C61DDE45501B2}UI/layouts/Menus/DeployMenu/GroupButton.layout",
desc:
"Layout for group button, has to have SCR_GroupButton attached to it.")]
12 [
Attribute(
"{59F46BD8645E8549}UI/layouts/Menus/DeployMenu/CreateGroupButton.layout")]
35 super.HandlerAttached(w);
49 m_PlyGroupComp = SCR_PlayerControllerGroupComponent.GetLocalPlayerControllerGroupComponent();
186 groupBtn.HideTooltip();
209 if (!groupBtn || (groupBtn.
GetGroupId() != groupId))
281 array<SCR_AIGroup> playableGroups =
m_GroupManager.GetSortedPlayableGroupsByFaction(faction);
284#ifdef DEPLOY_MENU_DEBUG
285 PrintFormat(
"ShowAvailableGroups() for %1", faction.GetFactionKey());
287 int groupCount = playableGroups.Count();
289 for (
int i = 0; i < groupCount; ++i)
338 child.RemoveFromHierarchy();
342 child = child.GetSibling();
401 child = child.GetSibling();
418 GetGame().GetCallqueue().CallLater(UpdateGroupButton, 1,
false, btnComp, canJoinGroup);
431 private void UpdateGroupButton(
SCR_GroupButton groupButton,
bool canJoinGroup)
472 if (SCR_FactionCommanderPlayerComponent.IsLocalPlayerCommander())
478 groupBtn.SetSelected(
true);
484 if (comp && comp != groupBtn)
489 child = child.GetSibling();
500 if (groupBtn && groupBtn.
GetGroup() == group)
537 Widget sibling = child.GetSibling();
625 super.HandlerAttached(w);
651#ifdef DEPLOY_MENU_DEBUG
660 bool buttonEnabled = canJoin && !
m_Group.IsFull() && !
m_Group.IsPrivate();
662#ifdef DEPLOY_MENU_DEBUG
663 PrintFormat(
"%1::UpdateGroup() name: %2, group id: %7, Is full: %3, IsEnabled(): %4, canJoin: %5, isPrivate: %6",
this,
m_Group.GetCustomNameWithOriginal(),
m_Group.IsFull().ToString(),
IsEnabled().
ToString(), canJoin.ToString(),
m_Group.IsPrivate().ToString(),
m_Group.GetGroupID());
667 if (
m_Group.IsMaxMembersLimited())
693 string freq =
string.Format(
"%1 #AR-VON_FrequencyUnits_MHz", group.GetRadioFrequency() * 0.001);
694 if (group.GetCustomName().IsEmpty())
696 string company, platoon, squad, character, format;
697 group.GetCallsigns(company, platoon, squad, character, format);
698 widget.SetTextFormat(format +
" %5", company, platoon, squad, character);
699 freqWidget.SetTextFormat(format + freq);
703 widget.SetTextFormat(
"%1 %2", group.GetCustomName());
725#ifdef DEPLOY_MENU_DEBUG
726 PrintFormat(
"%1::UpdateGroupPrivacy() %2, group id: %5, Is private: %3, IsEnabled(): %4",
738 if (!canJoinGroup &&
m_Group == groupCtrl.GetPlayersGroup())
775 m_wFreq.SetTextFormat(
"%1 #AR-VON_FrequencyUnits_MHz", (
m_Group.GetRadioFrequency() * 0.001).ToString());
786 array<ResourceName> textures = {};
787 array<string> names = {};
797 if (!imageSet.IsEmpty() && !names.IsEmpty())
799 SetImage(imageSet, names[0]);
801 else if (!textures.IsEmpty())
803 SetImage(textures[0]);
812 if (
m_Group.GetFlagIsFromImageSet())
814 SetImage(imageSet, flag);
826 super.SetSelected(selected);
ArmaReforgerScripted GetGame()
void SCR_GroupsManagerComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
static ScriptInvoker GetOnPrivateGroupChanged()
static ScriptInvoker GetOnPlayerRemoved()
static ScriptInvoker GetOnCustomNameChanged()
static ScriptInvoker GetOnPlayerAdded()
static ScriptInvoker GetOnFlagSelected()
static ScriptInvoker GetOnFrequencyChanged()
ResourceName GetGroupFlag()
TextWidget m_wExpandButtonName
bool m_bUseListFromButton
TextWidget m_wExpandButtonNameFreq
ImageWidget m_wExpandButtonIcon
string m_sExpandButtonName
ref array< SCR_DeployButtonBase > m_aButtons
static ScriptInvoker GetOnListCollapse()
string m_sExpandButtonIcon
void OnListExpand(SCR_DeployRequestUIBaseComponent component, bool expanded)
ref ScriptInvoker m_OnButtonFocused
ResourceName GetGroupFlagImageSet()
bool IsGroupRolesConfigured()
ResourceName GetFactionFlag()
int GetGroupFlagTextures(out array< ResourceName > textures)
int GetFlagNames(out array< string > flagNames)
static string GetTranslatedGroupNameAndRoleName(notnull SCR_AIGroup group)
Component responsible for handling group requests and visualization in deploy menu.
override void HandlerAttached(Widget w)
ref SCR_GroupFlagImageComponent m_GroupFlagImage
void ClearGroupList()
Clear the group list.
ScriptInvoker GetOnPlayerGroupJoined()
override void SetListWidget(Widget list)
Set current group list.
override void HandlerDeattached(Widget w)
Widget GetGroupList()
Return current group list.
ScriptInvoker GetOnLocalPlayerGroupJoined()
void AddGroup(SCR_AIGroup group)
Adds a new group button into the list.
void OnButtonFocused(Widget w)
Called when the group button is focused.
ScriptedWidgetEventHandler m_GroupFlagHandler
void UpdateGroupNames()
Set group name.
void ShowAvailableGroups(notnull Faction faction)
Show groups available for given faction.
override void SetExpanded(bool expanded)
void RemoveGroup(SCR_AIGroup group)
Removes the group button from the list.
int GetShownGroupId()
Gets id of a currently displayed group.
SCR_GroupsManagerComponent m_GroupManager
void UpdateLocalPlayerGroup(int groupId)
Update the group widget relevant to local player.
void CreateNewGroupButton()
Creates a button which handles creating of a new group.
void ShowGroupSelector(bool show)
override void ToggleCollapsed()
ResourceName m_sGroupButton
void UpdateGroupFlag()
Set group flag.
override bool IsExpanded()
void UpdateGroupPlayers(SCR_AIGroup group, int pid)
Update the group widget when player joins/leaves group.
ref ScriptInvoker< SCR_GroupButton > m_OnPlayerGroupJoined
ResourceName m_sNewGroupButton
void SetPlayerGroup(SCR_AIGroup group)
Update the expandable button name.
SCR_PlayerControllerGroupComponent m_PlyGroupComp
void SetShownGroupId(int groupId)
Set id of a currently displayed group.
ref ScriptInvoker< int > m_OnLocalPlayerGroupJoined
Widget m_wGroupFlagButton
void JoinGroupAutomatically()
Joins an automatically selected group.
void UpdateNewGroupButton()
Updates visibility of the button for creating a new group.
void SetGroupFlags()
Function that manages group flags, setting the correct icon to player local group.
void UpdateGroupPrivacy(int groupId, bool isPrivate)
Set group private.
void OnNewGroupButtonClicked()
void UpdateGroupFrequency()
Set group frequency.
void RequestNewGroup()
Requests creation of a new group.
SCR_GroupButton GetGroupButton(SCR_AIGroup group)
Gets relevant group button.
bool m_bCreateNewGroupButton
SCR_AIGroup GetPlayerGroup()
Return local player's group.
void RequestJoinGroup(notnull SCR_GroupButton groupBtn)
Sends a request for joining a group.
proto void PrintFormat(string fmt, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL, LogLevel level=LogLevel.NORMAL)
SCR_FieldOfViewSettings Attribute
int IsEnabled()
Returns true if the light is enabled.
proto external PlayerController GetPlayerController()
proto external int GetPlayerId()
proto external string ToString()
Plain C++ pointer, no weak pointers, no memory management.