internal Point FindSlotLocation(int slot)
            {
                cg.updateScreen();
                int offset     = 0;
                int xoffset    = 0;
                int queuecount = cg.QueueCount;

                if (slot > 11 && slot <= Queueid)
                {
                    offset = cg.FindOffset();                               // If there is players in the queue, the spectator slots move down. Find the offset in pixels to spectator.
                }
                if (slot - Queueid >= queuecount)
                {
                    return(Point.Empty);                              // If there is no one in the queue and the slot selected is a queue value, return invalid
                }
                if (slot > 11)
                {
                    xoffset = -100;            // If there is more than 6 players in the queue, a scrollbar appears offsetting the slot's x location by a few pixels.
                }
                if (slot > Queueid)
                {
                    slot = slot - 6;                 // selecting a person in the queue where spectator slots are normally at. Not equal to Queueid because that is set when returning 891, 24
                }
                if (slot != Queueid)
                {
                    return(new Point(playerLoc[slot, 0] + xoffset, playerLoc[slot, 1] + offset));                 // Blue, Red, Spectators, and all of queue except for the first slot.
                }
                else
                {
                    return(new Point(playerLoc[12, 0] + xoffset, 248)); // Queue 1 location
                }
            }
Exemplo n.º 2
0
            /// <summary>
            /// Gets the slot the moderator is on.
            /// </summary>
            /// <returns>Slot the moderator is on.</returns>
            public int ModeratorSlot()
            {
                // <image url="$(ProjectDir)\ImageComments\GetInfo.cs\ModeratorSlot.png" scale="0.7" />
                // Find the moderator icon.

                cg.updateScreen();
                int fade = 20;

                // Red and blue
                for (int i = 0; i < 12; i++)
                {
                    if (cg.CompareColor(ModeratorLocations[i, 0], ModeratorLocations[i, 1], CALData.ModeratorIconColor, fade))
                    {
                        return(i);
                    }
                }

                // Spectators
                int offset = cg.FindOffset();

                for (int i = 12; i < Queueid; i++)
                {
                    if (cg.CompareColor(ModeratorLocations[i, 0], ModeratorLocations[i, 1] + offset, CALData.SpectatorModeratorIconColor, fade))
                    {
                        return(i);
                    }
                }

                // Queue
                int queuecount = cg.QueueCount;

                for (int i = 12; i < 12 + queuecount; i++)
                {
                    if (cg.CompareColor(ModeratorLocations[i, 0], ModeratorLocations[i, 1] - 5, CALData.SpectatorModeratorIconColor, fade))
                    {
                        return(i + 6);
                    }
                }

                return(-1);
            }