8 protected ResourceName m_sNavigationButtonLayout;
11 protected ref array<SCR_InputButtonComponent> m_aNavigationButtons = {};
12 protected ref map<SCR_InputButtonComponent, bool> m_aNavigationButtonsVisibilityFlags =
new map<SCR_InputButtonComponent, bool>();
17 protected bool m_bShown;
18 protected bool m_bFocused;
27 void OnMenuFocusGained()
33 void OnMenuFocusLost()
41 void OnMenuUpdate(
float tDelta);
47 void OnTabCreate(Widget menuRoot, ResourceName buttonsLayout,
int index)
50 m_wMenuRoot = menuRoot;
52 m_sNavigationButtonLayout = buttonsLayout;
59 ShowNavigationButtons(
true);
67 ShowNavigationButtons(
false);
77 Widget w = comp.GetRootWidget();
81 w.RemoveFromHierarchy();
92 protected void ShowNavigationButtons(
bool show)
98 if (m_aNavigationButtonsVisibilityFlags.Contains(comp))
99 visible = m_aNavigationButtonsVisibilityFlags.Get(comp);
101 visible = visible && show;
103 comp.SetVisible(visible,
false);
114 if (!m_aNavigationButtonsVisibilityFlags.Contains(button) || !m_aNavigationButtons.Contains(button))
117 "SCR_SubMenuBase - FlagNavigationButtonVisibility() - button %1, %2 is not a sub menu footer button as it was not created with CreateNavigationButton() method",
119 button.GetRootWidget().GetName()
125 m_aNavigationButtonsVisibilityFlags.Set(button, show);
135 if (!m_aNavigationButtonsVisibilityFlags.Contains(button) || !m_aNavigationButtons.Contains(button))
138 "SCR_SubMenuBase - SetFooterButtonVisibile() - button %1, %2 is not a sub menu footer button as it was not created with CreateNavigationButton() method",
140 button.GetRootWidget().GetName()
146 FlagNavigationButtonVisibility(button, show);
147 button.SetVisible(
m_bShown && show, animate);
152 protected SCR_InputButtonComponent CreateNavigationButton(
string actionName,
string label,
bool rightFooter =
false,
bool show =
true)
154 if (!m_DynamicFooter)
157 SCR_EDynamicFooterButtonAlignment alignment = SCR_EDynamicFooterButtonAlignment.LEFT;
159 alignment = SCR_EDynamicFooterButtonAlignment.RIGHT;
166 m_aNavigationButtons.Insert(comp);
167 m_aNavigationButtonsVisibilityFlags.Insert(comp, show);
172 protected void RequestCloseMenu()
174 if (m_OnRequestCloseMenu)
175 m_OnRequestCloseMenu.Invoke();
180 protected void RequestTabChange(
int newTabIndex)
182 if (m_OnRequestTabChange)
183 m_OnRequestTabChange.Invoke(newTabIndex,
m_iIndex);
197 if (!m_OnRequestCloseMenu)
200 return m_OnRequestCloseMenu;
206 if (!m_OnRequestTabChange)
209 return m_OnRequestTabChange;