Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_GroupRequestUIComponent.c
Go to the documentation of this file.
1//------------------------------------------------------------------------------------------------
4{
5 [Attribute("GroupList", desc: "Container for available groups' buttons")]
6 protected string m_sGroupList;
8
9 [Attribute("{848C61DDE45501B2}UI/layouts/Menus/DeployMenu/GroupButton.layout", desc: "Layout for group button, has to have SCR_GroupButton attached to it.")]
11
12 [Attribute("{59F46BD8645E8549}UI/layouts/Menus/DeployMenu/CreateGroupButton.layout")]
15
16 [Attribute("1")]
18
20 protected SCR_PlayerControllerGroupComponent m_PlyGroupComp;
25 protected string m_sFlagName;
26 protected int m_iShownGroupId = -1;
27
31
32 //------------------------------------------------------------------------------------------------
33 override void HandlerAttached(Widget w)
34 {
35 super.HandlerAttached(w);
36
38 if (!m_GroupManager || !m_GroupManager.IsActive())
39 {
40 m_bEnabled = false;
41 return;
42 }
43
44 m_wExpandButtonName = TextWidget.Cast(w.FindAnyWidget(m_sExpandButtonName));
45 m_wExpandButtonNameFreq = TextWidget.Cast(w.FindAnyWidget("freq"));
47 m_wGroupFlagButton = w.FindAnyWidget("GroupFlagImage");
48
49 m_PlyGroupComp = SCR_PlayerControllerGroupComponent.GetLocalPlayerControllerGroupComponent();
50 if (!m_PlyGroupComp)
51 return;
52
54
55 m_GroupManager.GetOnPlayableGroupCreated().Insert(AddGroup);
56 m_GroupManager.GetOnPlayableGroupRemoved().Insert(RemoveGroup);
57
64
65 m_PlyGroupComp.GetOnGroupChanged().Insert(UpdateLocalPlayerGroup);
66
67 m_wGroupList = w.FindAnyWidget(m_sGroupList);
68
69 m_wExpandButton = w.FindAnyWidget(m_sExpandButton);
70 if (m_wExpandButton && m_wExpandButton.IsVisible())
71 {
73 expandBtn.m_OnClicked.Insert(ToggleCollapsed);
74 SetPlayerGroup(m_PlyGroupComp.GetPlayersGroup());
76 }
77 }
78
79 //------------------------------------------------------------------------------------------------
80 protected override void ToggleCollapsed()
81 {
82 if (m_wExpandButton && m_wExpandButton.IsVisible())
83 {
84 bool visible = !IsExpanded();
85 SetExpanded(visible);
86 GetOnListCollapse().Invoke(this, visible);
87 }
88 }
89
90 //------------------------------------------------------------------------------------------------
91 override void SetExpanded(bool expanded)
92 {
93 m_wGroupList.SetVisible(expanded);
94 }
95
96 //------------------------------------------------------------------------------------------------
97 protected override bool IsExpanded()
98 {
99 return m_wGroupList.IsVisible();
100 }
101
102 override void HandlerDeattached(Widget w)
103 {
104 if (m_GroupManager)
105 {
106 m_GroupManager.GetOnPlayableGroupCreated().Remove(AddGroup);
107 m_GroupManager.GetOnPlayableGroupRemoved().Remove(RemoveGroup);
108 }
109
116
117 if (m_PlyGroupComp)
118 m_PlyGroupComp.GetOnGroupChanged().Remove(UpdateLocalPlayerGroup);
119 }
120
121 //------------------------------------------------------------------------------------------------
123 protected void SetGroupFlags()
124 {
126 return;
127
128 SCR_AIGroup group = m_PlyGroupComp.GetPlayersGroup();
129 if (!group)
130 return;
131
132 ResourceName flag = group.GetGroupFlag();
133 if (!flag)
134 return;
135
137 if (!m_GroupFlagImage)
138 return;
139
140 m_GroupFlagImage.SetFlagButtonFromImageSet(flag);
141 }
142
143 //------------------------------------------------------------------------------------------------
145 protected void UpdateGroupPlayers(SCR_AIGroup group, int pid)
146 {
147 // go through shown groups and update the relevant one
148 foreach (SCR_DeployButtonBase btn : m_aButtons)
149 {
150 SCR_GroupButton groupBtn = SCR_GroupButton.Cast(btn);
151 if (!groupBtn)
152 continue;
153
154 bool canJoinGroup = m_PlyGroupComp.CanPlayerJoinGroup(GetGame().GetPlayerController().GetPlayerId(), group);
155 if (!canJoinGroup && group == GetPlayerGroup())
156 canJoinGroup = true;
157
158 if (groupBtn && groupBtn.GetGroupId() == group.GetGroupID())
159 groupBtn.UpdateGroup(canJoinGroup);
160
162 }
163
164 GetOnPlayerGroupJoined().Invoke(group, pid);
166 }
167
168 //---- REFACTOR NOTE START: This code will need to be refactored as current implementation is not conforming to the standards ----
170 protected void UpdateLocalPlayerGroup(int groupId)
171 {
172 m_iShownGroupId = groupId;
173 SCR_AIGroup group = m_GroupManager.FindGroup(groupId);
174 GetOnLocalPlayerGroupJoined().Invoke(group);
175
176 bool isPlayerGroup = (group == GetPlayerGroup());
177 if (isPlayerGroup)
178 {
179 foreach (SCR_DeployButtonBase btn : m_aButtons)
180 {
181 SCR_GroupButton groupBtn = SCR_GroupButton.Cast(btn);
182 if (groupBtn)
183 {
184 if (groupBtn.GetGroupId() == groupId)
185 {
186 groupBtn.HideTooltip();
187 groupBtn.UpdateGroup();
189 }
190
191 groupBtn.SetSelected(groupBtn.GetGroupId() == groupId);
192 }
193 }
194
197 GetGame().GetCallqueue().CallLater(SetPlayerGroup, 100, false, group); // call later because of group name initialization
198 }
199 }
200 //---- REFACTOR NOTE END ----
201
202 //------------------------------------------------------------------------------------------------
204 protected void UpdateGroupPrivacy(int groupId, bool isPrivate)
205 {
206 foreach (SCR_DeployButtonBase btn : m_aButtons)
207 {
208 SCR_GroupButton groupBtn = SCR_GroupButton.Cast(btn);
209 if (!groupBtn || (groupBtn.GetGroupId() != groupId))
210 continue;
211
212 groupBtn.UpdateGroupPrivacy(isPrivate);
214 break;
215 }
216
218 }
219
220 //------------------------------------------------------------------------------------------------
222 protected void UpdateGroupNames()
223 {
224 foreach (SCR_DeployButtonBase btn : m_aButtons)
225 {
226 SCR_GroupButton groupBtn = SCR_GroupButton.Cast(btn);
227 if (groupBtn)
228 {
229 groupBtn.UpdateGroupName();
230 if (m_wExpandButtonName && groupBtn.GetGroup() == GetPlayerGroup())
231 SCR_GroupButton.SGetGroupName(groupBtn.GetGroup(), m_wExpandButtonName,m_wExpandButtonNameFreq); // update group name in map's group selector
232 }
233 }
234 }
235
236 //------------------------------------------------------------------------------------------------
238 protected void UpdateGroupFrequency()
239 {
240 foreach (SCR_DeployButtonBase btn : m_aButtons)
241 {
242 SCR_GroupButton groupBtn = SCR_GroupButton.Cast(btn);
243 if (groupBtn)
244 groupBtn.UpdateGroupFrequency();
245 }
246 }
247
248 //------------------------------------------------------------------------------------------------
250 protected void UpdateGroupFlag()
251 {
252 foreach (SCR_DeployButtonBase btn : m_aButtons)
253 {
254 SCR_GroupButton groupBtn = SCR_GroupButton.Cast(btn);
255 if (groupBtn)
256 groupBtn.UpdateGroupFlag();
257 }
258 }
259
260 //------------------------------------------------------------------------------------------------
267
268 //------------------------------------------------------------------------------------------------
270 void ShowAvailableGroups(notnull Faction faction)
271 {
273 return;
274
275 if (!m_wExpandButtonName) // todo@lk: crate IsExpandable property or something like that
276 m_wGroupList.SetVisible(true);
277 m_PlyFaction = faction;
278
280
281 array<SCR_AIGroup> playableGroups = m_GroupManager.GetSortedPlayableGroupsByFaction(faction);
282 if (!playableGroups)
283 return;
284#ifdef DEPLOY_MENU_DEBUG
285 PrintFormat("ShowAvailableGroups() for %1", faction.GetFactionKey());
286#endif
287 int groupCount = playableGroups.Count();
288
289 for (int i = 0; i < groupCount; ++i)
290 {
291 AddGroup(playableGroups[i])
292 }
293
295 }
296
297 //------------------------------------------------------------------------------------------------
298 void ShowGroupSelector(bool show)
299 {
300 m_wRoot.SetVisible(show);
301 }
302
303 //------------------------------------------------------------------------------------------------
306 {
307 if (!m_GroupManager)
308 return;
309
310 SCR_AIGroup playerGroup = m_GroupManager.GetFirstNotFullForFaction(m_PlyFaction, respectPrivate: true);
311 if (!playerGroup)
312 {
314 }
315 else
316 {
317 m_PlyGroupComp.SetSelectedGroupID(playerGroup.GetGroupID());
318 m_PlyGroupComp.RequestJoinGroup(m_PlyGroupComp.GetSelectedGroupID());
319 }
320 }
321
322 //------------------------------------------------------------------------------------------------
324 protected void RemoveGroup(SCR_AIGroup group)
325 {
326 if (!m_wGroupList)
327 return;
328
329 Widget child = m_wGroupList.GetChildren();
330 while (child)
331 {
332 SCR_GroupButton comp = SCR_GroupButton.Cast(child.FindHandler(SCR_GroupButton));
333 if (!comp)
334 comp = SCR_GroupButton.Cast(child.FindAnyWidget("Button").FindHandler(SCR_GroupButton));
335
336 if (comp && comp.GetGroupId() == group.GetGroupID())
337 {
338 child.RemoveFromHierarchy();
339 break;
340 }
341
342 child = child.GetSibling();
343 }
344
346 }
347
348 //------------------------------------------------------------------------------------------------
350 protected void CreateNewGroupButton()
351 {
353 return;
354
356 m_wNewGroupButton.RemoveFromHierarchy();
357
358 m_wNewGroupButton = GetGame().GetWorkspace().CreateWidgets(m_sNewGroupButton, m_wGroupList);
359 SCR_DeployButtonBase handler = SCR_DeployButtonBase.Cast(m_wNewGroupButton.FindAnyWidget("Button").FindHandler(SCR_DeployButtonBase));
360 handler.m_OnClicked.Insert(OnNewGroupButtonClicked);
362 }
363
364 //------------------------------------------------------------------------------------------------
366 protected void UpdateNewGroupButton()
367 {
369 m_wNewGroupButton.SetVisible(m_GroupManager.CanCreateNewGroup(m_PlyFaction));
370 }
371
372 //------------------------------------------------------------------------------------------------
374 protected void RequestNewGroup()
375 {
376 // copypasta from marian's code
377 m_PlyGroupComp.SetSelectedGroupID(-1);
378 m_PlyGroupComp.RequestCreateGroup();
379 }
380
381 //------------------------------------------------------------------------------------------------
383 protected void AddGroup(SCR_AIGroup group)
384 {
385 if (group.GetFaction() != m_PlyFaction)
386 return;
387
389
390 bool create = true;
391 Widget child = m_wGroupList.GetChildren();
392 while (child)
393 {
394 SCR_GroupButton comp = SCR_GroupButton.Cast(child.FindHandler(SCR_GroupButton));
395 if (comp && comp.GetGroupId() == group.GetGroupID())
396 {
397 create = false;
398 break;
399 }
400
401 child = child.GetSibling();
402 }
403
404 if (!create)
405 return;
406
407 Widget btnW = GetGame().GetWorkspace().CreateWidgets(m_sGroupButton, m_wGroupList);
408
409 SCR_GroupButton btnComp;
411 btnComp = SCR_GroupButton.Cast(btnW.FindAnyWidget("Button").FindHandler(SCR_GroupButton));
412 else
413 btnComp = SCR_GroupButton.Cast(btnW.FindHandler(SCR_GroupButton));
414 btnComp.SetGroup(group);
415 btnComp.SetSelected(m_PlyGroupComp.GetGroupID() == group.GetGroupID());
416 bool canJoinGroup = m_PlyGroupComp.CanPlayerJoinGroup(GetGame().GetPlayerController().GetPlayerId(), group);
417 // Have to use CallLater for group attributes to be correctly synced on client before updating the button
418 GetGame().GetCallqueue().CallLater(UpdateGroupButton, 1, false, btnComp, canJoinGroup);
419 btnComp.m_OnClicked.Insert(RequestJoinGroup);
420
421 btnComp.m_OnFocus.Insert(OnButtonFocused);
422 btnComp.m_OnMouseEnter.Insert(OnButtonFocused);
423
424 btnComp.m_OnMouseLeave.Insert(OnMouseLeft);
425
426 m_aButtons.Insert(btnComp);
428 }
429
430 //------------------------------------------------------------------------------------------------
431 private void UpdateGroupButton(SCR_GroupButton groupButton, bool canJoinGroup)
432 {
433 groupButton.UpdateGroup(canJoinGroup);
434 }
435
436 //------------------------------------------------------------------------------------------------
438 protected void OnButtonFocused(Widget w)
439 {
440 SCR_GroupButton btn = SCR_GroupButton.Cast(w.FindHandler(SCR_GroupButton));
441 if (!btn)
442 return;
443
444 SCR_AIGroup group = m_GroupManager.FindGroup(btn.GetGroupId());
445 btn.SetTooltipAvailable(group != GetPlayerGroup());
446 m_OnButtonFocused.Invoke(group);
447 }
448
449 //------------------------------------------------------------------------------------------------
450 protected void OnNewGroupButtonClicked()
451 {
452 if (!m_PlyFaction)
453 return;
454
455 SCR_Faction scrFaction = SCR_Faction.Cast(m_PlyFaction);
456 if (!scrFaction)
457 return;
458
459 // checks if the group role config is set, if it's set it will open the CreateGroupSettingsDialog
460 // otherwise it will create a new group without a role
461 if (scrFaction.IsGroupRolesConfigured())
462 GetGame().GetMenuManager().OpenDialog(ChimeraMenuPreset.CreateGroupSettingsDialog);
463 else
465 }
466
467 //------------------------------------------------------------------------------------------------
469 protected void RequestJoinGroup(notnull SCR_GroupButton groupBtn)
470 {
471 // block joining to other group when player is commander
472 if (SCR_FactionCommanderPlayerComponent.IsLocalPlayerCommander())
473 return;
474
475 m_PlyGroupComp.SetSelectedGroupID(groupBtn.GetGroupId());
476 m_PlyGroupComp.RequestJoinGroup(m_PlyGroupComp.GetSelectedGroupID());
477
478 groupBtn.SetSelected(true);
479
480 Widget child = m_wGroupList.GetChildren();
481 while (child)
482 {
483 SCR_GroupButton comp = SCR_GroupButton.Cast(child.FindHandler(SCR_GroupButton));
484 if (comp && comp != groupBtn)
485 {
486 comp.SetSelected(false);
487 }
488
489 child = child.GetSibling();
490 }
491 }
492
493 //------------------------------------------------------------------------------------------------
496 {
497 foreach (SCR_DeployButtonBase btn : m_aButtons)
498 {
499 SCR_GroupButton groupBtn = SCR_GroupButton.Cast(btn);
500 if (groupBtn && groupBtn.GetGroup() == group)
501 return groupBtn;
502 }
503
504 return null;
505 }
506
507 //------------------------------------------------------------------------------------------------
510 {
511 return m_wGroupList;
512 }
513
514 //------------------------------------------------------------------------------------------------
517 {
518 return m_PlyGroupComp.GetPlayersGroup();
519 }
520
521 //------------------------------------------------------------------------------------------------
523 override void SetListWidget(Widget list)
524 {
525 if (m_wGroupList)
527 m_wGroupList = list;
528 }
529
530 //------------------------------------------------------------------------------------------------
532 protected void ClearGroupList()
533 {
534 Widget child = m_wGroupList.GetChildren();
535 while (child)
536 {
537 Widget sibling = child.GetSibling();
538 delete child;
539 child = sibling;
540 }
541
542 m_aButtons.Clear();
543 }
544
545 //------------------------------------------------------------------------------------------------
548 {
549 return m_iShownGroupId;
550 }
551
552 //------------------------------------------------------------------------------------------------
554 void SetShownGroupId(int groupId)
555 {
556 m_iShownGroupId = groupId;
557 }
558
559 //------------------------------------------------------------------------------------------------
567
568 //------------------------------------------------------------------------------------------------
576};
577
578//------------------------------------------------------------------------------------------------
581{
582 [Attribute("GroupName")]
583 protected string m_sGroupName;
585
586 [Attribute("FrequencyText")]
587 protected string m_sFreq;
589
590 [Attribute("PlayerCountText")]
591 protected string m_sPlayerCount;
593
594 [Attribute("PlayerIcon")]
595
596 protected string m_sPlayerIcon;
598
599 [Attribute("PrivateGroupWrapper")]
600 protected string m_sPrivateGroup;
602
603 [Attribute("FullGroup")]
604 protected string m_sFullGroup;
606
607 [Attribute("Arrow")]
608 protected string m_sArrowIcon;
610
611 [Attribute("GroupFlag")]
612 protected string m_sGroupFlag;
614
615 protected int m_iGroupId;
617
619
620 protected const LocalizedString SQUAD_CAPACITY = "#AR-Campaign_BaseRespawnsAmount";
621
622 //------------------------------------------------------------------------------------------------
623 override void HandlerAttached(Widget w)
624 {
625 super.HandlerAttached(w);
626
627 m_wGroupName = TextWidget.Cast(w.FindAnyWidget(m_sGroupName));
628 m_wFreq = TextWidget.Cast(w.FindAnyWidget(m_sFreq));
629 m_wPlayerCount = TextWidget.Cast(w.FindAnyWidget(m_sPlayerCount));
630 m_wPlayerIcon = ImageWidget.Cast(w.FindAnyWidget(m_sPlayerIcon));
631 m_wPrivateGroup = w.FindAnyWidget(m_sPrivateGroup);
632 m_wElements = w.FindAnyWidget(m_sElements);
633 m_wArrowIcon = ImageWidget.Cast(w.FindAnyWidget(m_sArrowIcon));
634 m_wFullGroup = w.FindAnyWidget(m_sFullGroup);
635 m_wGroupFlag = ButtonWidget.Cast(w.FindAnyWidget(m_sGroupFlag));
636 }
637
638 //------------------------------------------------------------------------------------------------
639 void SetGroup(notnull SCR_AIGroup group)
640 {
641 m_iGroupId = group.GetGroupID();
642 m_Group = group;
643 }
644
645 //---- REFACTOR NOTE START: This code will need to be refactored as current implementation is not conforming to the standards ----
646 //------------------------------------------------------------------------------------------------
647 void UpdateGroup(bool canJoin = true)
648 {
649 if (!m_Group)
650 return;
651#ifdef DEPLOY_MENU_DEBUG
652 PrintFormat("UpdateGroup() name: %1, group id: %2", m_Group.GetCustomNameWithOriginal(), m_Group.GetGroupID());
653#endif
656 UpdateGroupPrivacy(m_Group.IsPrivate());
658 SetGroupFull(m_Group.IsFull());
659
660 bool buttonEnabled = canJoin && !m_Group.IsFull() && !m_Group.IsPrivate();
661 SetEnabled(buttonEnabled);
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());
664#endif
665 if (m_wPlayerCount)
666 {
667 if (m_Group.IsMaxMembersLimited())
668 m_wPlayerCount.SetTextFormat(SQUAD_CAPACITY, m_Group.GetPlayerCount(), m_Group.GetMaxMembers());
669 else
670 m_wPlayerCount.SetText(m_Group.GetPlayerCount().ToString());
671 }
672 }
673
674 //---- REFACTOR NOTE END ----
675 //------------------------------------------------------------------------------------------------
677 {
678 // This function can only be used in UI menu, where to change the language you need to close and open the shown menu, so it will be renewed.
679 if (m_Group)
681 }
682
683 //------------------------------------------------------------------------------------------------
685 {
686 return m_wGroupName.GetText();
687 }
688
689 //------------------------------------------------------------------------------------------------
691 static void SGetGroupName(notnull SCR_AIGroup group, notnull TextWidget widget, notnull TextWidget freqWidget)
692 {
693 string freq = string.Format("%1 #AR-VON_FrequencyUnits_MHz", group.GetRadioFrequency() * 0.001);
694 if (group.GetCustomName().IsEmpty())
695 {
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);
700 }
701 else
702 {
703 widget.SetTextFormat("%1 %2", group.GetCustomName());
704 }
705 }
706
707 //------------------------------------------------------------------------------------------------
709 {
710 return m_iGroupId;
711 }
712
713 //------------------------------------------------------------------------------------------------
715 {
716 return m_Group;
717 }
718
719 //------------------------------------------------------------------------------------------------
720 void UpdateGroupPrivacy(bool isPrivate)
721 {
722 if (m_wPrivateGroup)
723 m_wPrivateGroup.SetVisible(isPrivate);
724
725#ifdef DEPLOY_MENU_DEBUG
726 PrintFormat("%1::UpdateGroupPrivacy() %2, group id: %5, Is private: %3, IsEnabled(): %4",
727 this, m_Group.GetCustomNameWithOriginal(), isPrivate.ToString(), IsEnabled().ToString(), m_Group.GetGroupID());
728#endif
729
730 }
731
732 void UpdateButtonAvailability(SCR_PlayerControllerGroupComponent groupCtrl)
733 {
734 if (!m_Group)
735 return;
736
737 bool canJoinGroup = groupCtrl.CanPlayerJoinGroup(GetGame().GetPlayerController().GetPlayerId(), m_Group);
738 if (!canJoinGroup && m_Group == groupCtrl.GetPlayersGroup())
739 {
740 SetEnabled(true);
741 return;
742 }
743
744 SetEnabled(canJoinGroup && !m_Group.IsFull() && !m_Group.IsPrivate());
745 }
746
747 protected void SetGroupFull(bool full)
748 {
749 if (m_wPlayerCount)
750 {
751 if (full)
752 {
755 }
756 else
757 {
758 m_wPlayerCount.SetColor(Color.FromInt(Color.WHITE));
759 m_wPlayerIcon.SetColor(Color.FromInt(Color.WHITE));
760 }
761 }
762 }
763
764 //------------------------------------------------------------------------------------------------
765 protected void SetText(string text)
766 {
767 if (m_wGroupName)
768 m_wGroupName.SetText(text);
769 }
770
771 //------------------------------------------------------------------------------------------------
773 {
774 if (m_wFreq && m_Group)
775 m_wFreq.SetTextFormat("%1 #AR-VON_FrequencyUnits_MHz", (m_Group.GetRadioFrequency() * 0.001).ToString());
776 }
777
778 //---- REFACTOR NOTE START: This code will need to be refactored as current implementation is not conforming to the standards ----
779 //------------------------------------------------------------------------------------------------
781 {
782 SCR_Faction scrFaction = SCR_Faction.Cast(m_Group.GetFaction());
783 if (!scrFaction)
784 return;
785
786 array<ResourceName> textures = {};
787 array<string> names = {};
788 ResourceName imageSet = scrFaction.GetGroupFlagImageSet();
789
790 scrFaction.GetGroupFlagTextures(textures);
791 scrFaction.GetFlagNames(names);
792
793 ResourceName flag = m_Group.GetGroupFlag();
794
795 if (flag.IsEmpty())
796 {
797 if (!imageSet.IsEmpty() && !names.IsEmpty())
798 {
799 SetImage(imageSet, names[0]);
800 }
801 else if (!textures.IsEmpty())
802 {
803 SetImage(textures[0]);
804 }
805 else
806 {
807 SetImage(scrFaction.GetFactionFlag());
808 }
809 }
810 else
811 {
812 if (m_Group.GetFlagIsFromImageSet())
813 {
814 SetImage(imageSet, flag);
815 }
816 else
817 {
818 SetImage(flag);
819 }
820 }
821 }
822
823 //------------------------------------------------------------------------------------------------
824 override void SetSelected(bool selected)
825 {
826 super.SetSelected(selected);
827 if (!m_wArrowIcon)
828 return;
829
830 if (selected)
831 m_wArrowIcon.SetRotation(90);
832 else
833 m_wArrowIcon.SetRotation(270);
834 }
835 //---- REFACTOR NOTE END ----
836};
837
ChimeraMenuPreset
Menu presets.
ArmaReforgerScripted GetGame()
Definition game.c:1398
void SCR_GroupsManagerComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition Color.c:13
static ScriptInvoker GetOnPrivateGroupChanged()
static ScriptInvoker GetOnPlayerRemoved()
static ScriptInvoker GetOnCustomNameChanged()
static ScriptInvoker GetOnPlayerAdded()
int GetGroupID()
static ScriptInvoker GetOnFlagSelected()
static ScriptInvoker GetOnFrequencyChanged()
Faction GetFaction()
ResourceName GetGroupFlag()
Base class for any button, regardless its own content.
override void SetEnabled(bool enabled, bool animate=true)
ref array< SCR_DeployButtonBase > m_aButtons
void OnListExpand(SCR_DeployRequestUIBaseComponent component, bool expanded)
ResourceName GetGroupFlagImageSet()
bool IsGroupRolesConfigured()
ResourceName GetFactionFlag()
int GetGroupFlagTextures(out array< ResourceName > textures)
int GetFlagNames(out array< string > flagNames)
Component attached to the group button.
override void HandlerAttached(Widget w)
const LocalizedString SQUAD_CAPACITY
void UpdateGroupPrivacy(bool isPrivate)
void UpdateButtonAvailability(SCR_PlayerControllerGroupComponent groupCtrl)
void SetGroup(notnull SCR_AIGroup group)
override void SetSelected(bool selected)
static void SGetGroupName(notnull SCR_AIGroup group, notnull TextWidget widget, notnull TextWidget freqWidget)
Set the group name into a TextWidget widget.
void UpdateGroup(bool canJoin=true)
static string GetTranslatedGroupNameAndRoleName(notnull SCR_AIGroup group)
Component responsible for handling group requests and visualization in deploy menu.
ref SCR_GroupFlagImageComponent m_GroupFlagImage
void ClearGroupList()
Clear the group list.
override void SetListWidget(Widget list)
Set current group list.
Widget GetGroupList()
Return current group list.
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 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 UpdateGroupPlayers(SCR_AIGroup group, int pid)
Update the group widget when player joins/leaves group.
ref ScriptInvoker< SCR_GroupButton > m_OnPlayerGroupJoined
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
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 UpdateGroupFrequency()
Set group frequency.
void RequestNewGroup()
Requests creation of a new group.
SCR_GroupButton GetGroupButton(SCR_AIGroup group)
Gets relevant group button.
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.
ScriptInvokerBase< func > ScriptInvoker
Definition tools.c:134