Пример #1
0
        /// <summary>
        /// Open a menu on the overview item with the given name
        /// </summary>
        /// <param name="entryName">The name of the overview item to open a menu on</param>
        /// <returns>True on success, false otherwise</returns>
        public bool openMenu(string entryName)
        {
            int           passes    = 0;
            bool          direction = false;
            bool          found     = false;
            OverViewEntry entry     = getEntry(entryName);

            while (passes < 2 && entry != null)
            {
                InterfaceResponse overv = overviewScrollbar();
                if (overv != null)
                {
                    if (entry.X != 0)
                    {
                        found = true;
                        break;
                    }

                    //Console.WriteLine("Overview Bottom: " + overviewBottom());
                    //Console.WriteLine("O.Y+O.Height+50: " + (overv.Y + overv.Height + 50));
                    if (overv.Y + overv.Height + 30 >= overviewBottom())
                    {
                        //  Console.WriteLine("GOING UP!");
                        //  Console.WriteLine("PASSES INCREMENTED");
                        passes++;
                        direction = false;
                    }

                    //Console.WriteLine("Overview Top: " + EOverViewHandler.overviewTop());
                    //Console.WriteLine("Overview.Y-3: " + (overv.Y - 30));
                    if (overv.Y - 30 <= overviewTop())
                    {
                        // Console.WriteLine("GOING DOWN!!!!");
                        // Console.WriteLine("PASSES INCREMENTED");
                        passes++;
                        direction = true;
                    }

                    if (!direction)
                    {
                        scrollUp();
                    }

                    else
                    {
                        scrollDown();
                    }

                    entry = getEntry(entryName);
                    Thread.Sleep(200);
                }
            }
            if (found)
            {
                mh.open(entry);
            }
            return(found);
        }
Пример #2
0
        /// <summary>
        /// Open a menu on the given character entry from the userlist
        /// </summary>
        /// <param name="charName">The character name to open the menu on</param>
        /// <returns>True on success, false otherwise</returns>
        public override bool openMenu(string charName)
        {
            int            passes    = 0;
            bool           direction = false;
            bool           found     = false;
            InterfaceEntry entry     = userlistGetEntry(charName);

            while (passes < 2 && entry != null)
            {
                InterfaceEntry userlist = userlistScrollBar();
                if (userlist != null)
                {
                    if (entry.X != 0)
                    {
                        found = true;
                        break;
                    }

                    if (userlist.Y + userlist.Height + 30 >= userlistBottom())
                    {
                        passes++;
                        direction = false;
                    }

                    if (userlist.Y - 30 <= userlistTop())
                    {
                        passes++;
                        direction = true;
                    }

                    if (!direction)
                    {
                        userlistScrollUp();
                    }

                    else
                    {
                        userlistScrollDown();
                    }

                    entry = userlistGetEntry(charName);
                    Thread.Sleep(200);
                }
            }
            if (found)
            {
                mh.open(entry);
            }
            return(found);
        }