コード例 #1
0
        protected override void MouseEventButtonDown(MouseState CurrMouse, MouseButton Button)
        {
            int Ctr;

            if (Button != MouseButton.Left)
            {
                return;
            }

            cMouseDown = CurrMouse.Position;

            for (Ctr = 0; Ctr < cOptionList.Count; Ctr++)
            {
                if (MGMath.IsPointInRect(cMouseDown, cOptionLocList[Ctr]) == true)
                {
                    cMouseCardIndex = Ctr;

                    cOptionList[Ctr].Include += 1;
                    if (cOptionList[Ctr].Include > cOptionList[Ctr].Count)
                    {
                        cOptionList[Ctr].Include = 0;
                    }

                    break;
                }
            }

            HasChanged = true;
        }
コード例 #2
0
ファイル: DeckFrame.cs プロジェクト: JBeighel/MDLN.MGTools
        private int DetermineShownCardFromCoords(Point Coord)
        {
            if ((SelectedCardIndex != -1) && (SelectedCardIsZoomed == true))
            {
                if (MGMath.IsPointInRect(Coord, cCardsShownList[SelectedCardIndex].DrawRegion) == true)
                {
                    return(SelectedCardIndex);
                }
            }

            for (int Ctr = cCardsShownList.Count - 1; Ctr >= 0; Ctr--)               //Cards are placed on top, so start from bottom to get most visible cards
            {
                if (MGMath.IsPointInRect(Coord, cCardsShownList[Ctr].DrawRegion) == true)
                {
                    return(Ctr);
                }
            }

            return(-1);
        }