Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_MapUIBaseComponent.c
Go to the documentation of this file.
1// Base for 2D map UI components
4{
5 [Attribute("0", UIWidgets.Auto, "Disable this component, useful for example when we want to inherit config without a specific component" )]
6 protected bool m_bDisableComponent;
7
8 [Attribute("0", desc: "All other exclusive Map UI Components are disabled when this component is enabled")]
9 protected bool m_bIsExclusive;
10
11 protected bool m_bHookToRoot = false; // determine whether this component is hooked to the root widget for use of ScriptedWidgetEventHandler events
12 protected Widget m_RootWidget; // map layout root widget
14
15 //------------------------------------------------------------------------------------------------
16 // BASE METHODS
17 //------------------------------------------------------------------------------------------------
18
19 //------------------------------------------------------------------------------------------------
22 protected void OnMapOpen(MapConfiguration config)
23 {
24 if (m_bHookToRoot)
25 m_RootWidget.AddHandler(this);
26 }
27
28 //------------------------------------------------------------------------------------------------
31 protected void OnMapClose(MapConfiguration config)
32 {
33 if (m_bHookToRoot)
34 m_RootWidget.RemoveHandler(this);
35 }
36
37 //------------------------------------------------------------------------------------------------
40 {
42 }
43
44 //------------------------------------------------------------------------------------------------
47 {
48 return m_bIsExclusive;
49 }
50
51 //------------------------------------------------------------------------------------------------
55 void SetActive(bool active, bool isCleanup = false)
56 {
57 if (active)
58 {
59 m_RootWidget = m_MapEntity.GetMapConfig().RootWidgetRef; // Needs to be refreshed here
60
61 m_MapEntity.GetOnMapOpen().Insert(OnMapOpen);
62 m_MapEntity.GetOnMapClose().Insert(OnMapClose);
63 }
64 else
65 {
66 m_MapEntity.GetOnMapOpen().Remove(OnMapOpen);
67 m_MapEntity.GetOnMapClose().Remove(OnMapClose);
68
69 if (!isCleanup)
70 m_MapEntity.DeactivateComponent(this);
71 }
72 }
73
74 //------------------------------------------------------------------------------------------------
76 void Init();
77
78 //------------------------------------------------------------------------------------------------
80 void Update(float timeSlice);
81
82 //------------------------------------------------------------------------------------------------
84 {
85 SCR_MapToolMenuUI toolMenu = SCR_MapToolMenuUI.Cast(m_MapEntity.GetMapUIComponent(SCR_MapToolMenuUI));
86 if (toolMenu)
87 return toolMenu.IsFocused();
88
89 return false;
90 }
91
92 //------------------------------------------------------------------------------------------------
93 // constructor
98}
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
void SCR_MapToolMenuUI()
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
static SCR_MapEntity GetMapInstance()
Get map entity instance.
void OnMapOpen(MapConfiguration config)
void OnMapClose(MapConfiguration config)
void Init()
Init method for cases where all modules and components should be loaded already so constructor cannot...
void Update(float timeSlice)
Update method for frame operations.
void SetActive(bool active, bool isCleanup=false)
SCR_FieldOfViewSettings Attribute