Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_CommandPostMapCampaignUI.c
Go to the documentation of this file.
2{
3 [Attribute("{E1D446FCFA9DF389}UI/layouts/Campaign/CommandPostMapUI.layout", params: "layout")]
5
7
8 protected const int MAP_CLOSE_DELAY = 300;
9
10 //------------------------------------------------------------------------------------------------
11 protected void InitCommander()
12 {
13 m_RootWidget = m_MapEntity.GetMapConfig().RootWidgetRef; // Needs to be refreshed here
14
15 Widget w = GetGame().GetWorkspace().CreateWidgets(m_sBaseElement, m_RootWidget);
16
17 m_InputManager = GetGame().GetInputManager();
18 m_InputManager.AddActionListener("MapEscape", EActionTrigger.DOWN, OnMapEscape);
19 }
20
21 //------------------------------------------------------------------------------------------------
22 protected override void OnMapOpen(MapConfiguration config)
23 {
24 super.OnMapOpen(config);
25
27 }
28
29 //------------------------------------------------------------------------------------------------
30 protected override void OnMapClose(MapConfiguration config)
31 {
32 super.OnMapClose(config);
33
35 m_InputManager.RemoveActionListener("MapEscape", EActionTrigger.DOWN, OnMapEscape);
36 }
37
38 //------------------------------------------------------------------------------------------------
39 protected void OnMapEscape()
40 {
41 // hotfix to suppress the pausemenu display, needs the same delay logic as for opening/closing the map in SCR_MapGadgetComponent
42 // after press Escape must first call game->OnMenuOpen() to check if it can open the pausemenu
43 GetGame().GetCallqueue().CallLater(OnMapEscapeDelayed, MAP_CLOSE_DELAY, false);
44 }
45
46 //------------------------------------------------------------------------------------------------
47 protected void OnMapEscapeDelayed()
48 {
49 MenuManager menuManager = GetGame().GetMenuManager();
50 menuManager.CloseMenuByPreset(ChimeraMenuPreset.CommandPostMapMenu);
51 }
52
53 //------------------------------------------------------------------------------------------------
54 override void Update(float timeSlice)
55 {
56 super.Update(timeSlice);
57
58 m_InputManager.ActivateContext("CommandPostMapContext");
59 }
60}
ChimeraMenuPreset
Menu presets.
ArmaReforgerScripted GetGame()
Definition game.c:1398
Input management system for user interactions.
proto external bool CloseMenuByPreset(ScriptMenuPresetEnum preset)
Put menu with given iPresetId into queue for closing (which is processed during next MenuManeger upda...
const int MAP_CLOSE_DELAY
override void OnMapOpen(MapConfiguration config)
void InitCommander()
void OnMapEscapeDelayed()
override void OnMapClose(MapConfiguration config)
void OnMapEscape()
override void Update(float timeSlice)
InputManager m_InputManager
ResourceName m_sBaseElement
SCR_FieldOfViewSettings Attribute
EActionTrigger