Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_MapMenuUI.c
Go to the documentation of this file.
1 //------------------------------------------------------------------------------------------------
4 {
5  protected SCR_MapEntity m_MapEntity;
6  protected SCR_ChatPanel m_ChatPanel;
7 
8  //------------------------------------------------------------------------------------------------
9  override void OnMenuOpen()
10  {
11  if (m_MapEntity)
12  {
13  BaseGameMode gameMode = GetGame().GetGameMode();
14  if (!gameMode)
15  return;
16 
17  SCR_MapConfigComponent configComp = SCR_MapConfigComponent.Cast(gameMode.FindComponent(SCR_MapConfigComponent));
18  if (!configComp)
19  return;
20 
21  MapConfiguration mapConfigFullscreen = m_MapEntity.SetupMapConfig(EMapEntityMode.FULLSCREEN, configComp.GetGadgetMapConfig(), GetRootWidget());
22  m_MapEntity.OpenMap(mapConfigFullscreen);
23  }
24 
25  Widget wChatPanel = GetRootWidget().FindAnyWidget("ChatPanel");
26  if (wChatPanel)
27  m_ChatPanel = SCR_ChatPanel.Cast(wChatPanel.FindHandler(SCR_ChatPanel));
28 
29  GetGame().GetInputManager().AddActionListener("ChatToggle", EActionTrigger.DOWN, Callback_OnChatToggleAction);
30  }
31 
32  //------------------------------------------------------------------------------------------------
33  override void OnMenuClose()
34  {
35  if (m_MapEntity)
36  m_MapEntity.CloseMap();
37 
38  GetGame().GetInputManager().RemoveActionListener("ChatToggle", EActionTrigger.DOWN, Callback_OnChatToggleAction);
39  }
40 
41  //------------------------------------------------------------------------------------------------
42  override void OnMenuInit()
43  {
44  if (!m_MapEntity)
45  m_MapEntity = SCR_MapEntity.GetMapInstance();
46  }
47 
48  //------------------------------------------------------------------------------------------------
49  override void OnMenuUpdate(float tDelta)
50  {
51  if (m_ChatPanel)
52  m_ChatPanel.OnUpdateChat(tDelta);
53  }
54 
55  //------------------------------------------------------------------------------------------------
56  void Callback_OnChatToggleAction()
57  {
58  if (!m_ChatPanel)
59  return;
60 
61  if (!m_ChatPanel.IsOpen())
62  SCR_ChatPanelManager.GetInstance().OpenChatPanel(m_ChatPanel);
63  }
64 };
ChimeraMenuBase
Constant variables used in various menus.
Definition: ChimeraMenuBase.c:70
m_MapEntity
protected SCR_MapEntity m_MapEntity
Definition: SCR_MapGadgetComponent.c:14
SCR_MapMenuUI
Fullscreen map menu.
Definition: SCR_MapMenuUI.c:3
GetGame
ArmaReforgerScripted GetGame()
Definition: game.c:1424
SCR_ChatPanelManager
Definition: SCR_ChatPanelManager.c:12
GetRootWidget
Widget GetRootWidget()
Definition: SCR_UITaskManagerComponent.c:160
SCR_ChatPanel
Definition: SCR_ChatPanel.c:6
SCR_MapEntity
Map entity.
Definition: SCR_MapEntity.c:20
EMapEntityMode
EMapEntityMode
Mode of the map.
Definition: SCR_MapConstants.c:28