12 [
Attribute(
"1",
desc:
"Delay (in seconds) to lock player input and display the actual end screen after end screen has faded in")]
15 [
Attribute(
"{144919871D65F121}UI/layouts/HUD/GameOver/EndScreen/EndScreen.layout",
params:
"layout")]
33 static const ref ScriptInvoker s_OnEndGame =
new ScriptInvoker();
41 return m_GameOverScreenConfig;
60 Debug.Error2(
"SCR_GameOverScreenManagerComponent",
"StartEndGameFade, could not find FadeUIComponent!");
65 fadeComponent.FadeIn();
68 hudManager.SetVisibleLayers(hudManager.GetVisibleLayers() & ~(
EHudLayers.HIGH));
75 if (!m_GameOverScreenConfig.GetGameOverScreenInfo(
m_iEndGameType, gameOverScreenInfo))
77 Print(
string.Format(
"SCR_GameOverScreenManagerComponent could not find end screen: %1, to play audio",
typename.EnumToString(
EGameOverTypes,
m_iEndGameType)), LogLevel.WARNING);
81 if (!gameOverScreenInfo.HasOptionalParams())
99 GetGame().GetMenuManager().CloseAllMenus();
117 hudManager.SetVisibleLayers(hudManager.GetVisibleLayers() |
EHudLayers.HIGH);
129 if (!m_GameOverScreenConfig.GetGameOverScreenInfo(
m_iEndGameType, gameOverScreenInfo))
131 Print(
string.Format(
"'SCR_GameOverScreenConfig': Could not find '%1' endscreen in array!",
typename.EnumToString(
EGameOverTypes,
m_iEndGameType)), LogLevel.NORMAL);
135 if (gameOverScreenInfo.HasOptionalParams())
143 SCR_GameOverScreenUIComponent gameOverScreen =
OpenGameOverScreen(gameOverScreenInfo.GetGameOverContentLayout(), endData, gameOverScreenInfo.GetTitle(
m_FactionPlayer,
m_aWinningFactions), gameOverScreenInfo.GetSubtitle(
m_FactionPlayer,
m_aWinningFactions), gameOverScreenInfo.GetDebriefing(
m_FactionPlayer,
m_aWinningFactions), gameOverScreenInfo.GetImage(
m_FactionPlayer,
m_aWinningFactions), gameOverScreenInfo.GetIcon(
m_FactionPlayer,
m_aWinningFactions), gameOverScreenInfo.GetVignetteColor(
m_FactionPlayer,
m_aWinningFactions), gameOverScreenInfo.GetTitleParam(
m_FactionPlayer,
m_aWinningFactions), gameOverScreenInfo.GetSubtitleParam(
m_FactionPlayer,
m_aWinningFactions), gameOverScreenInfo.GetDebriefingParam(
m_FactionPlayer,
m_aWinningFactions));
145 return gameOverScreen;
152 SCR_GameOverScreenUIComponent gameOverScreen =
OpenGameOverScreen(gameOverScreenInfo.GetGameOverContentLayout(), endData, gameOverScreenInfo.GetTitle(
m_iPlayerId,
m_aWinningPlayers), gameOverScreenInfo.GetSubtitle(
m_iPlayerId,
m_aWinningPlayers), gameOverScreenInfo.GetDebriefing(
m_iPlayerId,
m_aWinningPlayers), gameOverScreenInfo.GetImage(
m_iPlayerId,
m_aWinningPlayers), gameOverScreenInfo.GetIcon(
m_iPlayerId,
m_aWinningPlayers), gameOverScreenInfo.GetVignetteColor(
m_iPlayerId,
m_aWinningPlayers), gameOverScreenInfo.GetTitleParam(
m_iPlayerId,
m_aWinningPlayers), gameOverScreenInfo.GetSubtitleParam(
m_iPlayerId,
m_aWinningPlayers), gameOverScreenInfo.GetDebriefingParam(
m_iPlayerId,
m_aWinningPlayers));
154 return gameOverScreen;
163 return gameOverScreen;
169 return gameOverScreen;
191 FactionManager factionManager =
GetGame().GetFactionManager();
203 array<int> winningFactionIds = {};
204 endData.GetFactionWinnerIds(winningFactionIds);
206 if (winningFactionIds)
210 foreach (
int id: winningFactionIds)
212 factionVictor = factionManager.GetFactionByIndex(
id);
232 if (scrFactionManager)
264 if (isFactionVictory)
268 else if (factionsVictor.Contains(factionPlayer))
275 if (winningPlayers.Contains(playerId))
285 if (isFactionVictory)
289 else if (factionsVictor.Contains(factionPlayer))
296 if (winningPlayers.Contains(playerId))
305 if (isFactionVictory)
328 else if (factionsVictor.Contains(factionPlayer))
370 SCR_GameOverScreenUIComponent OpenGameOverScreen(ResourceName contentLayout,
SCR_GameModeEndData endData,
LocalizedString title =
string.Empty,
LocalizedString subtitle =
string.Empty,
LocalizedString debriefing =
string.Empty, ResourceName imageTexture = ResourceName.Empty, ResourceName icon = ResourceName.Empty, Color vignetteColor =
null,
string titleParam =
string.Empty,
string subtitleParam =
string.Empty,
string debriefingParam =
string.Empty)
379 Widget screen = Widget.Cast(menu.GetRootWidget());
383 if (screenUIComponent)
385 SCR_GameOverScreenUIContentData content =
new SCR_GameOverScreenUIContentData(contentLayout, endData, title, subtitle, debriefing, imageTexture, icon, vignetteColor, titleParam, subtitleParam, debriefingParam);
386 screenUIComponent.InitGameOverScreen(content);
389 return screenUIComponent;
406 gameOverInfo = m_GameOverScreenConfig.GetGameOverInfo(
EGameOverTypes.EDITOR_NEUTRAL);
411 Print(
string.Format(
"SCR_GameOverScreenManagerComponent could not find end screen: %1, so EDITOR_NEUTRAL is used instead",
typename.EnumToString(
EGameOverTypes,
m_iEditorSetGameOverType)), LogLevel.ERROR);
417 gameOverInfo = m_GameOverScreenConfig.GetGameOverInfo(
EGameOverTypes.NEUTRAL);
421 Print(
string.Format(
"SCR_GameOverScreenManagerComponent could not find end screen: %1 and EDITOR_NEUTRAL could not be found so NEUTRAL is used instead",
typename.EnumToString(
EGameOverTypes,
m_iEditorSetGameOverType)), LogLevel.ERROR);
426 Print(
string.Format(
"SCR_GameOverScreenManagerComponent could not find end screen: %1 nor EDITOR_NEUTRAL or NEUTRAL. Check if the config is set up correctly!",
typename.EnumToString(
EGameOverTypes,
m_iEditorSetGameOverType)), LogLevel.ERROR);
434 if (!optionalEditorParam || !optionalEditorParam.m_bNeedsPlayableFactions)
499 ResourceName m_sGameOverLayout;
504 ResourceName m_sImageTexture;
505 ResourceName m_sIcon;
506 Color m_cVignetteColor;
507 string m_sTitleParam;
508 string m_sSubtitleParam;
509 string m_sDebriefingParam;
524 void SCR_GameOverScreenUIContentData(ResourceName gameOverLayout,
SCR_GameModeEndData endGameData,
LocalizedString title =
string.Empty,
LocalizedString subtitle =
string.Empty,
LocalizedString debriefing =
string.Empty, ResourceName imageTexture = ResourceName.Empty, ResourceName icon = ResourceName.Empty, Color vignetteColor =
null,
string titleParam =
string.Empty,
string subtitleParam =
string.Empty,
string debriefingParam =
string.Empty)
526 m_sGameOverLayout = gameOverLayout;
527 m_EndGameData = endGameData;
529 m_sSubtitle = subtitle;
530 m_sDebriefing = debriefing;
531 m_sImageTexture = imageTexture;
533 m_cVignetteColor = vignetteColor;
534 m_sTitleParam = titleParam;
535 m_sSubtitleParam = subtitleParam;
536 m_sDebriefingParam = debriefingParam;