9 protected string m_sFactionUIHandler;
13 protected string m_sLoadoutUIHandler;
17 protected string m_sGroupUIHandler;
21 protected string m_sSpawnPointUIHandler;
25 protected string m_sFactionPlayerList;
29 protected string m_sGroupPlayerList;
32 [
Attribute(
desc:
"Determines which widgets should be hidden when opening the pause menu")]
33 protected ref array<string> m_aHiddenWidgetsOnPause;
35 [
Attribute(
desc:
"Determines which widgets should be disabled when opening the pause menu")]
36 protected ref array<string> m_aDisabledWidgetsOnPause;
38 protected ref array<Widget> m_aHiddenWidgets = {};
39 protected ref array<Widget> m_aDisabledWidgets = {};
42 override void HandlerAttached(Widget w)
44 super.HandlerAttached(w);
46 PauseMenuUI.m_OnPauseMenuOpened.Insert(OnPauseMenuOpened);
47 PauseMenuUI.m_OnPauseMenuClosed.Insert(OnPauseMenuClosed);
49 foreach (
string name : m_aHiddenWidgetsOnPause)
51 Widget widget =
m_wRoot.FindAnyWidget(name);
54 m_aHiddenWidgets.Insert(widget);
57 foreach (
string name : m_aDisabledWidgetsOnPause)
59 Widget widget =
m_wRoot.FindAnyWidget(name);
62 m_aDisabledWidgets.Insert(widget);
67 override void HandlerDeattached(Widget w)
69 super.HandlerDeattached(w);
71 PauseMenuUI.m_OnPauseMenuOpened.Remove(OnPauseMenuOpened);
72 PauseMenuUI.m_OnPauseMenuClosed.Remove(OnPauseMenuClosed);
76 protected void OnPauseMenuOpened()
78 UpdateWidgetsOnPause(
true);
82 protected void OnPauseMenuClosed()
84 UpdateWidgetsOnPause(
false);
88 protected void UpdateWidgetsOnPause(
bool paused)
90 foreach (Widget widget : m_aHiddenWidgets)
92 widget.SetVisible(!paused);
95 foreach (Widget widget : m_aDisabledWidgets)
97 widget.SetEnabled(!paused);
104 Widget tmp =
m_wRoot.FindAnyWidget(m_sFactionUIHandler);
114 Widget tmp =
m_wRoot.FindAnyWidget(m_sLoadoutUIHandler);
124 Widget tmp =
m_wRoot.FindAnyWidget(m_sGroupUIHandler);
134 Widget tmp =
m_wRoot.FindAnyWidget(m_sSpawnPointUIHandler);
144 Widget tmp =
m_wRoot.FindAnyWidget(m_sFactionPlayerList);
154 Widget tmp =
m_wRoot.FindAnyWidget(m_sGroupPlayerList);