Пример #1
0
        public static void Game_OnGameWndProc(WndEventArgs args)
        {
            if (Game.IsChatOpen)
            {
                return;
            }

            Point CursorPosition;

            ClipCursor.GetCursorPos(out CursorPosition);

            if (args.Msg == WM_KEYUP && args.WParam == 0x60)
            {
                IsScriptEnabled = !IsScriptEnabled;
                str[3]          = "Script (NUM_PAD1 or click) - " + ((IsScriptEnabled) ? "Enabled" : "Disabled");
            }
            else if (args.Msg == WM_LBUTTONUP)
            {
                for (int i = 0; i < _font.Length; i++)
                {
                    if ((CursorPosition.X >= xy1[i].X && CursorPosition.Y >= xy1[i].Y) && (CursorPosition.X <= xy2[i].X && CursorPosition.Y <= xy2[i].Y))
                    {
                        switch (i)
                        {
                        case 0:
                        {
                            IsMenuOpen = !IsMenuOpen;
                            break;
                        }

                        case 1:
                        {
                            MomentDownHealth += 100;
                            if (MomentDownHealth >= 1000)
                            {
                                MomentDownHealth = 300;
                            }
                            str[1] = "MomentDownHealt - " + MomentDownHealth;
                            break;
                        }

                        case 2:
                        {
                            MinHealthDownToDown += 100;
                            if (MinHealthDownToDown > 900)
                            {
                                MinHealthDownToDown = 200;
                            }
                            str[2] = "MinChangedHealthToUse - " + MinHealthDownToDown;
                            break;
                        }

                        case 3:
                        {
                            IsScriptEnabled = !IsScriptEnabled;
                            str[3]          = "Script (NUMPAD0 or click) - " + ((IsScriptEnabled) ? "Enabled" : "Disabled");
                            break;
                        }

                        default:
                        {
                            Console.WriteLine("Unknow item (weawer helper)");
                            break;
                        }
                        }
                    }
                }
            }
            else if (args.Msg == WM_MOUSEMOVE)
            {
                for (int i = 0; i < _font.Length; i++)
                {
                    if (CursorPosition.X >= xy1[i].X && CursorPosition.Y >= xy1[i].Y && CursorPosition.X <= xy2[i].X && CursorPosition.Y <= xy2[i].Y)
                    {
                        IsOnTarget[i] = true;
                    }
                    else
                    {
                        IsOnTarget[i] = false;
                    }
                }
                if (IsMenuMoved)
                {
                    if ((Control.MouseButtons & MouseButtons.Right) != 0)
                    {
                        xy1[0].X = CursorPosition.X;
                        xy2[0].X = CursorPosition.X + rect_w;
                        xy1[0].Y = CursorPosition.Y;
                        xy2[0].Y = CursorPosition.Y + rect_h;
                    }
                    else
                    {
                        IsMenuMoved = false;
                    }
                }
                if (!IsMenuMoved && (Control.MouseButtons & MouseButtons.Right) != 0)
                {
                    if ((CursorPosition.X >= xy1[0].X && CursorPosition.Y >= xy1[0].Y) && ((CursorPosition.X <= xy2[0].X - 50) && CursorPosition.Y <= xy2[0].Y))
                    {
                        IsMenuMoved = true;
                    }
                }
            }
        }
Пример #2
0
        public static void Game_OnGameWndProc(WndEventArgs args)
        {
            if (Game.IsChatOpen)
            {
                return;
            }

            Point CursorPosition;

            ClipCursor.GetCursorPos(out CursorPosition);

            if (args.Msg == WM_LBUTTONUP)
            {
                for (int i = 0; i < _font.Length; i++)
                {
                    if ((CursorPosition.X >= xy1[i].X && CursorPosition.Y >= xy1[i].Y) && (CursorPosition.X <= xy2[i].X && CursorPosition.Y <= xy2[i].Y))
                    {
                        switch (i)
                        {
                        case 0:
                        {
                            frm.Show();
                            if (frm.Opacity > 0)
                            {
                                CheckPlayerHero();
                            }
                            else
                            {
                                frm.Opacity = oldOpacity; str[0] = "REFRESH Picks";
                            }
                            break;
                        }

                        default:
                        {
                            Console.WriteLine("Unknow item");
                            break;
                        }
                        }
                    }
                }
            }
            else if (args.Msg == WM_MOUSEMOVE)
            {
                for (int i = 0; i < _font.Length; i++)
                {
                    if (CursorPosition.X >= xy1[i].X && CursorPosition.Y >= xy1[i].Y && CursorPosition.X <= xy2[i].X && CursorPosition.Y <= xy2[i].Y)
                    {
                        IsOnTarget[i] = true;
                    }
                    else
                    {
                        IsOnTarget[i] = false;
                    }
                }
                if (IsMenuMoved)
                {
                    if ((Control.MouseButtons & MouseButtons.Right) != 0)
                    {
                        xy1[0].X = CursorPosition.X;
                        xy2[0].X = CursorPosition.X + rect_w;
                        xy1[0].Y = CursorPosition.Y;
                        xy2[0].Y = CursorPosition.Y + rect_h;
                    }
                    else
                    {
                        IsMenuMoved = false;
                    }
                }
                if (!IsMenuMoved && (Control.MouseButtons & MouseButtons.Right) != 0)
                {
                    if ((CursorPosition.X >= xy1[0].X && CursorPosition.Y >= xy1[0].Y) && ((CursorPosition.X <= xy2[0].X - 50) && CursorPosition.Y <= xy2[0].Y))
                    {
                        IsMenuMoved = true;
                    }
                }
            }
        }