Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_DeployMenuHandler.c
Go to the documentation of this file.
1 
7 {
8  [Attribute("FactionOverlay")]
9  protected string m_sFactionUIHandler;
10  protected SCR_FactionRequestUIComponent m_FactionRequestHandler;
11 
12  [Attribute("LoadoutSelector")]
13  protected string m_sLoadoutUIHandler;
14  protected SCR_LoadoutRequestUIComponent m_LoadoutRequestHandler;
15 
16  [Attribute("GroupSelector")]
17  protected string m_sGroupUIHandler;
18  protected SCR_GroupRequestUIComponent m_GroupRequestHandler;
19 
20  [Attribute("SpawnPointSelector")]
21  protected string m_sSpawnPointUIHandler;
22  protected SCR_SpawnPointRequestUIComponent m_SpawnPointUIHandler;
23 
24  [Attribute("FactionPlayerList")]
25  protected string m_sFactionPlayerList;
26  protected SCR_FactionPlayerList m_FactionPlayerList;
27 
28  [Attribute("GroupPlayerList")]
29  protected string m_sGroupPlayerList;
30  protected SCR_GroupPlayerList m_GroupPlayerLIst;
31 
32  [Attribute(desc:"Determines which widgets should be hidden when opening the pause menu")]
33  protected ref array<string> m_aHiddenWidgetsOnPause;
34 
35  [Attribute(desc:"Determines which widgets should be disabled when opening the pause menu")]
36  protected ref array<string> m_aDisabledWidgetsOnPause;
37 
38  protected ref array<Widget> m_aHiddenWidgets = {};
39  protected ref array<Widget> m_aDisabledWidgets = {};
40 
41  //------------------------------------------------------------------------------------------------
42  override void HandlerAttached(Widget w)
43  {
44  super.HandlerAttached(w);
45 
46  PauseMenuUI.m_OnPauseMenuOpened.Insert(OnPauseMenuOpened);
47  PauseMenuUI.m_OnPauseMenuClosed.Insert(OnPauseMenuClosed);
48 
49  foreach (string name : m_aHiddenWidgetsOnPause)
50  {
51  Widget widget = m_wRoot.FindAnyWidget(name);
52 
53  if (widget)
54  m_aHiddenWidgets.Insert(widget);
55  }
56 
57  foreach (string name : m_aDisabledWidgetsOnPause)
58  {
59  Widget widget = m_wRoot.FindAnyWidget(name);
60 
61  if (widget)
62  m_aDisabledWidgets.Insert(widget);
63  }
64  }
65 
66  //------------------------------------------------------------------------------------------------
67  override void HandlerDeattached(Widget w)
68  {
69  super.HandlerDeattached(w);
70 
71  PauseMenuUI.m_OnPauseMenuOpened.Remove(OnPauseMenuOpened);
72  PauseMenuUI.m_OnPauseMenuClosed.Remove(OnPauseMenuClosed);
73  }
74 
75  //------------------------------------------------------------------------------------------------
76  protected void OnPauseMenuOpened()
77  {
78  UpdateWidgetsOnPause(true);
79  }
80 
81  //------------------------------------------------------------------------------------------------
82  protected void OnPauseMenuClosed()
83  {
84  UpdateWidgetsOnPause(false);
85  }
86 
87  //------------------------------------------------------------------------------------------------
88  protected void UpdateWidgetsOnPause(bool paused)
89  {
90  foreach (Widget widget : m_aHiddenWidgets)
91  {
92  widget.SetVisible(!paused);
93  }
94 
95  foreach (Widget widget : m_aDisabledWidgets)
96  {
97  widget.SetEnabled(!paused);
98  }
99  }
100 
101  //------------------------------------------------------------------------------------------------
102  SCR_FactionRequestUIComponent GetFactionRequestHandler()
103  {
104  Widget tmp = m_wRoot.FindAnyWidget(m_sFactionUIHandler);
105  if (!tmp)
106  return null;
107 
108  return SCR_FactionRequestUIComponent.Cast(tmp.FindHandler(SCR_FactionRequestUIComponent));
109  }
110 
111  //------------------------------------------------------------------------------------------------
112  SCR_LoadoutRequestUIComponent GetLoadoutRequestHandler()
113  {
114  Widget tmp = m_wRoot.FindAnyWidget(m_sLoadoutUIHandler);
115  if (!tmp)
116  return null;
117 
118  return SCR_LoadoutRequestUIComponent.Cast(tmp.FindHandler(SCR_LoadoutRequestUIComponent));
119  }
120 
121  //------------------------------------------------------------------------------------------------
122  SCR_GroupRequestUIComponent GetGroupRequestHandler()
123  {
124  Widget tmp = m_wRoot.FindAnyWidget(m_sGroupUIHandler);
125  if (!tmp)
126  return null;
127 
128  return SCR_GroupRequestUIComponent.Cast(tmp.FindHandler(SCR_GroupRequestUIComponent));
129  }
130 
131  //------------------------------------------------------------------------------------------------
132  SCR_SpawnPointRequestUIComponent GetSpawnPointRequestHandler()
133  {
134  Widget tmp = m_wRoot.FindAnyWidget(m_sSpawnPointUIHandler);
135  if (!tmp)
136  return null;
137 
139  }
140 
141  //------------------------------------------------------------------------------------------------
142  SCR_FactionPlayerList GetFactionPlayerList()
143  {
144  Widget tmp = m_wRoot.FindAnyWidget(m_sFactionPlayerList);
145  if (!tmp)
146  return null;
147 
148  return SCR_FactionPlayerList.Cast(tmp.FindHandler(SCR_FactionPlayerList));
149  }
150 
151  //------------------------------------------------------------------------------------------------
152  SCR_GroupPlayerList GetGroupPlayerList()
153  {
154  Widget tmp = m_wRoot.FindAnyWidget(m_sGroupPlayerList);
155  if (!tmp)
156  return null;
157 
158  return SCR_GroupPlayerList.Cast(tmp.FindHandler(SCR_GroupPlayerList));
159  }
160 }
SCR_LoadoutRequestUIComponent
Component responsible for requesting and visualization of available loadouts in deploy menu.
Definition: SCR_LoadoutRequestUIComponent.c:2
SCR_SpawnPointRequestUIComponent
Definition: SCR_SpawnPointRequestUIComponent.c:1
SCR_GroupPlayerList
Definition: SCR_FactionPlayerList.c:240
m_wRoot
protected Widget m_wRoot
Definition: SCR_ScenarioFrameworkLayerTaskDefend.c:59
SCR_FactionPlayerList
Definition: SCR_FactionPlayerList.c:57
PauseMenuUI
Definition: SCR_PauseMenuUI.c:2
SCR_DeployMenuHandler
Definition: SCR_DeployMenuHandler.c:6
desc
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
Definition: SCR_RespawnBriefingComponent.c:17
Attribute
typedef Attribute
Post-process effect of scripted camera.
SCR_GroupRequestUIComponent
Component responsible for handling group requests and visualization in deploy menu.
Definition: SCR_GroupRequestUIComponent.c:3
SCR_FactionRequestUIComponent
Definition: SCR_FactionRequestUIComponent.c:5
SCR_ScriptedWidgetComponent
Definition: SCR_ScriptedWidgetComponent.c:7