3 protected const int CONDITION_DEVICE = 1;
4 protected const int CONDITION_FOCUS = 2;
9 protected void RefreshVisibility()
11 bool show = m_Show == (CONDITION_DEVICE | CONDITION_FOCUS);
18 protected void OnMenuFocusGained()
20 m_Show |= CONDITION_FOCUS;
26 protected void OnMenuFocusLost()
28 m_Show &= ~CONDITION_FOCUS;
34 protected void OnInputDeviceIsGamepad(
bool isGamepad)
37 m_Show |= CONDITION_DEVICE;
39 m_Show &= ~CONDITION_DEVICE;
45 override protected bool IsUnique()
51 override void HandlerAttachedScripted(Widget w)
57 menu.GetOnMenuFocusGained().Insert(OnMenuFocusGained);
58 menu.GetOnMenuFocusLost().Insert(OnMenuFocusLost);
60 GetGame().OnInputDeviceIsGamepadInvoker().Insert(OnInputDeviceIsGamepad);
67 override void HandlerDeattached(Widget w)
73 menu.GetOnMenuFocusGained().Remove(OnMenuFocusGained);
74 menu.GetOnMenuFocusLost().Remove(OnMenuFocusLost);
76 GetGame().OnInputDeviceIsGamepadInvoker().Remove(OnInputDeviceIsGamepad);