501 array<EVotingType> votingTypes = {};
502 for (
int i, count =
m_VotingManager.GetVotingsAboutPlayer(playerID, votingTypes,
true,
true); i < count; i++)
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);
515 int cooldown =
m_VotingManager.GetCurrentVoteCooldownForLocalPlayer(votingType);
535 int currentVotes, VotesRequired;
536 if (
m_VotingManager.GetVoteCounts(votingType, playerID, currentVotes, VotesRequired))
547 int currentVotes, VotesRequired;
548 if (
m_VotingManager.GetVoteCounts(votingType, playerID, currentVotes, VotesRequired))
562 int currentVotes, VotesRequired;
563 if (
m_VotingManager.GetVoteCounts(votingType, playerID, currentVotes, VotesRequired))
579 array<int> requesters = {};
582 if (requesters.Contains(playerID))
596 combo.AddItem(
"#AR-Report_Dialog_Title",
false,
608 combo.AddItem(
"#AR-PlayerList_Block",
false,
610 SCR_EPlayerListComboType.BLOCK,
617 combo.AddItem(
"#AR-PlayerList_Unblock",
false,
619 SCR_EPlayerListComboType.BLOCK,
632 combo.SetElementWidgetEnabled(
index,
false,
false);
653 array<Widget> elementWidgets = {};
654 combo.GetElementWidgets(elementWidgets);
656 if (elementWidgets.IsEmpty())
667 array<EVotingType> votingTypesToRemove = {};
677 cooldown =
m_VotingManager.GetCurrentVoteCooldownForLocalPlayer(votingType);
682 if (!elementWidgets.IsIndexValid(
index))
685 textWidget =
TextWidget.Cast(elementWidgets[
index].FindAnyWidget(
"Text"));
694 votingTypesToRemove.Insert(votingType);
695 combo.SetElementWidgetEnabled(
index,
true,
true);
697 if (!elementWidgets.IsIndexValid(
index))
700 textWidget =
TextWidget.Cast(elementWidgets[
index].FindAnyWidget(
"Text"));
709 foreach (
EVotingType votingType : votingTypesToRemove)
838 foreach (SCR_PlayerListEntry entry :
m_aEntries)
840 if (entry.m_iID ==
id)
850 SCR_PlayerListEntry entry =
new SCR_PlayerListEntry();
862 entry.m_wVotingNotification = entry.m_wRow.FindAnyWidget(
"VotingNotification");
863 entry.m_wVotingNotification.SetVisible(
IsVotedAbout(entry));
867 entry.m_PlayerActionList.SetVisible(
false);
881 if (!info || playerId !=
id)
893 Faction faction = factionManager.GetPlayerFaction(entry.m_iID);
894 entry.m_Faction = faction;
897 Widget factionImage = w.FindAnyWidget(
"FactionImage");
902 factionImage.SetColor(entry.m_Faction.GetFactionColor());
904 factionImage.SetVisible(
false);
907 entry.m_wName =
TextWidget.Cast(w.FindAnyWidget(
"PlayerName"));
916 if (editorDelegateManager)
918 SCR_EditablePlayerDelegateComponent playerEditorDelegate = editorDelegateManager.
GetDelegate(
id);
920 if (playerEditorDelegate)
930 SCR_FactionCommanderHandlerComponent commanderHandler = SCR_FactionCommanderHandlerComponent.GetInstance();
933 entry.m_ParentFaction = scrFaction.
GetParent();
935 if (commanderHandler)
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"));
949 entry.m_wKills.SetText(entry.m_Info.m_iKills.ToString());
951 entry.m_wDeaths.SetText(entry.m_Info.m_iDeaths.ToString());
959 entry.m_wScore.SetText(score.ToString());
966 entry.m_wKills.SetText(
"");
968 entry.m_wDeaths.SetText(
"");
970 entry.m_wScore.SetText(
"");
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"));
991 if (entry.m_wTaskIcon && taskSystem)
994 if (taskSystem.GetTaskAssignedTo(taskExecutor))
996 entry.m_wTaskIcon.SetColor(entry.m_Faction.GetFactionColor());
1000 entry.m_wTaskIcon.SetOpacity(0);
1009 entryPlayerFaction = factionManager.GetPlayerFaction(entry.m_iID);
1016 playerLoadout = loadoutManager.GetPlayerLoadout(entry.m_iID);
1022 if (entry.m_wLoadoutIcon && (playerFaction != entryPlayerFaction))
1023 entry.m_wLoadoutIcon.SetVisible(
false);
1027 entry.m_wLoadoutIcon.SetVisible(
true);
1029 if (entry.m_wLoadoutIcon && playerLoadout && entry.m_wLoadoutIcon.IsVisible())
1037 info.SetIconTo(entry.m_wLoadoutIcon);
1040 if (entry.m_wPlatformIcon)
1043 if (playerController)
1044 playerController.SetPlatformImageTo(entry.m_iID, entry.m_wPlatformIcon, showOnPC:
true, showOnXbox:
true)
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"));
1052 if (badgeTop && badgeMiddle && badgeBottom && entry.m_Faction)
1054 factionColor = entry.m_Faction.GetFactionColor();
1055 badgeTop.SetColor(factionColor);
1056 badgeMiddle.SetColor(factionColor);
1057 badgeBottom.SetColor(factionColor);
1066 entry.m_Mute.SetEnabled(
false);
1067 entry.m_Mute.SetToggled(
true);
1071 entry.m_Mute.SetEnabled(
true);
1563 set<int> localFrequencies =
new set<int>();
1569 FactionAffiliationComponent factionAffiliation = FactionAffiliationComponent.Cast(localPlayer.
FindComponent(FactionAffiliationComponent));
1570 if (factionAffiliation)
1571 localFaction = factionAffiliation.GetAffiliatedFaction();
1574 foreach (SCR_PlayerListEntry entry :
m_aEntries)
1576 if (entry.m_Faction == localFaction)
1578 IEntity playerEntity =
GetGame().GetPlayerManager().GetPlayerControlledEntity(entry.m_iID);
1583 set<int> frequencies =
new set<int>();
1585 if (!frequencies.IsEmpty())
1587 entry.m_iSortFrequency = frequencies[0];
1593 entry.m_iSortFrequency =
int.MAX;
1594 entry.m_wFreq.SetText(
"-");
1610 m_Block.SetEnabled(
false,
false);
1611 m_Block.SetVisible(
true,
false);
1618 m_Mute.SetEnabled(
false,
false);
1633 m_SelectedEntry.m_Mute.SetToggled(isSelectedBlocked || isSelectedMuted,
false,
false,
true);
1637 m_Block.SetEnabled(!isSelectedBlocked,
false);
1638 m_Block.SetVisible(!isSelectedBlocked,
false);
1641 m_Unblock.SetEnabled(isSelectedBlocked && canBeUnblocked,
false);
1642 m_Unblock.SetVisible(isSelectedBlocked,
false);
1644 m_Mute.SetEnabled(!isSelectedBlocked,
false);
1646 if (isSelectedMuted || isSelectedBlocked)
1730 if (!scriptedFaction)
1750 factionFlag.LoadImageTexture(0, scriptedFaction.
GetFactionFlag());
1751 factionFlag.GetImageSize(0, x, y);
1752 factionFlag.SetSize(x, y);
1754 string playerCountText = scriptedFaction.
GetPlayerCount().ToString();
1756 if (playerLimit >= 0)
1757 playerCount.SetTextFormat(
"#AR-SupportStation_ActionFormat_ItemAmount", playerCountText, playerLimit);
1759 playerCount.SetText(playerCountText);