15 [
Attribute(defvalue:
"{F7138F20BD16D89A}UI/layouts/Menus/DeployMenu/DebriefingScreenFourUnevenTiles.layout")]
16 protected ResourceName m_sFourUnevenTilesLayout;
19 protected ref SCR_WelcomeScreenBaseContent m_TopLeftTile;
22 protected ref SCR_WelcomeScreenBaseContent m_TopRightTile;
25 protected ref SCR_WelcomeScreenBaseContent m_BottomLeftTile;
28 protected ref SCR_WelcomeScreenBaseContent m_BottomRightTile;
32 protected const string TOP_LEFT_TILE =
"TopLeftTile";
33 protected const string TOP_RIGHT_TILE =
"TopRightTile";
34 protected const string BOTTOM_LEFT_TILE =
"BottomLeftTile";
35 protected const string BOTTOM_RIGHT_TILE =
"BottomRightTile";
37 protected const string TOP_LEFT_TILE_BUTTON =
"TopLeftTileButton";
38 protected const string TOP_RIGHT_TILE_BUTTON =
"TopRightTileButton";
39 protected const string BOTTOM_LEFT_TILE_BUTTON =
"BottomLeftTileButton";
40 protected const string BOTTOM_RIGHT_TILE_BUTTON =
"BottomRightTileButton";
45 Widget targetColumn = menu.GetRootWidget().FindAnyWidget(
WELCOME_CONTENT);
49 GetGame().GetWorkspace().CreateWidgets(m_sFourUnevenTilesLayout, targetColumn);
53 m_aScreenBaseContents.Insert(m_TopLeftTile);
54 m_TopLeftTile.InitContent(menu, TOP_LEFT_TILE, TOP_LEFT_TILE_BUTTON);
59 m_aScreenBaseContents.Insert(m_TopRightTile);
60 m_TopRightTile.InitContent(menu, TOP_RIGHT_TILE, TOP_RIGHT_TILE_BUTTON);
65 m_aScreenBaseContents.Insert(m_BottomLeftTile);
66 m_BottomLeftTile.InitContent(menu, BOTTOM_LEFT_TILE, BOTTOM_LEFT_TILE_BUTTON);
69 if (m_BottomRightTile)
71 m_aScreenBaseContents.Insert(m_BottomRightTile);
72 m_BottomRightTile.InitContent(menu, BOTTOM_RIGHT_TILE, BOTTOM_RIGHT_TILE_BUTTON);
79 class SCR_DebriefingScreenBigImageContent : SCR_WelcomeScreenBaseContent
81 [
Attribute(
"", UIWidgets.ResourcePickerThumbnail,
"Big image to be shown",
params:
"edds")]
82 protected ResourceName m_sContentImage;
84 [
Attribute(defvalue:
"{6CD5DC3DE2C54BBE}UI/layouts/Menus/DeployMenu/DebriefingScreenBigImageTile.layout")]
85 protected ResourceName m_sBigImageLayout;
94 Widget targetTile = menu.GetRootWidget().FindAnyWidget(column);
98 Widget bigImageWidget =
GetGame().GetWorkspace().CreateWidgets(m_sBigImageLayout, targetTile);
102 ImageWidget imageWidget = ImageWidget.Cast(bigImageWidget.FindAnyWidget(
"ImageWidget"));
103 if (imageWidget && m_sContentImage)
104 imageWidget.LoadImageTexture(0, m_sContentImage,
false,
false);
110 ResourceName GetImage()
112 return m_sContentImage;
118 class SCR_DebriefingScreenSummaryContent : SCR_WelcomeScreenBaseContent
121 protected string m_sTitleText;
127 protected string m_sSubtitleLostText;
132 [
Attribute(defvalue:
"{10A7983E48474CB2}UI/layouts/Menus/DeployMenu/DebriefingScreenSummaryTile.layout")]
133 protected ResourceName m_sSummaryLayout;
135 protected Widget m_wSummaryWidget;
144 m_sContentName = column;
146 Widget targetTile = menu.GetRootWidget().FindAnyWidget(column);
150 m_wSummaryWidget =
GetGame().GetWorkspace().CreateWidgets(m_sSummaryLayout, targetTile);
151 if (!m_wSummaryWidget)
163 protected void FillSummaryWidget()
165 string characterRank =
"";
166 string subtitle = GetSubtitleLostText();
167 IEntity player =
GetGame().GetPlayerController().GetControlledEntity();
172 characterRank = rankComponent.GetCharacterRankName(player);
183 Faction faction =
Faction.Cast(factionManager.GetLocalPlayerFaction());
190 array<int> winnerIds = {};
191 array<int> winnerFactionIds = {};
192 endData.GetWinnerIds(winnerIds);
193 endData.GetFactionWinnerIds(winnerFactionIds);
194 if (!winnerFactionIds.IsEmpty())
196 if (winnerFactionIds.Contains(factionManager.GetFactionIndex(faction)))
199 else if (!winnerIds.IsEmpty())
201 int playerID =
GetGame().GetPlayerController().GetPlayerId();
202 if (winnerIds.Contains(playerID))
207 RichTextWidget subtitleText = RichTextWidget.Cast(m_wSummaryWidget.FindAnyWidget(
"SubtitleText"));
211 RichTextWidget descriptionText = RichTextWidget.Cast(m_wSummaryWidget.FindAnyWidget(
"DescriptionText"));
212 if (!descriptionText)
215 descriptionText.SetText(GetDescriptionText());
219 SCR_GameOverScreenManagerComponent gameOverScreenMgr = SCR_GameOverScreenManagerComponent.Cast(gamemode.FindComponent(SCR_GameOverScreenManagerComponent));
220 if (!gameOverScreenMgr)
228 gameOverConfig.GetGameOverScreenInfo(gameOverScreenMgr.GetCurrentGameOverType(), gameOverScreenInfo);
229 if (!gameOverScreenInfo)
232 if (!
SCR_StringHelper.IsEmptyOrWhiteSpace(gameOverScreenInfo.GetDebriefing(faction,
null)))
233 descriptionText.SetText(gameOverScreenInfo.GetDebriefing(faction,
null));
235 descriptionText.SetText(gameOverScreenInfo.GetSubtitle(faction,
null));
242 void UpdateSummarySubtitle(
string subtitle)
245 RichTextWidget subtitleText = RichTextWidget.Cast(m_wSummaryWidget.FindAnyWidget(
"SubtitleText"));
247 subtitleText.SetText(subtitle);
253 void UpdateSummaryDescription(
string description)
256 RichTextWidget descriptionText = RichTextWidget.Cast(m_wSummaryWidget.FindAnyWidget(
"DescriptionText"));
258 descriptionText.SetText(description);
263 string GetTitleText()
277 string GetSubtitleLostText()
279 return m_sSubtitleLostText;
284 string GetDescriptionText()
292 class SCR_DebriefingScreenFinishedObjectivesContent : SCR_WelcomeScreenBaseContent
295 protected string m_sTitleText;
297 [
Attribute(defvalue:
"{0B7DDF77E24F0C63}UI/layouts/Menus/DeployMenu/DebriefingScreenFinishedObjectivesTile.layout")]
298 protected ResourceName m_sFinishedObjectivesTileLayout;
300 [
Attribute(defvalue:
"{6B9E63C758849B7F}UI/layouts/Menus/DeployMenu/DebriefingScreenMissionObjective.layout")]
301 protected ResourceName m_sFinishedObjectivesLayout;
303 protected Widget m_wFinishedObjectivesWidget;
304 protected ButtonWidget m_wColumnButton;
305 protected ref array<SCR_BaseTask> m_aFinishedTasks = {};
306 protected ref array<Widget> m_aFinishedObjectivesWidgets = {};
308 protected int m_iFinishedTasksCount;
317 m_sContentName = column;
319 Widget targetTile = menu.GetRootWidget().FindAnyWidget(column);
323 m_wFinishedObjectivesWidget =
GetGame().GetWorkspace().CreateWidgets(m_sFinishedObjectivesTileLayout, targetTile);
324 if (!m_wFinishedObjectivesWidget)
327 Widget finishedObjectivesContent = m_wFinishedObjectivesWidget.FindAnyWidget(
"FinishedObjectivesLayout");
328 if (!finishedObjectivesContent)
331 m_wColumnButton = ButtonWidget.Cast(menu.GetRootWidget().FindAnyWidget(columnButton));
332 if (!m_wColumnButton)
335 FillFinishedObjectivesWidget(finishedObjectivesContent);
343 override void ToggleInteractions(
bool enabled)
345 HandlePagination(enabled);
361 Faction faction =
Faction.Cast(factionManager.GetLocalPlayerFaction());
365 array<SCR_BaseTask> activeTasks = {};
366 taskManager.GetFilteredTasks(activeTasks, faction);
367 taskManager.GetFilteredFinishedTasks(m_aFinishedTasks, faction);
369 m_iFinishedTasksCount = m_aFinishedTasks.Count();
378 map<SCR_CampaignMilitaryBaseComponent, SCR_BaseTask> finishedTasksMap =
new map <SCR_CampaignMilitaryBaseComponent, SCR_BaseTask>();
387 baseComponent = campaignTask.GetTargetBase();
389 if (baseComponent && !finishedTasksMap.Contains(baseComponent) && baseComponent.IsControlPoint() && baseComponent.IsHQRadioTrafficPossible(faction, SCR_ECampaignHQRadioComms.RECEIVE))
390 finishedTasksMap.Set(baseComponent, task);
401 baseComponent = campaignTask.GetTargetBase();
403 finishedTasksMap.Remove(baseComponent);
406 m_aFinishedTasks.Clear();
409 m_aFinishedTasks.Insert(task);
412 m_iFinishedTasksCount = m_aFinishedTasks.Count();
418 void FillFinishedObjectivesWidget(Widget content)
420 RichTextWidget titleText = RichTextWidget.Cast(m_wFinishedObjectivesWidget.FindAnyWidget(
"TitleText"));
422 titleText.SetText(GetTitleText());
427 if (m_iFinishedTasksCount < 7)
428 cycleCount = m_iFinishedTasksCount;
433 for (
int i = 0; i < cycleCount; ++i)
435 Widget objective =
GetGame().GetWorkspace().CreateWidgets(m_sFinishedObjectivesLayout, content);
436 m_aFinishedObjectivesWidgets.Insert(objective);
438 RichTextWidget name = RichTextWidget.Cast(objective.FindAnyWidget(
"ObjectiveText"));
442 name.SetTextFormat(editorTask.GetTitle(), editorTask.GetLocationName());
443 else if (campaignTask)
444 name.SetTextFormat(campaignTask.GetTitle(), campaignTask.GetBaseNameWithCallsign());
446 name.SetText(m_aFinishedTasks[i].GetTitle());
449 if (m_iFinishedTasksCount < 7)
451 Widget paginationWidget = m_wFinishedObjectivesWidget.FindAnyWidget(
"BottomTitleSizeLayout");
452 paginationWidget.SetOpacity(0);
456 Widget pages = m_wFinishedObjectivesWidget.FindAnyWidget(
"Pages");
461 if (!pagesVisualised)
464 pagesVisualised.SetItemCount(m_iFinishedTasksCount/6);
470 protected void InitPagination()
472 Widget previousButtonWidget = m_wFinishedObjectivesWidget.FindAnyWidget(
"PrevButton");
473 if (!previousButtonWidget)
478 previousButton.m_OnClicked.Insert(ButtonClicked);
480 Widget nextButtonWidget = m_wFinishedObjectivesWidget.FindAnyWidget(
"NextButton");
481 if (!nextButtonWidget)
486 nextButton.m_OnClicked.Insert(ButtonClicked);
491 protected void ButtonClicked()
493 GetGame().GetWorkspace().SetFocusedWidget(m_wColumnButton);
499 protected void HandlePagination(
bool enabled =
false)
501 Widget previousButtonWidget = m_wFinishedObjectivesWidget.FindAnyWidget(
"PrevButton");
502 if (!previousButtonWidget)
510 previousButton.m_OnActivated.Insert(PreviousButtonActivated);
512 previousButton.m_OnActivated.Remove(PreviousButtonActivated);
514 Widget nextButtonWidget = m_wFinishedObjectivesWidget.FindAnyWidget(
"NextButton");
515 if (!nextButtonWidget)
523 nextButton.m_OnActivated.Insert(NextButtonActivated);
525 nextButton.m_OnActivated.Remove(NextButtonActivated);
530 protected void PreviousButtonActivated()
532 int currentPage = GetCurrentPage();
540 FlipPage(currentPage);
545 protected void NextButtonActivated()
547 int currentPage = GetCurrentPage();
549 if (currentPage == Math.Ceil(m_iFinishedTasksCount/6))
552 FlipPage(currentPage);
558 protected void FlipPage(
int currentPage)
561 for (
int i = 0; i < 6; ++i)
563 m_aFinishedObjectivesWidgets[i].SetOpacity(1);
564 if (currentPage == 0)
566 name = RichTextWidget.Cast(m_aFinishedObjectivesWidgets[i].FindAnyWidget(
"ObjectiveText"));
567 if (i < m_iFinishedTasksCount)
572 name.SetTextFormat(editorTask.GetTitle(), editorTask.GetLocationName());
573 else if (campaignTask)
574 name.SetTextFormat(campaignTask.GetTitle(), campaignTask.GetBaseNameWithCallsign());
576 name.SetText(m_aFinishedTasks[i].GetTitle());
580 m_aFinishedObjectivesWidgets[i].SetOpacity(0);
585 name = RichTextWidget.Cast(m_aFinishedObjectivesWidgets[i].FindAnyWidget(
"ObjectiveText"));
586 if ((currentPage * 6) + i < m_iFinishedTasksCount)
591 name.SetTextFormat(editorTask.GetTitle(), editorTask.GetLocationName());
592 else if (campaignTask)
593 name.SetTextFormat(campaignTask.GetTitle(), campaignTask.GetBaseNameWithCallsign());
595 name.SetText(m_aFinishedTasks[(currentPage * 6) + i].GetTitle());
600 m_aFinishedObjectivesWidgets[i].SetOpacity(0);
605 SetCurrentPage(currentPage);
607 Widget pages = m_wFinishedObjectivesWidget.FindAnyWidget(
"Pages");
612 if (!pagesVisualised)
615 pagesVisualised.SetItemCount(m_iFinishedTasksCount/6);
616 pagesVisualised.SetCurrentItem(currentPage);
631 void SetCurrentPage(
int page)
638 string GetTitleText()
646 class SCR_DebriefingScreenStatisticsContent : SCR_WelcomeScreenBaseContent
649 protected string m_sTitleText;
652 protected ref array<ref SCR_DebriefingScreenStatisticBaseClass> m_aStatistics;
654 [
Attribute(defvalue:
"{64B98222099C391E}UI/layouts/Menus/DeployMenu/DebriefingScreenStatisticsTile.layout")]
655 protected ResourceName m_sStatisticsTileLayout;
657 [
Attribute(defvalue:
"{F2B6C48FDA2E261E}UI/layouts/Menus/DeployMenu/DebriefingScreenStatistic.layout")]
658 protected ResourceName m_sStatisticsLayout;
660 protected Widget m_wStatisticsWidget;
669 m_sContentName = column;
671 Widget targetTile = menu.GetRootWidget().FindAnyWidget(column);
675 m_wStatisticsWidget =
GetGame().GetWorkspace().CreateWidgets(m_sStatisticsTileLayout, targetTile);
676 if (!m_wStatisticsWidget)
679 Widget statisticsContent = m_wStatisticsWidget.FindAnyWidget(
"StatsLayout");
680 if (!statisticsContent)
683 FillStatisticsWidget(statisticsContent);
689 void FillStatisticsWidget(Widget content)
691 RichTextWidget titleText = RichTextWidget.Cast(m_wStatisticsWidget.FindAnyWidget(
"TitleText"));
692 titleText.SetText(GetTitleText());
694 array<ref SCR_DebriefingScreenStatisticBaseClass> statistics = {};
696 statisticsCount = GetStatistics(statistics);
699 if (statisticsCount < 7)
700 statsCycleCount = statisticsCount;
706 array<float> stats = playerData.CalculateStatsDifference();
708 for (
int i = 0; i < statsCycleCount; ++i)
711 Widget statistic =
GetGame().GetWorkspace().CreateWidgets(m_sStatisticsLayout, content);
713 statistics[i].InitStatistic(stats);
714 RichTextWidget name = RichTextWidget.Cast(statistic.FindAnyWidget(
"StatisticResult"));
715 name.SetText(statistics[i].GetStatisticResult());
723 int GetStatistics(out array<ref SCR_DebriefingScreenStatisticBaseClass> statistics)
725 statistics = m_aStatistics;
727 return m_aStatistics.Count();
732 string GetTitleText()
740 class SCR_DebriefingScreenStatisticBaseClass
742 protected string m_sStatisticResult;
747 void InitStatistic(notnull array<float> stats);
751 string GetStatisticResult()
753 return m_sStatisticResult;
759 class SCR_DebriefingScreenStatisticShotsFired : SCR_DebriefingScreenStatisticBaseClass
762 override void InitStatistic(notnull array<float> stats)
764 m_sStatisticResult =
string.Format(WidgetManager.Translate(
"<b>#AR-DebriefingScreen_Statistics_Rounds</b>", Math.Floor(stats[
SCR_EDataStats.SHOTS])));
770 class SCR_DebriefingScreenStatisticKills : SCR_DebriefingScreenStatisticBaseClass
773 override void InitStatistic(notnull array<float> stats)
775 m_sStatisticResult =
string.Format(WidgetManager.Translate(
"<b>#AR-DebriefingScreen_Statistics_Kills</b>", Math.Floor(stats[
SCR_EDataStats.AI_KILLS] + stats[
SCR_EDataStats.KILLS])));
781 class SCR_DebriefingScreenStatisticDeaths : SCR_DebriefingScreenStatisticBaseClass
785 override void InitStatistic(notnull array<float> stats)
787 m_sStatisticResult =
string.Format(WidgetManager.Translate(
"<b>#AR-DebriefingScreen_Statistics_Deaths</b>", Math.Floor(stats[
SCR_EDataStats.DEATHS])));
793 class SCR_DebriefingScreenStatisticDistanceWalked : SCR_DebriefingScreenStatisticBaseClass
796 override void InitStatistic(notnull array<float> stats)
798 m_sStatisticResult =
string.Format(WidgetManager.Translate(
"<b>#AR-DebriefingScreen_Statistics_DistanceWalked</b>", Math.Floor(stats[
SCR_EDataStats.DISTANCE_WALKED]/1000)));
804 class SCR_DebriefingScreenStatisticDistanceDriven : SCR_DebriefingScreenStatisticBaseClass
807 override void InitStatistic(notnull array<float> stats)
809 m_sStatisticResult =
string.Format(WidgetManager.Translate(
"<b>#AR-DebriefingScreen_Statistics_DistanceDriven</b>", Math.Floor(stats[
SCR_EDataStats.DISTANCE_DRIVEN]/1000)));