Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
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;
7  protected Widget m_wGroupList;
8 
9  [Attribute("{848C61DDE45501B2}UI/layouts/Menus/DeployMenu/GroupButton.layout", desc: "Layout for group button, has to have SCR_GroupButton attached to it.")]
10  protected ResourceName m_sGroupButton;
11 
12  [Attribute("{59F46BD8645E8549}UI/layouts/Menus/DeployMenu/CreateGroupButton.layout")]
13  protected ResourceName m_sNewGroupButton;
14  protected Widget m_wNewGroupButton;
15 
16  [Attribute("1")]
17  protected bool m_bCreateNewGroupButton;
18 
19  protected SCR_GroupsManagerComponent m_GroupManager;
20  protected SCR_PlayerControllerGroupComponent m_PlyGroupComp;
21  protected Faction m_PlyFaction;
22  protected int m_iShownGroupId = -1;
23 
24  protected ref ScriptInvoker<SCR_GroupButton> m_OnPlayerGroupJoined;
25  protected ref ScriptInvoker<int> m_OnLocalPlayerGroupJoined;
26 
27  //------------------------------------------------------------------------------------------------
28  override void HandlerAttached(Widget w)
29  {
30  super.HandlerAttached(w);
31 
32  m_GroupManager = SCR_GroupsManagerComponent.GetInstance();
33  if (!m_GroupManager || !m_GroupManager.IsActive())
34  {
35  m_bEnabled = false;
36  return;
37  }
38 
39  m_wExpandButtonName = TextWidget.Cast(w.FindAnyWidget(m_sExpandButtonName));
40  m_wExpandButtonIcon = ImageWidget.Cast(w.FindAnyWidget(m_sExpandButtonIcon));
41 
42  m_PlyGroupComp = SCR_PlayerControllerGroupComponent.GetLocalPlayerControllerGroupComponent();
43  if (!m_PlyGroupComp)
44  return;
45 
46  m_GroupManager.GetOnPlayableGroupCreated().Insert(AddGroup);
47  m_GroupManager.GetOnPlayableGroupRemoved().Insert(RemoveGroup);
48 
49  SCR_AIGroup.GetOnPlayerRemoved().Insert(UpdateGroupPlayers);
50  SCR_AIGroup.GetOnPlayerAdded().Insert(UpdateGroupPlayers);
51  SCR_AIGroup.GetOnPrivateGroupChanged().Insert(UpdateGroupPrivacy);
52  SCR_AIGroup.GetOnCustomNameChanged().Insert(UpdateGroupNames);
53  SCR_AIGroup.GetOnFrequencyChanged().Insert(UpdateGroupFrequency);
54  SCR_AIGroup.GetOnFlagSelected().Insert(UpdateGroupFlag);
55 
56  m_PlyGroupComp.GetOnGroupChanged().Insert(UpdateLocalPlayerGroup);
57 
58  m_wGroupList = w.FindAnyWidget(m_sGroupList);
59 
60  m_wExpandButton = w.FindAnyWidget(m_sExpandButton);
61  if (m_wExpandButton && m_wExpandButton.IsVisible())
62  {
64  expandBtn.m_OnClicked.Insert(ToggleCollapsed);
65  SetPlayerGroup(m_PlyGroupComp.GetPlayersGroup());
66  GetOnListCollapse().Insert(OnListExpand);
67  }
68  }
69 
70  protected override void ToggleCollapsed()
71  {
72  if (m_wExpandButton && m_wExpandButton.IsVisible())
73  {
74  bool visible = !IsExpanded();
75  SetExpanded(visible);
76  GetOnListCollapse().Invoke(this, visible);
77  }
78  }
79 
80  override void SetExpanded(bool expanded)
81  {
82  m_wGroupList.SetVisible(expanded);
83  }
84 
85  protected override bool IsExpanded()
86  {
87  return m_wGroupList.IsVisible();
88  }
89 
90  override void HandlerDeattached(Widget w)
91  {
92  if (m_GroupManager)
93  {
94  m_GroupManager.GetOnPlayableGroupCreated().Remove(AddGroup);
95  m_GroupManager.GetOnPlayableGroupRemoved().Remove(RemoveGroup);
96  }
97 
98  SCR_AIGroup.GetOnPlayerRemoved().Remove(UpdateGroupPlayers);
99  SCR_AIGroup.GetOnPlayerAdded().Remove(UpdateGroupPlayers);
100  SCR_AIGroup.GetOnPrivateGroupChanged().Remove(UpdateGroupPrivacy);
101  SCR_AIGroup.GetOnCustomNameChanged().Remove(UpdateGroupNames);
102  SCR_AIGroup.GetOnFrequencyChanged().Remove(UpdateGroupFrequency);
103  SCR_AIGroup.GetOnFlagSelected().Remove(UpdateGroupFlag);
104 
105  if (m_PlyGroupComp)
106  m_PlyGroupComp.GetOnGroupChanged().Remove(UpdateLocalPlayerGroup);
107  }
108 
110  protected void UpdateGroupPlayers(SCR_AIGroup group, int pid)
111  {
112  // go through shown groups and update the relevant one
113  foreach (SCR_DeployButtonBase btn : m_aButtons)
114  {
115  SCR_GroupButton groupBtn = SCR_GroupButton.Cast(btn);
116  if (!groupBtn)
117  continue;
118 
119  bool canJoinGroup = m_PlyGroupComp.CanPlayerJoinGroup(GetGame().GetPlayerController().GetPlayerId(), group);
120  if (!canJoinGroup && group == GetPlayerGroup())
121  canJoinGroup = true;
122 
123  if (groupBtn && groupBtn.GetGroupId() == group.GetGroupID())
124  groupBtn.UpdateGroup(canJoinGroup);
125 
126  groupBtn.UpdateButtonAvailability(m_PlyGroupComp);
127  }
128 
129  GetOnPlayerGroupJoined().Invoke(group, pid);
130  UpdateNewGroupButton();
131  }
132 
134  protected void UpdateLocalPlayerGroup(int groupId)
135  {
136  m_iShownGroupId = groupId;
137  SCR_AIGroup group = m_GroupManager.FindGroup(groupId);
138  GetOnLocalPlayerGroupJoined().Invoke(group);
139 
140  bool isPlayerGroup = (group == GetPlayerGroup());
141  if (isPlayerGroup)
142  {
143  foreach (SCR_DeployButtonBase btn : m_aButtons)
144  {
145  SCR_GroupButton groupBtn = SCR_GroupButton.Cast(btn);
146  if (groupBtn)
147  {
148  if (groupBtn.GetGroupId() == groupId)
149  {
150  groupBtn.HideTooltip();
151  groupBtn.UpdateGroup();
152  groupBtn.UpdateButtonAvailability(m_PlyGroupComp);
153  }
154 
155  groupBtn.SetSelected(groupBtn.GetGroupId() == groupId);
156  }
157  }
158 
159  UpdateNewGroupButton();
160  GetGame().GetCallqueue().CallLater(SetPlayerGroup, 100, false, group); // call later because of group name initialization
161  }
162  }
163 
165  protected void UpdateGroupPrivacy(int groupId, bool isPrivate)
166  {
167  foreach (SCR_DeployButtonBase btn : m_aButtons)
168  {
169  SCR_GroupButton groupBtn = SCR_GroupButton.Cast(btn);
170  if (!groupBtn || (groupBtn.GetGroupId() != groupId))
171  continue;
172 
173  groupBtn.UpdateGroupPrivacy(isPrivate);
174  groupBtn.UpdateButtonAvailability(m_PlyGroupComp);
175  break;
176  }
177 
178  UpdateNewGroupButton();
179  }
180 
182  protected void UpdateGroupNames()
183  {
184  foreach (SCR_DeployButtonBase btn : m_aButtons)
185  {
186  SCR_GroupButton groupBtn = SCR_GroupButton.Cast(btn);
187  if (groupBtn)
188  {
189  groupBtn.UpdateGroupName();
190  if (m_wExpandButtonName && groupBtn.GetGroup() == GetPlayerGroup())
191  SCR_GroupButton.SGetGroupName(groupBtn.GetGroup(), m_wExpandButtonName); // update group name in map's group selector
192  }
193  }
194  }
195 
197  protected void UpdateGroupFrequency()
198  {
199  foreach (SCR_DeployButtonBase btn : m_aButtons)
200  {
201  SCR_GroupButton groupBtn = SCR_GroupButton.Cast(btn);
202  if (groupBtn)
203  groupBtn.UpdateGroupFrequency();
204  }
205  }
206 
208  protected void UpdateGroupFlag()
209  {
210  foreach (SCR_DeployButtonBase btn : m_aButtons)
211  {
212  SCR_GroupButton groupBtn = SCR_GroupButton.Cast(btn);
213  if (groupBtn)
214  groupBtn.UpdateGroupFlag();
215  }
216  }
217 
219  void SetPlayerGroup(SCR_AIGroup group)
220  {
221  if (m_wExpandButtonName && group)
222  SCR_GroupButton.SGetGroupName(group, m_wExpandButtonName);
223  }
224 
226  void ShowAvailableGroups(notnull Faction faction)
227  {
228  if (!m_wGroupList || !m_GroupManager)
229  return;
230 
231  if (!m_wExpandButtonName) // todo@lk: crate IsExpandable property or something like that
232  m_wGroupList.SetVisible(true);
233  m_PlyFaction = faction;
234 
235  ClearGroupList();
236 
237  array<SCR_AIGroup> playableGroups = m_GroupManager.GetPlayableGroupsByFaction(faction);
238  if (!playableGroups)
239  return;
240 #ifdef DEPLOY_MENU_DEBUG
241  PrintFormat("ShowAvailableGroups() for %1", faction.GetFactionKey());
242 #endif
243  int groupCount = playableGroups.Count();
244 
245  for (int i = 0; i < groupCount; ++i)
246  {
247  AddGroup(playableGroups[i])
248  }
249 
250  CreateNewGroupButton();
251  }
252 
254  void JoinGroupAutomatically()
255  {
256  if (!m_GroupManager)
257  return;
258 
259  SCR_AIGroup playerGroup = m_GroupManager.GetFirstNotFullForFaction(m_PlyFaction);
260  if (!playerGroup)
261  {
262  RequestNewGroup();
263  }
264  else
265  {
266  m_PlyGroupComp.SetSelectedGroupID(playerGroup.GetGroupID());
267  m_PlyGroupComp.RequestJoinGroup(m_PlyGroupComp.GetSelectedGroupID());
268  }
269  }
270 
272  protected void RemoveGroup(SCR_AIGroup group)
273  {
274  if (!m_wGroupList)
275  return;
276 
277  Widget child = m_wGroupList.GetChildren();
278  while (child)
279  {
280  SCR_GroupButton comp = SCR_GroupButton.Cast(child.FindHandler(SCR_GroupButton));
281  if (!comp)
282  comp = SCR_GroupButton.Cast(child.FindAnyWidget("Button").FindHandler(SCR_GroupButton));
283 
284  if (comp && comp.GetGroupId() == group.GetGroupID())
285  {
286  child.RemoveFromHierarchy();
287  break;
288  }
289 
290  child = child.GetSibling();
291  }
292 
293  UpdateNewGroupButton();
294  }
295 
297  protected void CreateNewGroupButton()
298  {
299  if (!m_bCreateNewGroupButton)
300  return;
301 
302  if (m_wNewGroupButton)
303  m_wNewGroupButton.RemoveFromHierarchy();
304 
305  m_wNewGroupButton = GetGame().GetWorkspace().CreateWidgets(m_sNewGroupButton, m_wGroupList);
306  SCR_DeployButtonBase handler = SCR_DeployButtonBase.Cast(m_wNewGroupButton.FindAnyWidget("Button").FindHandler(SCR_DeployButtonBase));
307  handler.m_OnClicked.Insert(RequestNewGroup);
308  UpdateNewGroupButton();
309  }
310 
312  protected void UpdateNewGroupButton()
313  {
314  if (m_wNewGroupButton)
315  m_wNewGroupButton.SetVisible(m_GroupManager.CanCreateNewGroup(m_PlyFaction));
316  }
317 
319  protected void RequestNewGroup()
320  {
321  // copypasta from marian's code
322  m_PlyGroupComp.SetSelectedGroupID(-1);
323  m_PlyGroupComp.RequestCreateGroup();
324  }
325 
327  protected void AddGroup(SCR_AIGroup group)
328  {
329  if (group.GetFaction() != m_PlyFaction)
330  return;
331 
332  UpdateNewGroupButton();
333 
334  bool create = true;
335  Widget child = m_wGroupList.GetChildren();
336  while (child)
337  {
338  SCR_GroupButton comp = SCR_GroupButton.Cast(child.FindHandler(SCR_GroupButton));
339  if (comp && comp.GetGroupId() == group.GetGroupID())
340  {
341  create = false;
342  break;
343  }
344 
345  child = child.GetSibling();
346  }
347 
348  if (!create)
349  return;
350 
351  Widget btnW = GetGame().GetWorkspace().CreateWidgets(m_sGroupButton, m_wGroupList);
352 
353  SCR_GroupButton btnComp;
354  if (m_bUseListFromButton)
355  btnComp = SCR_GroupButton.Cast(btnW.FindAnyWidget("Button").FindHandler(SCR_GroupButton));
356  else
357  btnComp = SCR_GroupButton.Cast(btnW.FindHandler(SCR_GroupButton));
358  btnComp.SetGroup(group);
359  btnComp.SetSelected(m_PlyGroupComp.GetGroupID() == group.GetGroupID());
360  bool canJoinGroup = m_PlyGroupComp.CanPlayerJoinGroup(GetGame().GetPlayerController().GetPlayerId(), group);
361  btnComp.UpdateGroup(canJoinGroup);
362  btnComp.m_OnClicked.Insert(RequestJoinGroup);
363 
364  btnComp.m_OnFocus.Insert(OnButtonFocused);
365  btnComp.m_OnMouseEnter.Insert(OnButtonFocused);
366 
367  btnComp.m_OnMouseLeave.Insert(OnMouseLeft);
368 
369  m_aButtons.Insert(btnComp);
370  UpdateNewGroupButton();
371  }
372 
374  protected void OnButtonFocused(Widget w)
375  {
376  SCR_GroupButton btn = SCR_GroupButton.Cast(w.FindHandler(SCR_GroupButton));
377  if (!btn)
378  return;
379 
380  SCR_AIGroup group = m_GroupManager.FindGroup(btn.GetGroupId());
381  btn.SetTooltipAvailable(group != GetPlayerGroup());
382  m_OnButtonFocused.Invoke(group);
383  }
384 
386  protected void RequestJoinGroup(notnull SCR_GroupButton groupBtn)
387  {
388  m_PlyGroupComp.SetSelectedGroupID(groupBtn.GetGroupId());
389  m_PlyGroupComp.RequestJoinGroup(m_PlyGroupComp.GetSelectedGroupID());
390 
391  groupBtn.SetSelected(true);
392 
393  Widget child = m_wGroupList.GetChildren();
394  while (child)
395  {
396  SCR_GroupButton comp = SCR_GroupButton.Cast(child.FindHandler(SCR_GroupButton));
397  if (comp && comp != groupBtn)
398  {
399  comp.SetSelected(false);
400  }
401 
402  child = child.GetSibling();
403  }
404  }
405 
407  SCR_GroupButton GetGroupButton(SCR_AIGroup group)
408  {
409  foreach (SCR_DeployButtonBase btn : m_aButtons)
410  {
411  SCR_GroupButton groupBtn = SCR_GroupButton.Cast(btn);
412  if (groupBtn && groupBtn.GetGroup() == group)
413  return groupBtn;
414  }
415 
416  return null;
417  }
418 
420  Widget GetGroupList()
421  {
422  return m_wGroupList;
423  }
424 
426  SCR_AIGroup GetPlayerGroup()
427  {
428  return m_PlyGroupComp.GetPlayersGroup();
429  }
430 
432  override void SetListWidget(Widget list)
433  {
434  if (m_wGroupList)
435  ClearGroupList();
436  m_wGroupList = list;
437  }
438 
440  protected void ClearGroupList()
441  {
442  Widget child = m_wGroupList.GetChildren();
443  while (child)
444  {
445  Widget sibling = child.GetSibling();
446  delete child;
447  child = sibling;
448  }
449 
450  m_aButtons.Clear();
451  }
452 
454  int GetShownGroupId()
455  {
456  return m_iShownGroupId;
457  }
458 
460  void SetShownGroupId(int groupId)
461  {
462  m_iShownGroupId = groupId;
463  }
464 
465  ScriptInvoker GetOnPlayerGroupJoined()
466  {
467  if (!m_OnPlayerGroupJoined)
468  m_OnPlayerGroupJoined = new ScriptInvoker();
469 
470  return m_OnPlayerGroupJoined;
471  }
472 
473  ScriptInvoker GetOnLocalPlayerGroupJoined()
474  {
475  if (!m_OnLocalPlayerGroupJoined)
476  m_OnLocalPlayerGroupJoined = new ScriptInvoker();
477 
478  return m_OnLocalPlayerGroupJoined;
479  }
480 };
481 
482 //------------------------------------------------------------------------------------------------
485 {
486  [Attribute("GroupName")]
487  protected string m_sGroupName;
488  protected TextWidget m_wGroupName;
489 
490  [Attribute("FrequencyText")]
491  protected string m_sFreq;
492  protected TextWidget m_wFreq;
493 
494  [Attribute("PlayerCountText")]
495  protected string m_sPlayerCount;
496  protected TextWidget m_wPlayerCount;
497 
498  [Attribute("PrivateGroup")]
499  protected string m_sPrivateGroup;
500  protected Widget m_wPrivateGroup;
501 
502  [Attribute("FullGroup")]
503  protected string m_sFullGroup;
504  protected Widget m_wFullGroup;
505 
506  [Attribute("Arrow")]
507  protected string m_sArrowIcon;
508  protected ImageWidget m_wArrowIcon;
509 
510  protected int m_iGroupId;
511  protected SCR_AIGroup m_Group;
512 
513  //------------------------------------------------------------------------------------------------
514  override void HandlerAttached(Widget w)
515  {
516  super.HandlerAttached(w);
517 
518  m_wGroupName = TextWidget.Cast(w.FindAnyWidget(m_sGroupName));
519  m_wFreq = TextWidget.Cast(w.FindAnyWidget(m_sFreq));
520  m_wPlayerCount = TextWidget.Cast(w.FindAnyWidget(m_sPlayerCount));
521  m_wPrivateGroup = w.FindAnyWidget(m_sPrivateGroup);
522  m_wElements = w.FindAnyWidget(m_sElements);
523  m_wArrowIcon = ImageWidget.Cast(w.FindAnyWidget(m_sArrowIcon));
524  m_wFullGroup = w.FindAnyWidget(m_sFullGroup);
525  }
526 
527  //------------------------------------------------------------------------------------------------
528  void SetGroup(notnull SCR_AIGroup group)
529  {
530  m_iGroupId = group.GetGroupID();
531  m_Group = group;
532  }
533 
534  //------------------------------------------------------------------------------------------------
535  void UpdateGroup(bool canJoin = true)
536  {
537  if (!m_Group)
538  return;
539 #ifdef DEPLOY_MENU_DEBUG
540  PrintFormat("UpdateGroup() name: %1, group id: %2", m_Group.GetCustomNameWithOriginal(), m_Group.GetGroupID());
541 #endif
542  GetGame().GetCallqueue().CallLater(UpdateGroupName, 100, false); // fix for group names not being available on client right away
543 
544  UpdateGroupFrequency();
545  UpdateGroupPrivacy(m_Group.IsPrivate());
546  UpdateGroupFlag();
547  SetGroupFull(m_Group.IsFull());
548 
549  bool buttonEnabled = canJoin && !m_Group.IsFull() && !m_Group.IsPrivate();
550  SetEnabled(buttonEnabled);
551 #ifdef DEPLOY_MENU_DEBUG
552  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());
553 #endif
554  if (m_wPlayerCount)
555  m_wPlayerCount.SetTextFormat("%1/%2", m_Group.GetPlayerCount(), m_Group.GetMaxMembers());
556  }
557 
558  //------------------------------------------------------------------------------------------------
559  void UpdateGroupName()
560  {
561  if (m_Group.GetCustomName().IsEmpty())
562  {
563  string company, platoon, squad, character, format;
564  m_Group.GetCallsigns(company, platoon, squad, character, format);
565  m_wGroupName.SetTextFormat(format, company, platoon, squad, character);
566  }
567  else
568  {
569  SetText(m_Group.GetCustomName());
570  }
571  }
572 
573  //------------------------------------------------------------------------------------------------
574  string GetGroupName()
575  {
576  return m_wGroupName.GetText();
577  }
578 
580  static void SGetGroupName(notnull SCR_AIGroup group, notnull TextWidget widget)
581  {
582  string freq = string.Format("%1 #AR-VON_FrequencyUnits_MHz", group.GetRadioFrequency() * 0.001);
583  if (group.GetCustomName().IsEmpty())
584  {
585  string company, platoon, squad, character, format;
586  group.GetCallsigns(company, platoon, squad, character, format);
587  widget.SetTextFormat(format + " %5", company, platoon, squad, character, freq);
588  }
589  else
590  {
591  widget.SetTextFormat("%1 %2", group.GetCustomName(), freq);
592  }
593  }
594 
595  //------------------------------------------------------------------------------------------------
596  int GetGroupId()
597  {
598  return m_iGroupId;
599  }
600 
601  //------------------------------------------------------------------------------------------------
602  SCR_AIGroup GetGroup()
603  {
604  return m_Group;
605  }
606 
607  //------------------------------------------------------------------------------------------------
608  void UpdateGroupPrivacy(bool isPrivate)
609  {
610  if (m_wPrivateGroup)
611  m_wPrivateGroup.SetVisible(isPrivate);
612 
613 #ifdef DEPLOY_MENU_DEBUG
614  PrintFormat("%1::UpdateGroupPrivacy() %2, group id: %5, Is private: %3, IsEnabled(): %4",
615  this, m_Group.GetCustomNameWithOriginal(), isPrivate.ToString(), IsEnabled().ToString(), m_Group.GetGroupID());
616 #endif
617 
618  }
619 
620  void UpdateButtonAvailability(SCR_PlayerControllerGroupComponent groupCtrl)
621  {
622  if (!m_Group)
623  return;
624 
625  bool canJoinGroup = groupCtrl.CanPlayerJoinGroup(GetGame().GetPlayerController().GetPlayerId(), m_Group);
626  if (!canJoinGroup && m_Group == groupCtrl.GetPlayersGroup())
627  {
628  SetEnabled(true);
629  return;
630  }
631 
632  SetEnabled(canJoinGroup && !m_Group.IsFull() && !m_Group.IsPrivate());
633  }
634 
635  protected void SetGroupFull(bool full)
636  {
637  if (m_wFullGroup)
638  m_wFullGroup.SetVisible(full);
639 
640  if (m_wPlayerCount)
641  {
642  if (full)
643  m_wPlayerCount.SetColor(m_ColorWarning);
644  else
645  m_wPlayerCount.SetColor(Color.FromInt(Color.WHITE));
646  }
647  }
648 
649  //------------------------------------------------------------------------------------------------
650  protected void SetText(string text)
651  {
652  if (m_wGroupName)
653  m_wGroupName.SetText(text);
654  }
655 
656  //------------------------------------------------------------------------------------------------
657  void UpdateGroupFrequency()
658  {
659  if (m_wFreq && m_Group)
660  m_wFreq.SetTextFormat("%1 #AR-VON_FrequencyUnits_MHz", (m_Group.GetRadioFrequency() * 0.001).ToString());
661  }
662 
663  //------------------------------------------------------------------------------------------------
664  void UpdateGroupFlag()
665  {
666  SCR_Faction scrFaction = SCR_Faction.Cast(m_Group.GetFaction());
667  if (!scrFaction)
668  return;
669 
670  array<ResourceName> textures = {};
671  array<string> names = {};
672  ResourceName imageSet = scrFaction.GetGroupFlagImageSet();
673 
674  scrFaction.GetGroupFlagTextures(textures);
675  scrFaction.GetFlagNames(names);
676 
677  ResourceName flag = m_Group.GetGroupFlag();
678 
679  if (flag.IsEmpty())
680  {
681  if (!imageSet.IsEmpty() && !names.IsEmpty())
682  {
683  SetImage(imageSet, names[0]);
684  }
685  else if (!textures.IsEmpty())
686  {
687  SetImage(textures[0]);
688  }
689  else
690  {
691  SetImage(scrFaction.GetFactionFlag());
692  }
693  }
694  else
695  {
696  if (m_Group.GetFlagIsFromImageSet())
697  {
698  SetImage(imageSet, flag);
699  }
700  else
701  {
702  SetImage(flag);
703  }
704  }
705  }
706 
707  //------------------------------------------------------------------------------------------------
708  override void SetSelected(bool selected)
709  {
710  super.SetSelected(selected);
711  if (!m_wArrowIcon)
712  return;
713 
714  if (selected)
715  m_wArrowIcon.SetRotation(90);
716  else
717  m_wArrowIcon.SetRotation(270);
718  }
719 };
720 
722 {
723 
724 };
SetImage
void SetImage(BackendImage image)
image can be null
Definition: SCR_BackendImageComponent.c:36
SetEnabled
void SetEnabled(bool enabled)
Definition: SCR_BaseManualCameraComponent.c:91
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
m_Group
protected SCR_AIGroup m_Group
Definition: SCR_CallsignGroupComponent.c:10
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition: SCR_RespawnBriefingComponent.c:17
GetPlayerController
proto external PlayerController GetPlayerController()
Definition: SCR_PlayerDeployMenuHandlerComponent.c:307
SCR_DeployRequestUIBaseComponent
Definition: SCR_DeployRequestUIBaseComponent.c:2
Attribute
typedef Attribute
Post-process effect of scripted camera.
SCR_NewGroupButton
Definition: SCR_GroupRequestUIComponent.c:721
m_wFreq
TextWidget m_wFreq
Definition: SCR_PlayerListMenu.c:22
IsEnabled
int IsEnabled()
Definition: SCR_BaseManualCameraComponent.c:99
SCR_ButtonBaseComponent
Base class for any button, regardless its own content.
Definition: SCR_ButtonBaseComponent.c:3
Faction
Definition: Faction.c:12
SCR_GroupsManagerComponent
void SCR_GroupsManagerComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
Definition: SCR_GroupsManagerComponent.c:1320
SCR_GroupRequestUIComponent
Component responsible for handling group requests and visualization in deploy menu.
Definition: SCR_GroupRequestUIComponent.c:3
SCR_AIGroup
Definition: SCR_AIGroup.c:68
m_bEnabled
private bool m_bEnabled
Definition: SCR_BaseManualCameraComponent.c:3
m_wExpandButton
protected Widget m_wExpandButton
Definition: SCR_UITaskManagerComponent.c:20
m_aButtons
protected ref array< ref SCR_BrowserTooltipButtonPresetData > m_aButtons
Definition: SCR_BrowserHoverTooltipComponent.c:9
SCR_Faction
Definition: SCR_Faction.c:6
SCR_DeployButtonBase
Definition: SCR_DeployRequestUIBaseComponent.c:141
GetPlayerId
proto external int GetPlayerId()
Definition: SCR_SpawnRequestComponent.c:39
SCR_GroupButton
Component attached to the group button.
Definition: SCR_GroupRequestUIComponent.c:484