コード例 #1
0
ファイル: UIManager.cs プロジェクト: qkdefus/ClassicUO
        public static void OnExtraMouseButtonDown(int btn)
        {
            HandleMouseInput();
            if (MouseOverControl != null)
            {
                MakeTopMostGump(MouseOverControl);
                MouseOverControl.InvokeMouseDown(Mouse.Position, (MouseButtonType)btn);

                if (MouseOverControl.IsEnabled && MouseOverControl.IsVisible)
                {
                    if (_lastFocus != MouseOverControl)
                    {
                        _lastFocus?.OnFocusLeft();
                        MouseOverControl.OnFocusEnter();
                        _lastFocus = MouseOverControl;
                    }
                }

                _mouseDownControls[btn] = MouseOverControl;
            }
            else
            {
                foreach (Control s in Gumps)
                {
                    if (s.ControlInfo.IsModal && s.ControlInfo.ModalClickOutsideAreaClosesThisControl)
                    {
                        s.Dispose();
                        Mouse.CancelDoubleClick = true;
                    }
                }
            }

            ShowGamePopup(null);
        }
コード例 #2
0
ファイル: UIManager.cs プロジェクト: qkdefus/ClassicUO
        public static void OnLeftMouseButtonDown()
        {
            HandleMouseInput();
            _validForDClick = null;
            if (MouseOverControl != null)
            {
                MakeTopMostGump(MouseOverControl);
                MouseOverControl.InvokeMouseDown(Mouse.Position, MouseButtonType.Left);

                if (MouseOverControl.AcceptKeyboardInput)
                {
                    _keyboardFocusControl = MouseOverControl;
                }

                if (MouseOverControl.IsEnabled && MouseOverControl.IsVisible)
                {
                    if (_lastFocus != MouseOverControl)
                    {
                        _lastFocus?.OnFocusLeft();
                        MouseOverControl.OnFocusEnter();
                        _lastFocus = MouseOverControl;
                    }
                }

                _mouseDownControls[(int)MouseButtonType.Left] = MouseOverControl;
            }
            else
            {
                foreach (Control s in Gumps)
                {
                    if (s.ControlInfo.IsModal && s.ControlInfo.ModalClickOutsideAreaClosesThisControl)
                    {
                        s.Dispose();
                        Mouse.CancelDoubleClick = true;
                    }
                }
            }

            if (PopupMenu != null && !PopupMenu.Bounds.Contains(Mouse.Position.X, Mouse.Position.Y))
            {
                ShowGamePopup(null);
            }
        }