Ejemplo n.º 1
0
        private void dataGridView_manual_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (-1 == e.RowIndex)
            {
                return;
            }

            UILocation uiLocation = Properties.Settings.Default.ManualInagmeShortcutList[e.RowIndex];

            if (e.ColumnIndex == 0)
            {
                if (true == uiLocation.isUsing)
                {
                    uiLocation.isUsing = false;
                }
                else
                {
                    uiLocation.isUsing = true;
                }

                Properties.Settings.Default.ManualInagmeShortcutList[e.RowIndex] = uiLocation;
                Properties.Settings.Default.Save();
                RefreshDataGridView();
            }
        }
Ejemplo n.º 2
0
        private void IngameHotKey(UILocation uiLocation)
        {
            if (null == _Process)
            {
                return;
            }

            if (true == checkBox_Hide.Checked)
            {
                return;
            }

            Point Result = PointToResponsiveWindow(uiLocation);

            Mouseclick(Result);
        }
Ejemplo n.º 3
0
        // ===================================================================================


        // Ingame HotKey
        // ===================================================================================

        public Point PointToResponsiveWindow(UILocation uiLocation)
        {
            if (null == _Process)
            {
                return(new Point(0, 0));
            }

            Rect rect;

            Win32.GetClientRect(_Process.MainWindowHandle, out rect);

            Point ptBasePoint;

            switch (uiLocation.dir)
            {
            case UILocation.Direction.LT:
                ptBasePoint = new Point(rect.Left, rect.Top);
                break;

            case UILocation.Direction.CT:
                ptBasePoint = new Point((rect.Right - rect.Left) / 2 + rect.Left, rect.Top);
                break;

            case UILocation.Direction.RT:
                ptBasePoint = new Point(rect.Right, rect.Top);
                break;

            case UILocation.Direction.LC:
                ptBasePoint = new Point(rect.Left, (rect.Bottom - rect.Top) / 2 + rect.Top);
                break;

            case UILocation.Direction.CENTER:
                ptBasePoint = new Point((rect.Right - rect.Left) / 2 + rect.Left, (rect.Bottom - rect.Top) / 2 + rect.Top);
                break;

            case UILocation.Direction.RC:
                ptBasePoint = new Point(rect.Right, (rect.Bottom - rect.Top) / 2 + rect.Top);
                break;

            case UILocation.Direction.LB:
                ptBasePoint = new Point(rect.Left, rect.Bottom);
                break;

            case UILocation.Direction.CB:
                ptBasePoint = new Point((rect.Right - rect.Left) / 2 + rect.Left, rect.Bottom);
                break;

            case UILocation.Direction.RB:
                ptBasePoint = new Point(rect.Right, rect.Bottom);
                break;
            }

            Win32.ClientToScreen(_Process.MainWindowHandle, out ptBasePoint);

            float aspectRatio = (float)rect.Right / rect.Bottom;
            float magnification;

            if (MAX_CLIENT_ASPECT_RATIO < aspectRatio)
            {
                magnification = ((float)MAX_CLIENT_SIZE_X * rect.Bottom) / ((float)rect.Right * MAX_CLIENT_SIZE_Y) * ((float)rect.Right / MAX_CLIENT_SIZE_X);
            }
            else if (MAX_CLIENT_ASPECT_RATIO > aspectRatio)
            {
                magnification = ((float)rect.Right * MAX_CLIENT_SIZE_Y) / ((float)MAX_CLIENT_SIZE_X * rect.Bottom) * ((float)rect.Bottom / MAX_CLIENT_SIZE_Y);
            }
            else
            {
                magnification = ((float)rect.Right / MAX_CLIENT_SIZE_X);
            }

            Point ScreenLocation = new Point((int)(uiLocation.x * magnification), (int)(uiLocation.y * magnification));

            return(new Point(ptBasePoint.X - ScreenLocation.X, ptBasePoint.Y - ScreenLocation.Y));
        }
