4 protected Widget m_wRootWidget;
5 protected Widget m_wFirstColumnWidget;
6 protected Widget m_wCareerSpecializationsWidget;
7 protected Widget m_wProfileNotFound;
9 protected Widget m_wHud;
14 protected ResourceName m_StatsLayout;
17 protected ResourceName m_HeaderStatsLayout;
20 protected ResourceName m_ProgressionStatsLayout;
27 super.GameOverTabInit(endScreenUIContent);
29 m_wFirstColumnWidget = m_wRootWidget.FindAnyWidget(
"FirstColumn");
30 m_wCareerSpecializationsWidget = m_wRootWidget.FindAnyWidget(
"CareerSpecializations0");
31 m_wProfileNotFound = m_wRootWidget.FindAnyWidget(
"ProfileNotFound");
33 if (!m_wFirstColumnWidget || !m_wCareerSpecializationsWidget || !m_wProfileNotFound)
36 m_wHud = m_wFirstColumnWidget.FindAnyWidget(
"CareerProfileHUD0");
44 m_HudHandler.PrepareHUD(
"",
"RankTitleText",
"",
"",
"LevelProgress",
"PlayerLevel",
"ProgressBar0",
"");
47 if (!m_CareerSpecializationsHandler)
51 SetEndscreenVisualInfo(endScreenUIContent);
55 SCR_DataCollectorComponent dataCollector =
GetGame().GetDataCollector();
58 Print (
"SCR_CareerEndScreenUI: No data collector was found.", LogLevel.ERROR);
62 m_PlayerData = dataCollector.GetPlayerData(0,
false);
67 SCR_DataCollectorCommunicationComponent communicationComponent = SCR_DataCollectorCommunicationComponent.Cast(
GetGame().
GetPlayerController().FindComponent(SCR_DataCollectorCommunicationComponent));
68 if (communicationComponent)
69 communicationComponent.GetOnDataReceived().Insert(OnDataReceived);
71 else if (!m_PlayerData.IsDataProgressionReady())
72 m_PlayerData.CalculateStatsChange();
79 protected override void HandlerAttached(Widget w)
81 super.HandlerAttached(w);
90 m_PlayerData = playerData;
91 m_PlayerData.CalculateStatsChange();
96 protected void FillFields()
103 if (!m_PlayerData.IsDataProgressionReady())
105 Print(
"SCR_CareerEndScreenUI: Array of EarntPoints from player's PlayerData object is empty.", LogLevel.ERROR);
109 FillScreen(!m_PlayerData.IsEmptyProfile());
113 void FillScreen(
bool profileDataFound)
115 if (profileDataFound)
117 m_wFirstColumnWidget.SetVisible(
true);
118 m_wCareerSpecializationsWidget.SetVisible(
true);
119 m_wProfileNotFound.SetVisible(
false);
121 FillSpecializationsFrame();
125 m_wFirstColumnWidget.SetVisible(
false);
126 m_wCareerSpecializationsWidget.SetVisible(
false);
127 m_wProfileNotFound.SetVisible(
true);
132 protected void FillHudAndStats()
134 int Level = m_PlayerData.GetStat(
SCR_EDataStats.LEVEL_EXPERIENCE);
138 m_HudHandler.SetPlayerRank(m_PlayerData.GetStat(
SCR_EDataStats.RANK));
139 m_HudHandler.SetRandomBackgroundPicture();
141 array<float> EarntPoints = m_PlayerData.GetArrayEarntPoints();
143 m_HudHandler.SetLevelProgressGain(EarntPoints[
SCR_EDataStats.LEVEL_EXPERIENCE]);
145 Widget GeneralStatsWidget = m_wFirstColumnWidget.FindAnyWidget(
"GeneralStatEntries");
146 if (!GeneralStatsWidget)
154 int minutes = (m_PlayerData.GetStat(
SCR_EDataStats.SESSION_DURATION) - m_PlayerData.GetStat(
SCR_EDataStats.SESSION_DURATION,
false)) / 60;
156 SCR_CareerUI.CreateProgressionStatEntry(GeneralStatsWidget, m_ProgressionStatsLayout,
"#AR-CareerProfile_TimePlayed", EarntPoints[
SCR_EDataStats.SESSION_DURATION] * warCrimes, EarntPoints[
SCR_EDataStats.SESSION_DURATION],
"#AR-CareerProfile_Minutes",
""+minutes);
160 protected void FillSpecializationsFrame()
162 m_CareerSpecializationsHandler.SetShowProgression(
true);
163 m_CareerSpecializationsHandler.FillSpecializations(m_PlayerData, m_StatsLayout, m_HeaderStatsLayout, m_ProgressionStatsLayout);
164 m_CareerSpecializationsHandler.FillWarCrimes();
170 ImageWidget matchFlag = ImageWidget.Cast(m_wFirstColumnWidget.FindAnyWidget(
"MatchResultFlag"));
171 RichTextWidget MatchFactionWinner = RichTextWidget.Cast(m_wFirstColumnWidget.FindAnyWidget(
"MatchFactionWinner"));
172 if (!matchFlag || !MatchFactionWinner)
177 MatchFactionWinner.SetTextFormat(endScreenUIContent.m_sSubtitle, endScreenUIContent.m_sSubtitleParam);
179 MatchFactionWinner.SetVisible(
false);
183 matchFlag.LoadImageTexture(0, endScreenUIContent.m_sIcon);
185 matchFlag.SetVisible(
false);