Esempio n. 1
0
        public override bool HandleInput(MyGuiInput input, bool hasKeyboardActiveControl, bool hasKeyboardActiveControlPrevious, bool receivedFocusInThisUpdate)
        {
            if ((MyGuiScreenGamePlay.Static.IsEditorActive() == true) && (MyGuiManager.IsScreenOfTypeOpen(typeof(MyGuiScreenEditorContextMenu)) == false))
            {
                m_enabled     = true;
                m_contextMenu = null;
            }

            if (!IsEnabled)
            {
                return(false);
            }

            if (input.IsEditorControlNewPressed(MyEditorControlEnums.ENTER_CONTEXT_MENU))
            {
                m_contextMenu = new MyGuiScreenEditorContextMenu();
                MyGuiManager.AddScreen(m_contextMenu);
                m_enabled = false;
            }

            if (m_contextMenu != null)
            {
                m_contextMenu.HandleInput(input, receivedFocusInThisUpdate);
            }

            return(base.HandleInput(input, hasKeyboardActiveControl, hasKeyboardActiveControlPrevious, receivedFocusInThisUpdate));
        }
        public override bool HandleInput(MyGuiInput input, bool hasKeyboardActiveControl, bool hasKeyboardActiveControlPrevious, bool receivedFocusInThisUpdate)
        {
            if ((MyGuiScreenGamePlay.Static.IsEditorActive() == true) && (MyGuiManager.IsScreenOfTypeOpen(typeof(MyGuiScreenEditorContextMenu)) == false))
            {
                m_enabled = true;
                m_contextMenu = null;
            }

            if (!IsEnabled) return false;

            if (input.IsEditorControlNewPressed(MyEditorControlEnums.ENTER_CONTEXT_MENU))
            {
                m_contextMenu = new MyGuiScreenEditorContextMenu();
                MyGuiManager.AddScreen(m_contextMenu);
                m_enabled = false;
            }

            if (m_contextMenu != null)
            {
                m_contextMenu.HandleInput(input, receivedFocusInThisUpdate);
            }

            return base.HandleInput(input, hasKeyboardActiveControl, hasKeyboardActiveControlPrevious, receivedFocusInThisUpdate);
        }