Ejemplo n.º 4
0
        private void MousePickWindow_MouseUp(object sender, MouseEventArgs e)
        {
            if (radioButton_LT.Checked == true ||
                radioButton_CT.Checked == true ||
                radioButton_RT.Checked == true ||
                radioButton_LC.Checked == true ||
                radioButton_CENTER.Checked == true ||
                radioButton_RC.Checked == true ||
                radioButton_LB.Checked == true ||
                radioButton_CB.Checked == true ||
                radioButton_RB.Checked == true)
            {
                Point basePT = new Point(0, 0);

                if (_Direction == UILocation.Direction.CT)
                {
                    basePT = new Point(800, 0);
                }
                else if (_Direction == UILocation.Direction.RT)
                {
                    basePT = new Point(1600, 0);
                }
                else if (_Direction == UILocation.Direction.LC)
                {
                    basePT = new Point(0, 450);
                }
                else if (_Direction == UILocation.Direction.CENTER)
                {
                    basePT = new Point(800, 450);
                }
                else if (_Direction == UILocation.Direction.RC)
                {
                    basePT = new Point(1600, 450);
                }
                else if (_Direction == UILocation.Direction.LB)
                {
                    basePT = new Point(0, 900);
                }
                else if (_Direction == UILocation.Direction.CB)
                {
                    basePT = new Point(800, 900);
                }
                else if (_Direction == UILocation.Direction.RB)
                {
                    basePT = new Point(1600, 900);
                }

                Point mousePT = MousePosition;
                mousePT = PointToClient(mousePT);

                string name = "";
                Keys   key  = Keys.None;

                MousePickWindowName nameWindow = new MousePickWindowName();
                nameWindow._sendEvent += new MousePickWindowName.SendDataHandler((_name, _key) => { name = _name; key = _key; });

                if (DialogResult.Cancel == nameWindow.ShowDialog())
                {
                    Close();
                    return;
                }

                UILocation uiLocation = new UILocation(basePT.X - mousePT.X, basePT.Y - mousePT.Y, _Direction, name, key);
                if (null == Properties.Settings.Default.ManualInagmeShortcutList)
                {
                    Properties.Settings.Default.ManualInagmeShortcutList = new BindingList <UILocation>();
                }

                Properties.Settings.Default.ManualInagmeShortcutList.Add(uiLocation);
                Properties.Settings.Default.Save();
                Close();
            }
        }
Ejemplo n.º 5
0
        private void dataGridView_manual_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (-1 == e.RowIndex)
            {
                return;
            }

            UILocation uiLocation = Properties.Settings.Default.ManualInagmeShortcutList[e.RowIndex];

            //Rect rect = new Rect(pictureBox_preview.Left, pictureBox_preview.Top, pictureBox_preview.Right, pictureBox_preview.Bottom);
            Rect rect = new Rect(0, 0, 384, 216);

            Point ptBasePoint = new Point();

            switch (uiLocation.dir)
            {
            case UILocation.Direction.LT:
                ptBasePoint = new Point(rect.Left, rect.Top);
                break;

            case UILocation.Direction.CT:
                ptBasePoint = new Point((rect.Right - rect.Left) / 2 + rect.Left, rect.Top);
                break;

            case UILocation.Direction.RT:
                ptBasePoint = new Point(rect.Right, rect.Top);
                break;

            case UILocation.Direction.LC:
                ptBasePoint = new Point(rect.Left, (rect.Bottom - rect.Top) / 2 + rect.Top);
                break;

            case UILocation.Direction.CENTER:
                ptBasePoint = new Point((rect.Right - rect.Left) / 2 + rect.Left, (rect.Bottom - rect.Top) / 2 + rect.Top);
                break;

            case UILocation.Direction.RC:
                ptBasePoint = new Point(rect.Right, (rect.Bottom - rect.Top) / 2 + rect.Top);
                break;

            case UILocation.Direction.LB:
                ptBasePoint = new Point(rect.Left, rect.Bottom);
                break;

            case UILocation.Direction.CB:
                ptBasePoint = new Point((rect.Right - rect.Left) / 2 + rect.Left, rect.Bottom);
                break;

            case UILocation.Direction.RB:
                ptBasePoint = new Point(rect.Right, rect.Bottom);
                break;
            }

            float magnification  = ((float)rect.Right / TaskManager.MAX_CLIENT_SIZE_X);
            Point ScreenLocation = new Point((int)(uiLocation.x * magnification), (int)(uiLocation.y * magnification));

            int x = ptBasePoint.X - ScreenLocation.X;
            int y = ptBasePoint.Y - ScreenLocation.Y;

            pictureBox_preview.Refresh();

            Rectangle ellipse = new Rectangle(x - 7, y - 7, 14, 14);

            _graphics.FillEllipse(_brush, ellipse);
            _graphics.DrawEllipse(_pen, ellipse);
        }