Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_PlayerListMenu.c
Go to the documentation of this file.
2{
3 ALL = 0,
5}
6
7class SCR_PlayerListEntry
8{
10 int m_iID;
15
18
30
31 //------------------------------------------------------------------------------------------------
33 {
34 return faction == m_Faction || (m_ParentFaction && m_ParentFaction == faction);
35 }
36};
37
38//------------------------------------------------------------------------------------------------
40{
41 protected ResourceName m_sScoreboardRow = "{65369923121A38E7}UI/layouts/Menus/PlayerList/PlayerListEntry.layout";
42
43 protected ref array<ref SCR_PlayerListEntry> m_aEntries = new array<ref SCR_PlayerListEntry>();
45 protected ref array<Faction> m_aFactions = {null};
46
53
55 protected SCR_VoterComponent m_VoterComponent;
57 protected SCR_PlayerListEntry m_SelectedEntry;
58 protected SCR_PlayerControllerGroupComponent m_PlayerGroupController;
59 protected PlayerController m_PlayerController;
60 protected SocialComponent m_SocialComponent;
62 protected Widget m_wTable;
63 protected bool m_bFiltering;
64 protected float m_fTimeSkip;
65
66 protected const float TIME_STEP = 1.0;
67
68 protected const string MUTE = "#AR-PlayerList_Mute";
69 protected const string UNMUTE = "#AR-PlayerList_Unmute";
70 protected const string BLOCK = "#AR-PlayerList_Block";
71 protected const string UNBLOCK = "#AR-PlayerList_Unblock";
72 protected const string INVITE_PLAYER_VOTE = "#AR-PlayerList_Invite";
73 protected const string MUTE_TEXTURE = "sound-off";
74 protected const string OPTIONS_COMBO_ACCEPT = "#AR-Group_AcceptJoinPrivateGroup";
75 protected const string OPTIONS_COMBO_CANCEL = "#AR-Group_RefuseJoinPrivateGroup";
76 protected const string VOTING_PLAYER_COUNT_FORMAT = "#AR-Voting_PlayerCountFormatting";
77
78 protected const string FILTER_FAV = "Favourite";
79 protected const string FILTER_NAME = "Name";
80 protected const string FILTER_FREQ = "Freq";
81 protected const string FILTER_KILL = "Kills";
82 protected const string FILTER_DEATH = "Deaths";
83 protected const string FILTER_SCORE = "Score";
84 protected const string FILTER_MUTE = "Mute";
85 protected const string FILTER_BLOCK = "Block";
86
87 protected static const ResourceName FACTION_COUNTER_LAYOUT = "{5AD2CE85825EDA11}UI/layouts/Menus/PlayerList/FactionPlayerCounter.layout";
88
89 protected const int DEFAULT_SORT_INDEX = 1;
90
91 protected string m_sGameMasterIndicatorName = "GameMasterIndicator";
92 protected string m_sCommanderIndicatorName = "CommanderIndicator";
93
94 protected static ref ScriptInvoker s_OnPlayerListMenu = new ScriptInvoker();
95
96 protected ref Color m_PlayerNameSelfColor = new Color(0.898, 0.541, 0.184, 1);
97
99
100 protected ref BackendCallback m_BlockCallback = null;
101
107 {
108 return s_OnPlayerListMenu;
109 }
110
111 //------------------------------------------------------------------------------------------------
112 protected void InitSorting()
113 {
114 if (!GetRootWidget())
115 return;
116
117 Widget w = GetRootWidget().FindAnyWidget("SortHeader");
118 if (!w)
119 return;
120
122 if (!m_Header)
123 return;
124
125 m_Header.m_OnChanged.Insert(OnHeaderChanged);
126
127 if (m_ScoringSystem)
128 return;
129
132
133 // Hide K/D/S sorting headers if the re is no scoreboard
134 ButtonWidget sortKills = ButtonWidget.Cast(w.FindAnyWidget("sortKills"));
135 ButtonWidget sortDeaths = ButtonWidget.Cast(w.FindAnyWidget("sortDeaths"));
136 ButtonWidget sortScore = ButtonWidget.Cast(w.FindAnyWidget("sortScore"));
137
138 if (sortKills)
139 sortKills.SetOpacity(0);
140 if (sortDeaths)
141 sortDeaths.SetOpacity(0);
142 if (sortScore)
143 sortScore.SetOpacity(0);
144 }
145
146 //------------------------------------------------------------------------------------------------
147 protected void OnHeaderChanged(SCR_SortHeaderComponent sortHeader)
148 {
149 string filterName = sortHeader.GetSortElementName();
150 bool sortUp = sortHeader.GetSortOrderAscending();
151 Sort(filterName, sortUp);
152 }
153
154
155 //------------------------------------------------------------------------------------------------
156 protected void Sort(string filterName, bool sortUp)
157 {
158 if (filterName == FILTER_NAME)
159 SortByName(sortUp);
160 else if (filterName == FILTER_FREQ)
161 SortByFrequency(sortUp);
162 else if (filterName == FILTER_KILL)
163 SortByKills(sortUp);
164 else if (filterName == FILTER_DEATH)
165 SortByDeaths(sortUp);
166 else if (filterName == FILTER_SCORE)
167 SortByScore(sortUp);
168 else if (filterName == FILTER_MUTE)
169 SortByMuted(sortUp);
170 }
171
172 //------------------------------------------------------------------------------------------------
173 void SortByMuted(bool reverseSort = false)
174 {
175 int direction = 1;
176 if (reverseSort)
177 direction = -1;
178
179 foreach (SCR_PlayerListEntry entry : m_aEntries)
180 {
181 entry.m_wRow.SetZOrder(entry.m_Mute.IsToggled() * direction);
182 }
183 }
184
185 //------------------------------------------------------------------------------------------------
186 void SortByName(bool reverseSort = false)
187 {
188 int direction = 1;
189 if (reverseSort)
190 direction = -1;
191
192 array<string> names = {};
193 foreach (SCR_PlayerListEntry entry : m_aEntries)
194 {
195 if (entry.m_wName)
196 names.Insert(entry.m_wName.GetText());
197 }
198
199 names.Sort();
200
201 foreach (SCR_PlayerListEntry entry : m_aEntries)
202 {
203 if (!entry.m_wName)
204 continue;
205
206 string text = entry.m_wName.GetText();
207
208 foreach (int i, string s : names)
209 {
210 if (s != text)
211 continue;
212
213 if (entry.m_wRow)
214 entry.m_wRow.SetZOrder(i * direction);
215 continue;
216 }
217 }
218 }
219
220 //------------------------------------------------------------------------------------------------
221 void SortByFrequency(bool reverseSort = false)
222 {
223 int direction = 1;
224 if (reverseSort)
225 direction = -1;
226
227 foreach (SCR_PlayerListEntry entry : m_aEntries)
228 {
229 entry.m_wRow.SetZOrder(entry.m_iSortFrequency * direction);
230 }
231 }
232
233 //------------------------------------------------------------------------------------------------
234 void SortByKills(bool reverseSort = false)
235 {
236 int direction = 1;
237 if (reverseSort)
238 direction = -1;
239
240 foreach (SCR_PlayerListEntry entry : m_aEntries)
241 {
242 SCR_ScoreInfo score = entry.m_Info;
243 if (score)
244 entry.m_wRow.SetZOrder(score.m_iKills * direction);
245 }
246 }
247
248 //------------------------------------------------------------------------------------------------
249 void SortByDeaths(bool reverseSort = false)
250 {
251 int direction = 1;
252 if (reverseSort)
253 direction = -1;
254
255 foreach (SCR_PlayerListEntry entry : m_aEntries)
256 {
257 SCR_ScoreInfo score = entry.m_Info;
258 if (score)
259 entry.m_wRow.SetZOrder(score.m_iDeaths * direction);
260 }
261 }
262
263 //------------------------------------------------------------------------------------------------
264 void SortByScore(bool reverseSort = false)
265 {
266 int direction = 1;
267 if (reverseSort)
268 direction = -1;
269
270 foreach (SCR_PlayerListEntry entry : m_aEntries)
271 {
272 SCR_ScoreInfo info = entry.m_Info;
273 if (info)
274 {
275 int score;
276 if (m_ScoringSystem)
277 score = m_ScoringSystem.GetPlayerScore(entry.m_iID);
278 else
279 score = 0;
280
281 entry.m_wRow.SetZOrder(score * direction);
282 }
283 }
284 }
285
286 //------------------------------------------------------------------------------------------------
287 void OnBlock(SCR_InputButtonComponent comp, string actionName)
288 {
290 return;
291
293 m_BlockCallback.SetOnError(OnBlockError);
294 m_BlockCallback.SetOnSuccess(OnBlockSuccess);
295 GameBlocklist blckList = GetGame().GetGameBlocklist();
296 blckList.Block(m_BlockCallback, m_SelectedEntry.m_iID);
297 }
298
299 //------------------------------------------------------------------------------------------------
300 void OnUnblock(SCR_InputButtonComponent comp, string actionName)
301 {
303 return;
304
306 m_BlockCallback.SetOnError(OnBlockError);
307 m_BlockCallback.SetOnSuccess(OnBlockSuccess);
308 GameBlocklist blckList = GetGame().GetGameBlocklist();
309 blckList.Unblock(m_BlockCallback, m_SelectedEntry.m_iID);
310 }
311
312 //------------------------------------------------------------------------------------------------
313 void OnMute()
314 {
315 if (!m_SelectedEntry)
316 return;
317
319 mute.SetToggled(!mute.IsToggled());
320 }
321
322 //------------------------------------------------------------------------------------------------
323 void OnTabChanged(SCR_TabViewComponent comp, Widget w, int selectedTab)
324 {
325 if (selectedTab < 0)
326 return;
327
328 Faction faction = null;
329 foreach (Faction playableFaction : m_aFactions)
330 {
331 if (comp.GetShownTabComponent().m_sTabButtonContent == playableFaction.GetFactionName())
332 faction = playableFaction;
333 }
334
335 int lowestZOrder = int.MAX;
336 foreach (SCR_PlayerListEntry entry : m_aEntries)
337 {
338 if (!entry.m_wRow)
339 continue;
340
341 //if the tab is the first one, it's the All tab for now
342 if (comp.GetShownTab() == 0)
343 entry.m_wRow.SetVisible(true);
344 else if (entry.IsPartOfFaction(faction))
345 entry.m_wRow.SetVisible(true);
346 else
347 entry.m_wRow.SetVisible(false);
348 }
349
350 if (m_Header)
351 m_Header.SetCurrentSortElement(DEFAULT_SORT_INDEX, ESortOrder.ASCENDING, useDefaultSortOrder: true);
353 }
354
355 //------------------------------------------------------------------------------------------------
356 void OnBack()
357 {
358 Close();
359 }
360
361 //------------------------------------------------------------------------------------------------
362 void OnVoting()
363 {
364 if (!m_SelectedEntry)
365 return;
366
367 SCR_ComboBoxComponent comp = m_SelectedEntry.m_PlayerActionList;
368 if (!comp)
369 return;
370
371 if (comp.IsOpened())
372 comp.CloseList();
373 else
374 comp.OpenList();
375 }
376
377 //------------------------------------------------------------------------------------------------
378 void OnInvite()
379 {
380 if (!m_SelectedEntry)
381 return;
382 SCR_PlayerControllerGroupComponent.GetLocalPlayerControllerGroupComponent().InvitePlayer(m_SelectedEntry.m_iID);
383 }
384
385 //------------------------------------------------------------------------------------------------
386 protected void OnViewProfile()
387 {
388 if (!m_SelectedEntry)
389 return;
390
391 GetGame().GetPlayerManager().ShowUserProfile(m_SelectedEntry.m_iID);
392 }
393
394 //------------------------------------------------------------------------------------------------
396 {
398 return;
399
400 int id = -1;
401 foreach (SCR_PlayerListEntry entry : m_aEntries)
402 {
403 if (entry.m_Mute != comp)
404 continue;
405
406 id = entry.m_iID;
407 break;
408 }
409
410 if (id < 0)
411 return;
412
413 m_SocialComponent.SetMuted(id, state);
415 }
416
417 //------------------------------------------------------------------------------------------------
418 void OnEntryFocused(notnull Widget w)
419 {
420 foreach (SCR_PlayerListEntry entry : m_aEntries)
421 {
422 if (!entry)
423 continue;
424
425 Widget row = entry.m_wRow;
426 if (row != w)
427 continue;
428
429 m_SelectedEntry = entry;
430 break;
431 }
432
433 bool enablePlayerOptionList = CanOpenPlayerActionList(m_SelectedEntry);
434
435 if (m_SelectedEntry && m_SelectedEntry.m_PlayerActionList)
436 m_SelectedEntry.m_PlayerActionList.SetEnabled(enablePlayerOptionList);
437
438 if (m_Vote)
439 m_Vote.SetEnabled(enablePlayerOptionList);
440
442 m_Invite.SetEnabled(m_PlayerGroupController.CanInvitePlayer(m_SelectedEntry.m_iID));
443
444 if (m_SelectedEntry)
447 }
448
449 //------------------------------------------------------------------------------------------------
451 {
453 }
454
455 //------------------------------------------------------------------------------------------------
457 {
458 Widget firstEntry;
459 int lowestZOrder = int.MAX;
460 foreach (SCR_PlayerListEntry entry : m_aEntries)
461 {
462 if (!entry.m_wRow.IsVisible())
463 continue;
464
465 int z = entry.m_wRow.GetZOrder();
466 if (z < lowestZOrder)
467 {
468 lowestZOrder = z;
469 firstEntry = entry.m_wRow;
470 }
471 }
472
473 if (firstEntry)
474 GetGame().GetWorkspace().SetFocusedWidget(firstEntry);
475 }
476
477 //------------------------------------------------------------------------------------------------
478 protected void UpdateViewProfileButton(int playerId, bool forceHidden = false)
479 {
480 if (!m_ViewProfile)
481 return;
482
483 bool isLocal = IsLocalPlayer(playerId);
484 bool isProfileAvailable = GetGame().GetPlayerManager().IsUserProfileAvailable(playerId);
485
486 m_ViewProfile.SetVisible(!forceHidden && !isLocal && isProfileAvailable, false);
487 }
488
489 //------------------------------------------------------------------------------------------------
490 protected void SetupPlayerActionList(notnull SCR_ComboBoxComponent combo)
491 {
493 return;
494
495 combo.ClearAll();
496
498
499 int playerID = GetVotingPlayerID(combo);
500 SCR_VotingUIInfo info;
501 array<EVotingType> votingTypes = {};
502 for (int i, count = m_VotingManager.GetVotingsAboutPlayer(playerID, votingTypes, true, true); i < count; i++)
503 {
504 EVotingType votingType = votingTypes[i];
505 info = m_VotingManager.GetVotingInfo(votingType);
506
507 if (!info)
508 {
509 Print("'SCR_PlayerListMenu' function 'SetupPlayerActionList' could not find votingInfo for vote: '" + typename.EnumToString(EVotingType, votingType) + "' is it added to the voting component?", LogLevel.ERROR);
510 continue;
511 }
512
513 if (!m_VotingManager.IsVoting(votingType, playerID))
514 {
515 int cooldown = m_VotingManager.GetCurrentVoteCooldownForLocalPlayer(votingType);
516
517 //--- Voting not in progress, start it
518 if (cooldown <= 0)
519 {
520 combo.AddItem(info.GetStartVotingName(), false, new SCR_PlayerListComboEntryData(votingType, SCR_EPlayerListComboAction.START_VOTE));
521 }
522 //~ Currently the player cannot vote as there is a cooldown
523 else
524 {
525 combo.AddItem(WidgetManager.Translate(m_VotingManager.VOTE_TIMEOUT_FORMAT, info.GetStartVotingName(), SCR_FormatHelper.GetTimeFormatting(cooldown, ETimeFormatParam.DAYS | ETimeFormatParam.HOURS)), false, new SCR_PlayerListComboEntryData(votingType, SCR_EPlayerListComboAction.START_VOTE));
526 m_mVotingTypesOnCooldown.Insert(votingType, combo.GetNumItems() -1);
527 }
528 }
529 //--- Voting in progress
530 else
531 {
532 //~ Did cast a vote, withdraw it
533 if (m_VoterComponent.DidVote(votingType, playerID))
534 {
535 int currentVotes, VotesRequired;
536 if (m_VotingManager.GetVoteCounts(votingType, playerID, currentVotes, VotesRequired))
537 combo.AddItem(WidgetManager.Translate(VOTING_PLAYER_COUNT_FORMAT, info.GetCancelVotingName(), currentVotes, VotesRequired), false, new SCR_PlayerListComboEntryData(votingType, SCR_EPlayerListComboAction.CANCEL_VOTE));
538 else
539 combo.AddItem(info.GetCancelVotingName(), false, new SCR_PlayerListComboEntryData(votingType, SCR_EPlayerListComboAction.CANCEL_VOTE));
540 }
541 else
542 {
543 //~ The player did not abstain from voting
544 if (!m_VoterComponent.HasAbstained(votingType, playerID))
545 {
546 //~ Did not cast a vote, do it or abstain from doing it
547 int currentVotes, VotesRequired;
548 if (m_VotingManager.GetVoteCounts(votingType, playerID, currentVotes, VotesRequired))
549 {
550 combo.AddItem(WidgetManager.Translate(VOTING_PLAYER_COUNT_FORMAT, info.GetName(), currentVotes, VotesRequired), false, new SCR_PlayerListComboEntryData(votingType, SCR_EPlayerListComboAction.VOTE));
551 combo.AddItem(info.GetAbstainVoteName(), false, new SCR_PlayerListComboEntryData(votingType, SCR_EPlayerListComboAction.ABSTAIN_VOTE));
552 }
553 else
554 {
555 combo.AddItem(info.GetName(), false, new SCR_PlayerListComboEntryData(votingType, SCR_EPlayerListComboAction.VOTE));
556 combo.AddItem(info.GetAbstainVoteName(), false, new SCR_PlayerListComboEntryData(votingType, SCR_EPlayerListComboAction.ABSTAIN_VOTE));
557 }
558 }
559 //~ The Player abstained from voting. Revote again
560 else
561 {
562 int currentVotes, VotesRequired;
563 if (m_VotingManager.GetVoteCounts(votingType, playerID, currentVotes, VotesRequired))
564 combo.AddItem(WidgetManager.Translate(VOTING_PLAYER_COUNT_FORMAT, info.GetRevoteName(), currentVotes, VotesRequired), false, new SCR_PlayerListComboEntryData(votingType, SCR_EPlayerListComboAction.VOTE));
565 else
566 combo.AddItem(info.GetRevoteName(), false, new SCR_PlayerListComboEntryData(votingType, SCR_EPlayerListComboAction.VOTE));
567 }
568 }
569 }
570 }
571
572 //~ Group actions
573 SCR_GroupsManagerComponent groupManager = SCR_GroupsManagerComponent.GetInstance();
574 if (groupManager)
575 {
576 SCR_AIGroup group = groupManager.GetPlayerGroup(SCR_PlayerController.GetLocalPlayerId());
577 if (group)
578 {
579 array<int> requesters = {};
580 group.GetRequesterIDs(requesters);
581
582 if (requesters.Contains(playerID))
583 {
584 combo.AddItem(OPTIONS_COMBO_ACCEPT, false, new SCR_PlayerListComboEntryData(SCR_EPlayerListComboType.GROUP, SCR_EPlayerListComboAction.COMFIRM_JOIN_PRIVATE_GROUP));
585 combo.AddItem(OPTIONS_COMBO_CANCEL, false, new SCR_PlayerListComboEntryData(SCR_EPlayerListComboType.GROUP, SCR_EPlayerListComboAction.CANCEL_JOIN_PRIVATE_GROUP));
586 }
587 else if (m_PlayerGroupController.CanInvitePlayer(playerID))
588 combo.AddItem(INVITE_PLAYER_VOTE, false, new SCR_PlayerListComboEntryData(SCR_EPlayerListComboType.GROUP, SCR_EPlayerListComboAction.INVITE_TO_GROUP));
589 }
590 }
591
592 bool isLocalPlayer = IsLocalPlayer(playerID);
593
594 //~ Reporting action
595 if (!isLocalPlayer)
596 combo.AddItem("#AR-Report_Dialog_Title", false,
597 new SCR_PlayerListComboEntryData(SCR_EPlayerListComboType.REPORT,
598 SCR_EPlayerListComboAction.REPORT_PLAYER
599 )
600 );
601
602 //Blockin system action
603 //~ Reporting action
604 if (!isLocalPlayer)
605 {
606 if (!m_SocialComponent.IsBlocked(playerID))
607 {
608 combo.AddItem("#AR-PlayerList_Block", false,
610 SCR_EPlayerListComboType.BLOCK,
611 SCR_EPlayerListComboAction.BLOCK_PLAYER
612 )
613 );
614 }
615 else if (m_SocialComponent.CanUnblock(playerID))
616 {
617 combo.AddItem("#AR-PlayerList_Unblock", false,
619 SCR_EPlayerListComboType.BLOCK,
620 SCR_EPlayerListComboAction.UNBLOCK_PLAYER
621 )
622 );
623 }
624 }
625
626 //~ Update any votes that have a cooldown
627 if (!m_mVotingTypesOnCooldown.IsEmpty())
628 {
629 //~ Disable the HUD elements of the votes that are disabled
630 foreach (EVotingType votingType, int index : m_mVotingTypesOnCooldown)
631 {
632 combo.SetElementWidgetEnabled(index, false, false);
633 }
634
635 UpdatePlayerActionList(combo , false);
636 GetGame().GetCallqueue().CallLater(UpdatePlayerActionList, 1000, true, combo, true);
637 }
638 }
639
640 //------------------------------------------------------------------------------------------------
641 protected void UpdatePlayerActionList(notnull SCR_ComboBoxComponent combo, bool isCallqueue)
642 {
643 //~ Check if there is a combo and any votes have a cooldown
644 if (m_mVotingTypesOnCooldown.IsEmpty())
645 {
646 if (isCallqueue)
647 GetGame().GetCallqueue().Remove(UpdatePlayerActionList);
648
649 return;
650 }
651
652 //~ Check if combo has elements
653 array<Widget> elementWidgets = {};
654 combo.GetElementWidgets(elementWidgets);
655
656 if (elementWidgets.IsEmpty())
657 {
658 if (isCallqueue)
659 GetGame().GetCallqueue().Remove(UpdatePlayerActionList);
660
661 return;
662 }
663
664 int cooldown;
665 SCR_VotingUIInfo info;
666
667 array<EVotingType> votingTypesToRemove = {};
668 TextWidget textWidget;
669
670 //~ For each disbled voting entry
671 foreach (EVotingType votingType, int index : m_mVotingTypesOnCooldown)
672 {
673 info = m_VotingManager.GetVotingInfo(votingType);
674 if (!info)
675 continue;
676
677 cooldown = m_VotingManager.GetCurrentVoteCooldownForLocalPlayer(votingType);
678
679 //~ Entry still disabled so update the timer
680 if (cooldown > 0)
681 {
682 if (!elementWidgets.IsIndexValid(index))
683 continue;
684
685 textWidget = TextWidget.Cast(elementWidgets[index].FindAnyWidget("Text"));
686 if (!textWidget)
687 continue;
688
689 textWidget.SetTextFormat(m_VotingManager.VOTE_TIMEOUT_FORMAT, info.GetStartVotingName(), SCR_FormatHelper.GetTimeFormatting(cooldown, ETimeFormatParam.DAYS | ETimeFormatParam.HOURS));
690 }
691 //~ Voting is possible so set the entry active
692 else
693 {
694 votingTypesToRemove.Insert(votingType);
695 combo.SetElementWidgetEnabled(index, true, true);
696
697 if (!elementWidgets.IsIndexValid(index))
698 continue;
699
700 textWidget = TextWidget.Cast(elementWidgets[index].FindAnyWidget("Text"));
701 if (!textWidget)
702 continue;
703
704 textWidget.SetText(info.GetStartVotingName());
705 }
706 }
707
708 //~ Any entries that need to be removed
709 foreach (EVotingType votingType : votingTypesToRemove)
710 {
711 m_mVotingTypesOnCooldown.Remove(votingType);
712 }
713
714 //~ No longer any votes with active cooldowns
715 if (isCallqueue && m_mVotingTypesOnCooldown.IsEmpty())
716 GetGame().GetCallqueue().Remove(UpdatePlayerActionList);
717 }
718
719 //------------------------------------------------------------------------------------------------
720 protected void OnComboBoxConfirm(notnull SCR_ComboBoxComponent combo, int index)
721 {
722 if (!m_VoterComponent)
723 return;
724
725 int playerID = GetVotingPlayerID(combo);
726
727 SCR_PlayerListComboEntryData comboData = SCR_PlayerListComboEntryData.Cast(combo.GetItemData(index));
728 if (comboData)
729 {
730 switch (comboData.GetComboEntryAction())
731 {
733 {
734 m_VoterComponent.Vote(comboData.GetComboEntryType(), playerID);
735 break;
736 }
737 case SCR_EPlayerListComboAction.CANCEL_VOTE:
738 {
739 if (m_VoterComponent.DidVote(comboData.GetComboEntryType(), playerID))
740 m_VoterComponent.RemoveVote(comboData.GetComboEntryType(), playerID);
741
742 break;
743 }
744 case SCR_EPlayerListComboAction.ABSTAIN_VOTE:
745 {
746 m_VoterComponent.AbstainVote(comboData.GetComboEntryType(), playerID);
747 break;
748 }
749 case SCR_EPlayerListComboAction.INVITE_TO_GROUP:
750 {
751 SCR_PlayerControllerGroupComponent groupComponent = SCR_PlayerControllerGroupComponent.GetLocalPlayerControllerGroupComponent();
752 if (groupComponent)
753 groupComponent.InvitePlayer(playerID);
754
755 break;
756 }
757 case SCR_EPlayerListComboAction.COMFIRM_JOIN_PRIVATE_GROUP:
758 {
759 m_PlayerGroupController.AcceptJoinPrivateGroup(playerID, true);
760 break;
761 }
762 case SCR_EPlayerListComboAction.CANCEL_JOIN_PRIVATE_GROUP:
763 {
764 m_PlayerGroupController.AcceptJoinPrivateGroup(playerID, false);
765 break;
766 }
767 case SCR_EPlayerListComboAction.REPORT_PLAYER:
768 {
769 new SCR_ReportPlayerDialog(playerID);
770 break;
771 }
772 case SCR_EPlayerListComboAction.BLOCK_PLAYER:
773 {
774 OnBlock(null, string.Empty);
775 break;
776 }
777 case SCR_EPlayerListComboAction.UNBLOCK_PLAYER:
778 {
779 OnUnblock(null, string.Empty);
780 break;
781 }
782 }
783 }
784
785 combo.SetCurrentItem(-1, false, false);
786 }
787
788 //------------------------------------------------------------------------------------------------
790 {
791 for (int i, count = m_aEntries.Count(); i < count; i++)
792 {
793 if (m_aEntries[i].m_PlayerActionList == combo)
794 return m_aEntries[i].m_iID;
795 }
796 return 0;
797 }
798
799 //------------------------------------------------------------------------------------------------
801 {
802 SCR_GroupsManagerComponent groupManager = SCR_GroupsManagerComponent.GetInstance();
803 if (!groupManager)
804 return;
805
806 SCR_AIGroup group = groupManager.GetPlayerGroup(m_PlayerController.GetPlayerId());
807 if (!group)
808 return;
809
810 array<int> requesters = {};
811 array<string> reqNames = {};
812
813 group.GetRequesterIDs(requesters);
814
815 foreach (int req : requesters)
816 {
817 reqNames.Insert(SCR_PlayerNamesFilterCache.GetInstance().GetPlayerDisplayName(req));
818 }
819
820 if (!requesters.Contains(m_SelectedEntry.m_iID))
821 return;
822
823 Widget w = GetGame().GetWorkspace().FindAnyWidget("Button");
824
826 if (!button)
827 return;
828
829 ImageWidget background = ImageWidget.Cast(m_SelectedEntry.m_wRow.FindAnyWidget("Background"));
830
831 background.SetColor(color);
832 }
833
834 //------------------------------------------------------------------------------------------------
835 void CreateEntry(int id, SCR_PlayerDelegateEditorComponent editorDelegateManager)
836 {
837 //check for existing entry, return if it exists already
838 foreach (SCR_PlayerListEntry entry : m_aEntries)
839 {
840 if (entry.m_iID == id)
841 return;
842 }
843
844 ImageWidget badgeTop, badgeMiddle, badgeBottom;
845
846 Widget w = GetGame().GetWorkspace().CreateWidgets(m_sScoreboardRow, m_wTable);
847 if (!w)
848 return;
849
850 SCR_PlayerListEntry entry = new SCR_PlayerListEntry();
851 entry.m_iID = id;
852 entry.m_wRow = w;
853
854 //--- Initialize voting combo box
855 entry.m_PlayerActionList = SCR_ComboBoxComponent.GetComboBoxComponent("VotingCombo", w);
856 if (m_VotingManager)
857 {
858 entry.m_PlayerActionList.m_OnOpened.Insert(SetupPlayerActionList);
859 entry.m_PlayerActionList.m_OnChanged.Insert(OnComboBoxConfirm);
860 entry.m_PlayerActionList.SetEnabled(CanOpenPlayerActionList(entry));
861
862 entry.m_wVotingNotification = entry.m_wRow.FindAnyWidget("VotingNotification");
863 entry.m_wVotingNotification.SetVisible(IsVotedAbout(entry));
864 }
865 else
866 {
867 entry.m_PlayerActionList.SetVisible(false);
868 }
869
871 if (handler)
872 {
873 handler.m_OnFocus.Insert(OnEntryFocused);
874 handler.m_OnFocusLost.Insert(OnEntryFocusLost);
875 }
876
878 {
879 foreach (int playerId, SCR_ScoreInfo info : m_aAllPlayersInfo)
880 {
881 if (!info || playerId != id)
882 continue;
883
884 entry.m_Info = info;
885 break;
886 }
887 }
888
889 // Find faction
890 SCR_FactionManager factionManager = SCR_FactionManager.Cast(GetGame().GetFactionManager());
891 if (factionManager)
892 {
893 Faction faction = factionManager.GetPlayerFaction(entry.m_iID);
894 entry.m_Faction = faction;
895 }
896
897 Widget factionImage = w.FindAnyWidget("FactionImage");
898
899 if (factionImage)
900 {
901 if (entry.m_Faction)
902 factionImage.SetColor(entry.m_Faction.GetFactionColor());
903 else
904 factionImage.SetVisible(false);
905 }
906
907 entry.m_wName = TextWidget.Cast(w.FindAnyWidget("PlayerName"));
908
909 if (entry.m_wName)
910 {
911 entry.m_wName.SetText(SCR_PlayerNamesFilterCache.GetInstance().GetPlayerDisplayName(id));
912 if (entry.m_iID == m_PlayerController.GetPlayerId())
913 entry.m_wName.SetColor(m_PlayerNameSelfColor);
914 }
915
916 if (editorDelegateManager)
917 {
918 SCR_EditablePlayerDelegateComponent playerEditorDelegate = editorDelegateManager.GetDelegate(id);
919
920 if (playerEditorDelegate)
921 {
922 playerEditorDelegate.GetOnLimitedEditorChanged().Insert(OnEditorRightsChanged);
923 UpdateGameMasterIndicator(entry, playerEditorDelegate.HasLimitedEditor());
924 }
925 }
926
927 SCR_Faction scrFaction = SCR_Faction.Cast(entry.m_Faction);
928 if (scrFaction)
929 {
930 SCR_FactionCommanderHandlerComponent commanderHandler = SCR_FactionCommanderHandlerComponent.GetInstance();
931
932 if (scrFaction.GetParent())
933 entry.m_ParentFaction = scrFaction.GetParent();
934
935 if (commanderHandler)
936 {
937 ToggleCommanderIndicator(entry, scrFaction.GetCommanderId() == entry.m_iID);
938 commanderHandler.GetOnFactionCommanderChanged().Insert(OnFactionCommanderChanged);
939 }
940 }
941
942 entry.m_wFreq = TextWidget.Cast(w.FindAnyWidget("Freq"));
943 entry.m_wKills = TextWidget.Cast(w.FindAnyWidget("Kills"));
944 entry.m_wDeaths = TextWidget.Cast(w.FindAnyWidget("Deaths"));
945 entry.m_wScore = TextWidget.Cast(w.FindAnyWidget("Score"));
946 if (entry.m_Info)
947 {
948 if (entry.m_wKills)
949 entry.m_wKills.SetText(entry.m_Info.m_iKills.ToString());
950 if (entry.m_wDeaths)
951 entry.m_wDeaths.SetText(entry.m_Info.m_iDeaths.ToString());
952 if (entry.m_wScore)
953 {
954 // Use modifiers from scoring system where applicable!!!
955 int score;
956 if (m_ScoringSystem)
957 score = m_ScoringSystem.GetPlayerScore(id);
958
959 entry.m_wScore.SetText(score.ToString());
960 }
961 }
962 else
963 {
964
965 if (entry.m_wKills)
966 entry.m_wKills.SetText("");
967 if (entry.m_wDeaths)
968 entry.m_wDeaths.SetText("");
969 if (entry.m_wScore)
970 entry.m_wScore.SetText("");
971 }
972
973 entry.m_Mute = SCR_ButtonBaseComponent.GetButtonBase("Mute", w);
974 entry.m_wTaskIcon = entry.m_wRow.FindAnyWidget("TaskIcon");
975 entry.m_wBlockedIcon = entry.m_wRow.FindAnyWidget("BlockedIcon");
976 entry.m_wLoadoutIcon = ImageWidget.Cast(entry.m_wRow.FindAnyWidget("LoadoutIcon"));
977 entry.m_wPlatformIcon = ImageWidget.Cast(entry.m_wRow.FindAnyWidget("PlatformIcon"));
978
979 ImageWidget background = ImageWidget.Cast(w.FindAnyWidget("Background"));
980 SCR_GroupsManagerComponent groupManager = SCR_GroupsManagerComponent.GetInstance();
981 if (!groupManager)
982 return;
983
984 SCR_AIGroup group = groupManager.GetPlayerGroup(m_PlayerController.GetPlayerId());
985
986 // Saphyr TODO: temporary before definition from art dept.
987 if (group && group.HasRequesterID(id))
988 background.SetColor(m_PlayerNameSelfColor);
989
990 SCR_TaskSystem taskSystem = SCR_TaskSystem.GetInstance();
991 if (entry.m_wTaskIcon && taskSystem)
992 {
993 SCR_TaskExecutor taskExecutor = SCR_TaskExecutor.FromPlayerID(entry.m_iID);
994 if (taskSystem.GetTaskAssignedTo(taskExecutor))
995 {
996 entry.m_wTaskIcon.SetColor(entry.m_Faction.GetFactionColor());
997 }
998 else
999 {
1000 entry.m_wTaskIcon.SetOpacity(0);
1001 }
1002 }
1003
1004 Faction playerFaction;
1005 Faction entryPlayerFaction;
1006 if (factionManager)
1007 {
1008 playerFaction = factionManager.GetPlayerFaction(m_PlayerController.GetPlayerId());
1009 entryPlayerFaction = factionManager.GetPlayerFaction(entry.m_iID);
1010 }
1011
1012
1013 SCR_BasePlayerLoadout playerLoadout;
1014 SCR_LoadoutManager loadoutManager = GetGame().GetLoadoutManager();
1015 if (loadoutManager)
1016 playerLoadout = loadoutManager.GetPlayerLoadout(entry.m_iID);
1017
1018
1019 if (entry.m_wBlockedIcon && m_SocialComponent)
1020 entry.m_wBlockedIcon.SetOpacity(m_SocialComponent.IsBlocked(entry.m_iID));
1021
1022 if (entry.m_wLoadoutIcon && (playerFaction != entryPlayerFaction))
1023 entry.m_wLoadoutIcon.SetVisible(false);
1024
1025 // Enable GM to see everyones loadout icon, temporary solution until we get improved ways to say who's GM
1026 if (SCR_EditorManagerEntity.IsOpenedInstance())
1027 entry.m_wLoadoutIcon.SetVisible(true);
1028
1029 if (entry.m_wLoadoutIcon && playerLoadout && entry.m_wLoadoutIcon.IsVisible())
1030 {
1031 Resource res = Resource.Load(playerLoadout.GetLoadoutResource());
1032 IEntityComponentSource source = SCR_BaseContainerTools.FindComponentSource(res, "SCR_EditableCharacterComponent");
1033 if (!source)
1034 return;
1035 BaseContainer container = source.GetObject("m_UIInfo");
1036 SCR_EditableEntityUIInfo info = SCR_EditableEntityUIInfo.Cast(BaseContainerTools.CreateInstanceFromContainer(container));
1037 info.SetIconTo(entry.m_wLoadoutIcon);
1038 }
1039
1040 if (entry.m_wPlatformIcon)
1041 {
1043 if (playerController)
1044 playerController.SetPlatformImageTo(entry.m_iID, entry.m_wPlatformIcon, showOnPC: true, showOnXbox: true)
1045 }
1046
1047 badgeTop = ImageWidget.Cast(entry.m_wRow.FindAnyWidget("BadgeTop"));
1048 badgeMiddle = ImageWidget.Cast(entry.m_wRow.FindAnyWidget("BadgeMiddle"));
1049 badgeBottom = ImageWidget.Cast(entry.m_wRow.FindAnyWidget("BadgeBottom"));
1050 Color factionColor;
1051
1052 if (badgeTop && badgeMiddle && badgeBottom && entry.m_Faction)
1053 {
1054 factionColor = entry.m_Faction.GetFactionColor();
1055 badgeTop.SetColor(factionColor);
1056 badgeMiddle.SetColor(factionColor);
1057 badgeBottom.SetColor(factionColor);
1058 }
1059
1060 // Handle mute icon/action based on blocked state
1061 if (m_SocialComponent && !IsLocalPlayer(entry.m_iID))
1062 {
1063 // Fore "muted" for blocked players
1064 if (m_SocialComponent.IsBlocked(entry.m_iID))
1065 {
1066 entry.m_Mute.SetEnabled(false);
1067 entry.m_Mute.SetToggled(true);
1068 }
1069 else
1070 {
1071 entry.m_Mute.SetEnabled(true);
1072 entry.m_Mute.SetToggled(m_SocialComponent.IsMuted(entry.m_iID));
1073 }
1074 entry.m_Mute.m_OnToggled.Insert(OnMuteClick);
1075 }
1076
1077 m_aEntries.Insert(entry);
1078 }
1079
1080 //------------------------------------------------------------------------------------------------
1081 protected void OnEditorRightsChanged(int playerID, bool newLimited)
1082 {
1083 foreach (SCR_PlayerListEntry entry : m_aEntries)
1084 {
1085 if (entry.m_iID == playerID)
1086 {
1087 UpdateGameMasterIndicator(entry, newLimited);
1088 break;
1089 }
1090 }
1091 }
1092
1093 //------------------------------------------------------------------------------------------------
1094 protected void UpdateGameMasterIndicator(notnull SCR_PlayerListEntry entry, bool editorIslimited)
1095 {
1096 Widget gameMasterIndicator = entry.m_wRow.FindAnyWidget(m_sGameMasterIndicatorName);
1097 if (gameMasterIndicator)
1098 gameMasterIndicator.SetVisible(!editorIslimited);
1099 }
1100
1101 //------------------------------------------------------------------------------------------------
1102 // IsLocalPlayer would be better naming
1103 protected bool IsLocalPlayer(int id)
1104 {
1105 if (id <= 0)
1106 return false;
1107
1109 }
1110
1111 //------------------------------------------------------------------------------------------------
1112 void RemoveEntry(notnull SCR_PlayerListEntry entry)
1113 {
1114 if (entry.m_wRow)
1115 entry.m_wRow.RemoveFromHierarchy();
1116
1118
1119 //Remove the subscription to player right changed
1120 if (editorDelegateManager)
1121 {
1122 SCR_EditablePlayerDelegateComponent playerEditorDelegate = editorDelegateManager.GetDelegate(entry.m_iID);
1123
1124 if (playerEditorDelegate)
1125 {
1126 playerEditorDelegate.GetOnLimitedEditorChanged().Remove(OnEditorRightsChanged);
1127 }
1128 }
1129
1130 m_aEntries.RemoveItem(entry);
1131 }
1132
1133 //------------------------------------------------------------------------------------------------
1134 protected void OnVotingChanged(EVotingType type, int value, int playerID)
1135 {
1136 UpdateVoting();
1137 }
1138 protected void GetOnVotingStart(EVotingType type, int value)
1139 {
1140 UpdateVoting();
1141 }
1142 protected void UpdateVoting()
1143 {
1144 foreach (SCR_PlayerListEntry entry : m_aEntries)
1145 {
1146 entry.m_PlayerActionList.SetEnabled(CanOpenPlayerActionList(entry));
1147 entry.m_wVotingNotification.SetVisible(IsVotedAbout(entry));
1148 }
1149
1150 if (m_SelectedEntry)
1152 }
1153 protected bool IsVotedAbout(SCR_PlayerListEntry entry)
1154 {
1155 if (!entry || !m_VotingManager)
1156 return false;
1157
1158 array<EVotingType> votingTypes = {};
1159 int count = m_VotingManager.GetVotingsAboutPlayer(entry.m_iID, votingTypes, false, true);
1160 int validEntries = count;
1161
1162 //~ Remove any votes that cannot be shown to the player. Eg faction specific votes
1163 foreach (EVotingType voteType : votingTypes)
1164 {
1165 if (!m_VotingManager.IsVotingAvailable(voteType, entry.m_iID))
1166 validEntries--;
1167 }
1168
1169 return validEntries > 0;
1170 }
1171
1172 protected bool CanOpenPlayerActionList(notnull SCR_PlayerListEntry entry)
1173 {
1174 if (m_VotingManager)
1175 {
1176 //~ Check if can vote, if yes return true
1177 array<EVotingType> votingTypes = {};
1178 m_VotingManager.GetVotingsAboutPlayer(entry.m_iID, votingTypes, true, true);
1179
1180 //~ Check if UI info can be found
1181 foreach(EVotingType votingType : votingTypes)
1182 {
1183 if (m_VotingManager.GetVotingInfo(votingType))
1184 return true;
1185 }
1186 }
1187
1188 //~ Can invite the player so return true
1189 if (m_PlayerGroupController.CanInvitePlayer(entry.m_iID))
1190 return true;
1191
1192 //~ Check if Player actions have group dropdown
1193 SCR_GroupsManagerComponent groupManager = SCR_GroupsManagerComponent.GetInstance();
1194 if (groupManager)
1195 {
1196 //~ No group so no drop down
1197 SCR_AIGroup group = groupManager.GetPlayerGroup(SCR_PlayerController.GetLocalPlayerId());
1198 if (group)
1199 {
1200 array<int> requesters = {};
1201 group.GetRequesterIDs(requesters);
1202
1203 if (requesters.Contains(entry.m_iID))
1204 return true;
1205 }
1206 }
1207
1208 //Check if reporting is available
1209 if (!IsLocalPlayer(entry.m_iID))
1210 return true;
1211
1212 //~ None of the conditions met
1213 return false;
1214 }
1215
1216 //------------------------------------------------------------------------------------------------
1217 private void OnPlayerAdded(int playerId)
1218 {
1219 UpdatePlayerList(true, playerId);
1220 }
1221 private void OnPlayerRemoved(int playerId)
1222 {
1223 UpdatePlayerList(false, playerId);
1224 }
1225 private void OnScoreChanged()
1226 {
1227 UpdateScore();
1228 }
1229 private void OnPlayerScoreChanged(int playerId, SCR_ScoreInfo scoreInfo)
1230 {
1231 OnScoreChanged();
1232 }
1233 private void OnFactionScoreChanged(Faction faction, SCR_ScoreInfo scoreInfo)
1234 {
1235 OnScoreChanged();
1236 }
1237
1238 //------------------------------------------------------------------------------------------------
1239 override void OnMenuOpen()
1240 {
1241 super.OnMenuOpen();
1242
1243 GameBlocklist blocklist = GetGame().GetGameBlocklist();
1244 blocklist.OnBlockListUpdateInvoker.Insert(OnBlocklistUpdate);
1245
1246 m_PlayerController = GetGame().GetPlayerController();
1248 {
1249 m_SocialComponent = SocialComponent.Cast(m_PlayerController.FindComponent(SocialComponent));
1250
1251 SCR_HUDManagerComponent hudManager = SCR_HUDManagerComponent.Cast(m_PlayerController.FindComponent(SCR_HUDManagerComponent));
1252 hudManager.SetVisibleLayers(hudManager.GetVisibleLayers() & ~EHudLayers.HIGH);
1253 }
1254
1255 SCR_BaseGameMode gameMode = SCR_BaseGameMode.Cast(GetGame().GetGameMode());
1256 if (!gameMode)
1257 return;
1258 m_PlayerGroupController = SCR_PlayerControllerGroupComponent.GetLocalPlayerControllerGroupComponent();
1259 m_VoterComponent = SCR_VoterComponent.GetInstance();
1261
1262 if (m_VotingManager)
1263 {
1264 m_VotingManager.GetOnVotingEnd().Insert(OnVotingChanged);
1265 m_VotingManager.GetOnVotingStart().Insert(GetOnVotingStart);
1266 m_VotingManager.GetOnRemoveVote().Insert(OnVotingChanged);
1267 }
1268
1269 gameMode.GetOnPlayerRegistered().Insert(OnPlayerConnected);
1270
1272 if (m_ScoringSystem)
1273 {
1274 m_ScoringSystem.GetOnPlayerAdded().Insert(OnPlayerAdded);
1275 m_ScoringSystem.GetOnPlayerRemoved().Insert(OnPlayerRemoved);
1276 m_ScoringSystem.GetOnPlayerScoreChanged().Insert(OnPlayerScoreChanged);
1277 m_ScoringSystem.GetOnFactionScoreChanged().Insert(OnFactionScoreChanged);
1278
1279 array<int> players = {};
1280 PlayerManager playerManager = GetGame().GetPlayerManager();
1281 playerManager.GetPlayers(players);
1282
1283 m_aAllPlayersInfo.Clear();
1284 foreach (int playerId : players)
1285 m_aAllPlayersInfo.Insert(playerId, m_ScoringSystem.GetPlayerScoreInfo(playerId));
1286 }
1287
1288 FactionManager fm = GetGame().GetFactionManager();
1289 if (fm)
1290 {
1291 fm.GetFactionsList(m_aFactions);
1292 }
1293
1294 m_wTable = GetRootWidget().FindAnyWidget("Table");
1295
1296 // Create navigation buttons
1297 Widget footer = GetRootWidget().FindAnyWidget("FooterLeft");
1298 Widget footerBack = GetRootWidget().FindAnyWidget("Footer");
1299 SCR_InputButtonComponent back = SCR_InputButtonComponent.GetInputButtonComponent(UIConstants.BUTTON_BACK, footerBack);
1300 if (back)
1301 back.m_OnActivated.Insert(OnBack);
1302
1303 // Setup all buttons, throw error in case of misconfigured layout.
1304 // Then do not check in other methods
1305 m_Mute = SCR_InputButtonComponent.GetInputButtonComponent("Mute", footer);
1306 if (m_Mute)
1307 {
1308 m_Mute.SetEnabled(false);
1309 m_Mute.m_OnActivated.Insert(OnMute);
1310 }
1311 else
1312 {
1313 Print("'SCR_PlayerListMenu' missing 'Mute' 'SCR_InputButtonComponent'", LogLevel.ERROR);
1314 }
1315
1316 m_Block = SCR_InputButtonComponent.GetInputButtonComponent("Block", footer);
1317 if (m_Block)
1318 {
1319 m_Block.SetEnabled(false);
1320 m_Block.m_OnActivated.Insert(OnBlock);
1321 }
1322 else
1323 {
1324 Print("'SCR_PlayerListMenu' missing 'Block' 'SCR_InputButtonComponent'", LogLevel.ERROR);
1325 }
1326
1327 m_Unblock = SCR_InputButtonComponent.GetInputButtonComponent("Unblock", footer);
1328 if (m_Unblock)
1329 {
1330 m_Unblock.m_OnActivated.Insert(OnUnblock);
1331 // Create this button hidden and disabled
1332 m_Unblock.SetVisible(false);
1333 m_Unblock.SetEnabled(false);
1334 }
1335 else
1336 {
1337 Print("'SCR_PlayerListMenu' missing 'Unblock' 'SCR_InputButtonComponent'", LogLevel.ERROR);
1338 }
1339
1340 m_Vote = SCR_InputButtonComponent.GetInputButtonComponent("Vote", footer);
1341 if (m_Vote)
1342 {
1343 if (m_VotingManager)
1344 m_Vote.m_OnActivated.Insert(OnVoting);
1345 else
1346 m_Vote.SetVisible(false,false);
1347 m_Vote.SetEnabled(false);
1348 }
1349 else
1350 {
1351 Print("'SCR_PlayerListMenu' missing 'Vote' 'SCR_InputButtonComponent'", LogLevel.ERROR);
1352 }
1353
1354 m_Invite = SCR_InputButtonComponent.GetInputButtonComponent("Invite", footer);
1355 if (m_Invite)
1356 {
1358 m_Invite.m_OnActivated.Insert(OnInvite);
1359 else
1360 m_Invite.SetVisible(false, false);
1361 m_Invite.SetEnabled(false);
1362 }
1363 else
1364 {
1365 Print("'SCR_PlayerListMenu' missing 'Invite' 'SCR_InputButtonComponent'", LogLevel.ERROR);
1366 }
1367
1368 m_ViewProfile = SCR_InputButtonComponent.GetInputButtonComponent("ViewProfile", footer);
1369 if (m_ViewProfile)
1370 {
1371 UpdateViewProfileButton(0, true);
1372 m_ViewProfile.m_OnActivated.Insert(OnViewProfile);
1373 }
1374 else
1375 {
1376 Print("'SCR_PlayerListMenu' missing 'ViewProfile' 'SCR_InputButtonComponent'", LogLevel.ERROR);
1377 }
1378
1379 SCR_InputButtonComponent filter = SCR_InputButtonComponent.GetInputButtonComponent("Filter", footer);
1380
1381 // Create table
1382 if (!m_wTable || m_sScoreboardRow == string.Empty)
1383 return;
1384
1385 //Get editor Delegate manager to check if has editor rights
1386 SCR_PlayerDelegateEditorComponent editorDelegateManager = SCR_PlayerDelegateEditorComponent.Cast(SCR_PlayerDelegateEditorComponent.GetInstance(SCR_PlayerDelegateEditorComponent));
1387
1388
1389 array<int> ids = {};
1390 GetGame().GetPlayerManager().GetPlayers(ids);
1391
1392 foreach (int id : ids)
1393 {
1394 CreateEntry(id, editorDelegateManager);
1395 }
1396
1397 InitSorting();
1398
1399 m_SuperMenuComponent.GetTabView().GetOnChanged().Insert(OnTabChanged);
1400
1401 // Create new tabs
1402 SCR_Faction scrFaction;
1403 foreach (Faction faction : m_aFactions)
1404 {
1405 if (!faction)
1406 continue;
1407
1408 scrFaction = SCR_Faction.Cast(faction);
1409 if (scrFaction && (!scrFaction.IsPlayable() || scrFaction.GetParent()))
1410 continue; //--- ToDo: Refresh dynamically when a new faction is added/removed
1411
1412 string name = faction.GetFactionName();
1413 m_SuperMenuComponent.GetTabView().AddTab(ResourceName.Empty,name);
1414
1415 AddFactionPlayerCounter(faction);
1416 }
1417
1419
1420 s_OnPlayerListMenu.Invoke(true);
1421 }
1422
1423 //------------------------------------------------------------------------------------------------
1424 override void OnMenuUpdate(float tDelta)
1425 {
1426 m_fTimeSkip = m_fTimeSkip + tDelta;
1427
1428 if (m_fTimeSkip >= TIME_STEP)
1429 {
1431 m_fTimeSkip = 0.0;
1432 }
1433
1434 GetGame().GetInputManager().ActivateContext("PlayerMenuContext");
1435 }
1436
1437 //------------------------------------------------------------------------------------------------
1438 override void OnMenuFocusGained()
1439 {
1440 GetGame().GetInputManager().AddActionListener("ShowScoreboard", EActionTrigger.DOWN, Close);
1441
1442 if (m_Header)
1443 m_Header.SetCurrentSortElement(DEFAULT_SORT_INDEX, ESortOrder.ASCENDING, useDefaultSortOrder: true);
1444
1445 // TODO: Consider not changing focus if it is already set e.g. dialog opened over
1447 }
1448
1449 //------------------------------------------------------------------------------------------------
1450 override void OnMenuFocusLost()
1451 {
1452 GetGame().GetInputManager().RemoveActionListener("ShowScoreboard", EActionTrigger.DOWN, Close);
1453
1454 //--- Close when some other menu is opened on top
1455 // Update: We do not want to close menu under the dialog
1456 //Close();
1457 }
1458
1459 //------------------------------------------------------------------------------------------------
1460 override void OnMenuClose()
1461 {
1462 super.OnMenuClose();
1463
1464 GetGame().GetGameBlocklist().OnBlockListUpdateInvoker.Insert(OnBlocklistUpdate);;
1465
1466 SCR_HUDManagerComponent hudManager = SCR_HUDManagerComponent.Cast(m_PlayerController.FindComponent(SCR_HUDManagerComponent));
1467 if (hudManager)
1468 hudManager.SetVisibleLayers(hudManager.GetVisibleLayers() | EHudLayers.HIGH);
1469
1470 SCR_PlayerDelegateEditorComponent editorDelegateManager = SCR_PlayerDelegateEditorComponent.Cast(SCR_PlayerDelegateEditorComponent.GetInstance(SCR_PlayerDelegateEditorComponent));
1471
1472 //Remove the subscriptions to player right changed
1473 if (editorDelegateManager)
1474 {
1475 foreach (SCR_PlayerListEntry entry : m_aEntries)
1476 {
1477 if (entry)
1478 {
1479 SCR_EditablePlayerDelegateComponent playerEditorDelegate = editorDelegateManager.GetDelegate(entry.m_iID);
1480
1481 if (playerEditorDelegate)
1482 {
1483 playerEditorDelegate.GetOnLimitedEditorChanged().Remove(OnEditorRightsChanged);
1484 }
1485 }
1486 }
1487 }
1488
1489 m_aAllPlayersInfo.Clear();
1490 m_aFactions.Clear();
1491
1492 if (m_ScoringSystem)
1493 {
1494 m_ScoringSystem.GetOnPlayerAdded().Remove(OnPlayerAdded);
1495 m_ScoringSystem.GetOnPlayerRemoved().Remove(OnPlayerRemoved);
1496 m_ScoringSystem.GetOnPlayerScoreChanged().Remove(OnPlayerScoreChanged);
1497 m_ScoringSystem.GetOnFactionScoreChanged().Remove(OnFactionScoreChanged);
1498 }
1499
1500 if (!m_mVotingTypesOnCooldown.IsEmpty())
1501 GetGame().GetCallqueue().Remove(UpdatePlayerActionList);
1502
1503 s_OnPlayerListMenu.Invoke(false);
1504 }
1505
1506 // Call updates with delay, so name is synced properly
1507 //------------------------------------------------------------------------------------------------
1508 void OnPlayerConnected(int id)
1509 {
1510 GetGame().GetCallqueue().CallLater(UpdatePlayerList, 1000, false, true, id);
1511 }
1512
1513 //------------------------------------------------------------------------------------------------
1514 protected void OnFactionCommanderChanged(SCR_Faction faction, int commanderPlayerId)
1515 {
1516 foreach (SCR_PlayerListEntry entry : m_aEntries)
1517 {
1518 ToggleCommanderIndicator(entry, commanderPlayerId == entry.m_iID);
1519 }
1520 }
1521
1522 //------------------------------------------------------------------------------------------------
1523 void UpdatePlayerList(bool addPlayer, int id)
1524 {
1525 if (addPlayer)
1526 {
1528 CreateEntry(id, editorDelegateManager);
1529
1530 // Get current sort method and re-apply sorting
1531 if (!m_Header)
1532 return;
1533
1535 }
1536 else
1537 {
1538 // Delete entry from the list
1539 SCR_PlayerListEntry playerEntry;
1540 foreach (SCR_PlayerListEntry entry : m_aEntries)
1541 {
1542 if (entry.m_iID != id)
1543 continue;
1544
1545 playerEntry = entry;
1546 break;
1547 }
1548
1549 if (!playerEntry)
1550 return;
1551
1552 playerEntry.m_wRow.RemoveFromHierarchy();
1553 m_aEntries.RemoveItem(playerEntry);
1554 }
1555 }
1556
1557 //------------------------------------------------------------------------------------------------
1559 {
1560 SCR_GadgetManagerComponent gadgetManager;
1562 Faction localFaction;
1563 set<int> localFrequencies = new set<int>();
1564 if (localPlayer)
1565 {
1566 gadgetManager = SCR_GadgetManagerComponent.Cast(localPlayer.FindComponent(SCR_GadgetManagerComponent));
1567 SCR_Global.GetFrequencies(gadgetManager, localFrequencies);
1568
1569 FactionAffiliationComponent factionAffiliation = FactionAffiliationComponent.Cast(localPlayer.FindComponent(FactionAffiliationComponent));
1570 if (factionAffiliation)
1571 localFaction = factionAffiliation.GetAffiliatedFaction();
1572 }
1573
1574 foreach (SCR_PlayerListEntry entry : m_aEntries)
1575 {
1576 if (entry.m_Faction == localFaction)
1577 {
1578 IEntity playerEntity = GetGame().GetPlayerManager().GetPlayerControlledEntity(entry.m_iID);
1579 if (playerEntity)
1580 {
1581 //--- ToDo: Don't extract frequencies locally; do it on server and distribute values to all clients
1582 gadgetManager = SCR_GadgetManagerComponent.Cast(playerEntity.FindComponent(SCR_GadgetManagerComponent));
1583 set<int> frequencies = new set<int>();
1584 SCR_Global.GetFrequencies(gadgetManager, frequencies);
1585 if (!frequencies.IsEmpty())
1586 {
1587 entry.m_iSortFrequency = frequencies[0];
1588 entry.m_wFreq.SetText(SCR_FormatHelper.FormatFrequencies(frequencies, localFrequencies));
1589 continue;
1590 }
1591 }
1592 }
1593 entry.m_iSortFrequency = int.MAX;
1594 entry.m_wFreq.SetText("-");
1595 }
1596 GetGame().GetCallqueue().CallLater(UpdateFrequencies, 1000, false);
1597 }
1598
1599 //------------------------------------------------------------------------------------------------
1602 {
1604 return;
1605
1606 // Self player list record handling
1607 if (IsLocalPlayer(m_SelectedEntry.m_iID))
1608 {
1609 // Show disabled block button
1610 m_Block.SetEnabled(false, false);
1611 m_Block.SetVisible(true, false);
1612
1613 // Hide unblock button
1614 m_Unblock.SetEnabled(false, false);
1615 m_Unblock.SetVisible(false, false);
1616
1617 // Disable mute
1618 m_Mute.SetEnabled(false, false);
1619
1620 GetRootWidget().Update();
1621
1622 m_SelectedEntry.m_wBlockedIcon.SetOpacity(0);
1623 m_SelectedEntry.m_Mute.SetEnabled(false);
1624 return;
1625 }
1626
1627 bool isSelectedMuted = m_SocialComponent.IsMuted(m_SelectedEntry.m_iID);
1628 bool isSelectedBlocked = m_SocialComponent.IsBlocked(m_SelectedEntry.m_iID);
1629
1630 // Update elements in selected entry
1631 m_SelectedEntry.m_wBlockedIcon.SetOpacity(isSelectedBlocked);
1632 // Force muted for blocked ones
1633 m_SelectedEntry.m_Mute.SetToggled(isSelectedBlocked || isSelectedMuted, false, false, true);
1634 m_SelectedEntry.m_Mute.SetEnabled(!isSelectedBlocked);
1635
1636 // Update buttons
1637 m_Block.SetEnabled(!isSelectedBlocked, false);
1638 m_Block.SetVisible(!isSelectedBlocked, false);
1639 // Unblock button is available only if not blocked outside of game
1640 bool canBeUnblocked = m_SocialComponent.CanUnblock(m_SelectedEntry.m_iID);
1641 m_Unblock.SetEnabled(isSelectedBlocked && canBeUnblocked, false);
1642 m_Unblock.SetVisible(isSelectedBlocked, false);
1643 // Enable muted only if not blocked
1644 m_Mute.SetEnabled(!isSelectedBlocked, false);
1645
1646 if (isSelectedMuted || isSelectedBlocked)
1647 {
1648 m_Mute.SetLabel(UNMUTE);
1649 }
1650 else
1651 {
1652 m_Mute.SetLabel(MUTE);
1653 }
1654
1655 GetRootWidget().Update();
1656 }
1657
1658 //------------------------------------------------------------------------------------------------
1660 {
1661 if (!m_aAllPlayersInfo || m_aAllPlayersInfo.Count() == 0 || !m_ScoringSystem)
1662 return;
1663
1664 foreach (SCR_PlayerListEntry entry : m_aEntries)
1665 {
1666 foreach (int playerId, SCR_ScoreInfo info : m_aAllPlayersInfo)
1667 {
1668 if (!info || playerId != entry.m_iID)
1669 continue;
1670
1671 entry.m_Info = info;
1672 break;
1673 }
1674
1675 if (!entry.m_Info)
1676 continue;
1677
1678 if (entry.m_wKills)
1679 entry.m_wKills.SetText(entry.m_Info.m_iKills.ToString());
1680 if (entry.m_wDeaths)
1681 entry.m_wDeaths.SetText(entry.m_Info.m_iDeaths.ToString());
1682 if (entry.m_wScore)
1683 {
1684 // Use modifiers from scoring system where applicable!!!
1685 int score;
1686 if (m_ScoringSystem)
1687 score = m_ScoringSystem.GetPlayerScore(entry.m_iID);
1688
1689 entry.m_wScore.SetText(score.ToString());
1690 }
1691 }
1692
1693 // Get current sort method and re-apply sorting
1694 if (!m_Header)
1695 return;
1696
1698 }
1699
1700 //------------------------------------------------------------------------------------------------
1702 {
1703 foreach (SCR_PlayerListEntry entry : m_aEntries)
1704 {
1705 if (entry.m_PlayerActionList && entry.m_PlayerActionList.IsOpened())
1706 entry.m_PlayerActionList.CloseList();
1707 }
1708 }
1709
1710 //------------------------------------------------------------------------------------------------
1712 {
1713 for (int i = m_aEntries.Count() - 1; i >= 0; i--)
1714 {
1715 if (!m_aEntries[i])
1716 continue;
1717
1718 if (!m_aEntries[i] || GetGame().GetPlayerManager().IsPlayerConnected(m_aEntries[i].m_iID))
1719 continue;
1720
1721 m_aEntries[i].m_wRow.RemoveFromHierarchy();
1722 m_aEntries.Remove(i);
1723 }
1724 }
1725
1726 //------------------------------------------------------------------------------------------------
1728 {
1729 SCR_Faction scriptedFaction = SCR_Faction.Cast(faction);
1730 if (!scriptedFaction)
1731 return;
1732
1733 Widget contentLayout = GetRootWidget().FindAnyWidget("FactionPlayerNumbersLayout");
1734 if (!contentLayout)
1735 return;
1736
1737 Widget factionTile = GetGame().GetWorkspace().CreateWidgets(FACTION_COUNTER_LAYOUT, contentLayout);
1738 if (!factionTile)
1739 return;
1740
1741 RichTextWidget playerCount = RichTextWidget.Cast(factionTile.FindAnyWidget("PlayerCount"));
1742 if (!playerCount)
1743 return;
1744
1745 ImageWidget factionFlag = ImageWidget.Cast(factionTile.FindAnyWidget("FactionFlag"));
1746 if (!factionFlag)
1747 return;
1748
1749 int x, y;
1750 factionFlag.LoadImageTexture(0, scriptedFaction.GetFactionFlag());
1751 factionFlag.GetImageSize(0, x, y);
1752 factionFlag.SetSize(x, y);
1753
1754 string playerCountText = scriptedFaction.GetPlayerCount().ToString();
1755 int playerLimit = scriptedFaction.GetPlayerLimit();
1756 if (playerLimit >= 0)
1757 playerCount.SetTextFormat("#AR-SupportStation_ActionFormat_ItemAmount", playerCountText, playerLimit);
1758 else
1759 playerCount.SetText(playerCountText);
1760 }
1761
1762 //------------------------------------------------------------------------------------------------
1763 protected void ToggleCommanderIndicator(SCR_PlayerListEntry entry, bool toggle)
1764 {
1765 ImageWidget commanderIndicator = ImageWidget.Cast(entry.m_wRow.FindAnyWidget(m_sCommanderIndicatorName));
1766
1767 if (!commanderIndicator)
1768 return;
1769
1770 if (toggle && SCR_FactionManager.SGetLocalPlayerFaction() != SCR_FactionManager.SGetPlayerFaction(entry.m_iID))
1771 toggle = false;
1772
1773 if (toggle)
1774 {
1775 commanderIndicator.LoadImageFromSet(0, "{3262679C50EF4F01}UI/Textures/Icons/icons_wrapperUI.imageset", "emote_salute");
1776 commanderIndicator.SetColor(SCR_FactionManager.SGetLocalPlayerFaction().GetFactionColor());
1777 }
1778
1779 commanderIndicator.SetVisible(toggle);
1780 }
1781
1782 //------------------------------------------------------------------------------------------------
1783
1785 private void ShowBlockErrorDialog(string dialogTag)
1786 {
1789 }
1790
1791 //------------------------------------------------------------------------------------------------
1792 private void OnBlockSuccess(BackendCallback cb)
1793 {
1794 m_BlockCallback = null;
1795 }
1796
1797 //------------------------------------------------------------------------------------------------
1798 private void OnBlockError(BackendCallback cb)
1799 {
1800 if (cb.GetBackendError() == EBackendError.EBERR_STORAGE_IS_FULL)
1801 ShowBlockErrorDialog("block_failed_full");
1802 else
1803 ShowBlockErrorDialog("block_failed_general");
1804 m_BlockCallback = null;
1805 }
1806
1807 //------------------------------------------------------------------------------------------------
1808 private void OnBlocklistUpdate(bool success)
1809 {
1810 if (!success)
1811 {
1812 ShowBlockErrorDialog("block_failed_general");
1813 return;
1814 }
1815
1816 // Possible risk/todo: We may get more information in the blocklist update
1817 // thus we should iterate all the playerlist entries and update them properly
1818 // we are now updating only focused item
1820 }
1821};
1822
1823//------------------------------------------------------------------------------------------------
1824//~ Holds the data of the player list combo entry
1826{
1827 protected SCR_EPlayerListComboType m_eComboEntryType;
1829
1830 void SCR_PlayerListComboEntryData(SCR_EPlayerListComboType comboEntryType, SCR_EPlayerListComboAction comboEntryAction)
1831 {
1832 m_eComboEntryType = comboEntryType;
1833 m_eComboEntryAction = comboEntryAction;
1834 }
1835
1839 SCR_EPlayerListComboType GetComboEntryType()
1840 {
1841 return m_eComboEntryType;
1842 }
1843
1851}
1852
1853//------------------------------------------------------------------------------------------------
1854//~ Types of combo list data entry, inherents from Voting as voting is the main type used
1855enum SCR_EPlayerListComboType : EVotingType
1856{
1857 GROUP, //~ Makes sure System knows the combo data is regarding group
1859 BLOCK
1861
1862//------------------------------------------------------------------------------------------------
1863//~ Available actions valid for the player combo box data types
AddonBuildInfoTool id
ETimeFormatParam
EVotingType
Definition EVotingType.c:2
ArmaReforgerScripted GetGame()
Definition game.c:1398
ref array< string > ids
Faction m_Faction
SCR_BaseGameMode GetGameMode()
ref SCR_HintUIInfo m_Info
SCR_CampaignFaction m_ParentFaction
EDamageType type
vector direction
SCR_DestructionSynchronizationComponentClass ScriptComponentClass int index
void SCR_EditorManagerEntity(IEntitySource src, IEntity parent)
Get all prefabs that have the spawner the given labels and are valid in the editor mode param catalogType Type to catalog to get prefabs from param editorMode Editor mode to get valid entries from param faction Faction(Optional)
void SCR_FactionManager(IEntitySource src, IEntity parent)
@ VOTE
Players will vote their own Game Master.
void SCR_GroupsManagerComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
void SCR_LoadoutManager(IEntitySource src, IEntity parent)
void OnPlayerAdded(SCR_AIGroup group, int playerId)
Widget GetRootWidget()
SCR_ButtonBaseComponent m_Mute
Widget m_wTaskIcon
SCR_EPlayerListComboAction
@ BLOCK_PLAYER
@ COMFIRM_JOIN_PRIVATE_GROUP
@ CANCEL_VOTE
@ UNBLOCK_PLAYER
@ ABSTAIN_VOTE
@ CANCEL_JOIN_PRIVATE_GROUP
@ REPORT_PLAYER
@ INVITE_TO_GROUP
SCR_PlayerListComboEntryData BLOCK
SCR_ComboBoxComponent m_PlayerActionList
Widget m_wBlockedIcon
EPlayerListTab
int m_iID
int m_iSortFrequency
ImageWidget m_wLoadoutIcon
TextWidget m_wScore
bool IsPartOfFaction(Faction faction)
ImageWidget m_wPlatformIcon
TextWidget m_wKills
TextWidget m_wName
SCR_PlayerListComboEntryData REPORT
Widget m_wRow
Widget m_wFactionImage
TextWidget m_wDeaths
TextWidget m_wFreq
Widget m_wVotingNotification
void SCR_VotingManagerComponent(IEntityComponentSource src, IEntity ent, IEntity parent)
proto native void Close()
Definition Color.c:13
proto external Managed FindComponent(typename typeName)
Object holding reference to resource. In destructor release the resource.
Definition Resource.c:25
bool HasRequesterID(int id)
int GetRequesterIDs(out array< int > valueArray)
static ScriptInvoker GetOnJoinPrivateGroupConfirm()
static ScriptInvoker GetOnJoinPrivateGroupCancel()
static const ResourceName BLOCKED_USER_DIALOG_CONFIG
SCR_BaseScoringSystemComponent GetScoringSystemComponent()
ScriptInvokerBase< SCR_BaseGameMode_PlayerId > GetOnPlayerRegistered()
Base class for any button, regardless its own content.
ref ScriptInvoker< Widget > m_OnFocusLost
void SetToggled(bool toggled, bool animate=true, bool invokeChange=true, bool instant=false)
ref ScriptInvoker< Widget > m_OnFocus
static SCR_ButtonBaseComponent GetButtonBase(string name, Widget parent, bool searchAllChildren=true)
static SCR_ConfigurableDialogUi CreateFromPreset(ResourceName presetsResourceName, string tag, SCR_ConfigurableDialogUi customDialogObj=null)
Creates a dialog from preset.
Faction GetParent()
int GetPlayerLimit()
ResourceName GetFactionFlag()
int GetCommanderId()
bool IsPlayable()
int GetPlayerCount()
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
void SetVisibleLayers(EHudLayers layers=-1)
static int GetLocalPlayerId()
Returns either a valid ID of local player or 0.
static IEntity GetLocalMainEntity()
SCR_EditablePlayerDelegateComponent GetDelegate(int playerID)
SCR_EPlayerListComboType GetComboEntryType()
SCR_EPlayerListComboType m_eComboEntryType
SCR_EPlayerListComboAction GetComboEntryAction()
SCR_EPlayerListComboAction m_eComboEntryAction
void SCR_PlayerListComboEntryData(SCR_EPlayerListComboType comboEntryType, SCR_EPlayerListComboAction comboEntryAction)
SCR_InputButtonComponent m_ViewProfile
void CreateEntry(int id, SCR_PlayerDelegateEditorComponent editorDelegateManager)
void OnMuteClick(SCR_ButtonBaseComponent comp, bool state)
void SetupPlayerActionList(notnull SCR_ComboBoxComponent combo)
void SortByScore(bool reverseSort=false)
ref BackendCallback m_BlockCallback
int GetVotingPlayerID(SCR_ComboBoxComponent combo)
void OnEditorRightsChanged(int playerID, bool newLimited)
SCR_InputButtonComponent m_Invite
static ScriptInvoker GetOnPlayerListMenu()
SCR_PlayerListEntry m_SelectedEntry
void OnEntryFocusLost(Widget w)
SocialComponent m_SocialComponent
void UpdateShownUIElements()
Updates selected player list entry and main actions/buttons.
void ToggleCommanderIndicator(SCR_PlayerListEntry entry, bool toggle)
static const ResourceName FACTION_COUNTER_LAYOUT
ref array< ref SCR_PlayerListEntry > m_aEntries
void OnUnblock(SCR_InputButtonComponent comp, string actionName)
void SortByKills(bool reverseSort=false)
SCR_PlayerControllerGroupComponent m_PlayerGroupController
void UpdatePlayerActionList(notnull SCR_ComboBoxComponent combo, bool isCallqueue)
void OnBlock(SCR_InputButtonComponent comp, string actionName)
void UpdatePlayerList(bool addPlayer, int id)
SCR_BaseScoringSystemComponent m_ScoringSystem
ref array< Faction > m_aFactions
static ref ScriptInvoker s_OnPlayerListMenu
void UpdateViewProfileButton(int playerId, bool forceHidden=false)
void OnEntryFocused(notnull Widget w)
void OnComboBoxConfirm(notnull SCR_ComboBoxComponent combo, int index)
void GetOnVotingStart(EVotingType type, int value)
void SortByFrequency(bool reverseSort=false)
void SortByDeaths(bool reverseSort=false)
void OnFactionCommanderChanged(SCR_Faction faction, int commanderPlayerId)
PlayerController m_PlayerController
void UpdateGameMasterIndicator(notnull SCR_PlayerListEntry entry, bool editorIslimited)
SCR_VoterComponent m_VoterComponent
SCR_SortHeaderComponent m_Header
SCR_VotingManagerComponent m_VotingManager
void SortByName(bool reverseSort=false)
const string OPTIONS_COMBO_ACCEPT
void AddFactionPlayerCounter(Faction faction)
void OnTabChanged(SCR_TabViewComponent comp, Widget w, int selectedTab)
ref map< EVotingType, int > m_mVotingTypesOnCooldown
SCR_InputButtonComponent m_Vote
bool CanOpenPlayerActionList(notnull SCR_PlayerListEntry entry)
const string INVITE_PLAYER_VOTE
void OnHeaderChanged(SCR_SortHeaderComponent sortHeader)
void Sort(string filterName, bool sortUp)
void RemoveEntry(notnull SCR_PlayerListEntry entry)
SCR_InputButtonComponent m_Unblock
SCR_InputButtonComponent m_Block
SCR_InputButtonComponent m_Mute
void SortByMuted(bool reverseSort=false)
bool IsVotedAbout(SCR_PlayerListEntry entry)
ResourceName m_sScoreboardRow
const string OPTIONS_COMBO_CANCEL
const string VOTING_PLAYER_COUNT_FORMAT
void OnVotingChanged(EVotingType type, int value, int playerID)
void SetEntryBackgrounColor(Color color)
ref map< int, SCR_ScoreInfo > m_aAllPlayersInfo
bool GetSortOrderAscending()
True when sort order is ASCENDING.
SCR_SuperMenuComponent m_SuperMenuComponent
override void OnMenuFocusGained()
override void OnMenuClose()
override void OnMenuOpen()
override void OnMenuFocusLost()
SCR_TabViewContent GetShownTabComponent()
string GetStartVotingName()
string GetCancelVotingName()
string GetAbstainVoteName()
Definition Types.c:486
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
Enum with severity of the logging message.
Definition LogLevel.c:14
@ GROUP
AI Group (inherited from AIGroup).
@ ALL
Everything except general switch.
Definition EntityEvent.c:37
proto external PlayerController GetPlayerController()
EActionTrigger
EBackendError
Backend error.
ScriptInvokerBase< func > ScriptInvoker
Definition tools.c:134