Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_GroupTileButton.c
Go to the documentation of this file.
2{
4 protected int m_iPlayerId;
5 protected SCR_ChimeraCharacter m_AICharacter;
6
9
10 //------------------------------------------------------------------------------------------------
11 override bool OnClick(Widget w, int x, int y, int button)
12 {
13 // TODO: on self, this combo box is empty and invisible. On others allows inviting to your group
14 m_OptionsCombo.OpenList();
15 return super.OnClick(w, x, y, button);
16 }
17
18 //------------------------------------------------------------------------------------------------
19 override bool OnFocus(Widget w, int x, int y)
20 {
21 if (m_OnTileFocus)
23
24 return super.OnFocus(w, x, y);
25 }
26
27 //------------------------------------------------------------------------------------------------
28 override bool OnFocusLost(Widget w, int x, int y)
29 {
32
33 return super.OnFocusLost(w, x, y);
34 }
35
36 //------------------------------------------------------------------------------------------------
44
45 //------------------------------------------------------------------------------------------------
53
54 //------------------------------------------------------------------------------------------------
56 {
57 return m_iPlayerId;
58 }
59
60 //------------------------------------------------------------------------------------------------
61 void SetTilePlayerID(int playerID)
62 {
63 m_iPlayerId = playerID;
64 }
65
66 //------------------------------------------------------------------------------------------------
67 SCR_ChimeraCharacter GetCharacter()
68 {
69 return m_AICharacter;
70 }
71
72 //------------------------------------------------------------------------------------------------
73 void SetCharacter(SCR_ChimeraCharacter character)
74 {
75 m_AICharacter = character;
76 }
77
78 //------------------------------------------------------------------------------------------------
83
84 //------------------------------------------------------------------------------------------------
86 {
87 m_OptionsCombo = optionsCombo;
88 }
89
90 //------------------------------------------------------------------------------------------------
91 void SetOpacity(float opacity)
92 {
93 Widget comboBox = m_OptionsCombo.GetRootWidget();
94 if (!comboBox)
95 return;
96
97 ImageWidget comboImage = ImageWidget.Cast(comboBox.FindAnyWidget("Image0"));
98 if (!comboImage)
99 return;
100
101 comboImage.SetOpacity(opacity);
102 }
103};
104
106{
107 protected int m_iGroupID;
109
110 [Attribute()]
112
113 [Attribute()]
115
120 protected SCR_PlayerControllerGroupComponent m_GroupComponent;
122
123 protected SCR_HorizontalScrollAnimationComponent m_ScrollComponent;
124
125 [Attribute("0.898 0.541 0.184 1", UIWidgets.ColorPicker)]
127
128 [Attribute("0.898 0.541 0.184 1", UIWidgets.ColorPicker)]
130
131 [Attribute("0.898 0.541 0.184 1", UIWidgets.ColorPicker)]
132 protected ref Color m_GroupFullColor;
133
135 protected string m_sGroupImageWidgetName = "GroupImage";
136 protected string m_sGroupInnerImageWidgetName = "GroupIconInner";
137
138 [Attribute("TaskNameText")]
140
141 [Attribute("m_wTaskIconButton0")]
143
144 [Attribute("m_wTaskIconBackground")]
146
147 [Attribute("m_wTaskIconOutline")]
149
150 [Attribute("m_wTaskIconSymbol")]
152
153 [Attribute("GroupTaskOverlay")]
155
156 protected const string OPTIONS_COMBO_INVITE = "#AR-PlayerList_Invite";
157 protected const string OPTIONS_COMBO_KICK = "#AR-DeployMenu_Groups_Kick";
158 protected const string OPTIONS_COMBO_PROMOTE = "#AR-DeployMenu_Groups_Promote";
159 protected const string LOCK_GROUP = "#AR-Player_Groups_Lock";
160 protected const string UNLOCK_GROUP = "#AR-Player_Groups_Unlock";
161 protected const string PRIVATE_GROUP = "#AR-Player_Groups_Private";
162 protected const string PUBLIC_GROUP = "#AR-Player_Groups_Public";
163 protected const string JOIN_GROUP = "#AR-DeployMenu_JoinGroup";
164 protected const string REQUEST_JOIN_GROUP = "#AR-DeployMenu_RequestJoinGroup";
165 protected const string CUSTOM_GROUP_NAME_FORMAT = "#AR-Player_Groups_CustomName_Format";
166 protected const string SQUAD_CAPACITY = "#AR-Campaign_BaseRespawnsAmount";
167
168 protected const ResourceName GROUP_FLAG_SELECTION = "{7340FE3C6872C6D3}UI/layouts/Menus/GroupSlection/GroupFlagSelection.layout";
169
170 protected ref array<SCR_PlayerTileButtonComponent> m_aPlayerComponentsList = {};
173
176
177 protected bool m_bIsPriority;
178
179 //------------------------------------------------------------------------------------------------
180 override void HandlerAttached(Widget w)
181 {
182 super.HandlerAttached(w);
183
184 m_ScrollComponent = SCR_HorizontalScrollAnimationComponent.Cast(w.FindAnyWidget("CallsignFrame").FindHandler(SCR_HorizontalScrollAnimationComponent));
185 }
186
187 //------------------------------------------------------------------------------------------------
188 override void HandlerDeattached(Widget w)
189 {
190 super.HandlerDeattached(w);
191
192 SCR_Task.GetOnTaskAssigneeAdded().Remove(OnTaskAssigneeChanged);
193 SCR_Task.GetOnTaskAssigneeRemoved().Remove(OnTaskAssigneeChanged);
194 }
195
196 //------------------------------------------------------------------------------------------------
197 override bool OnClick(Widget w, int x, int y, int button)
198 {
199 super.OnClick(w, x, y, button);
200
201#ifdef DEBUG_GROUPS
202 SCR_GroupsManagerComponent.GetInstance().UpdateDebugUI();
203#endif
204
205 m_GroupComponent.SetSelectedGroupID(m_iGroupID);
206 s_OnGroupButtonClicked.Invoke();
207
208 return true;
209 }
210
211 //------------------------------------------------------------------------------------------------
213 {
215 if (!m_GroupManager)
216 return;
217
218 m_GroupComponent = SCR_PlayerControllerGroupComponent.GetLocalPlayerControllerGroupComponent();
219 if (!m_GroupComponent)
220 return;
221
223 if (!playerController)
224 return;
225
226 SocialComponent socialComp = SocialComponent.Cast(playerController.FindComponent(SocialComponent));
227 if (!socialComp)
228 return;
229
230 SCR_AIGroup group = m_GroupManager.FindGroup(m_iGroupID);
231 if (!group)
232 return;
233
236
237 m_TaskSystem = SCR_TaskSystem.GetInstance();
238 if (m_TaskSystem)
239 {
240 m_TaskSystem.GetOnTaskAdded().Insert(OnTaskAdded);
241 m_TaskSystem.GetOnTaskRemoved().Insert(OnTaskRemoved);
242 }
243
244 SCR_Task.GetOnTaskAssigneeAdded().Insert(OnTaskAssigneeChanged);
245 SCR_Task.GetOnTaskAssigneeRemoved().Insert(OnTaskAssigneeChanged);
246
248
249 RichTextWidget squadName = RichTextWidget.Cast(GetRootWidget().FindAnyWidget("Callsign"));
250 if (squadName)
251 {
252 // 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.
253 squadName.SetText(SCR_GroupHelperUI.GetTranslatedGroupName(group));
254 }
255
256 RichTextWidget squadType = RichTextWidget.Cast(GetRootWidget().FindAnyWidget("Type"));
257 Widget squadFrameType = GetRootWidget().FindAnyWidget("FrameType");
258 if (squadType && squadFrameType)
259 {
260 string roleName = SCR_GroupHelperUI.GetRoleName(group);
261 squadFrameType.SetVisible(!roleName.IsEmpty());
262 squadType.SetText(roleName);
263 }
264
265 RichTextWidget frequency = RichTextWidget.Cast(GetRootWidget().FindAnyWidget("Frequency"));
266 if (frequency)
267 frequency.SetTextFormat("%1 #AR-VON_FrequencyUnits_MHz", group.GetRadioFrequency() * 0.001);
268
269 RichTextWidget playerCount = RichTextWidget.Cast(GetRootWidget().FindAnyWidget("PlayerCount"));
270 ImageWidget playerImageWidget = ImageWidget.Cast(GetRootWidget().FindAnyWidget("PlayerIcon"));
271
272 if (playerCount)
273 {
274 if (group.IsMaxMembersLimited())
275 playerCount.SetTextFormat(SQUAD_CAPACITY, group.GetPlayerCount(), group.GetMaxMembers());
276 else
277 playerCount.SetText(group.GetPlayerCount().ToString());
278 }
279
280 if (group.IsFull())
281 {
283 playerCount.SetColor(UIColors.WARNING);
284 playerImageWidget.SetColor(UIColors.WARNING);
285 }
286 else
287 {
288 playerCount.SetColor(Color.White);
289 playerImageWidget.SetColor(Color.White);
290 }
291
292 SizeLayoutWidget groupImage = SizeLayoutWidget.Cast(GetRootWidget().FindAnyWidget("GroupImageMenu"));
293
294 if (groupImage)
295 SetGroupFlag(group, groupImage);
296
297 ImageWidget background = ImageWidget.Cast(GetRootWidget().FindAnyWidget("Background"));
298
299 if (background)
300 background.SetVisible(m_GroupComponent.GetSelectedGroupID() == m_iGroupID);
301
302 if (group.IsPlayerInGroup(playerController.GetPlayerId()))
303 {
304 squadName.SetColor(m_PlayerNameSelfColor);
305 ImageWidget m_wPrivateIconImage = ImageWidget.Cast(GetRootWidget().FindAnyWidget("PrivateImage"));
307 if (m_wPrivateIconImage)
308 m_wPrivateIconImage.SetColor(m_PlayerNameSelfColor);
309 }
310
311 SizeLayoutWidget privateIcon = SizeLayoutWidget.Cast(GetRootWidget().FindAnyWidget("PrivateSize"));
312 if (privateIcon)
313 privateIcon.SetVisible(group.IsPrivate());
314
315 if (!m_ParentSubMenu)
317
319 }
320
321 //------------------------------------------------------------------------------------------------
324 void SetGroupFlag(SCR_AIGroup group, Widget groupImage)
325 {
326 SCR_Faction scrFaction = SCR_Faction.Cast(group.GetFaction());
327 if (!scrFaction)
328 return;
329
331 if (!groupIcon)
332 return;
333
334 ResourceName flag = group.GetGroupFlag();
335
336 if (flag.IsEmpty())
337 {
338 array<ResourceName> textures = {};
339 scrFaction.GetGroupFlagTextures(textures);
340 if (!scrFaction.GetGroupFlagImageSet().IsEmpty())
341 {
342 array<string> names = {};
343 scrFaction.GetFlagNames(names);
344 groupIcon.SetFlagButtonFromImageSet(names[0]);
345 }
346 else if (!textures.IsEmpty())
347 groupIcon.SetImage(textures[0]);
348 else
349 {
350 array<ResourceName> images = {};
351 scrFaction.GetGroupFlagTextures(images);
352
353 if (!scrFaction.GetGroupFlagImageSet().IsEmpty())
354 {
355 array<string> names = {};
356 scrFaction.GetFlagNames(names);
357 if (!names.IsEmpty())
358 groupIcon.SetFlagButtonFromImageSet(names[0]);
359 }
360 else if (!images.IsEmpty())
361 groupIcon.SetImage(images[0]);
362 else
363 groupIcon.SetImage(scrFaction.GetFactionFlag());
364 }
365 }
366 else
367 {
368 if (group.GetFlagIsFromImageSet())
369 groupIcon.SetFlagButtonFromImageSet(flag);
370 else
371 groupIcon.SetImage(flag);
372 }
373
374 }
375 //------------------------------------------------------------------------------------------------
378 {
379 if (!m_ParentSubMenu)
380 return;
381
382 Widget groupImage = m_ParentSubMenu.GetRootWidget().FindAnyWidget("GroupImage");
383 if (!groupImage)
384 return;
385
387 if (!imageButton)
388 return;
389
390 imageButton.SetVisible(true);
391 imageButton.m_OnClicked.Insert(OnSelectGroupFlagButtonClicked);
392
393 // disable group flag image editing when groups use the group role
394 if (group.GetGroupRole() != SCR_EGroupRole.NONE)
395 imageButton.SetEnabled(false);
396
397 SCR_Faction scrFaction = SCR_Faction.Cast(m_GroupFaction);
398 if (!scrFaction)
399 return;
400
401 ResourceName flag = group.GetGroupFlag();
402
403 if (flag.IsEmpty())
404 {
405 array<ResourceName> textures = {};
406
407 scrFaction.GetGroupFlagTextures(textures);
408
409 if (!scrFaction.GetGroupFlagImageSet().IsEmpty())
410 {
411 array<string> names = {};
412
413 scrFaction.GetFlagNames(names);
414
415 imageButton.SetFlagButtonFromImageSet(names[0]);
416 }
417 else if (!textures.IsEmpty())
418 {
419 imageButton.SetImage(textures[0]);
420 }
421 else
422 {
423 array<ResourceName> images = {};
424
425 scrFaction.GetGroupFlagTextures(images);
426
427 if (!scrFaction.GetGroupFlagImageSet().IsEmpty())
428 {
429 array<string> names = {};
430
431 scrFaction.GetFlagNames(names);
432
433 if (!names.IsEmpty())
434 imageButton.SetFlagButtonFromImageSet(names[0]);
435 }
436 else if (!images.IsEmpty())
437 {
438 imageButton.SetImage(images[0]);
439 }
440 else
441 {
442 imageButton.SetImage(scrFaction.GetFactionFlag());
443 }
444 }
445 }
446 else
447 {
448 if (group.GetFlagIsFromImageSet())
449 imageButton.SetFlagButtonFromImageSet(flag);
450 else
451 imageButton.SetImage(flag);
452 }
453 }
454
455 //------------------------------------------------------------------------------------------------
457 {
458 SCR_PlayerControllerGroupComponent playerComponent = SCR_PlayerControllerGroupComponent.GetLocalPlayerControllerGroupComponent();
459 if (!playerComponent)
460 return;
461
462 SCR_AIGroup group = m_GroupManager.FindGroup(m_iGroupID);
463 if (!group)
464 return;
465
466 if (!group.IsPlayerLeader(playerComponent.GetPlayerID()))
467 {
468 SCR_NotificationsComponent.SendLocal(ENotification.GROUPS_PLAYER_IS_NOT_LEADER);
469 return;
470 }
471
472 SCR_Faction playerFaction = SCR_Faction.Cast(group.GetFaction());
473
474 array<string> flagNames = {};
475 array<ResourceName> flagTextures = {};
476 playerFaction.GetFlagNames(flagNames);
477 playerFaction.GetGroupFlagTextures(flagTextures);
478
479 if (!flagNames.IsEmpty() || !flagTextures.IsEmpty())
480 GetGame().GetMenuManager().OpenDialog(ChimeraMenuPreset.GroupFlagDialog, DialogPriority.CRITICAL, 0, true);
481 else
482 SCR_NotificationsComponent.SendLocal(ENotification.GROUPS_NO_FLAGS);
483 }
484
485 //------------------------------------------------------------------------------------------------
486 protected void OnTaskAdded(notnull SCR_Task task)
487 {
489 }
490
491 //------------------------------------------------------------------------------------------------
492 protected void OnTaskRemoved(notnull SCR_Task task)
493 {
495 }
496
497 //------------------------------------------------------------------------------------------------
499 {
500 if (!m_ParentSubMenu)
501 return;
502
503 OverlayWidget taskOverlay = OverlayWidget.Cast(m_ParentSubMenu.GetRootWidget().FindAnyWidget(m_sGroupAssignedTaskOverlayWidgetName));
504 if (!taskOverlay)
505 return;
506
507 m_TaskSystem = SCR_TaskSystem.GetInstance();
508 if (!m_TaskSystem)
509 {
510 taskOverlay.SetVisible(false);
511 return;
512 }
513
514 SCR_TaskExecutor groupTaskExecutor = SCR_TaskExecutor.FromGroup(group.GetGroupID());
515 if (!groupTaskExecutor)
516 {
517 taskOverlay.SetVisible(false);
518 return;
519 }
520
521 SCR_Task groupTask = m_TaskSystem.GetTaskAssignedTo(groupTaskExecutor);
522 if (!groupTask)
523 {
524 taskOverlay.SetVisible(false);
525 return;
526 }
527
528 SCR_Faction groupFaction = SCR_Faction.Cast(group.GetFaction());
529 if (!groupFaction)
530 {
531 taskOverlay.SetVisible(false);
532 return;
533 }
534
535 RichTextWidget taskNameWidget = RichTextWidget.Cast(taskOverlay.FindAnyWidget(m_sGroupAssignedTaskNameWidgetName));
536 if (taskNameWidget)
537 taskNameWidget.SetTextFormat(groupTask.GetTaskUIInfo().GetTranslatedName());
538
539 ButtonWidget taskIconWidget = ButtonWidget.Cast(taskOverlay.FindAnyWidget(m_sGroupAssignedTaskIconButtonName));
540 if (taskIconWidget)
541 {
542 ImageWidget taskIconSymbolWidget = ImageWidget.Cast(taskOverlay.FindAnyWidget(m_sGroupAssignedTaskIconSymbolName));
543 if (taskIconSymbolWidget)
544 {
545 taskIconSymbolWidget.SetColor(groupFaction.GetOutlineFactionColor());
546 taskIconSymbolWidget.LoadImageFromSet(0, groupTask.GetTaskIconPath(), groupTask.GetTaskIconSetName());
547 }
548
549 ImageWidget taskIconOutlineWidget = ImageWidget.Cast(taskOverlay.FindAnyWidget(m_sGroupAssignedTaskIconOutlineName));
550 if (taskIconOutlineWidget)
551 taskIconOutlineWidget.SetColor(groupFaction.GetOutlineFactionColor());
552
553 ImageWidget taskIconBackgroundWidget = ImageWidget.Cast(taskOverlay.FindAnyWidget(m_sGroupAssignedTaskIconBackgroundName));
554 if (taskIconBackgroundWidget)
555 taskIconBackgroundWidget.SetColor(groupFaction.GetFactionColor());
556 }
557
558 taskOverlay.SetVisible(true);
559 }
560
561 //------------------------------------------------------------------------------------------------
562 protected void OnTaskAssigneeChanged(SCR_Task task, SCR_TaskExecutor executor, int requesterID)
563 {
564 SCR_TaskExecutorGroup groupTaskExecutor = SCR_TaskExecutorGroup.Cast(executor);
565 if (!groupTaskExecutor)
566 return;
567
568 if (groupTaskExecutor.GetGroupID() != m_GroupComponent.GetSelectedGroupID() || groupTaskExecutor.GetGroupID() != m_iGroupID)
569 return;
570
571 SCR_AIGroup group = m_GroupManager.FindGroup(m_iGroupID);
572 if (!group)
573 return;
574
576 }
577
578 //------------------------------------------------------------------------------------------------
580 {
581 PlayerManager playerManager = GetGame().GetPlayerManager();
582 if (!m_GroupFaction || !m_GroupManager || !playerManager)
583 return;
584
586 if (!playerController)
587 return;
588
589 SCR_AIGroup group = m_GroupManager.FindGroup(m_iGroupID);
590 if (!group)
591 return;
592
594
595 if (m_ParentSubMenu == null)
597
599
601
602 VerticalLayoutWidget playerList = VerticalLayoutWidget.Cast(m_ParentSubMenu.GetRootWidget().FindAnyWidget("PlayerList"));
603 if (!playerList)
604 return;
605
606 VerticalLayoutWidget leaderList = VerticalLayoutWidget.Cast(m_ParentSubMenu.GetRootWidget().FindAnyWidget("Leader"));
607 if (!leaderList)
608 return;
609
610 RichTextWidget squadName = RichTextWidget.Cast(m_ParentSubMenu.GetRootWidget().FindAnyWidget("GroupDetailCallsign"));
611 if (!squadName)
612 return;
613
614 RichTextWidget squadType = RichTextWidget.Cast(m_ParentSubMenu.GetRootWidget().FindAnyWidget("Type"));
615 if (!squadType)
616 return;
617
618 RichTextWidget description = RichTextWidget.Cast(m_ParentSubMenu.GetRootWidget().FindAnyWidget("Description"));
619 if (!description)
620 return;
621
622 RichTextWidget frequency = RichTextWidget.Cast(m_ParentSubMenu.GetRootWidget().FindAnyWidget("GroupDetailFrequency"));
623 if (!frequency)
624 return;
625
626 RichTextWidget groupDetailType = RichTextWidget.Cast(m_ParentSubMenu.GetRootWidget().FindAnyWidget("GroupDetailType"));
627 if (!groupDetailType)
628 return;
629
630 SCR_PlayerControllerGroupComponent s_PlayerGroupController = SCR_PlayerControllerGroupComponent.GetLocalPlayerControllerGroupComponent();
631 if (!s_PlayerGroupController)
632 return;
633
634 SocialComponent socialComp = SocialComponent.Cast(playerController.FindComponent(SocialComponent));
635 if (!socialComp)
636 return;
637
638 if (!s_PlayerGroupController.CanPlayerJoinGroup(playerController.GetPlayerId(), m_GroupManager.FindGroup(m_iGroupID)))
640 else
642
643 // 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.
644 squadName.SetText(SCR_GroupHelperUI.GetTranslatedGroupName(group));
645
646 Widget groupTypeOverlay = m_ParentSubMenu.GetRootWidget().FindAnyWidget("GroupTypeOverlay");
647 if (groupTypeOverlay)
648 {
649 string roleName = SCR_GroupHelperUI.GetRoleName(group);
650 groupTypeOverlay.SetVisible(!roleName.IsEmpty());
651 groupDetailType.SetText(roleName);
652 }
653
654 if (!group.GetCustomDescription().IsEmpty())
655 description.SetText(group.GetCustomDescription());
656 else
657 description.SetText(string.Empty);
658
660
661 frequency.SetTextFormat("%1 #AR-VON_FrequencyUnits_MHz", group.GetRadioFrequency() * 0.001);
662
663 Widget children = playerList.GetChildren();
664 while (children)
665 {
666 playerList.RemoveChild(children);
667 children = playerList.GetChildren();
668 }
669
670 children = leaderList.GetChildren();
671 while (children)
672 {
673 leaderList.RemoveChild(children);
674 children = leaderList.GetChildren();
675 }
676
677 array<int> playerIDs = group.GetPlayerIDs();
678 Widget playerTile;
679
680 int leaderID = group.GetLeaderID();
681 if (leaderID >= 0)
682 {
683 playerTile = GetGame().GetWorkspace().CreateWidgets(m_textLayout, leaderList);
684 SetupPlayerTile(playerTile, leaderID);
685 }
686
687 foreach (int playerID : playerIDs)
688 {
689 if (playerID == leaderID)
690 continue;
691
692 playerTile = GetGame().GetWorkspace().CreateWidgets(m_textLayout, playerList);
693 SetupPlayerTile(playerTile, playerID);
694 }
695
696 //disable this for now as it has issues with replication of aigroups
697 //ShowAIsInGroup();
698
701 GetGame().GetWorkspace().SetFocusedWidget(GetRootWidget());
702 }
703
704 //------------------------------------------------------------------------------------------------
706 {
707 SCR_PlayerControllerGroupComponent playerGroupController = SCR_PlayerControllerGroupComponent.GetLocalPlayerControllerGroupComponent();
708 if (!playerGroupController)
709 return;
710
711 SCR_AIGroup group;
712 if (playerGroupController.GetSelectedGroupID() == -1)
713 group = m_GroupManager.FindGroup(m_iGroupID);
714 else
715 group = m_GroupManager.FindGroup(playerGroupController.GetSelectedGroupID());
716
717 if (!group)
718 return;
719
720 if (group.IsPrivate())
722 else
724
725 array<int> denied = {};
726 group.GetDeniedRequesters(denied);
727 array<int> requesters = {};
728 group.GetRequesterIDs(requesters);
729
730 bool requesterDenied = denied.Contains(playerGroupController.GetPlayerID());
731 bool requestSent = requesters.Contains(playerGroupController.GetPlayerID());
732
733 if (
734 requesterDenied ||
735 requestSent ||
736 SCR_FactionCommanderPlayerComponent.IsLocalPlayerCommander() || // block joining to other group when player is commander
737 !m_GroupManager.FindGroup(m_iGroupID) ||
738 !playerGroupController.CanPlayerJoinGroup(SCR_PlayerController.GetLocalPlayerId(), m_GroupManager.FindGroup(m_iGroupID)))
739 {
741 m_JoinGroupButton.SetEnabled(false);
742 }
743 else
744 {
746 m_JoinGroupButton.SetEnabled(true);
747 }
748
749 SCR_Faction scrFaction = SCR_Faction.Cast(m_GroupFaction);
750 if (!scrFaction)
751 return;
752
753 array<SCR_GroupRolePresetConfig> groupRolePresetConfigs = {};
754 scrFaction.GetGroupRolePresetConfigs(groupRolePresetConfigs);
755
756 // disable join group button by group role preset
757 foreach (SCR_GroupRolePresetConfig preset : groupRolePresetConfigs)
758 {
759 if (preset.GetGroupRole() == group.GetGroupRole() && !preset.CanPlayerJoin())
760 {
762 break;
763 }
764 }
765 }
766
767 //------------------------------------------------------------------------------------------------
768 protected void SetJoinButtonVisible(bool state)
769 {
770 SCR_PlayerControllerGroupComponent playerGroupController = SCR_PlayerControllerGroupComponent.GetLocalPlayerControllerGroupComponent();
771 int focusedGroupId = playerGroupController.GetSelectedGroupID();
772 if (focusedGroupId != -1)
773 {
774 int groupId = playerGroupController.GetGroupID();
775
776 if (playerGroupController.HasInviteFromGroup(focusedGroupId))
777 state = false;
778 else if (groupId == focusedGroupId)
779 state = false;
780 }
781
782 m_JoinGroupButton.SetVisible(state, false);
783 }
784
785 //------------------------------------------------------------------------------------------------
788 {
789 SCR_PlayerControllerGroupComponent playerGroupController = SCR_PlayerControllerGroupComponent.GetLocalPlayerControllerGroupComponent();
790 if (!playerGroupController)
791 return;
792
793 SCR_AIGroup group;
794 if (playerGroupController.GetSelectedGroupID() == -1)
795 group = m_GroupManager.FindGroup(m_iGroupID);
796 else
797 group = m_GroupManager.FindGroup(playerGroupController.GetSelectedGroupID());
798
799 if (!group)
800 return;
801
802 int playerId = SCR_PlayerController.GetLocalPlayerId();
803 bool canRemove = playerGroupController.CanPlayerRemoveGroup(playerId, group);
804
805 m_RemoveGroupButton.SetVisible(canRemove, false);
806 }
807
808 //------------------------------------------------------------------------------------------------
809 //TODO: setup should be taken care of by the player tile component
810 void SetupPlayerTile(Widget playerTile, int playerID)
811 {
812 PlayerManager playerManager = GetGame().GetPlayerManager();
813 if (!m_GroupFaction || !m_GroupManager || !playerManager)
814 return;
815
816 SCR_AIGroup group = m_GroupManager.FindGroup(m_iGroupID);
817 if (!group)
818 return;
819
820 SCR_GadgetManagerComponent gadgetManager;
821 TextWidget playerName, playerFrequency;
822 ImageWidget taskIcon, muteIcon, background, loadoutIcon;
823 //string m_sTaskText;
824 SizeLayoutWidget m_wTaskLayout;
825 ButtonWidget playerButton;
826 SCR_TaskExecutor taskExecutor;
827 SCR_BasePlayerLoadout playerLoadout;
828 Resource res;
830 BaseContainer container;
832 set<int> frequencies = new set<int>();
833
834 playerName = TextWidget.Cast(playerTile.FindAnyWidget("PlayerName"));
835 playerFrequency = TextWidget.Cast(playerTile.FindAnyWidget("Frequency"));
836 m_wTaskLayout = SizeLayoutWidget.Cast(playerTile.FindAnyWidget("TaskLayout"));
837 Widget wBackground = ImageWidget.Cast(playerTile.FindAnyWidget("TaskIconBackground"));
838 Widget m_wOutline = ImageWidget.Cast(playerTile.FindAnyWidget("TaskIconOutline"));
839 Widget m_wSymbol = ImageWidget.Cast(playerTile.FindAnyWidget("TaskIconSymbol"));
840 muteIcon = ImageWidget.Cast(playerTile.FindAnyWidget("MuteIcon"));
841 background = ImageWidget.Cast(playerTile.FindAnyWidget("Background"));
842 loadoutIcon = ImageWidget.Cast(playerTile.FindAnyWidget("LoadoutIcon"));
843 ImageWidget m_wIconSymbol = ImageWidget.Cast(playerTile.FindAnyWidget("TaskIconSymbol"));
844 ImageWidget platformIcon = ImageWidget.Cast(playerTile.FindAnyWidget("PlatformIcon"));
845
846 playerButton = ButtonWidget.Cast(playerTile.FindAnyWidget("PlayerButton"));
847 if (!playerButton)
848 return;
849
851 m_PlayerTileComponent.SetTilePlayerID(playerID);
852
853 SetupOptionsCombo(playerTile);
854
855 playerName.SetText(SCR_PlayerNamesFilterCache.GetInstance().GetPlayerDisplayName(playerID));
856
858 if (playerCtrl)
859 playerCtrl.SetPlatformImageTo(playerID, platformIcon);
860
861 ChimeraCharacter controlledEntity = ChimeraCharacter.Cast(playerManager.GetPlayerControlledEntity(playerID));
862 if (controlledEntity)
863 {
864 gadgetManager = SCR_GadgetManagerComponent.Cast(controlledEntity.FindComponent(SCR_GadgetManagerComponent));
865 SCR_Global.GetFrequencies(gadgetManager, frequencies);
866 if (!frequencies.IsEmpty())
867 {
868 playerFrequency.SetText(SCR_FormatHelper.FormatFrequencies(frequencies));
869 background.SetOpacity(0.85);
870 }
871 }
872
873 if (playerID == GetGame().GetPlayerController().GetPlayerId())
874 playerName.SetColor(m_PlayerNameSelfColor);
875
876// if (m_TaskSystem)
877// {
878// PlayerController m_PlayerController = GetGame().GetPlayerController();
879// if (!m_PlayerController)
880// return;
881//
882// // TODO: check for good const usage
883// const ResourceName TaskIconImageset = "{10C0A9A305E8B3A4}UI/Imagesets/Tasks/Task_Icons.imageset";
884// SCR_FactionManager factionManager = SCR_FactionManager.Cast(GetGame().GetFactionManager());
885// if (!factionManager)
886// return;
887//
888// Faction playerFaction = factionManager.GetPlayerFaction(m_PlayerController.GetPlayerId());
889// if (!playerFaction)
890// return;
891//
892// Faction localPlayerFaction = factionManager.GetLocalPlayerFaction();
893// if (!localPlayerFaction)
894// return;
895//
896// PlayerController playerController = GetGame().GetPlayerController();
897// if (!playerController)
898// return;
899//
900// m_sPlyFactionAffilComp = SCR_PlayerFactionAffiliationComponent.Cast(playerController.FindComponent(SCR_PlayerFactionAffiliationComponent));
901// if (!m_sPlyFactionAffilComp)
902// return;
903//
904// SCR_Faction m_sfactionCol = SCR_Faction.Cast(m_sPlyFactionAffilComp.GetAffiliatedFaction());
905// if (!m_sfactionCol)
906// return;
907//
908// //check for task and adjust the icon visibility
909// taskExecutor = SCR_TaskExecutor.FromPlayerID(playerID);
910// if(!taskExecutor)
911// return;
912//
913// SCR_EditorTask gmTask = SCR_EditorTask.Cast(m_TaskSystem.GetTaskAssignedTo(taskExecutor));
914// SCR_Task baseTask = m_TaskSystem.GetTaskAssignedTo(taskExecutor);
915// SCR_CampaignMilitaryBaseTaskEntity task = SCR_CampaignMilitaryBaseTaskEntity.Cast(m_TaskSystem.GetTaskAssignedTo(taskExecutor));
916//
917// if(gmTask || baseTask || task && playerFaction == localPlayerFaction)
918// {
919// m_wTaskLayout.SetVisible(true);
920// m_wTaskLayout.SetColor(localPlayerFaction.GetFactionColor());
921// wGroupTaskName = RichTextWidget.Cast(playerTile.FindAnyWidget("TaskDescription"));
922//
923// if (task) // When task is assigned and when player has the same faction with entry faction for campaign.
924// {
925// m_wIconSymbol.LoadImageFromSet(0, TaskIconImageset, task.GetTaskIconSetName());
926// m_sTaskText = task.GetTaskName();
927// }
928//
929// if (gmTask) // When task is assigned and when player has the same faction with entry faction for Game Master.
930// {
931// m_wIconSymbol.LoadImageFromSet(0, TaskIconImageset, gmTask.GetTaskIconSetName());
932// m_sTaskText = gmTask.GetTaskName();
933// wGroupTaskName.SetTextFormat(gmTask.GetTaskName(), gmTask.GetLocationName());
934// }
935// }
936// }
937
938 //set the state of mute
939 PlayerController pc = GetGame().GetPlayerController();
940 // Using another PlayerController variable to not alter rest of code
941 if (muteIcon && pc)
942 {
943 SocialComponent sc = SocialComponent.Cast(pc.FindComponent(SocialComponent));
944 if (sc && sc.IsRestricted(playerID, EUserInteraction.VoiceChat))
945 {
946 muteIcon.SetColor(m_PlayerNameSelfColor);
947 muteIcon.LoadImageFromSet(0, UIConstants.ICONS_IMAGE_SET, "sound-off");
948 }
949 }
950
951 //look for loadout and set the appropriate icon
952 if (loadoutIcon)
953 {
954 SCR_LoadoutManager loadoutManager = GetGame().GetLoadoutManager();
955 if (loadoutManager)
956 playerLoadout = loadoutManager.GetPlayerLoadout(playerID);
957
958 if (playerLoadout)
959 {
960 res = Resource.Load(playerLoadout.GetLoadoutResource());
961 source = SCR_BaseContainerTools.FindComponentSource(res, "SCR_EditableCharacterComponent");
962 if (source)
963 {
964 container = source.GetObject("m_UIInfo");
965 info = SCR_EditableEntityUIInfo.Cast(BaseContainerTools.CreateInstanceFromContainer(container));
966 info.SetIconTo(loadoutIcon);
967 }
968 }
969
970 //set leader icon if given player is a leader
971 if (group.IsPlayerLeader(playerID))
972 {
973 m_LeaderInfo.SetIconTo(loadoutIcon);
974 loadoutIcon.SetColor(m_PlayerNameSelfColor);
975 }
976
977 //set badge color
978 Widget badge = playerTile.FindAnyWidget("PlayerBadge");
979 if (badge)
980 {
981 Color badgeColor = m_GroupFaction.GetFactionColor();
982 if (group.IsPlayerLeader(playerID))
983 badgeColor = (m_PlayerNameSelfColor);
984
985 SetBadgeColor(badge, badgeColor);
986 }
987 }
988
989 m_PlayerTileComponent.GetOnTileFocus().Insert(OnPlayerTileFocus);
990 m_PlayerTileComponent.GetOnTileFocusLost().Insert(OnPlayerTileFocusLost);
991
993 }
994
995 //------------------------------------------------------------------------------------------------
996 void SetIsPriority(bool isPriority)
997 {
998 m_bIsPriority = isPriority;
999 }
1000
1001 //------------------------------------------------------------------------------------------------
1003 {
1004 return m_bIsPriority;
1005 }
1006
1007 //------------------------------------------------------------------------------------------------
1008 protected void OnPlayerTileFocus(int id)
1009 {
1011 m_OnPlayerTileFocus.Invoke(id);
1012
1014 }
1015
1016 //------------------------------------------------------------------------------------------------
1017 protected void OnPlayerTileFocusLost(int id)
1018 {
1020 m_OnPlayerTileFocusLost.Invoke(id);
1021
1023 }
1024
1025 //------------------------------------------------------------------------------------------------
1026 void SetGroupInfoColor(Color groupColor)
1027 {
1028 ImageWidget frequencyImage = ImageWidget.Cast(GetRootWidget().FindAnyWidget("FrequencyImage"));
1029 ImageWidget playerIcon = ImageWidget.Cast(GetRootWidget().FindAnyWidget("PlayerIcon"));
1030 TextWidget callsign = TextWidget.Cast(GetRootWidget().FindAnyWidget("Callsign"));
1031 TextWidget frequency = TextWidget.Cast(GetRootWidget().FindAnyWidget("Frequency"));
1032 TextWidget playerCount = TextWidget.Cast(GetRootWidget().FindAnyWidget("PlayerCount"));
1033
1034 if (!frequencyImage || !playerIcon || !callsign || !frequency || !playerCount)
1035 return;
1036
1037 frequencyImage.SetColor(groupColor);
1038 playerIcon.SetColor(groupColor);
1039 callsign.SetColor(groupColor);
1040 frequency.SetColor(groupColor);
1041 playerCount.SetColor(groupColor);
1042 }
1043
1044 //------------------------------------------------------------------------------------------------
1046 {
1047 return m_iGroupID;
1048 }
1049
1050 //------------------------------------------------------------------------------------------------
1051 override bool OnFocus(Widget w, int x, int y)
1052 {
1053 super.OnFocus(w, x, y);
1054
1055 if (m_GroupComponent.GetSelectedGroupID() == -1)
1056 m_GroupComponent.SetSelectedGroupID(m_iGroupID);
1057
1058 EInputDeviceType deviceType = GetGame().GetInputManager().GetLastUsedInputDevice();
1059 if (deviceType == EInputDeviceType.GAMEPAD || deviceType == EInputDeviceType.KEYBOARD)
1060 {
1061 m_GroupComponent.SetSelectedGroupID(m_iGroupID);
1063 }
1064
1065 if (!m_ScrollComponent.GetContentFitX())
1066 m_ScrollComponent.AnimationStart();
1067
1068 return false;
1069 }
1070
1071 //------------------------------------------------------------------------------------------------
1072 override bool OnFocusLost(Widget w, int x, int y)
1073 {
1074 if (m_ScrollComponent.IsAnimating())
1075 {
1076 m_ScrollComponent.AnimationStop();
1077 m_ScrollComponent.ResetPosition();
1078 }
1079
1080 return super.OnFocusLost(w, x, y);
1081 }
1082
1083 //------------------------------------------------------------------------------------------------
1084 void SetGroupID(int id)
1085 {
1086 m_iGroupID = id;
1087 }
1088
1089 //------------------------------------------------------------------------------------------------
1091 {
1092 return m_GroupFaction;
1093 }
1094
1095 //------------------------------------------------------------------------------------------------
1096 void SetGroupFaction(Faction groupFaction)
1097 {
1098 m_GroupFaction = groupFaction;
1099 }
1100
1101 //------------------------------------------------------------------------------------------------
1103 {
1104 m_JoinGroupButton = joinGroupButton;
1105 }
1106
1107 //------------------------------------------------------------------------------------------------
1109 {
1110 m_RemoveGroupButton = removeGroupButton;
1111 }
1112
1113 //------------------------------------------------------------------------------------------------
1114 void SetupOptionsCombo(Widget playerTile)
1115 {
1116 ButtonWidget playerOptionsButton = ButtonWidget.Cast(playerTile.FindAnyWidget("PlayerOptions"));
1117 if (!playerOptionsButton)
1118 return;
1119
1120 SCR_ComboBoxComponent playerOptionsCombo = SCR_ComboBoxComponent.Cast(playerOptionsButton.FindHandler(SCR_ComboBoxComponent));
1121 if (!playerOptionsCombo)
1122 return;
1123
1124 m_PlayerTileComponent.SetOptionsComboBoxComponent(playerOptionsCombo);
1125
1126 int playerID = GetGame().GetPlayerController().GetPlayerId();
1127 SCR_AIGroup group = m_GroupManager.GetPlayerGroup(playerID);
1128
1129 if (group && m_iGroupID != group.GetGroupID() && m_PlayerTileComponent.GetTilePlayerID() != -1)
1130 m_PlayerTileComponent.GetOptionsComboComponent().AddItem(OPTIONS_COMBO_INVITE);
1131
1132 group = m_GroupManager.FindGroup(m_iGroupID);
1133
1134 if (!group)
1135 return;
1136
1137 if (group.IsPlayerLeader(playerID) && playerID != m_PlayerTileComponent.GetTilePlayerID() && m_PlayerTileComponent.GetTilePlayerID() != -1)
1138 {
1139 if (group.GetGroupRole() != SCR_EGroupRole.RESERVES) // kicked players will get sent to the reserves, so we get rid of the option to avoid confusion
1140 m_PlayerTileComponent.GetOptionsComboComponent().AddItem(OPTIONS_COMBO_KICK);
1141
1142 m_PlayerTileComponent.GetOptionsComboComponent().AddItem(OPTIONS_COMBO_PROMOTE);
1143 }
1144
1145 if (m_PlayerTileComponent.GetOptionsComboComponent().GetNumItems() == 0)
1146 {
1147 m_PlayerTileComponent.SetOpacity(0.3);
1148 m_PlayerTileComponent.GetOptionsComboComponent().SetVisible(false);
1149 m_PlayerTileComponent.GetOptionsComboComponent().SetEnabled(false);
1150 }
1151
1152 m_PlayerTileComponent.GetOptionsComboComponent().m_OnOpened.Insert(DisableConfirmButton);
1153 m_PlayerTileComponent.GetOptionsComboComponent().m_OnClosed.Insert(EnableConfirmButton);
1154
1155 m_PlayerTileComponent.GetOptionsComboComponent().m_OnChanged.Insert(OnComboBoxConfirm);
1156 }
1157
1158 //------------------------------------------------------------------------------------------------
1160 {
1161 SCR_PlayerControllerGroupComponent playerGroupController = SCR_PlayerControllerGroupComponent.GetLocalPlayerControllerGroupComponent();
1162
1163 if (!playerGroupController)
1164 return;
1165
1166 int playerID;
1167 for (int i = m_aPlayerComponentsList.Count()-1; i >= 0; i--)
1168 {
1169 if (m_aPlayerComponentsList[i].GetOptionsComboComponent() == combo)
1170 playerID = m_aPlayerComponentsList[i].GetTilePlayerID();
1171 }
1172
1173 switch (combo.GetItemName(index))
1174 {
1176 {
1177 playerGroupController.InvitePlayer(playerID);
1178 break;
1179 }
1180
1181 case OPTIONS_COMBO_KICK:
1182 {
1183 playerGroupController.RequestKickPlayer(playerID);
1184 break;
1185 }
1186
1188 {
1189 playerGroupController.RequestPromoteLeader(playerID);
1190 break;
1191 }
1192 }
1193
1194 combo.SetCurrentItem(-1, false, false);
1195 }
1196
1197 //------------------------------------------------------------------------------------------------
1198 protected void CheckLeaderOptions()
1199 {
1200 SCR_AIGroup group = m_GroupManager.FindGroup(m_iGroupID);
1201 if (!group)
1202 return;
1203
1204 Widget privateChecker = m_ParentSubMenu.GetRootWidget().FindAnyWidget("PrivateCheckLayout");
1205 if (!privateChecker)
1206 return;
1207
1208 Widget privateCheckerButton = m_ParentSubMenu.GetRootWidget().FindAnyWidget("PrivateChecker");
1209 if (!privateCheckerButton)
1210 return;
1211
1212 SCR_ButtonCheckerComponent checkerComp = SCR_ButtonCheckerComponent.Cast(privateCheckerButton.FindHandler(SCR_ButtonCheckerComponent));
1213 if (!checkerComp)
1214 return;
1215
1216 ButtonWidget nameChangeButton = ButtonWidget.Cast(m_ParentSubMenu.GetRootWidget().FindAnyWidget("ChangeNameButton"));
1217 if (!nameChangeButton)
1218 return;
1219
1220 if (!group.IsPlayerLeader(GetGame().GetPlayerController().GetPlayerId()) || !m_GroupManager.CanPlayersChangeAttributes() ||
1221 !group.IsPrivacyChangeable())
1222 {
1223 privateChecker.SetOpacity(0);
1224 privateChecker.SetEnabled(false);
1225 nameChangeButton.SetOpacity(0);
1226 nameChangeButton.SetEnabled(false);
1227 return;
1228 }
1229
1230 checkerComp.SetToggled(group.IsPrivate(), instant: true);
1231 if (group.IsPrivate())
1232 checkerComp.SetText(PRIVATE_GROUP);
1233 else
1234 checkerComp.SetText(PUBLIC_GROUP);
1235
1236 privateChecker.SetOpacity(1);
1237 privateChecker.SetEnabled(true);
1238 nameChangeButton.SetOpacity(1);
1239 nameChangeButton.SetEnabled(true);
1240 }
1241
1242 //------------------------------------------------------------------------------------------------
1247
1248 //------------------------------------------------------------------------------------------------
1256
1257 //------------------------------------------------------------------------------------------------
1265
1266 //------------------------------------------------------------------------------------------------
1268 {
1270 }
1271
1272 //------------------------------------------------------------------------------------------------
1274 {
1275 InputManager inputManager = GetGame().GetInputManager();
1276 if (inputManager && inputManager.GetLastUsedInputDevice() == EInputDeviceType.GAMEPAD)
1278 }
1279
1280 //------------------------------------------------------------------------------------------------
1281 void SetConfirmButtonStatus(bool status)
1282 {
1283// SCR_RespawnSubMenuBase subMenu = SCR_RespawnSubMenuBase.Cast(m_ParentSubMenu);
1284// if (!subMenu)
1285// return;
1286
1287// subMenu.SetConfirmButtonEnabled(status);
1288 }
1289
1290 //------------------------------------------------------------------------------------------------
1291 void SetBadgeColor(Widget badge, Color color)
1292 {
1293 if (!badge)
1294 return;
1295
1296 ImageWidget badgeTop, badgeMiddle, badgeBottom;
1297
1298 badgeTop = ImageWidget.Cast(badge.FindAnyWidget("BadgeTop"));
1299 badgeMiddle = ImageWidget.Cast(badge.FindAnyWidget("BadgeMiddle"));
1300 badgeBottom = ImageWidget.Cast(badge.FindAnyWidget("BadgeBottom"));
1301
1302 if (!badgeMiddle || !badgeTop || !badgeBottom)
1303 return;
1304
1305 badgeTop.SetColor(color);
1306 badgeMiddle.SetColor(color);
1307 badgeBottom.SetColor(color);
1308 }
1309
1310 //------------------------------------------------------------------------------------------------
1312 {
1313 SCR_AIGroup group = m_GroupManager.FindGroup(m_iGroupID);
1314 if (!group)
1315 return;
1316
1317 VerticalLayoutWidget playerList = VerticalLayoutWidget.Cast(m_ParentSubMenu.GetRootWidget().FindAnyWidget("PlayerList"));
1318 if (!playerList)
1319 return;
1320
1321 Widget playerTile;
1322 TextWidget playerName;
1323 ButtonWidget playerButton;
1324
1325 SCR_AIGroup slaveGroup = group.GetSlave();
1326 if (!slaveGroup)
1327 return;
1328
1329 array<SCR_ChimeraCharacter> aiMembers = slaveGroup.GetAIMembers();
1330 SCR_CharacterIdentityComponent identityComponent;
1331
1332 foreach (SCR_ChimeraCharacter AIcharacter : aiMembers)
1333 {
1334 playerTile = GetGame().GetWorkspace().CreateWidgets(m_textLayout, playerList);
1335 playerName = TextWidget.Cast(playerTile.FindAnyWidget("PlayerName"));
1336
1337 identityComponent = SCR_CharacterIdentityComponent .Cast(AIcharacter.FindComponent(SCR_CharacterIdentityComponent));
1338 if (!identityComponent)
1339 return;
1340
1341 string name;
1342 array<string> nameParams = {};
1343 identityComponent.GetFormattedFullName(name, nameParams);
1344 playerName.SetTextFormat(name, nameParams[0], nameParams[1], nameParams[2]);
1345
1346 playerButton = ButtonWidget.Cast(playerTile.FindAnyWidget("PlayerButton"));
1347 if (!playerButton)
1348 return;
1349
1352 return;
1353
1354 m_PlayerTileComponent.SetTilePlayerID(-1);
1355 m_PlayerTileComponent.SetCharacter(AIcharacter);
1356
1357 //set badge color
1358 Widget badge = playerTile.FindAnyWidget("PlayerBadge");
1359
1360 if (badge)
1361 SetBadgeColor(badge, m_GroupFaction.GetFactionColor());
1362
1363 SetupOptionsCombo(playerTile);
1364 }
1365 }
1366}
AddonBuildInfoTool id
ChimeraMenuPreset
Menu presets.
ENotification
ArmaReforgerScripted GetGame()
Definition game.c:1398
SCR_DestructionSynchronizationComponentClass ScriptComponentClass int index
SCR_EGroupRole
Group roles.
void SCR_GroupsManagerComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
ImageWidget m_wOutline
void SCR_LoadoutManager(IEntitySource src, IEntity parent)
ScriptInvokerBase< ScriptInvokerVoidMethod > ScriptInvokerVoid
ScriptInvokerBase< ScriptInvokerIntMethod > ScriptInvokerInt
void SCR_Task(IEntitySource src, IEntity parent)
Definition SCR_Task.c:1938
Definition Color.c:13
Input management system for user interactions.
Object holding reference to resource. In destructor release the resource.
Definition Resource.c:25
array< SCR_ChimeraCharacter > GetAIMembers()
int GetPlayerCount(bool checkMasterAndSlaves=false)
bool IsPlayerLeader(int playerID)
SCR_AIGroup GetSlave()
SCR_EGroupRole GetGroupRole()
bool GetFlagIsFromImageSet()
array< int > GetPlayerIDs()
bool IsPrivacyChangeable()
int GetRequesterIDs(out array< int > valueArray)
ScriptInvoker GetOnMemberStateChange()
int GetRadioFrequency()
int GetMaxMembers()
static ScriptInvoker GetOnPlayerLeaderChanged()
static ScriptInvoker GetOnJoinPrivateGroupRequest()
bool IsPrivate()
int GetGroupID()
bool IsFull()
int GetDeniedRequesters(out array< int > valueArray)
string GetCustomDescription()
int GetLeaderID()
Faction GetFaction()
bool IsMaxMembersLimited()
bool IsPlayerInGroup(int playerID)
ResourceName GetGroupFlag()
Base class for any button, regardless its own content.
void FindParentMenu()
Finds the parent menu of this component.
override void SetToggled(bool toggled, bool animate=true, bool invokeChange=true, bool instant=false)
override bool SetCurrentItem(int i, bool playSound=false, bool animate=false)
ResourceName GetGroupFlagImageSet()
Color GetOutlineFactionColor()
void GetGroupRolePresetConfigs(notnull array< SCR_GroupRolePresetConfig > groupArray)
ResourceName GetFactionFlag()
int GetGroupFlagTextures(out array< ResourceName > textures)
int GetFlagNames(out array< string > flagNames)
static string FormatFrequencies(notnull set< int > frequencies, set< int > highlightFrequencies=null)
static int GetFrequencies(SCR_GadgetManagerComponent gadgetManager, out notnull set< int > outFrequencies)
Definition Functions.c:1884
static string GetTranslatedGroupName(notnull SCR_AIGroup group)
static string GetRoleName(notnull SCR_AIGroup group)
override bool OnFocusLost(Widget w, int x, int y)
void OnTaskRemoved(notnull SCR_Task task)
const string OPTIONS_COMBO_INVITE
void SetGroupFlag(SCR_AIGroup group, Widget groupImage)
void OnTaskAdded(notnull SCR_Task task)
SCR_HorizontalScrollAnimationComponent m_ScrollComponent
const string CUSTOM_GROUP_NAME_FORMAT
SCR_PlayerTileButtonComponent m_PlayerTileComponent
override bool OnFocus(Widget w, int x, int y)
void OnComboBoxConfirm(SCR_ComboBoxComponent combo, int index)
override void HandlerDeattached(Widget w)
void SetJoinGroupButton(SCR_InputButtonComponent joinGroupButton)
static ref ScriptInvokerInt m_OnPlayerTileFocusLost
string m_sGroupAssignedTaskIconBackgroundName
SCR_GroupsManagerComponent m_GroupManager
void SetJoinButtonVisible(bool state)
void SetConfirmButtonStatus(bool status)
void SetIsPriority(bool isPriority)
SCR_PlayerControllerGroupComponent m_GroupComponent
static ScriptInvokerVoid GetOnGroupTileClicked()
SCR_InputButtonComponent m_JoinGroupButton
override bool OnClick(Widget w, int x, int y, int button)
static ScriptInvokerInt GetOnPlayerTileFocusLost()
static ref ScriptInvokerVoid s_OnGroupButtonClicked
void SetupRemoveGroupButton()
Setup remove group button, set visibility by selected group.
void SetSelectedGroupTaskInfo(SCR_AIGroup group)
void SetupPlayerTile(Widget playerTile, int playerID)
void OnTaskAssigneeChanged(SCR_Task task, SCR_TaskExecutor executor, int requesterID)
void SetBadgeColor(Widget badge, Color color)
ref array< SCR_PlayerTileButtonComponent > m_aPlayerComponentsList
void SetGroupInfoColor(Color groupColor)
RichTextWidget wGroupTaskName
void SetRemoveGroupButton(SCR_InputButtonComponent removeGroupButton)
SCR_InputButtonComponent m_RemoveGroupButton
static ScriptInvokerInt GetOnPlayerTileFocus()
SCR_PlayerFactionAffiliationComponent m_sPlyFactionAffilComp
void SetupSelectGroupFlagButton(SCR_AIGroup group)
const string OPTIONS_COMBO_PROMOTE
override void HandlerAttached(Widget w)
const ResourceName GROUP_FLAG_SELECTION
static ref ScriptInvokerInt m_OnPlayerTileFocus
void SetupOptionsCombo(Widget playerTile)
void SetGroupFaction(Faction groupFaction)
static int GetLocalPlayerId()
Returns either a valid ID of local player or 0.
SCR_ComboBoxComponent m_OptionsCombo
SCR_ChimeraCharacter m_AICharacter
void SetCharacter(SCR_ChimeraCharacter character)
void SetOptionsComboBoxComponent(SCR_ComboBoxComponent optionsCombo)
SCR_ComboBoxComponent GetOptionsComboComponent()
override bool OnFocusLost(Widget w, int x, int y)
SCR_ChimeraCharacter GetCharacter()
override bool OnFocus(Widget w, int x, int y)
override bool OnClick(Widget w, int x, int y, int button)
ref ScriptInvokerInt m_OnTileFocus
ref ScriptInvokerInt m_OnTileFocusLost
SCR_FieldOfViewSettings Attribute
proto external PlayerController GetPlayerController()
EUserInteraction
Interaction type between two players.
proto external int GetPlayerId()
DialogPriority
Definition menuManager.c:5