3 [
Attribute(
"TabView",
desc:
"Tab view will only be used if the widget in the layout is visible. This is because some changes that no longer required the tabview")]
4 protected string m_sTabViewName;
7 protected string m_sContentHolderName;
10 protected string m_sBackgroundName;
13 protected string m_sBackgroundColorOverlayName;
15 [
Attribute(
"#AR-PauseMenu_ReturnTitle", uiwidget: UIWidgets.LocaleEditBox)]
18 [
Attribute(
"#AR-PauseMenu_ReturnText", uiwidget: UIWidgets.LocaleEditBox)]
21 [
Attribute(
"{2EFEA2AF1F38E7F0}UI/Textures/Icons/icons_wrapperUI-64.imageset",
params:
"imageset")]
22 protected ResourceName m_sMainMenuPopUpImageSet;
25 protected string m_sMainMenuPopUpImage;
28 protected string m_sBackButtonName;
31 protected string m_sChatButtonName;
34 protected string m_sDebriefingButtonName;
37 protected string m_sButtonHolderName;
40 protected string m_sRestartTimerHolderName;
43 protected float m_fBackgroundColorOverlayOpacity;
46 protected float m_fContentFadeInSpeed;
48 [
Attribute(
"0",
desc:
"Which tab will show the end screen content eg: Victory, Defeat, etc.")]
49 protected float m_iContentTabIndex;
51 protected Widget m_wRoot;
52 protected Widget m_wEndscreenContent;
64 OnEndScreenContentShow(tabIndex == m_iContentTabIndex);
75 baseGameOverTab.GameOverTabInit(m_EndScreenUIContentInfo);
79 protected void OnTabViewFadeDone()
81 if (m_TabViewComponent)
82 m_TabViewComponent.EnableAllTabs(
true);
86 protected void OnEndScreenContentShow(
bool show)
88 if (m_wEndscreenContent)
89 m_wEndscreenContent.SetVisible(show);
99 if (m_wEndscreenContent)
102 m_EndScreenUIContentInfo = endScreenUIContent;
104 Widget contentHolder =
m_wRoot.FindAnyWidget(m_sContentHolderName);
109 if (!endScreenUIContent.m_sGameOverLayout.IsEmpty())
111 m_wEndscreenContent =
GetGame().GetWorkspace().CreateWidgets(endScreenUIContent.m_sGameOverLayout, contentHolder);
113 if (m_wEndscreenContent)
117 if (gameOverWidgetContent)
118 gameOverWidgetContent.InitContent(endScreenUIContent);
122 if (endScreenUIContent.m_cVignetteColor)
124 ImageWidget colorOverlay = ImageWidget.Cast(
m_wRoot.FindAnyWidget(m_sBackgroundColorOverlayName));
126 colorOverlay.SetColor(endScreenUIContent.m_cVignetteColor);
129 if (m_ContentFadeComponent)
130 m_ContentFadeComponent.FadeIn();
131 if (m_TabViewFadeComponent)
132 m_TabViewFadeComponent.FadeIn();
133 if (m_ButtonHolderFadeComponent)
134 m_ButtonHolderFadeComponent.FadeIn();
135 if (m_OverlayBackgroundColorFadeUIComponent)
136 m_OverlayBackgroundColorFadeUIComponent.FadeIn();
137 if (m_RestartTimerFadeComponent)
138 m_RestartTimerFadeComponent.FadeIn();
140 Widget returnToMenuBtn =
m_wRoot.FindAnyWidget(m_sBackButtonName);
144 if (returnToMenuButton)
145 returnToMenuButton.m_OnActivated.Insert(ReturnToMenu);
148 Widget debriefingWidgetButton =
m_wRoot.FindAnyWidget(m_sDebriefingButtonName);
149 if (debriefingWidgetButton)
151 BaseGameMode gameMode =
GetGame().GetGameMode();
154 debriefingWidgetButton.SetVisible(
false);
158 SCR_DebriefingScreenComponent debriefingScreen = SCR_DebriefingScreenComponent.Cast(gameMode.FindComponent(SCR_DebriefingScreenComponent));
159 if (debriefingScreen)
162 if (debriefingButton)
163 debriefingButton.m_OnActivated.Insert(OpenDebriefingScreenMenu);
167 debriefingWidgetButton.SetVisible(
false);
174 void OpenDebriefingScreenMenu()
186 dlg.m_OnConfirm.Insert(BackToMainMenuPopupConfirm);
190 protected void BackToMainMenuPopupConfirm()
200 void SetMainMenuPopUpTexts(
DialogUI popup)
202 popup.SetMessage(m_sMainMenuPopUpMessage);
203 popup.SetTitle(m_sMainMenuPopUpTitle);
204 popup.SetTitleIcon(m_sMainMenuPopUpImageSet, m_sMainMenuPopUpImage);
208 protected void OnGameEnd()
213 override void HandlerAttached(Widget w)
220 ImageWidget colorOverlay = ImageWidget.Cast(
m_wRoot.FindAnyWidget(m_sBackgroundColorOverlayName));
223 colorOverlay.SetOpacity(m_fBackgroundColorOverlayOpacity);
226 if (m_OverlayBackgroundColorFadeUIComponent)
228 m_OverlayBackgroundColorFadeUIComponent.SetFadeInSpeed(m_fContentFadeInSpeed);
229 colorOverlay.SetVisible(
false);
233 Widget contentHolder = w.FindAnyWidget(m_sContentHolderName);
238 if (m_ContentFadeComponent)
240 m_ContentFadeComponent.SetFadeInSpeed(m_fContentFadeInSpeed);
241 contentHolder.SetVisible(
false);
245 Widget buttonHolder = w.FindAnyWidget(m_sButtonHolderName);
249 if (m_ButtonHolderFadeComponent)
251 m_ButtonHolderFadeComponent.SetFadeInSpeed(m_fContentFadeInSpeed);
252 buttonHolder.SetVisible(
false);
256 Widget restartTimerHolder = w.FindAnyWidget(m_sRestartTimerHolderName);
257 if (restartTimerHolder)
261 if (restartTimer && restartTimer.IsValid())
264 if (m_RestartTimerFadeComponent)
266 m_RestartTimerFadeComponent.SetFadeInSpeed(m_fContentFadeInSpeed);
267 restartTimerHolder.SetVisible(
false);
274 gameMode.GetOnGameEnd().Insert(OnGameEnd);
276 Widget tabView = w.FindAnyWidget(m_sTabViewName);
279 if (tabView && tabView.IsVisible())
284 if (m_TabViewFadeComponent)
286 m_TabViewFadeComponent.SetFadeInSpeed(m_fContentFadeInSpeed);
287 tabView.SetVisible(
false);
288 m_TabViewFadeComponent.GetOnFadeDone().Insert(OnTabViewFadeDone);
292 if (m_TabViewComponent)
294 if (m_TabViewFadeComponent)
295 m_TabViewComponent.EnableAllTabs(
false);
297 m_TabViewComponent.GetOnChanged().Insert(OnTabChanged);
298 m_TabViewComponent.GetOnContentCreate().Insert(OnTabCreated);
302 override void HandlerDeattached(Widget w)
306 gameMode.GetOnGameEnd().Remove(OnGameEnd);