Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_DebriefingScreenMenu.c
Go to the documentation of this file.
1 //------------------------------------------------------------------------------------------------
3 {
4  //------------------------------------------------------------------------------------------------
5  override void OnMenuOpen()
6  {
8  m_PlayerManager = PlayerManager.Cast(GetGame().GetPlayerManager());
9  m_MapEntity = SCR_MapEntity.GetMapInstance();
10 
11  SCR_DebriefingScreenComponent debriefingScreen = SCR_DebriefingScreenComponent.Cast(m_GameMode.FindComponent(SCR_DebriefingScreenComponent));
12  if (!debriefingScreen)
13  {
14  Close();
15  return;
16  }
17 
18  m_GameMasterButton = SCR_InputButtonComponent.GetInputButtonComponent("Editor", GetRootWidget());
19  if (m_GameMasterButton)
20  {
21  if (m_GameMode.GetState() != SCR_EGameModeState.GAME)
22  {
23  m_GameMasterButton.SetVisible(false);
24  }
25  else
26  {
27  SCR_EditorManagerEntity editor = SCR_EditorManagerEntity.GetInstance();
28  if (editor)
29  m_GameMasterButton.SetVisible(editor && !editor.IsLimited());
30  else
31  m_GameMasterButton.SetVisible(false);
32  }
33  }
34 
35  RichTextWidget scenarioTitle = RichTextWidget.Cast(GetRootWidget().FindAnyWidget("DeploySetup"));
36  if (scenarioTitle)
37  //scenarioTitle.SetText(debriefingScreen.GetHeaderTitle());
38  scenarioTitle.SetText("#AR-DebriefingScreen_Debriefing");
39 
40  /*RichTextWidget scenarioSubtitle = RichTextWidget.Cast(GetRootWidget().FindAnyWidget("HeaderSubtitle"));
41  if (scenarioSubtitle)
42  scenarioSubtitle.SetText(debriefingScreen.GetHeaderSubtitle());*/
43 
44  SCR_MissionHeader header = SCR_MissionHeader.Cast(GetGame().GetMissionHeader());
45  if (header)
46  m_iMaxPlayerCount = header.m_iPlayerCount;
47 
48  m_wPlayerCount = RichTextWidget.Cast(GetRootWidget().FindAnyWidget("PlayerCount"));
49  UpdatePlayerCount(0);
50 
51  m_wScenarioTimeElapsed = RichTextWidget.Cast(GetRootWidget().FindAnyWidget("TimeElapsed"));
52 
53  Widget continueBtn = GetRootWidget().FindAnyWidget("CloseButton");
54  if (continueBtn)
55  {
56  SCR_InputButtonComponent continueButton = SCR_InputButtonComponent.Cast(continueBtn.FindHandler(SCR_InputButtonComponent));
57  if (continueButton)
58  continueButton.m_OnActivated.Insert(ReturnToMenu);
59 
60  RichTextWidget continueBtnBackToMenu = RichTextWidget.Cast(continueBtn.FindAnyWidget("Text"));
61  if (continueBtnBackToMenu)
62  continueBtnBackToMenu.SetText("#AR-PauseMenu_Exit");
63  }
64 
65  Widget pauseMenuBtn = GetRootWidget().FindAnyWidget("PauseButton");
66  if (pauseMenuBtn)
67  {
68  SCR_InputButtonComponent pauseMenuButton = SCR_InputButtonComponent.Cast(pauseMenuBtn.FindHandler(SCR_InputButtonComponent));
69  if (pauseMenuButton)
70  pauseMenuButton.m_OnActivated.Insert(OpenPauseMenu);
71  }
72 
73  Widget chat = GetRootWidget().FindAnyWidget("ChatPanel");
74  if (chat)
75  m_ChatPanel = SCR_ChatPanel.Cast(chat.FindHandler(SCR_ChatPanel));
76 
77  m_ChatButton = SCR_InputButtonComponent.GetInputButtonComponent("ChatButton", GetRootWidget());
78  if (m_ChatButton)
79  m_ChatButton.m_OnActivated.Insert(OnChatToggle);
80 
81  UpdateElapsedTime();
82  SCR_DeployMenuBaseScreenLayout baseLayout = debriefingScreen.GetBaseLayout();
83  if (!baseLayout)
84  return;
85 
86  baseLayout.InitContent(this);
87 
88  //InitMap();
89  }
90 
91  //------------------------------------------------------------------------------------------------
92  void ReturnToMenu()
93  {
94  SCR_ConfigurableDialogUi dlg = SCR_CommonDialogs.CreateDialog("scenario_exit");
95  if (!dlg)
96  return;
97 
98  dlg.m_OnConfirm.Insert(BackToMainMenuPopupConfirm);
99  }
100 
101  //-----------------------------------------------------------------------------------------------
102  protected void BackToMainMenuPopupConfirm()
103  {
104  GetRootWidget().RemoveFromHierarchy();
105  GameStateTransitions.RequestGameplayEndTransition();
106  }
107 
108  //------------------------------------------------------------------------------------------------
109  void OpenDebriefingScreenMenu()
110  {
111  GetGame().GetMenuManager().OpenMenu(ChimeraMenuPreset.DebriefingScreenMenu);
112  }
113 
114  //------------------------------------------------------------------------------------------------
115  void CloseDebriefingScreenMenu()
116  {
117  GetGame().GetMenuManager().CloseMenuByPreset(ChimeraMenuPreset.DebriefingScreenMenu);
118  }
119 };
SCR_BaseGameMode
Definition: SCR_BaseGameMode.c:137
m_MapEntity
protected SCR_MapEntity m_MapEntity
Definition: SCR_MapGadgetComponent.c:14
SCR_DeployMenuBaseScreenLayout
Base class for Deploy menu layouts.
Definition: SCR_DeployMenuBaseScreenComponent.c:43
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
SCR_CommonDialogs
Definition: CommonDialogs.c:5
GetRootWidget
Widget GetRootWidget()
Definition: SCR_UITaskManagerComponent.c:160
GetGameMode
SCR_BaseGameMode GetGameMode()
Definition: SCR_BaseGameModeComponent.c:15
GameStateTransitions
Definition: GameStateTransitions.c:12
SCR_ChatPanel
Definition: SCR_ChatPanel.c:6
OnChatToggle
protected void OnChatToggle()
Toggle chat.
Definition: SCR_DeployMenuBase.c:779
m_GameMode
protected SCR_BaseGameMode m_GameMode
Definition: SCR_DeployMenuBase.c:111
SCR_MapEntity
Map entity.
Definition: SCR_MapEntity.c:20
m_PlayerManager
protected PlayerManager m_PlayerManager
Definition: SCR_PlayerTeleportedFeedbackComponent.c:9
SCR_DebriefingScreenMenu
Definition: SCR_DebriefingScreenMenu.c:2
SCR_WelcomeScreenMenu
Class that handles Welcome screen menu.
Definition: SCR_WelcomeScreenMenu.c:3
ChimeraMenuPreset
ChimeraMenuPreset
Menu presets.
Definition: ChimeraMenuBase.c:3
SCR_ConfigurableDialogUi
Definition: SCR_ConfigurableDialogUI.c:13
SCR_EGameModeState
SCR_EGameModeState
Definition: SCR_EGameModeState.c:4
PlayerManager
Definition: PlayerManager.c:12
SCR_MissionHeader
Definition: SCR_MissionHeader.c:1
SCR_InputButtonComponent
Definition: SCR_InputButtonComponent.c:1
SCR_EditorManagerEntity
Definition: SCR_EditorManagerEntity.c:26