7 protected RichTextWidget m_wPlayerCount;
8 protected RichTextWidget m_wScenarioTimeElapsed;
9 protected ref MapConfiguration m_MapConfig =
new MapConfiguration();
10 protected string m_sTimeElapsed;
11 protected float m_fTimeSlice;
12 protected int m_iMaxPlayerCount;
16 override void OnMenuOpen()
24 SCR_WelcomeScreenComponent welcomeScreen = SCR_WelcomeScreenComponent.Cast(
m_GameMode.FindComponent(SCR_WelcomeScreenComponent));
41 m_iMaxPlayerCount = header.m_iPlayerCount;
43 m_wPlayerCount = RichTextWidget.Cast(
GetRootWidget().FindAnyWidget(
"PlayerCount"));
46 m_wScenarioTimeElapsed = RichTextWidget.Cast(
GetRootWidget().FindAnyWidget(
"TimeElapsed"));
48 Widget continueBtn =
GetRootWidget().FindAnyWidget(
"CloseButton");
53 continueButton.m_OnActivated.Insert(CloseWelcomeScreenMenu);
56 Widget pauseMenuBtn =
GetRootWidget().FindAnyWidget(
"PauseButton");
61 pauseMenuButton.m_OnActivated.Insert(OpenPauseMenu);
70 m_ChatButton.m_OnActivated.Insert(OnChatToggle);
77 baseLayout.InitContent(
this);
84 override void OnMenuOpened()
96 protected void InitMap()
100 ResourceName
conf =
"{A786DD4868598F15}Configs/Map/MapPlain.conf";
106 override void OnMenuFocusGained()
110 editorManager.AutoInit();
112 GetGame().GetInputManager().AddActionListener(
"ShowScoreboard", EActionTrigger.DOWN, OpenPlayerList);
114 super.OnMenuFocusGained();
119 override void OnMenuFocusLost()
121 GetGame().GetInputManager().RemoveActionListener(
"ShowScoreboard", EActionTrigger.DOWN, OpenPlayerList);
123 super.OnMenuFocusLost();
128 protected void OpenPauseMenu()
130 GetGame().OpenPauseMenu(
false,
true);
135 void OpenWelcomeScreenMenu()
142 void CloseWelcomeScreenMenu()
146 PlayerController playerController =
GetGame().GetPlayerController();
147 SCR_PlayerDeployMenuHandlerComponent deployMenu = SCR_PlayerDeployMenuHandlerComponent.Cast(playerController.FindComponent(SCR_PlayerDeployMenuHandlerComponent));
149 deployMenu.SetWelcomeClosed();
154 override void OnMenuUpdate(
float tDelta)
156 super.OnMenuUpdate(tDelta);
158 GetGame().GetInputManager().ActivateContext(
"DeployMenuContext");
159 GetGame().GetInputManager().ActivateContext(
"MenuWithEditorContext");
162 m_ChatPanel.OnUpdateChat(tDelta);
164 m_fTimeSlice += tDelta;
165 if (m_fTimeSlice > 1)
171 protected void OnChatToggle()
180 if (!m_ChatPanel || m_ChatPanel.IsOpen())
185 if (!chatPanelManager)
193 protected void UpdateElapsedTime()
197 m_wScenarioTimeElapsed.SetText(m_sTimeElapsed);
198 UpdatePlayerCount(0);
203 protected void UpdatePlayerCount(
int playerID)
205 if (m_iMaxPlayerCount > 0)
206 m_wPlayerCount.SetTextFormat(
"%1/%2",
m_PlayerManager.GetPlayerCount().ToString(), m_iMaxPlayerCount);